/* BYANGBYANG — editorial, clean, understated. Warm-white base, near-black text.
   2차 패스: content-width 1200, type scale-up, featured/works 존재감 강화. */

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #1b1a17;
  --ink-soft: #4a4741;
  --muted: #8a867e;
  --line: #e7e1d7;
  --line-soft: #efe9dd;
  --accent: #3f5a45; /* 최소 사용: 링크·배지 포인트 */
  --accent-soft: #edf1ec;
  --radius: 8px;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1.0625rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.3125rem;
  --fs-xl: clamp(1.8125rem, calc(3vw + 1px), 2.3125rem);
  --fs-hero: clamp(2.6875rem, calc(5vw + 1px), 4.3125rem);

  --content-width: 1200px;
  --shell-width: 1540px;   /* main 1200 + rail 280 + gap 44 + padding */
  --rail-width: 280px;
  --shell-gap: clamp(2rem, 3vw, 2.75rem); /* 32–44px */
  --header-h: 64px;
  --status-active: #5c6e58; /* muted olive — in-progress 전용 미세 포인트 */
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic",
    "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.65;
  letter-spacing: -0.01em;
}

img { max-width: 100%; display: block; }

h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.02em; }
p { margin: 0; }

/* 한글 제목: 한 글자씩 끊기지 않도록 어절 단위 줄바꿈 */
.work-title,
.feature-title,
.log-item-title {
  word-break: keep-all;
  overflow-wrap: break-word;
}

.container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: clamp(1.125rem, 3vw, 2.5rem); /* mobile 18 / tablet ~24 / desktop 40 */
}

.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }

/* 스크린리더 전용 텍스트 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 접근성: 포커스 / 스킵 / 모션 ---------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--ink);
  color: var(--bg);
  border-radius: 6px;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0.75rem; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 헤더 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
  min-height: var(--header-h);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--header-h);
}

.brand {
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
}

.site-nav ul {
  display: flex;
  gap: var(--space-6);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: var(--fs-sm); /* 13px */
  letter-spacing: 0.1em;
  font-weight: 600;
  padding-block: var(--space-2);
}
.site-nav a:hover { color: var(--ink); }

.menu-button {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 6px;
  padding: 0.45rem 1rem;
  font-size: 0.9375rem;
}

/* ---------- Hero ---------- */

.hero {
  padding-top: clamp(5.5rem, 10vw, 7.5rem);   /* ~88–120px */
  padding-bottom: clamp(4.5rem, 7vw, 6rem);   /* ~72–96px → Featured 간격 */
  border-bottom: 1px solid var(--line-soft);
}

.eyebrow {
  font-size: var(--fs-sm);
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: var(--space-4);
}

.hero h1 {
  font-size: var(--fs-hero);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.hero .lede {
  margin-top: var(--space-5);
  font-size: clamp(1.3125rem, calc(2.6vw + 1px), 1.6875rem);
  line-height: 1.25;
  font-weight: 550;
}

.hero .lede-ko {
  margin-top: var(--space-3);
  color: var(--ink-soft);
  font-size: 1rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  margin: var(--space-6) 0 0;
  padding: var(--space-5) 0 0;
  border-top: 1px solid var(--line-soft);
}

.hero-meta li {
  font-size: 0.875rem;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 6px; /* pill 금지 — 절제된 사각 태그 */
  padding: 0.35rem 0.75rem;
  background: var(--surface);
}

/* ---------- 섹션 공통 ---------- */

.section-eyebrow {
  font-size: var(--fs-xs); /* 11px — 실제 가독 최소치 */
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-2);
}

.section-title {
  font-size: var(--fs-xl);
  font-weight: 750;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.work-count {
  font-size: 0.9375rem;
  color: var(--muted);
  padding-bottom: 0.4rem;
  white-space: nowrap;
}

/* 섹션 간격: Hero→Featured ~93 / Featured→Works ~110 / Works→Log ~120 / Log→Links ~96 */
#featured { padding-block: 0 clamp(3.5rem, 6vw, 5rem); }
#works { padding-block: clamp(1.5rem, 3vw, 2.5rem) clamp(4.5rem, 7vw, 6.5rem); }
#log { padding-block: clamp(1.5rem, 3vw, 2.5rem) clamp(4rem, 6vw, 5.5rem); }
#links { padding-block: clamp(1rem, 2vw, 1.5rem) clamp(4rem, 6vw, 5rem); }

/* 섹션 헤딩(eyebrow+H2)과 본체 사이 */
#featured-slot, #log-slot, #links-slot { margin-top: clamp(2rem, 4vw, 3rem); }
#works .section-head { margin-bottom: clamp(2rem, 4vw, 3rem); }

/* ---------- Featured ---------- */

.feature-card {
  display: grid;
  grid-template-columns: 1.5fr 1fr; /* 60 : 40 */
  gap: clamp(2rem, 4vw, 3rem);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: clamp(1.25rem, 3vw, 2rem);
}

.feature-card > * { min-width: 0; }

/* 정사각형 원본 기준 — 16:9 크롭 금지 */
.feature-cover {
  aspect-ratio: 1 / 1;
}

.feature-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-4);
  min-width: 0;
  padding-block: var(--space-3);
}

.feature-title {
  font-size: clamp(1.8125rem, calc(3.2vw + 1px), 2.4375rem);
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
}

.feature-desc {
  color: var(--ink-soft);
  font-size: var(--fs-base);
}

.feature-meta {
  font-size: 0.9375rem;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
  padding-top: var(--space-3);
}

.feature-link {
  align-self: flex-start;
  margin-top: var(--space-1);
  color: var(--accent);
  font-weight: 650;
  font-size: 1rem;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}
.feature-pending {
  align-self: flex-start;
  margin-top: var(--space-1);
  color: var(--muted);
  font-size: 0.9375rem;
  border-bottom: 1px dashed currentColor;
  padding-bottom: 1px;
}

.badge {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #dfe6df;
  border-radius: 999px;
  padding: 0.32rem 0.8rem;
  white-space: nowrap;
}

.badge.is-done {
  color: var(--ink-soft);
  background: #f3efe7;
  border-color: var(--line);
}

/* ---------- 표지(커버) ---------- */

.cover {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--line-soft);
  background: #ece7db;
  isolation: isolate;
}

/* 이미지 없는 상태: 중립 placeholder (작품별 tone으로 미묘하게 구분) */
.cover[data-tone="1"] { background: #ece7db; }
.cover[data-tone="2"] { background: #e9e6dd; }
.cover[data-tone="3"] { background: #e6e2d6; }
.cover[data-tone="4"] { background: #eae4d8; }

/* 절제된 placeholder: 작품 전체 제목을 작게, 표지보다 눈에 띄지 않게 */
.cover::before {
  content: attr(data-title);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.7;
  color: rgba(27, 26, 23, 0.38);
  z-index: 0;
}
.cover::after {
  content: "COVER";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.9rem;
  text-align: center;
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  color: rgba(27, 26, 23, 0.3);
  z-index: 0;
}
.cover.has-image::before,
.cover.has-image::after { content: none; }

.cover img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: inherit;
}

/* ---------- 작품 그리드: desktop 3열 중심 ---------- */

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(1.5rem, 3vw, 2rem);   /* 24–32px */
  row-gap: clamp(3rem, 5vw, 3.5rem);      /* 48–56px */
}

.work-card {
  min-width: 0;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  border-top: 1px solid var(--line);
  padding-top: var(--space-4);
}

.work-card .cover { aspect-ratio: 1 / 1; }

.work-title {
  font-size: clamp(1.1875rem, calc(1.6vw + 1px), 1.3125rem);
  font-weight: 700;
  line-height: 1.35;
}

.work-sub {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
  order: -1; /* metadata → 제목 → 설명 순서 */
}

.work-desc {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.work-card[href]:not([href="#"]) .work-title { transition: transform 0.18s ease; }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .work-card[href]:not([href="#"]):hover .cover img { transform: scale(1.02); }
  .work-card[href]:not([href="#"]):hover .work-title { transform: translateX(2px); }
  .work-card[href]:not([href="#"]):hover { border-top-color: var(--ink); }
}
.cover img { transition: transform 0.25s ease; }

.noscript-list {
  margin: var(--space-4) 0 0;
  padding-left: 1.25rem;
  color: var(--ink-soft);
}

/* ---------- 셸 레이아웃: main + production rail ---------- */

.container--shell { max-width: var(--shell-width); }

.shell-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail-width);
  gap: var(--shell-gap);
  align-items: start;
}

.shell-main { display: contents; }

/* main/rail이 container padding을 공유하므로 내부는 padding 없이 폭만 제한 */
.shell-main #featured,
.shell-main #works,
.shell-main #log,
.shell-main #links {
  grid-column: 1;
  max-width: var(--content-width);
}

.shell-main #featured { grid-row: 1; }
.shell-main #works { grid-row: 2; }
.shell-main #log { grid-row: 3; }
.shell-main #links { grid-row: 4; }

.shell-rail {
  grid-column: 2;
  grid-row: 1 / span 4;
  min-width: 0;
  align-self: start;
  position: sticky;
  top: calc(var(--header-h) + 28px); /* ~92px */
}

#production {
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
  padding-bottom: var(--space-6);
  border-top: 1px solid var(--ink);
}

/* ---------- Production Queue: editorial list ---------- */

#production-slot { margin-top: var(--space-5); }

.prod-groups { display: flex; flex-direction: column; gap: var(--space-6); }

.prod-group-title {
  font-size: var(--fs-xs);
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
  word-break: keep-all;
}

.prod-group-ko {
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
}

.prod-list { list-style: none; margin: 0; padding: 0; }

.prod-item {
  display: grid;
  grid-template-columns: 0.5rem minmax(0, 1fr);
  gap: var(--space-3);
  padding-block: var(--space-3);
  border-bottom: 1px solid var(--line-soft);
}

.prod-item:last-child { border-bottom: 0; }

.prod-dot {
  width: 0.42rem;
  height: 0.42rem;
  margin-top: 0.5em;
  border-radius: 50%;
  border: 1px solid var(--muted);
  background: transparent;
}

.prod-item.is-active .prod-dot {
  background: var(--status-active);
  border-color: var(--status-active);
}

.prod-item.is-done { opacity: 0.62; }
.prod-item.is-done .prod-task { text-decoration: line-through; text-decoration-thickness: 1px; }

.prod-body { min-width: 0; }

.prod-project {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  word-break: keep-all;
}

.prod-task {
  margin-top: 0.15rem;
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.55;
  word-break: keep-all;
}

.prod-status {
  margin-top: var(--space-1);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.prod-item.is-active .prod-status { color: var(--status-active); }

.prod-sep { letter-spacing: 0; }

.prod-updated {
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- 로그: editorial changelog 강화 ---------- */

.log-group + .log-group { margin-top: var(--space-6); }

.log-month {
  font-size: var(--fs-sm);
  font-weight: 750;
  letter-spacing: 0.08em;
  color: var(--ink);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--ink);
  margin-bottom: 0;
}

.log-list { list-style: none; margin: 0; padding: 0; }

.log-item {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: var(--space-6);
  align-items: baseline;
  padding-block: 1.4rem;
  border-bottom: 1px solid var(--line-soft);
}

.log-date {
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.log-item-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 650;
}

.log-note {
  margin-top: var(--space-1);
  font-size: 1rem;
  color: var(--ink-soft);
}

.log-tag {
  font-size: calc(0.72rem + 1px);
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  margin-left: var(--space-2);
  vertical-align: middle;
  white-space: nowrap;
}

/* ---------- 링크: 박스 카드 → horizontal row ---------- */

.links-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 1.25rem 0.25rem;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.links-list li:last-child .link-row { border-bottom: 1px solid var(--line); }

.link-row[href]:not([href="#links"]):hover .link-name {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-row[aria-disabled="true"] { cursor: default; }

.link-name { display: block; font-size: 1.125rem; font-weight: 700; }
.link-desc { display: block; margin-top: 0.15rem; font-size: 0.9375rem; color: var(--muted); }
.link-status { font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }

/* ---------- 푸터 ---------- */

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding-block: var(--space-6);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  align-items: baseline;
  justify-content: space-between;
}

.footer-brand {
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 1.0625rem;
}

.footer-note { font-size: 0.9375rem; }

/* ---------- 작품 상세: 기존 editorial 스타일 재사용 ---------- */

.detail-wrap {
  padding-top: clamp(3rem, 6vw, 4.5rem);
  padding-bottom: clamp(4rem, 6vw, 5rem);
}

.detail-back { margin-bottom: var(--space-5); }

.detail-back a { color: var(--ink-soft); }

.detail-head {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(2rem, 4vw, 3rem);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: clamp(1.25rem, 3vw, 2rem);
}

.detail-head > * { min-width: 0; }

.detail-cover { aspect-ratio: 1 / 1; }

.detail-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.detail-title {
  font-size: clamp(1.8125rem, calc(3.2vw + 1px), 2.4375rem);
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
  word-break: keep-all;
}

.detail-subtitle {
  color: var(--ink-soft);
  font-size: var(--fs-base);
}

.detail-desc {
  color: var(--ink-soft);
  font-size: var(--fs-base);
}

.detail-section { margin-top: clamp(2.5rem, 5vw, 4rem); }

.detail-body {
  margin-top: var(--space-4);
  color: var(--ink-soft);
}

.detail-list {
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.detail-list li {
  padding-block: var(--space-3);
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft);
}

.site-nav--always { display: block; }

.site-nav--always ul {
  display: flex;
  gap: var(--space-6);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav--always a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: var(--fs-sm);
  letter-spacing: 0.1em;
  font-weight: 600;
  padding-block: var(--space-2);
}

.site-nav--always a:hover { color: var(--ink); }

/* ---------- 반응형 ---------- */

/* <1500px: rail 해제 → Featured 아래 일반 섹션으로 (Works 3열 유지) */
@media (max-width: 1499px) {
  .container--shell { max-width: var(--content-width); }
  .shell-grid { grid-template-columns: minmax(0, 1fr); }
  .shell-main #featured,
  .shell-main #works,
  .shell-main #log,
  .shell-main #links,
  .shell-rail { grid-column: 1; grid-row: auto; }
  .shell-rail { position: static; }
  #production {
    padding-top: clamp(1.5rem, 3vw, 2.5rem);
    padding-bottom: 0;
  }
  #production-slot { margin-top: var(--space-4); }
  .prod-groups {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-5);
  }
  .prod-updated { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .prod-groups { grid-template-columns: 1fr; }
}

/* tablet: Works 2열 */
@media (max-width: 900px) {
  .works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: var(--space-7);
  }
  .feature-card { grid-template-columns: 1fr; }
  .feature-cover { max-width: 560px; }
  .detail-head { grid-template-columns: 1fr; }
  .detail-cover { max-width: 560px; }
}

/* mobile: Featured/Works/Queue 1열 */
@media (max-width: 640px) {
  .menu-button { display: inline-block; }
  .site-nav { display: none; width: 100%; }
  .site-nav.is-open { display: block; }
  .header-inner { flex-wrap: wrap; padding-block: 0.65rem; }
  .site-nav ul {
    flex-direction: column;
    gap: 0;
    width: 100%;
    padding-block: var(--space-2);
  }
  .site-nav a {
    display: block;
    padding-block: 0.7rem;
    font-size: 1rem;
    border-top: 1px solid var(--line-soft);
  }
  .works-grid { grid-template-columns: 1fr; }
  .log-item { grid-template-columns: 4.5rem minmax(0, 1fr); gap: var(--space-4); }
}
