/* INSPOND 별밤 — 기준 : DESIGN.md, 정본 : prototype/index.html */
:root {
  --night: #0b1836;
  --ink: #f4ecd0;
  --ink-soft: #a7b5d8;
  --gold: #f2c230;
  --serif: "Gowun Batang", "Noto Serif KR", serif;
  --sans: "Pretendard Variable", Pretendard, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Pretendard Variable", Pretendard, monospace;
  --gutter: clamp(20px, 5vw, 72px);
  --brush-blue: linear-gradient(90deg, #24509f, #4d86c9 25%, #1b3a8c 55%, #6fa3d6 80%, #2f66b3);
  --brush-gold: linear-gradient(90deg, #e8962a, #f6d44a 35%, #fbe98a 60%, #f2b632);
  --brush-mark: linear-gradient(90deg, #2f66b3, #6fa3d6 45%, #cfe0c0 70%, #f2c230);
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--night); }
body {
  background: var(--night);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.narrow-only { display: none; }

/* ── 머리 ── */
header {
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 3;
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px var(--gutter);
  font-size: 13px;
}
.sub header { position: relative; }
.mark { font-weight: 600; letter-spacing: .32em; text-shadow: 0 1px 12px #040a1c; }
header nav { display: flex; gap: 8px; }
header nav a, header nav button {
  letter-spacing: .08em;
  background: #071027b8;
  padding: 6px 14px;
  border-radius: 99px;
  transition: color .3s;
}
header nav a:hover, header nav button:hover, #music[aria-pressed="true"] { color: var(--gold); }
/* 관리자 메뉴 : 방문자용 메뉴 뒤에 간격을 두고 흐리게 */
header nav .admin-nav { display: flex; gap: 8px; margin-left: 14px; }
header nav .admin-nav a { color: var(--ink-soft); }
header nav .admin-nav a:hover { color: var(--gold); }

/* ── 밤하늘과 연못 (홈 첫 화면) ── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: 96px var(--gutter) clamp(64px, 12vh, 130px);
  overflow: hidden;
  cursor: crosshair;
}
.pond { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.pond canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after {
  content: "";
  position: absolute; inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to top, var(--night) 0%, transparent 20%),
    linear-gradient(72deg, #071027ee 0%, #071027a8 36%, transparent 62%);
}

.story { position: relative; z-index: 2; max-width: 46rem; }
.tagline { font-family: var(--serif); font-size: 17px; color: var(--gold); margin-bottom: clamp(18px, 3vh, 32px); }
.hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(30px, 5.2vw, 70px);
  line-height: 1.3;
  letter-spacing: -.03em;
  word-break: keep-all;
  text-shadow: 0 2px 28px #040a1ccc;
}
.hero h1 em { font-style: normal; color: var(--gold); position: relative; white-space: nowrap; }
.origin {
  margin-top: clamp(28px, 5vh, 52px);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 28px;
  align-items: baseline;
  max-width: 34rem;
  color: var(--ink-soft);
  font-size: 15px;
  word-break: keep-all;
}
.origin dt { font-family: var(--serif); font-size: 18px; color: var(--ink); white-space: nowrap; }
.origin dt i { font-style: normal; color: var(--ink-soft); }

/* 등장: 별이 피어난 뒤 글이 천천히 떠오름 */
.rise { opacity: 0; animation: rise 2.2s ease forwards; }
.rise:nth-child(1) { animation-delay: 1.5s; }
.rise:nth-child(2) { animation-delay: 1.9s; }
.rise:nth-child(3) { animation-delay: 2.6s; }
@keyframes rise { to { opacity: 1; } }
.hero h1 em::after { transform-origin: left center; transform: scaleX(0); animation: sweep 1s cubic-bezier(.3, .7, .2, 1) 3.2s forwards; }
@keyframes sweep { to { transform: scaleX(1); } }

/* ── 붓 자국 ── */
.brush-defs { position: absolute; width: 0; height: 0; }
.hero h1 em::after, .journal h2::after, .posts a::after, .page-head h1::after,
.prose hr, .post-head::after, .field::after, .prose blockquote::before {
  content: "";
  position: absolute;
  border-radius: 99px;
  filter: url(#brush);
}
.hero h1 em::after {
  left: -2%; right: -2%; bottom: -.02em; height: .13em;
  background: linear-gradient(90deg, #e8962a, #f6d44a 30%, #fbe98a 55%, #f2b632 80%, #e8962a);
  opacity: .9;
}

/* ── 글 목록 ── */
.journal {
  padding: clamp(72px, 14vh, 160px) var(--gutter) clamp(56px, 9vh, 110px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  gap: 24px clamp(24px, 6vw, 96px);
}
.journal h2 { position: relative; font-family: var(--serif); font-size: 28px; font-weight: 700; color: var(--gold); line-height: 1.3; }
.journal h2::after {
  left: 0; top: 44px; width: 96px; height: 7px;
  background: var(--brush-mark);
}
.journal h2 small {
  display: block;
  margin-top: 20px;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: .04em;
}
.posts { list-style: none; padding: 0; }
.posts a {
  position: relative;
  display: grid;
  grid-template-columns: 7.5em 3.5em 1fr auto;
  gap: 6px 16px;
  align-items: baseline;
  padding: 22px 0;
  transition: padding .5s cubic-bezier(.2, .7, .2, 1), color .3s;
}
.posts a::after {
  left: 0; right: 0; bottom: -2px; height: 4px;
  background: var(--brush-blue);
  opacity: .6;
  transition: opacity .4s;
}
.posts a:hover::after, .posts a:focus-visible::after { opacity: 1; background: var(--brush-gold); }
.posts time { font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.posts .kind { font-size: 12px; color: var(--ink-soft); letter-spacing: .1em; }
/* 종류 라벨 : kind-post / kind-notice / kind-work (값을 그대로 클래스로 쓰면 .post, .work 와 겹침) */
.kind.kind-notice { color: var(--gold); }
.kind.kind-work { color: #8fb8e0; }
.posts .title { font-family: var(--serif); font-size: clamp(18px, 1.7vw, 22px); line-height: 1.45; letter-spacing: -.02em; word-break: keep-all; }
.posts .dot {
  width: 12px; height: 10px;
  background: var(--gold);
  border-radius: 45% 60% 50% 55%;
  filter: url(#brush);
  opacity: 0;
  transform: scale(.2);
  transition: opacity .4s, transform .7s cubic-bezier(.2, .7, .2, 1);
  align-self: center;
}
.posts a:hover, .posts a:focus-visible { padding-left: 14px; color: var(--gold); outline: none; }
.posts a:hover .dot, .posts a:focus-visible .dot { opacity: 1; transform: scale(1.4); }
.posts .summary {
  grid-column: 3 / 4;
  font-size: 14px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .3s;
}
.posts a:hover .summary { color: var(--ink-soft); }
.journal.few { padding-top: calc(clamp(72px, 14vh, 160px) / 2); }
.empty { padding: 22px 0; color: var(--ink-soft); }
.more {
  display: inline-block;
  margin-top: 28px;
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--ink-soft);
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
  transition: color .3s;
}
.more:hover { color: var(--gold); }

/* ── 하위 페이지 머리 (전체 목록) ── */
.page-head { padding: clamp(40px, 9vh, 110px) var(--gutter) 0; }
.page-head h1 { position: relative; display: inline-block; font-family: var(--serif); font-size: clamp(30px, 4vw, 44px); font-weight: 700; color: var(--gold); line-height: 1.3; }
.page-head h1::after { left: 0; bottom: -18px; width: 96px; height: 7px; background: var(--brush-mark); }
.page-head p { margin-top: 36px; color: var(--ink-soft); font-size: 14px; letter-spacing: .04em; }
.archive { padding-top: clamp(24px, 5vh, 56px); padding-bottom: 8px; }
.archive + .archive { padding-top: 32px; }
.archive:last-of-type { padding-bottom: clamp(56px, 9vh, 110px); }
.archive h2 { font-size: 22px; color: var(--ink-soft); font-weight: 400; padding-top: 18px; }
.archive h2::after { display: none; }

/* ── 글 읽기 ── */
.post {
  --measure: 34em;
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin: 0 auto;
  padding: clamp(40px, 9vh, 110px) var(--gutter) clamp(56px, 9vh, 110px);
  font-size: 17px;
}
.post-head { position: relative; padding-bottom: 34px; margin-bottom: 48px; }
.post-head::after { left: 0; bottom: 0; width: 96px; height: 7px; background: var(--brush-mark); }
.post-meta { display: flex; gap: 14px; align-items: baseline; font-size: 13px; color: var(--ink-soft); letter-spacing: .04em; }
.post-meta time { font-variant-numeric: tabular-nums; }
.post-meta .kind { letter-spacing: .1em; }
.post-meta .edit { margin-left: auto; }
.post-meta .edit:hover { color: var(--gold); }
.post-head h1 {
  margin-top: 18px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.4;
  letter-spacing: -.03em;
  word-break: keep-all;
}

.prose { line-height: 1.85; color: #e6dfc5; word-break: keep-all; overflow-wrap: anywhere; }
.prose > * + * { margin-top: 1.4em; }
.prose > p:first-child { font-size: 19px; line-height: 1.8; color: var(--ink); }
.prose h2, .prose h3, .prose h4 { font-family: var(--serif); font-weight: 700; line-height: 1.45; letter-spacing: -.02em; }
.prose h2 { font-size: 1.45em; margin-top: 2.4em; }
.prose h3 { font-size: 1.2em; margin-top: 2em; }
.prose h4 { font-size: 1em; margin-top: 1.8em; color: var(--ink-soft); }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: .7em; }
.prose a {
  text-decoration: underline;
  text-decoration-color: #4d86c9;
  text-decoration-thickness: 2px;
  text-underline-offset: .3em;
  transition: color .3s, text-decoration-color .3s;
}
.prose a:hover { color: var(--gold); text-decoration-color: var(--gold); }
.prose strong { font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--ink-soft); }
.prose blockquote {
  position: relative;
  padding: .2em 0 .2em 1.5em;
  font-family: var(--serif);
  color: #d9d7cf;
}
.prose blockquote::before {
  left: 0; top: .35em; bottom: .35em; width: 5px;
  background: linear-gradient(180deg, #2f66b3, #6fa3d6 45%, #cfe0c0 75%, #f2c230);
  filter: url(#brush-v);
}
.prose hr {
  position: relative;
  border: 0;
  width: 96px; height: 7px;
  margin: 3em auto;
  background: var(--brush-mark);
}
.prose code {
  font-family: var(--mono);
  font-size: .86em;
  background: #ffffff12;
  color: #cfe0c0;
  padding: .12em .4em;
  border-radius: 4px;
}
.prose pre {
  background: #071027;
  padding: 1.1em 1.3em;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.7;
  word-break: normal;
  overflow-wrap: normal;
}
.prose pre code { background: none; padding: 0; color: var(--ink); font-size: inherit; }
.prose table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.6;
  word-break: keep-all;
}
.prose th, .prose td { padding: .65em .9em; text-align: left; vertical-align: top; }
.prose th { color: var(--ink-soft); font-weight: 600; background: #ffffff0d; }
.prose tbody tr:nth-child(even) { background: #ffffff06; }
.prose img { display: block; max-width: 100%; height: auto; margin: 2em auto; border-radius: 3px; }

.post-nav { position: relative; margin-top: 4em; font-size: 15px; }
.post-nav .end-dot {
  display: block;
  width: 14px; height: 12px;
  margin: 0 auto 3em;
  background: var(--gold);
  border-radius: 45% 60% 50% 55%;
  filter: url(#brush);
}
.post-nav .all { margin-top: 2.6em; text-align: center; }
.post-nav .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.post-nav .pair a { display: block; transition: color .3s; }
.post-nav .pair a:hover { color: var(--gold); }
.post-nav .pair .next { text-align: right; grid-column: 2; }
.post-nav small { display: block; font-size: 12px; color: var(--ink-soft); letter-spacing: .1em; margin-bottom: 6px; }
.post-nav .pair span { font-family: var(--serif); font-size: 17px; line-height: 1.5; word-break: keep-all; }

/* ── 글쓰기 (관리자) ── */
.editor { max-width: calc(46rem + var(--gutter) * 2); margin: 0 auto; padding: clamp(28px, 5vh, 56px) var(--gutter) 0; }
.editor-label { font-size: 13px; color: var(--ink-soft); letter-spacing: .1em; margin-bottom: 28px; }
.editor .error { color: var(--gold); margin-bottom: 24px; }
.meta-row { display: flex; gap: 40px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 30px; }
.kinds legend, .field > span, .pane-head label, .pane-head > span {
  display: block; font-size: 13px; color: var(--ink-soft); letter-spacing: .06em; margin-bottom: 8px; padding: 0;
}
.kinds { display: flex; gap: 22px; border: 0; padding: 0; margin: 0; }
.kinds label { position: relative; cursor: pointer; padding-bottom: 6px; }
.kinds input { position: absolute; opacity: 0; }
.kinds label span { font-family: var(--serif); font-size: 19px; color: var(--ink-soft); opacity: .7; transition: color .3s, opacity .3s; }
.kinds input:checked + span { color: var(--ink); opacity: 1; }
.kinds label span::after {
  content: ""; position: absolute; left: -4%; right: -4%; bottom: 0; height: 5px; border-radius: 99px;
  background: linear-gradient(90deg, #e8962a, #f6d44a 30%, #fbe98a 55%, #f2b632 80%, #e8962a);
  filter: url(#brush); opacity: 0; transform: scaleX(.3); transform-origin: left center;
  transition: opacity .3s, transform .5s cubic-bezier(.3, .7, .2, 1);
}
.kinds input:checked + span::after { opacity: .95; transform: scaleX(1); }
.kinds input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 4px; }
.field { position: relative; display: block; }
.field::after { left: 0; right: 0; bottom: -3px; height: 4px; background: var(--brush-blue); opacity: .5; pointer-events: none; }
.field:focus-within::after { background: var(--brush-gold); opacity: 1; }
.field input {
  width: 100%; font: inherit; color: var(--ink); background: transparent; border: 0; padding: 4px 0 10px;
}
.field input:focus { outline: none; }
.field.date { width: 10em; }
.field.date input { font-variant-numeric: tabular-nums; color-scheme: dark; }
.field.title { margin-bottom: 36px; }
.field.title input {
  font-family: var(--serif); font-weight: 700; font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.35; letter-spacing: -.03em;
}
.field.title input::placeholder { color: var(--ink-soft); opacity: .45; }

.tabs { display: none; gap: 22px; margin-bottom: 16px; }
.tabs button { position: relative; font-size: 14px; color: var(--ink-soft); padding-bottom: 6px; transition: color .3s; }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button[aria-selected="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 99px;
  background: var(--brush-gold); filter: url(#brush);
}
.workspace { display: block; }
.pane-preview { display: none; }
.pane-head { display: flex; justify-content: space-between; align-items: baseline; }
.text-btn { font-size: 13px; color: var(--ink-soft); letter-spacing: .04em; border-bottom: 1px solid currentColor; padding-bottom: 1px; transition: color .3s; }
.text-btn:hover { color: var(--gold); }
.pane-write textarea {
  display: block; width: 100%; min-height: 360px; resize: none; overflow: hidden;
  font-family: var(--mono); font-size: 15px; line-height: 1.7; color: var(--ink);
  background: #071027; border: 0; border-radius: 6px; padding: 18px 20px;
  transition: box-shadow .3s;
}
.pane-write textarea:focus { outline: none; box-shadow: 0 0 0 2px #f2c23055; }
.pane-write textarea.dropping { box-shadow: 0 0 0 2px var(--gold); }
.hint { margin-top: 10px; font-size: 13px; color: var(--ink-soft); min-height: 1.6em; }
.preview-post { max-width: none; margin: 0; padding: 4px 0 0; }
.preview-post .post-head { margin-bottom: 40px; }
.preview-post h1.placeholder { color: var(--ink-soft); opacity: .45; }

.workspace { padding-bottom: 96px; } /* 끝까지 내리면 안내 글이 저장 줄 위로 올라오게 */
.savebar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 22px;
  padding: 16px 0 22px;
  background: var(--night);
}
.savebar::before {
  content: ""; position: absolute; left: 0; right: 0; top: -16px; height: 16px; pointer-events: none;
  background: linear-gradient(to top, var(--night), #0b183600);
}
.savebar .spacer { flex: 1; }
.save {
  position: relative; height: 44px; padding: 0 30px;
  font-weight: 600; font-size: 15px; letter-spacing: .1em; color: var(--night);
  isolation: isolate;
}
.save::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 6px;
  background: linear-gradient(90deg, #f2b632, #f6d44a 35%, #fbe98a 60%, #f2c230);
  filter: url(#brush-block); transition: transform .3s;
}
.save:hover::before { transform: scale(1.03); }
.save:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.cancel { font-size: 14px; color: var(--ink-soft); border-bottom: 1px solid currentColor; padding-bottom: 2px; transition: color .3s; }
.cancel:hover { color: var(--ink); }
.delete { font-size: 13px; color: var(--ink-soft); opacity: .7; transition: color .3s, opacity .3s; }
.delete:hover { color: #e8962a; opacity: 1; }
.editor .signout { padding: 8px 0 40px; }

@media (min-width: 1024px) {
  .editor { max-width: calc(78rem + var(--gutter) * 2); }
  /* 왼쪽 단 : 종류·날짜, 제목, 본문 (쓰는 곳) / 오른쪽 단 : 미리 보기 (보이는 모습, 맨 위부터) */
  .workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 4vw, 64px); align-items: start; }
  .pane-preview { display: block; position: sticky; top: 24px; max-height: calc(100vh - 140px); overflow-y: auto; padding-right: 6px; }
  .pane-preview .pane-head { margin-bottom: 4px; }
}
@media (max-width: 1023px) {
  .tabs { display: flex; }
  .workspace[data-tab="preview"] .pane-write { display: none; }
  .workspace[data-tab="preview"] .pane-preview { display: block; }
  .pane-preview .pane-head { display: none; }
}

/* ── 하는 일 (홈 고정 구역) ── */
.work {
  padding: clamp(72px, 14vh, 160px) var(--gutter) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  gap: 24px clamp(24px, 6vw, 96px);
}
.work h2 { position: relative; font-family: var(--serif); font-size: 28px; font-weight: 700; color: var(--gold); line-height: 1.3; }
.work h2::after {
  content: ""; position: absolute; border-radius: 99px; filter: url(#brush);
  left: 0; top: 44px; width: 96px; height: 7px; background: var(--brush-mark);
}
.work h2 small { display: block; margin-top: 20px; font-family: var(--sans); font-weight: 400; font-size: 13px; color: var(--ink-soft); letter-spacing: .04em; }
.work .lead { font-family: var(--serif); font-size: clamp(22px, 2.7vw, 36px); line-height: 1.5; letter-spacing: -.025em; word-break: keep-all; max-width: 21em; }
.work .sub { margin-top: 18px; color: var(--ink-soft); max-width: 36em; line-height: 1.85; word-break: keep-all; }
.work .lead + .sub { margin-top: 24px; }
.work .more { margin-top: 36px; }

/* ── 종류별로 걸러 보기 ── */
.filters { display: flex; gap: 12px; margin-top: 14px; font-size: 13px; color: var(--ink-soft); }
.filters a { transition: color .3s; }
.filters a:hover, .filters a[aria-current] { color: var(--gold); }

/* ── 링크 페이지 ── */
.links-head h1 { font-size: 40px; }
.links-head h1::after { bottom: -22px; }
.links-head p { margin-top: 44px; }
.links-wrap { padding: clamp(40px, 7vh, 72px) var(--gutter) clamp(56px, 9vh, 110px); }
.links-admin { margin-bottom: 12px; }
.links { list-style: none; padding: 0; max-width: 60rem; }
.links li > a {
  position: relative;
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) auto;
  gap: 8px 28px;
  align-items: center;
  padding: 22px 0;
  transition: padding .5s cubic-bezier(.2, .7, .2, 1);
}
.links li > a::after {
  content: ""; position: absolute; border-radius: 99px; filter: url(#brush);
  left: 0; right: 0; bottom: -2px; height: 4px;
  background: var(--brush-blue); opacity: .6; transition: opacity .4s;
}
.links li > a:hover::after, .links li > a:focus-visible::after { opacity: 1; background: var(--brush-gold); }
.links li > a:focus-visible { outline: none; }
/* 썸네일 : 평소엔 밤빛으로 가라앉혀 두고, 올리면 제 색이 살아남 */
.thumb { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 6px; overflow: hidden; background: #08112a; }
/* 투명 배경 이미지(로고 등)는 밤색 바탕 위에서 가라앉히면 통째로 남색이 되므로, 투명한 부분 뒤에 종이색을 깔아
   "흰 페이지 위의 로고"와 같은 톤으로 보이게 함. 비율이 16:10 이 아니어도 잘리지 않게 contain, 남는 부분도 같은 종이색 */
.thumb img { display: block; width: 100%; height: 100%; object-fit: contain; background: #f4f1e8; filter: grayscale(.85) brightness(.5) contrast(1.1); transition: filter .6s ease; }
.thumb::after { content: ""; position: absolute; inset: 0; background: #1b3a8c; mix-blend-mode: color; opacity: .9; transition: opacity .6s ease; }
.links li > a:hover .thumb img, .links li > a:focus-visible .thumb img, .links li > a:active .thumb img, .thumb.live img { filter: none; }
.links li > a:hover .thumb::after, .links li > a:focus-visible .thumb::after, .links li > a:active .thumb::after, .thumb.live::after { opacity: 0; }
.links .info > span { display: block; }
.links .name { font-family: var(--serif); font-size: clamp(18px, 1.8vw, 22px); letter-spacing: -.02em; word-break: keep-all; transition: color .3s; }
.links li > a:hover .name, .links li > a:focus-visible .name { color: var(--gold); }
.links .desc { margin-top: 4px; color: var(--ink-soft); font-size: 15px; word-break: keep-all; }
.links .url { margin-top: 8px; font-size: 12px; letter-spacing: .06em; color: var(--ink-soft); overflow-wrap: anywhere; }
.links .go { font-family: var(--serif); font-size: 20px; color: var(--gold); opacity: 0; transform: translate(-6px, 6px); transition: opacity .4s, transform .5s cubic-bezier(.2, .7, .2, 1); }
.links li > a:hover .go, .links li > a:focus-visible .go { opacity: 1; transform: none; }
/* 관리자 도구(고치기 ↑ ↓) : 구분선 위, 항목 안쪽 오른쪽 아래 */
.links li { position: relative; }
.links li.has-tools > a { padding-bottom: 54px; }
.link-tools { position: absolute; right: 0; bottom: 16px; display: flex; gap: 14px; align-items: center; font-size: 13px; color: var(--ink-soft); }
.link-tools a, .link-tools button { color: var(--ink-soft); transition: color .3s; }
.link-tools a:hover, .link-tools button:hover { color: var(--gold); }
.link-tools form { display: inline; }

/* 링크 추가/고치기 */
.field.plain { margin-bottom: 30px; }
.field.plain input { font-size: 16px; }
.field .count { position: absolute; right: 0; top: 0; font-size: 12px; color: var(--ink-soft); }
.field .count.over { color: #e8962a; }
.thumb-field { margin-top: 6px; }
.thumb-previews { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 20px; padding: 8px; margin: 0 -8px; border-radius: 8px; transition: box-shadow .3s; }
.thumb-previews.dropping { box-shadow: 0 0 0 2px var(--gold); }
.thumb-previews figure { margin: 0; }
.thumb-previews figcaption { margin-top: 8px; font-size: 12px; color: var(--ink-soft); }
.link-editor .field.title, .link-editor .field.plain, .link-editor .thumb-field { max-width: 40rem; }

/* ── 404 ── */
.lost { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; padding: 64px var(--gutter); }
.lost p { font-family: var(--serif); font-size: clamp(22px, 3vw, 32px); line-height: 1.5; word-break: keep-all; }

/* ── 푸터 ── */
.band {
  display: block; width: 100%; height: 150px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 60%);
          mask-image: linear-gradient(to bottom, transparent, #000 60%);
}
footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 28px var(--gutter) 40px;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--ink-soft);
}
footer i { font-family: var(--serif); font-style: normal; font-size: 14px; letter-spacing: 0; }
footer .mail { letter-spacing: .06em; transition: color .3s; }
footer .mail:hover { color: var(--gold); }

@media (max-width: 720px) {
  .wide-only { display: none !important; }
  .narrow-only { display: block; }

  /* 첫 화면 : 제목을 먼저, 지평선(0.48) 바로 아래에. 다음 구역이 살짝 보이게 88svh */
  .hero { min-height: 88svh; align-items: flex-start; padding-top: 46svh; padding-bottom: 40px; }
  .hero::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 120px; z-index: 1; pointer-events: none;
    background: linear-gradient(to bottom, #071027cc, transparent);
  }
  .rise { animation-duration: .5s; }
  .rise:nth-child(1) { animation-delay: 0s; }
  .rise:nth-child(2) { animation-delay: .1s; }
  .hero h1 em::after { animation-delay: 1s; }
  .origin-band { padding: 56px var(--gutter) 0; }
  header nav .admin-nav { margin-left: 6px; }

  .origin { grid-template-columns: 1fr; gap: 2px; }
  .origin dd { margin-bottom: 12px; }
  .journal { grid-template-columns: 1fr; }
  .posts a { grid-template-columns: auto 1fr; gap: 4px 14px; }
  .posts .title { grid-column: 1 / -1; }
  .posts .summary { grid-column: 1 / -1; }
  .work { grid-template-columns: 1fr; }
  .links li > a { grid-template-columns: 96px minmax(0, 1fr); gap: 4px 16px; align-items: start; }
  .links .go { display: none; }
  .links-head h1 { font-size: 32px; }
  .origin-band .origin { margin-top: 0; }
  .posts .dot { display: none; }
  .hero::after {
    background:
      linear-gradient(to top, var(--night) 0%, transparent 20%),
      linear-gradient(to top, #071027f2 0%, #071027b0 45%, transparent 72%);
  }
  .post { font-size: 17px; }
  footer { flex-direction: column; gap: 6px; }
  .post-nav .pair { grid-template-columns: 1fr; }
  .post-nav .pair .next { grid-column: 1; text-align: left; }
}
/* 좁은 휴대폰 : 메뉴 알약이 로고에 붙지 않게 */
@media (max-width: 420px) {
  header nav { gap: 4px; }
  header nav a, header nav button { padding: 6px 10px; letter-spacing: .04em; }
  header nav .admin-nav { gap: 4px; margin-left: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; opacity: 1; }
  .hero h1 em::after { animation: none; transform: none; }
  .posts a, .posts .dot { transition: none; }
}
