/* ============================================================
   labs-steve — 잡스가 만들었던, 그리고 만들었을 인터페이스 표본실
   레지스터: 흑백. 검정 구간과 흰 구간이 번갈아 오는 제품 페이지의 리듬
   ============================================================ */

/* ---------- 서체 ----------
   SF Pro 계열 시스템 서체가 있으면 그것을, 없으면 같은 골격의 Pretendard를 쓴다.
   Pretendard 파일은 프로젝트 안에 있어 외부 요청이 없다. */
@font-face {
  font-family: "Pretendard Variable";
  src: url("../fonts/PretendardVariable.woff2") format("woff2-variations");
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}

/* ---------- 토큰 ---------- */
:root {
  --page:        #FFFFFF;          /* 본문 구간 바탕 */
  --ground:      #F5F5F7;
  --ground-2:    #E8E8ED;
  --surface:     #FFFFFF;
  --surface-2:   #F5F5F7;
  --ink:         #1D1D1F;
  --ink-2:       #55555A;
  --ink-3:       #68686D;
  --line:        rgba(0, 0, 0, .09);
  --line-faint:  rgba(0, 0, 0, .05);
  --line-2:      rgba(0, 0, 0, .18);
  --accent:      #1D1D1F;          /* 흑백 — 강조는 색이 아니라 농도와 굵기로 */
  --accent-2:    #000000;
  --accent-wash: rgba(0, 0, 0, .06);
  --friction:    #68686D;          /* 나쁜 예는 회색으로 물러선다 */
  --on-accent:   #FFFFFF;
  --shadow:      0 2px 10px rgba(0, 0, 0, .06), 0 18px 40px -20px rgba(0, 0, 0, .25);

  --sans: "Pretendard Variable", Pretendard, system-ui, sans-serif;
  --mono: var(--sans);

  /* 재현한 제품 화면 안쪽에서만 쓰는 크기. 페이지의 글은 아래 텍스트 스타일을 쓴다 */
  --t-xs:   .875rem;
  --t-sm:   .875rem;
  --t-md:   1rem;
  --t-base: 1rem;

  /* 텍스트 스타일 — 크기는 모두 타입 스케일의 한 단계 */
  --display-0: 600 128px/128px var(--sans);   /* 숫자 그림 전용 */
  --display-1: 600 96px/96px var(--sans);     /* 숫자 그림 전용 */
  --display-2: 600 72px/72px var(--sans);     /* 숫자 그림 전용 */
  --heading-1: 600 60px/60px var(--sans);
  --heading-2: 600 48px/48px var(--sans);
  --heading-3: 600 36px/40px var(--sans);
  --heading-4: 600 30px/36px var(--sans);
  --heading-5: 600 24px/32px var(--sans);
  --heading-6: 600 20px/28px var(--sans);
  --title-1: 500 20px/28px var(--sans);
  --title-2: 500 18px/28px var(--sans);
  --body-1: 600 16px/24px var(--sans);
  --body-2: 500 16px/24px var(--sans);
  --body-3: 400 16px/24px var(--sans);
  --body-4: 600 14px/20px var(--sans);
  --body-5: 500 14px/20px var(--sans);
  --body-6: 400 14px/20px var(--sans);
  --body-7: 400 18px/28px var(--sans);        /* 긴 본문 */
  --button-md: 600 16px/24px var(--sans);
  --button-sm: 600 14px/20px var(--sans);
  --caption-3: 600 12px/16px var(--sans);
  --caption-4: 500 12px/16px var(--sans);
  --caption-5: 400 12px/16px var(--sans);

  /* 화면 폭에 따라 한 단계씩 바뀌는 역할 — 사이 값은 없다 */
  --type-hero:    var(--heading-5);
  --type-section: var(--heading-4);
  --type-part:    var(--heading-3);
  --type-opener:  var(--heading-2);
  --type-quote:   var(--heading-4);
  --type-coda:    var(--heading-3);
  --type-pull:    var(--heading-5);
  --type-lede:    var(--heading-5);
  --type-dek:     var(--title-2);
  --type-sub:     var(--title-1);
  --type-label:   var(--title-2);
  --type-toc:     var(--heading-6);
  --type-tl-year: var(--heading-1);
  --type-decade:  var(--display-2);
  --type-tl-y:    var(--heading-4);
  --type-count:   var(--display-1);
  --type-stage:   var(--heading-5);
  --type-dens:    var(--heading-6);

  /* 간격 — 이 값들만 쓴다 */
  --s-25: 2px; --s-50: 4px; --s-75: 8px; --s-100: 12px; --s-200: 16px; --s-300: 24px;
  --s-400: 32px; --s-500: 40px; --s-600: 48px; --s-700: 64px; --s-800: 80px; --s-900: 96px;
  /* 넓은 화면에서 한 단계 커지는 간격 (좁은 값 → 넓은 값) */
  --sp-100-400: var(--s-100);
  --sp-200-300: var(--s-200);
  --sp-200-700: var(--s-200);
  --sp-300-500: var(--s-300);
  --sp-300-600: var(--s-300);
  --sp-400-600: var(--s-400);
  --sp-400-700: var(--s-400);
  --sp-400-800: var(--s-400);
  --sp-500-700: var(--s-500);
  --sp-500-800: var(--s-500);
  --sp-500-900: var(--s-500);
  --sp-700-900: var(--s-700);
  --sp-800-900: var(--s-800);

  /* 모션 — 무게감 있게 감속 */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-move: 500ms;
  --t-color: 300ms;

  --gut: var(--s-200);
  --plate-radius: 24px;
  --row-h: 32px;
}

@media (min-width: 360px) {
  :root { --type-hero: var(--heading-4); }
}
@media (min-width: 600px) {
  :root {
    --gut: var(--s-400);
    --type-hero: var(--heading-2);
    --type-section: var(--heading-2);
    --type-part: var(--heading-2);
    --type-quote: var(--heading-3);
  }
}
@media (min-width: 861px) {
  :root {
    --sp-100-400: var(--s-400);
    --sp-200-300: var(--s-300);
    --sp-200-700: var(--s-700);
    --sp-300-500: var(--s-500);
    --sp-300-600: var(--s-600);
    --sp-400-600: var(--s-600);
    --sp-400-700: var(--s-700);
    --sp-400-800: var(--s-800);
    --sp-500-700: var(--s-700);
    --sp-500-800: var(--s-800);
    --sp-500-900: var(--s-900);
    --sp-700-900: var(--s-900);
    --sp-800-900: var(--s-900);
    --type-hero: var(--heading-4);
    --type-part: var(--heading-1);
    --type-opener: var(--heading-1);
    --type-quote: var(--heading-1);
    --type-coda: var(--heading-1);
    --type-pull: var(--heading-3);
    --type-lede: var(--heading-4);
    --type-dek: var(--title-1);
    --type-sub: var(--heading-5);
    --type-label: var(--title-1);
    --type-toc: var(--heading-5);
    --type-tl-year: var(--display-1);
    --type-decade: var(--display-0);
    --type-tl-y: var(--heading-3);
    --type-count: var(--display-0);
    --type-stage: var(--heading-3);
    --type-dens: var(--heading-5);
  }
}
@media (min-width: 960px) {
  :root { --type-hero: var(--heading-3); }
}
@media (min-width: 1200px) {
  :root {
    --gut: var(--s-600);
    --type-dens: var(--heading-3);
  }
}
@media (min-width: 1240px) {
  :root { --type-hero: var(--heading-2); }
}
@media (min-width: 1440px) {
  :root { --type-hero: var(--heading-1); }
}

/* 검정 구간 — 화면 테마와 무관하게 늘 검정 */
.tone-dark,
:root[data-theme="dark"] {
  --page: #000000; --ground: #000000; --ground-2: #181818; --surface: #1F1F1F; --surface-2: #181818;
  --ink: #F5F5F7; --ink-2: #A1A1A6; --ink-3: #86868B;
  --line: rgba(255,255,255,.12); --line-2: rgba(255,255,255,.24);
  --line-faint: rgba(255,255,255,.06);
  --accent: #F5F5F7; --accent-2: #FFFFFF; --accent-wash: rgba(255,255,255,.1);
  --friction: #6E6E73;
  --on-accent: #000000;
  --shadow: 0 2px 10px rgba(0,0,0,.5), 0 18px 40px -20px rgba(0,0,0,.8);
}
.tone-dark { background-color: var(--ground); color: var(--ink); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #000000; --ground: #000000; --ground-2: #181818; --surface: #1F1F1F; --surface-2: #181818;
    --ink: #F5F5F7; --ink-2: #A1A1A6; --ink-3: #86868B;
    --line: rgba(255,255,255,.12); --line-2: rgba(255,255,255,.24);
    --line-faint: rgba(255,255,255,.06);
    --accent: #F5F5F7; --accent-2: #FFFFFF; --accent-wash: rgba(255,255,255,.1);
    --friction: #6E6E73;
    --on-accent: #000000;
    --shadow: 0 2px 10px rgba(0,0,0,.5), 0 18px 40px -20px rgba(0,0,0,.8);
  }
}

/* ---------- 리셋 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  font: var(--body-3);
  margin: 0;
  background-color: var(--ground);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;          /* 한글 어절 단위 줄바꿈 */
  overflow-wrap: break-word;
  overflow-x: clip;              /* 전폭 히어로가 가로 스크롤을 만들지 않도록 */
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; }
svg { display: block; }

::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- 공통 조판 ---------- */
.wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--gut);
}

/* 계측·라벨 — 대문자·넓은 자간 대신 본문과 같은 결의 작은 글자 */
.mono {
  font: var(--body-6);
  letter-spacing: -.005em;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3 {
  letter-spacing: -.025em;
  text-wrap: balance;
  font-weight: 600;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ============================================================
   표본판 (plate)
   ============================================================ */
.plate {
  position: relative;
  display: flex;
  flex-direction: column;          /* min-height로 남는 높이를 본문이 흡수하도록 */
  margin: var(--sp-200-300) 0 var(--sp-300-500);
  background: var(--surface-2);
  border: 0;
  border-radius: var(--plate-radius);
}

.plate__bar {
  font: var(--body-6);
  display: flex;
  align-items: center;
  gap: var(--s-200);
  flex-wrap: wrap;
  min-height: 72px;                /* 칩이 들어와도 바가 두꺼워지지 않도록 */
  padding: var(--s-300) var(--sp-300-500) 0;
}
.plate__spec { font: var(--body-6); color: var(--ink-3);}
.plate__spec b { color: var(--ink-2); font-weight: 500; }
.plate__spec--wrap { line-height: 1.7; }
.plate__bar-spacer { flex: 1; }

.plate__stage {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-200);
}

/* 계측 readout */
.readout {
  font: var(--body-6);
  display: flex;
  gap: var(--s-200);
  flex-wrap: wrap;
  justify-content: center;
  color: var(--ink-3);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.readout b { color: var(--accent); font-weight: 600; }

/* 공용 칩 버튼 */
.chip {
  font: var(--body-6);
  padding: var(--s-75) var(--s-200);
  border: 1px solid var(--line-2);
  border-radius: 9999px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color var(--t-color) var(--ease), color var(--t-color) var(--ease), border-color var(--t-color) var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip[aria-pressed="true"],
.chip.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
/* 대화 제안 답변은 문장이므로 대문자화·자간 해제 */
.chip--say { text-transform: none; letter-spacing: .01em; }

/* ============================================================
   FIG.01 — 휠
   ============================================================ */
.wheelrig {
  display: flex;
  gap: clamp(20px, 4vw, 44px);
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.ipod {
  width: 224px;
  height: 224px;
  border-radius: 50%;
  position: relative;
  flex: none;
  touch-action: none;
  cursor: grab;
  background: radial-gradient(circle at 50% 34%, var(--surface-2), var(--ground-2) 74%);
  border: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), var(--shadow);
  user-select: none;
  -webkit-user-select: none;
}
@media (prefers-color-scheme: dark) {
  .ipod { box-shadow: inset 0 1px 0 rgba(255,255,255,.06), var(--shadow); }
}
.ipod:active { cursor: grabbing; }

.ipod__label {
  position: absolute;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .16em;
  color: var(--ink-3);
  pointer-events: none;
}
.ipod__label--menu { top: 15px;    left: 50%;  transform: translateX(-50%); }
.ipod__label--prev { left: 16px;   top: 50%;   transform: translateY(-50%); }
.ipod__label--next { right: 16px;  top: 50%;   transform: translateY(-50%); }
.ipod__label--play { bottom: 15px; left: 50%;  transform: translateX(-50%); }

.ipod__center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .09s var(--ease), background-color .15s var(--ease), color .15s var(--ease);
}
.ipod__center:hover { color: var(--accent); }
.ipod__center:active { transform: translate(-50%, -50%) scale(.955); }
.ipod__center.is-playing {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

/* 회전 지시침 */
.ipod__needle { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; }
.ipod__needle i {
  position: absolute;
  top: 5px;
  left: 50%;
  width: 3px;
  height: 11px;
  margin-left: -1.5px;
  background: var(--accent);
  border-radius: 6px;
  opacity: 0;
  transition: opacity .25s var(--ease);
}
.ipod.is-active .ipod__needle i { opacity: 1; }

.screen {
  flex: 1 1 300px;
  min-width: 0;
  max-width: 380px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--ground-2);
  overflow: hidden;
}
.screen__head {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  background: var(--surface-2);
}
.screen__view { position: relative; height: 224px; overflow: hidden; }
.screen__band {
  position: absolute;
  left: 0; right: 0;
  top: 96px;
  height: var(--row-h);
  background: var(--accent);
  opacity: .14;
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  pointer-events: none;
}
.screen__list { will-change: transform; padding-top: 96px; }

.row {
  height: var(--row-h);
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--t-sm);
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
}
.row__t { overflow: hidden; text-overflow: ellipsis; }
.row__a { margin-left: auto; color: var(--ink-3); font-size: var(--t-xs); flex: none; }
.row.is-sel { color: var(--ink); font-weight: 650; }
.row.is-sel .row__a { color: var(--ink-2); }

.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 11px; flex: none; }
.eq i { width: 2px; background: var(--accent); animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(1) { height: 5px;  animation-delay: 0s; }
.eq i:nth-child(2) { height: 11px; animation-delay: .18s; }
.eq i:nth-child(3) { height: 7px;  animation-delay: .36s; }
@keyframes eq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

/* ============================================================
   FIG.02 — 바운스
   ============================================================ */
.abpair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
}
@media (max-width: 560px) { .abpair { grid-template-columns: 1fr; } }

.scroller {
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--ground-2);
  overflow: hidden;
}
.scroller__head {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-3);
}
.scroller__head b { font-weight: 600; }
.scroller--bad  .scroller__head b { color: var(--friction); }
.scroller--good .scroller__head b { color: var(--accent); }

.scroller__view {
  /* 휴대폰 화면처럼 세로로 길게 — 관성이 붙을 거리가 있어야 차이가 드러난다 */
  height: clamp(320px, 30vw, 420px);
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}
.scroller__view:active { cursor: grabbing; }
.scroller__inner { will-change: transform; }

.item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 13px;
  height: 50px;
  border-bottom: 1px solid var(--line);
  font-size: var(--t-sm);
}
.item__y {
  flex: none;
  font-size: var(--t-xs);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;            /* 연도는 절대 쪼개지지 않는다 */
}
.item__txt {
  min-width: 0;                   /* 줄바꿈 대신 말줄임이 되도록 */
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.item__n,
.item__d {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item__n { color: var(--ink); font-weight: 600; letter-spacing: -.015em; }
.item__d { color: var(--ink-3); font-size: var(--t-xs); }

/* 경계 충돌 표시 — A판 전용 */
.scroller__edge {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: var(--friction);
  opacity: 0;
  transition: opacity .12s var(--ease);
  pointer-events: none;
}
.scroller__edge--top { top: 0; }
.scroller__edge--bot { bottom: 0; }
.scroller__edge.is-hit { opacity: .9; }

/* ============================================================
   FIG.06 — 스케일
   ============================================================ */
.handleblock {
  width: 100%;
  max-width: 470px;
  margin-bottom: var(--s-700);            /* 세로 중앙에서 조금 위로 올린다 */
}

.paper {
  position: relative;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--ground-2);
  padding: var(--s-200) var(--s-200) var(--s-500);
  min-height: 186px;
  transition: min-height .28s var(--ease);
}
.paper__text {
  font: var(--body-3);
  color: var(--ink);
  transition: opacity .12s var(--ease);
}
.paper__text.is-swapping { opacity: .18; }

/* 손잡이는 눈에 먼저 띄어야 한다 — 액센트로 칠하고 위아래 화살표를 얹는다 */
.handle {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 54px;
  height: 34px;
  border: 1px solid var(--accent);
  background: var(--accent-wash);
  color: var(--accent);
  cursor: ns-resize;
  touch-action: none;
  display: grid;
  place-items: center;
  border-radius: 8px 0 8px 0;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.handle svg { width: 19px; height: 19px; }
.handle:hover,
.handle.is-drag {
  background: var(--accent);
  color: var(--on-accent);
}

/* 상세도 사다리 */
.ladder {
  display: flex;
  gap: var(--s-50);
  margin-top: var(--s-100);
  align-items: flex-end;
  justify-content: center;
}
.ladder i {
  width: 30px;
  height: 3px;
  border-radius: 9999px;
  background: var(--line-2);
  transition: background-color .2s var(--ease);
}
.ladder i.is-on { background: var(--accent); height: 8px; }

/* 안 쳐도 되는 문장 */
.deadbox {
  font: var(--body-6);
  margin-top: var(--s-100);
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  padding: var(--s-100) var(--s-100);
  color: var(--ink-3);
  display: flex;
  gap: var(--s-100);
  align-items: flex-start;
}
.deadbox--wide { max-width: 460px; width: 100%; }
.deadbox__tag {
  font: var(--caption-5);
  letter-spacing: 0;
  color: var(--friction);
  border: 1px solid var(--friction);
  padding: var(--s-25) var(--s-50);
  border-radius: 6px;
  flex: none;
  margin-top: var(--s-50);
}
.deadbox__txt { text-decoration: line-through; text-decoration-color: var(--line-2); }

/* ============================================================
   FIG.04 — 명사 후 동사
   ============================================================ */
.doc {
  width: 100%;
  max-width: 460px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--ground-2);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.obj {
  position: relative;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  padding: 4px;
  transition: border-color .15s var(--ease);
}
.obj:hover  { border-color: var(--line-2); }
.obj.is-sel { border-color: var(--accent); }

.obj__verbs {
  position: absolute;
  left: -1px;
  bottom: calc(100% + 7px);
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  padding: 5px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(5px) scale(.97);
  transform-origin: 12px 100%;
  pointer-events: none;
  transition: opacity .16s var(--ease), transform .16s var(--ease);
  z-index: 4;
}
.obj.is-sel .obj__verbs { opacity: 1; transform: none; pointer-events: auto; }

.verb {
  font: var(--caption-5);
  letter-spacing: .08em;
  padding: var(--s-50) var(--s-75);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}
.verb:hover { border-color: var(--accent); color: var(--accent); }
.verb.is-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* 높이는 고정, 폭은 원본 비율(320:220)을 따른다.
   높이가 안 변하니 '정사각'을 눌러도 상자가 튀지 않는다. */
.photo {
  height: 240px;
  width: 349px;                   /* 240 × 320 ÷ 220 */
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 6px;
  /* 배경 지우기 시 노출되는 투명 체커 */
  background-color: var(--surface);
  background-image:
    linear-gradient(45deg, var(--surface-2) 25%, transparent 25% 75%, var(--surface-2) 75%),
    linear-gradient(45deg, var(--surface-2) 25%, transparent 25% 75%, var(--surface-2) 75%);
  background-size: 14px 14px;
  background-position: 0 0, 7px 7px;
  transition: width .3s var(--ease), filter .3s var(--ease);
}
.photo svg { width: 100%; height: 100%; }
.photo.is-square { width: 240px; }
.photo.is-bright { filter: brightness(1.24) saturate(1.06); }
.photo.is-gray   { filter: grayscale(1) contrast(1.06); }
.photo.is-bright.is-gray { filter: grayscale(1) brightness(1.24) contrast(1.06); }
.photo.is-nobg .ph-bg { opacity: 0; }
.ph-bg { transition: opacity .3s var(--ease); }

.para {
  font: var(--body-3);
  min-height: 6.4em;              /* "짧게"를 눌러도 높이가 안 줄도록 */
  color: var(--ink-2);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.para.is-quote {
  border-left: 2px solid var(--accent);
  padding-left: var(--s-200);
  color: var(--ink);
}
.para mark {
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.para.is-mark mark { background: var(--accent-wash); color: var(--accent); }

/* 재생 표시 — 샘플 음원임을 숨기지 않는다 */
.nowplaying {
  font: var(--body-6);
  display: flex;
  align-items: center;
  gap: var(--s-100);
  flex-wrap: wrap;
  justify-content: center;
  letter-spacing: .08em;
  color: var(--ink-3);
  min-height: 20px;
}
.nowplaying b { color: var(--accent); font-weight: 600; }
.nowplaying__tag {
  border: 1px solid var(--line-2);
  border-radius: 980px;
  padding: 2px 9px;
  font-size: 12px;
}

/* ============================================================
   FIG.04 — 밀어서 열기
   ============================================================ */
.lockrig { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: var(--s-200); }

/* 휴대폰 잠금화면처럼 세로로 길게. 시계는 위, 손잡이는 바닥에 */
.lockface {
  align-self: center;
  width: 100%;
  max-width: 320px;
  min-height: clamp(380px, 32vw, 430px);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--ground-2);
  padding: 52px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}
.lockface__clock {
  font-size: 48px;
  font-weight: 250;
  letter-spacing: -.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.lockface__date { color: var(--ink-3); margin-top: -14px; }

.lock {
  margin-top: auto;               /* 시계와 떨어져 화면 바닥에 앉는다 */
  position: relative;
  width: 100%;
  height: 56px;
  border: 1px solid var(--line-2);
  border-radius: 30px;
  background: var(--surface-2);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.lock__hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-left: 44px;
  font-size: var(--t-base);
  font-weight: 500;
  letter-spacing: .01em;
  pointer-events: none;
  /* 빛이 왼쪽에서 오른쪽으로 훑는다 — 밀 방향을 알려주는 유일한 단서 */
  background: linear-gradient(100deg,
      var(--ink-3) 30%, var(--ink) 42%, var(--ink-3) 54%) 0 0 / 320% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 2.6s linear infinite;
}
@keyframes sheen { to { background-position: -320% 0; } }

.lock__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  cursor: grab;
  color: var(--ink-2);
  will-change: transform;
}
.lock__knob svg { width: 20px; height: 20px; }
.lock__knob:active { cursor: grabbing; }
.lock.is-open .lock__knob {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.lock.is-open .lock__hint { display: none; }

.lock__fill {
  position: absolute;
  inset: 0;
  background: var(--accent-wash);
  transform-origin: left center;
  transform: scaleX(0);
  pointer-events: none;
}

.lockstate {
  font: var(--body-6);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: var(--s-100) var(--s-200);
  color: var(--ink-2);
  background: var(--surface);
}
.lockstate b { color: var(--accent); }

/* ============================================================
   FIG.05 — 바뀌는 자판
   ============================================================ */
.formrig { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: var(--s-200); }

.fields { display: flex; flex-direction: column; gap: 8px; }

.field {
  display: grid;
  grid-template-columns: 4.6em 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 13px 15px;
  background: var(--ground-2);
  cursor: text;
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.field:hover { border-color: var(--ink-3); }
.field.is-active { border-color: var(--accent); background: var(--accent-wash); }
.field__label {
  font-size: var(--t-sm);
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink-3);
}
.field.is-active .field__label { color: var(--accent); }
.field__value {
  font-size: 18px;
  color: var(--ink);
  min-height: 1.5em;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field__value:empty::before { content: attr(data-ph); color: var(--ink-3); }
.field__caret {
  display: none;
  width: 1px;
  height: 1.1em;
  background: var(--accent);
  vertical-align: -.15em;
  animation: caret 1.05s steps(1) infinite;
}
.field.is-active .field__caret { display: inline-block; }
@keyframes caret { 50% { opacity: 0; } }

/* 휴대폰 자판처럼 세로로 넉넉하게. 줄 수가 달라도 판 높이는 그대로 */
.kbd {
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-height: 268px;
}
.kbd__row { display: flex; gap: 6px; justify-content: center; }

.key {
  flex: 1 1 0;
  min-width: 0;
  height: 46px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: var(--t-sm);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color .1s var(--ease), transform .07s var(--ease), color .1s var(--ease);
}
.key:hover { background: var(--accent-wash); border-color: var(--accent); }
.key:active { transform: translateY(1px); background: var(--accent); color: var(--on-accent); }
.key--wide { flex: 2.4 1 0; }
.key--util { color: var(--ink-2); font-size: 11px; letter-spacing: .04em; }
/* 맥락에 따라 새로 나타나는 키 */
.key--ctx {
  border-color: var(--accent);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: .02em;
}
.key--go { background: var(--accent); border-color: var(--accent); color: var(--on-accent); flex: 1.6 1 0; }

.kbdswap {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--ink-3);
}
.kbdswap b { color: var(--accent); font-weight: 600; }

/* ============================================================
   FIG.03 — 끌어다 놓기
   ============================================================ */
.desk {
  width: 100%;
  max-width: 460px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--ground-2);
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.desk__loose {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 210px;              /* 집어 옮길 여지가 보이도록 */
  align-content: flex-start;
}

.icon {
  width: 78px;
  padding: 9px 4px 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.icon:hover { border-color: var(--line-2); }
.icon.is-lifted {
  cursor: grabbing;
  border-color: var(--accent);
  box-shadow: var(--shadow);
  opacity: .92;
  z-index: 5;
  position: relative;
}
.icon--return { transition: transform .26s var(--ease); }

.icon__glyph { color: var(--accent); line-height: 0; }
.icon__glyph svg { width: 26px; height: 26px; }
.icon__name {
  font-size: 10.5px;
  color: var(--ink-2);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.desk__targets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.drop {
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  padding: 13px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: border-color .14s var(--ease), background-color .14s var(--ease);
}
.drop__glyph { color: var(--ink-3); line-height: 0; transition: color .14s var(--ease); }
.drop__glyph svg { width: 24px; height: 24px; }
.drop__name  { font-size: var(--t-sm); color: var(--ink-2); }
.drop__num   { color: var(--ink-3); }

.drop.is-over {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-wash);
}
.drop.is-over .drop__glyph,
.drop.is-over .drop__name,
.drop.is-over .drop__num { color: var(--accent); }

.drop--bin.is-over {
  border-color: var(--friction);
  background: transparent;
}
.drop--bin.is-over .drop__glyph,
.drop--bin.is-over .drop__name,
.drop--bin.is-over .drop__num { color: var(--friction); }

/* ============================================================
   FIG.08 — 준비된 제안
   ============================================================ */
.ghostwrap {
  width: 100%;
  max-width: 480px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--ground-2);
  overflow: hidden;
}
.ghostwrap__head {
  display: flex;
  justify-content: space-between;
  gap: var(--s-100);
  flex-wrap: wrap;
  padding: var(--s-75) var(--s-100);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-3);
}
.ghostwrap__head b { color: var(--accent); font-weight: 600; }

/* 문서 한 장처럼 세워둔다. 제안을 소비해 글이 짧아져도 상자는 그대로 */
.ghostdoc {
  font: var(--body-3);
  min-height: clamp(280px, 26vw, 340px);
  padding: var(--s-200) var(--s-200) var(--s-200);
  line-height: 2.45;              /* 알약·동그라미가 줄 사이에 끼어들 여유 */
  color: var(--ink);
}

/* 묶음 전체를 nowrap으로 두면 상자 밖으로 밀린다.
   원문은 줄바꿈을 허용하고, 알약+동그라미만 붙여 둔다. */
.ghost { white-space: normal; }

/* 원문은 지워질 후보로 남겨 둔다 */
.ghost__was {
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-color: var(--friction);
  margin-right: var(--s-50);
}

/* 이미 준비된 대안 — 누르면 그대로 확정된다 */
/* 받아들이기(알약)와 버리기(동그라미)를 한 쌍으로 묶는다 */
.ghost__pair {
  display: inline-flex;
  align-items: center;
  gap: var(--s-50);
  vertical-align: middle;
  white-space: nowrap;
}

.ghost__now {
  font: inherit;
  max-width: 100%;
  white-space: normal;
  border: 1px solid var(--accent);
  border-radius: 9999px;
  background: var(--accent-wash);
  color: var(--accent);
  padding: 0 var(--s-100);
  line-height: 1.5;
  cursor: pointer;
  transition: background-color .13s var(--ease), color .13s var(--ease);
}
.ghost__now:hover { background: var(--accent); color: var(--on-accent); }

.ghost__no {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: border-color .13s var(--ease), color .13s var(--ease), background-color .13s var(--ease);
}
.ghost__no svg { width: 10px; height: 10px; }
/* 받아들이기와 같은 방식으로 반응한다 — 호버하면 채워진다. 색만 다르다 */
.ghost__no:hover {
  background: var(--friction);
  border-color: var(--friction);
  color: #FFFFFF;
}

.ghost__kept { color: var(--ink); }

/* ============================================================
   서명
   ============================================================ */
.signature {
  border-top: 1px solid var(--line-faint);   /* 탭 바 하단선과 같은 농도 */
  padding: var(--s-100) 0 var(--s-200);
  color: var(--ink-3);
  text-align: right;
}
/* .mono의 대문자화가 상속을 이기므로 여기서 직접 끈다 */
.signature .mono { text-transform: none; }
/* 평소엔 서명의 일부로 조용히, 가리키면 링크임이 드러난다 */
.signature__link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--line-2);
  transition: color var(--t-color) var(--ease), border-color var(--t-color) var(--ease);
}
.signature__link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ============================================================
   FIG.09 — 확신의 농도
   ============================================================ */
/* 채팅창 안에서 벌어지는 일로 보여준다 — 이 표본이 겨누는 대상이 그것이므로 */
.answer {
  width: 100%;
  max-width: 520px;
  min-height: clamp(260px, 26vw, 330px);
  padding: var(--s-200);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--ground-2);
  display: flex;
  flex-direction: column;
  gap: var(--s-100);
}

.chatline {
  max-width: 90%;
  padding: var(--s-100) var(--s-200);
  border-radius: 16px;
}
.chatline--me {
  font: var(--body-3);
  align-self: flex-end;
  background: var(--accent);
  color: var(--on-accent);
  border-bottom-right-radius: 4px;
}
.chatline--ai {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}

/* 농도 차이는 글자가 클수록 눈에 잘 걸린다 */
.answer__body {
  font: var(--title-1);
  line-height: 2;
  letter-spacing: -.015em;
  overflow-wrap: break-word;
  color: var(--ink);
}

/* 세 단계. 표시를 끄면 전부 확실한 것처럼 보인다 — 그게 지금의 상태다 */
.grade--sure { color: var(--ink); }
.grade--soft { color: var(--ink-2); }
.grade--weak {
  color: var(--ink-3);
  text-decoration: underline dotted var(--friction);
  text-underline-offset: 5px;
}
.grade--soft,
.grade--weak {
  cursor: help;
  border-radius: 2px;
  transition: background-color .14s var(--ease), color .14s var(--ease);
}
.grade--soft:hover,
.grade--weak:hover { background: var(--accent-wash); color: var(--accent); }
.grade.is-open { background: var(--accent-wash); color: var(--accent); }

/* 표시를 끈 상태 — 전부 같은 굵기, 같은 색 */
.answer.is-flat .grade--sure,
.answer.is-flat .grade--soft,
.answer.is-flat .grade--weak {
  color: var(--ink);
  text-decoration: none;
  cursor: default;
  background: transparent;
}

.answer__why {
  font: var(--body-6);
  width: 100%;
  max-width: 520px;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: var(--s-100);
  padding: var(--s-100) var(--s-100);
  border: 1px dashed var(--line-2);
  border-radius: 6px;
  color: var(--ink-3);
}
.answer__why b {
  font: var(--caption-4);
  flex: none;
  align-self: flex-start;
  letter-spacing: 0;
  color: var(--friction);
  border: 1px solid var(--friction);
  border-radius: 2px;
  padding: var(--s-25) var(--s-50);
  margin-top: var(--s-25);
}

/* ============================================================
   좁은 화면 — 손가락으로 쓰는 조건
   ============================================================ */
@media (max-width: 720px) {
  /* 휠은 두 덩이가 위아래로 */
  .wheelrig { flex-direction: column; }
  .screen { width: 100%; max-width: 100%; }

  /* 판 위쪽 사양 줄이 여러 줄로 접히는 걸 허용 */
  .plate__bar { min-height: 0; padding-top: var(--s-75); padding-bottom: var(--s-75); }
}

@media (max-width: 480px) {
  /* 자판은 키가 작아지므로 높이도 함께 줄인다 */
  .kbd { min-height: 0; padding: 9px 7px; gap: 6px; }
  .kbd__row { gap: 4px; }
  .key { height: 40px; font-size: var(--t-xs); }
  .key--ctx { font-size: 10px; }

  /* 파일 아이콘은 한 줄에 세 개 */
  .icon { width: 30%; }
  .desk__loose { min-height: 150px; }

  /* 답변·문서 상자는 세로 여유를 줄인다 */
  .answer { min-height: 0; }
  .ghostdoc { min-height: 0; line-height: 2.2; }

  /* 잠금화면은 화면 폭에 맞춘다 */
  .lockface { min-height: clamp(320px, 78vw, 380px); padding-top: 40px; }

  /* 목록 두 판은 조금 낮게 */
  .scroller__view { height: 300px; }

  /* 서명은 가운데로 — 오른쪽 끝에 붙으면 잘려 보인다 */
  .signature { text-align: center; }
}

/* ---------- 접근성 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
