/* =========================================================================
   DolAmi — Latent Space Edition ✦
   "최대한 AI스럽게": 오로라 그라디언트, 신경망 배경, 글로우, 글래스, 채팅·터미널 UI
   이전 디자인(작업대 노트)은 _backup-workbench/ 에 있습니다.
   구조: 1 토큰 · 2 기본·배경 · 3 헤더/푸터 · 4 공용 부품 · 5 메인
         6 용어집 · 7 디자인 샘플 · 8 작업 방식 · 9 모션(원할 때만)
   ========================================================================= */

@font-face {
  font-family: "Pretendard";
  src: url("PretendardVariable.subset.woff2") format("woff2-variations"),
       url("PretendardVariable.subset.woff2") format("woff2");
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DolAmi Hangul";
  src: url("PretendardVariable.subset.woff2") format("woff2-variations"),
       url("PretendardVariable.subset.woff2") format("woff2");
  font-weight: 45 920;
  font-display: swap;
  unicode-range: U+1100-11FF, U+3130-318F, U+A960-A97F, U+AC00-D7AF, U+D7B0-D7FF;
}

/* 애니메이션 가능한 사용자 정의 속성 */
@property --angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --hero-w { syntax: "<number>"; inherits: true; initial-value: 850; }

/* ---------- 1. 토큰 ----------
   테마 3가지(data-palette) × 밝기 2가지(data-theme / 시스템 설정).
   a = 청회색·세이지, b = 남색·모래(기본), c = 웜그레이·테라코타.
   [data-palette]를 어느 요소에 달아도 그 안은 그 테마 색으로 그려짐(디자인 샘플 비교용). */
:root {
  color-scheme: dark light;

  --font-sans: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --font-mono: "DolAmi Hangul", ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;

  --step--1: clamp(0.82rem, 0.8rem + 0.1vw, 0.88rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.45vw, 1.45rem);
  --step-2:  clamp(1.45rem, 1.25rem + 1vw, 2rem);
  --step-3:  clamp(2rem, 1.4rem + 2.6vw, 3.5rem);
  --step-4:  clamp(2.9rem, 1.4rem + 7vw, 8rem);

  --radius: 22px;
  --radius-sm: 12px;
  --gutter: clamp(1rem, 0.6rem + 2vw, 2.5rem);
  --wide: 76rem;
  --measure: 40rem;
  --header-h: 4rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --neural-alpha: 0.4;
  --aur1: 0.2; --aur2: 0.12; --aur3: 0.16;
}
:root[data-theme="light"] { color-scheme: light; --neural-alpha: 0.32; --aur1: 0.18; --aur2: 0.1; --aur3: 0.14; }
:root[data-theme="dark"]  { color-scheme: dark; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --neural-alpha: 0.32; --aur1: 0.18; --aur2: 0.1; --aur3: 0.14; } }

/* B. 남색 · 모래 (기본) */
:root, [data-palette="b"] {
  --bg:     light-dark(#f3f2ee, #11151f);
  --bg-2:   light-dark(#ffffff, #171d2a);
  --text:   light-dark(#1a2236, #e7e9ef);
  --text-2: light-dark(#454d63, #b1b7c8);
  --text-3: light-dark(#575f75, #9299ac);
  --g1:     light-dark(#2f4468, #9fb0cf);
  --g3:     light-dark(#7a5f31, #cdb88f);
  --accent-text: light-dark(#2f4468, #b9c6de);
  --ok:     light-dark(#2d6a4c, #9fcfb0);
  --rb: light-dark(#dfe3ec, #cfd5e2); --rb2: light-dark(#a8b1c6, #8f99b0); --rs: light-dark(#1f2a44, #1b2335); --ra: light-dark(#e0b968, #e2c995);
}
/* A. 청회색 · 세이지 */
[data-palette="a"] {
  --bg:     light-dark(#f2f3ef, #15191c);
  --bg-2:   light-dark(#ffffff, #1c2125);
  --text:   light-dark(#1f2a28, #e6ebe8);
  --text-2: light-dark(#475653, #afbab6);
  --text-3: light-dark(#56645f, #939f9b);
  --g1:     light-dark(#46685a, #9db5a7);
  --g3:     light-dark(#465d74, #8fa4b8);
  --accent-text: light-dark(#3d5d4f, #b3cbbd);
  --ok:     light-dark(#2f6a4a, #a3cdb0);
  --rb: light-dark(#dfe5e1, #c9d3cf); --rb2: light-dark(#aebbb5, #93a29c); --rs: light-dark(#2b3a3a, #1f2a2c); --ra: light-dark(#8fc0a4, #a8c8b4);
}
/* C. 웜그레이 · 테라코타 */
[data-palette="c"] {
  --bg:     light-dark(#f5f2ed, #1a1817);
  --bg-2:   light-dark(#ffffff, #22201e);
  --text:   light-dark(#2a2420, #ece7e1);
  --text-2: light-dark(#5a514a, #bab2a9);
  --text-3: light-dark(#685e56, #a0978e);
  --g1:     light-dark(#86502f, #cfa286);
  --g3:     light-dark(#53604b, #a6ae9f);
  --accent-text: light-dark(#7d4a2c, #dcb59c);
  --ok:     light-dark(#3a6a4b, #a8cfa6);
  --rb: light-dark(#e6e0d8, #d9d1c8); --rb2: light-dark(#b8ada1, #a0968b); --rs: light-dark(#2f2a27, #2a2624); --ra: light-dark(#e09a6c, #e3a77f);
}
/* 테마 색에서 파생되는 값: 테마가 달린 요소마다 다시 계산되도록 같은 선택자에 둠 */
:root, [data-palette] {
  --surface:   light-dark(rgb(255 255 255 / 0.66), rgb(255 255 255 / 0.04));
  --surface-2: light-dark(rgb(255 255 255 / 0.9), rgb(255 255 255 / 0.07));
  --border:    color-mix(in oklab, var(--text) 13%, transparent);
  --border-2:  color-mix(in oklab, var(--text) 24%, transparent);
  --g2: color-mix(in oklab, var(--g1) 55%, var(--g3));
  --on-grad: light-dark(#ffffff, var(--bg));
  --grad: linear-gradient(115deg, var(--g1), var(--g3));
  --grad-ui: linear-gradient(115deg, var(--g1), color-mix(in oklab, var(--g1) 70%, var(--g3)));
  --grad-soft: linear-gradient(115deg, color-mix(in oklab, var(--g1) 14%, transparent), color-mix(in oklab, var(--g3) 12%, transparent));
  --glow: 0 0 0 1px color-mix(in oklab, var(--g1) 30%, transparent), 0 12px 32px -14px color-mix(in oklab, var(--g1) 45%, transparent);
  --glow-sm: 0 0 0 1px color-mix(in oklab, var(--g1) 25%, transparent), 0 6px 16px -8px color-mix(in oklab, var(--g1) 45%, transparent);
  --shadow: 0 22px 50px -28px light-dark(rgb(30 30 40 / 0.28), rgb(0 0 0 / 0.7));
}

/* ---------- 2. 기본 · 배경 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  background: var(--bg);
}
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column;
  background: transparent; color: var(--text);
  font-family: var(--font-sans); font-size: var(--step-0); font-weight: 420; line-height: 1.72;
  word-break: keep-all; overflow-wrap: break-word; font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; position: relative; z-index: 1; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0; font-weight: 780; letter-spacing: -0.03em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 0.22em; text-decoration-color: color-mix(in oklab, currentColor 50%, transparent); }
a:hover { color: var(--text); text-decoration-color: var(--g2); }
:focus-visible { outline: 2px solid var(--g3); outline-offset: 3px; border-radius: 6px; box-shadow: 0 0 0 6px color-mix(in oklab, var(--g3) 25%, transparent); }
::selection { background: color-mix(in oklab, var(--g2) 45%, transparent); color: var(--text); }
button, input { font: inherit; color: inherit; }
code, kbd, .mono { font-family: var(--font-mono); font-size: 0.86em; letter-spacing: 0; }
kbd { border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 6px; padding: 0.05em 0.4em; font-size: 0.75em; color: var(--text-2); }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--gutter); top: -4rem; z-index: 200; background: var(--grad); color: var(--on-grad); padding: 0.6rem 1rem; border-radius: 999px; text-decoration: none; font-weight: 650; }
.skip-link:focus { top: 0.75rem; color: var(--on-grad); }
.wrap { width: min(100% - 2 * var(--gutter), var(--wide)); margin-inline: auto; }

/* 그라디언트 글자 (지원 안 하면 단색) */
.grad-text { color: var(--accent-text); }
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .grad-text {
    background: var(--grad); background-size: 200% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
}

/* 배경: 오로라 + 신경망 캔버스 + 점 격자. 화면에 고정, 클릭 통과 */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora span {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: var(--aur1);
  width: 46vmax; height: 46vmax;
}
.aurora span:nth-child(1) { background: var(--g1); top: -18vmax; left: -10vmax; }
.aurora span:nth-child(2) { background: var(--g2); top: 20vh; right: -18vmax; width: 38vmax; height: 38vmax; opacity: var(--aur2); }
.aurora span:nth-child(3) { background: var(--g3); bottom: -22vmax; left: 25vw; width: 40vmax; height: 40vmax; opacity: var(--aur3); }
.neural { position: absolute; inset: 0; width: 100%; height: 100%; opacity: var(--neural-alpha); }
.grid-dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(color-mix(in oklab, var(--text) 16%, transparent) 1px, transparent 1.4px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
}

/* ---------- 3. 헤더 / 푸터 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in oklab, var(--bg) 62%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 0.75rem; }
.wordmark { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 820; font-size: 1.22rem; letter-spacing: -0.03em; text-decoration: none; view-transition-name: wordmark; }
.badge-ai { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; padding: 0.15rem 0.4rem; border-radius: 6px; background: var(--grad); color: var(--on-grad); }
.orb {
  width: 1.35rem; height: 1.35rem; border-radius: 50%; flex: none;
  background: conic-gradient(from var(--angle), var(--g1), var(--g2), var(--g3), var(--g1));
  box-shadow: var(--glow-sm);
}
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--grad); transform-origin: 0 50%; transform: scaleX(0); }

.nav-toggle {
  margin-left: auto; display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 999px;
  padding: 0.4rem 0.9rem; font-size: var(--step--1); font-weight: 650;
}
.nav-toggle svg { width: 1rem; height: 1rem; }
.site-nav {
  margin: 0; inset: calc(var(--header-h) + 0.25rem) var(--gutter) auto auto;
  width: min(18rem, calc(100vw - 2 * var(--gutter))); padding: 0.5rem;
  border: 1px solid var(--border-2); border-radius: 18px; color: var(--text);
  background: color-mix(in oklab, var(--bg-2) 88%, transparent);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: var(--glow);
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.site-nav a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.6rem 0.85rem; border-radius: 12px; text-decoration: none; font-weight: 600; color: var(--text);
}
.site-nav a .mono { color: var(--text-3); font-size: 0.72rem; }
.site-nav a:hover { background: var(--surface-2); }
.site-nav a[aria-current="page"] { background: var(--grad); color: var(--on-grad); box-shadow: var(--glow-sm); }
.site-nav a[aria-current="page"] .mono { color: inherit; opacity: 0.8; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; flex: none; cursor: pointer;
  border-radius: 50%; border: 1px solid var(--border-2); background: var(--surface);
}
.theme-toggle:hover { box-shadow: var(--glow-sm); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; display: none; }
.theme-toggle:not([data-mode]) .i-system, .theme-toggle[data-mode="system"] .i-system,
.theme-toggle[data-mode="light"] .i-light, .theme-toggle[data-mode="dark"] .i-dark { display: block; }

@media (min-width: 60rem) {
  .nav-toggle { display: none; }
  .site-nav, .site-nav:not(:popover-open) {
    display: block; position: static; inset: auto; width: auto; margin: 0 0 0 auto;
    padding: 0.25rem; border-radius: 999px; box-shadow: none; overflow: visible;
    background: var(--surface); border: 1px solid var(--border);
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .site-nav ul { display: flex; gap: 0.1rem; }
  .site-nav a { padding: 0.35rem 0.85rem; border-radius: 999px; font-size: 0.92rem; }
  .site-nav a .mono { display: none; }
}

/* 주 메뉴 두 묶음(AI 용어 관련 / 디자인 관련) + 하위 메뉴.
   작은 화면(팝오버 메뉴): 묶음 이름 아래에 하위 메뉴를 펼쳐 둔다. 큰 화면: 묶음에 올리거나 누르면 아래로 펼친다. */
.site-nav .nav-groups { display: grid; gap: 0.35rem; }
.nav-top {
  display: flex; align-items: center; gap: 0.35rem; width: 100%;
  padding: 0.45rem 0.85rem 0.25rem; border: 0; background: none; color: var(--text-3);
  font: inherit; font-size: 0.75rem; font-weight: 750; letter-spacing: 0.04em; cursor: default;
}
.nav-top .chev { display: none; width: 0.7rem; height: 0.7rem; transition: transform 0.2s; }
.site-nav .nav-sub { display: grid; gap: 0.1rem; }
.nav-single { padding-top: 0.35rem; border-top: 1px solid var(--border); }   /* 작은 화면: 묶음과 구분 */
@media (min-width: 60rem) { .nav-single { padding-top: 0; border-top: 0; } }

@media (min-width: 60rem) {
  .site-nav .nav-groups { display: flex; gap: 0.15rem; }
  .nav-group { position: relative; }
  .nav-top {
    width: auto; padding: 0.35rem 0.85rem; border-radius: 999px; cursor: pointer;
    color: var(--text); font-size: 0.92rem; font-weight: 600; letter-spacing: 0;
  }
  .nav-top .chev { display: block; }
  .nav-top:hover, .nav-top[aria-expanded="true"] { background: var(--surface-2); }
  .nav-group.is-current > .nav-top { background: var(--grad); color: var(--on-grad); box-shadow: var(--glow-sm); }
  .site-nav .nav-sub {
    position: absolute; top: calc(100% + 0.55rem); right: 0; z-index: 60; min-width: 13rem;
    display: none; gap: 0.1rem; padding: 0.4rem; border-radius: 16px;
    background: color-mix(in oklab, var(--bg-2) 94%, transparent); border: 1px solid var(--border-2);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: var(--glow);
  }
  .nav-sub::before { content: ""; position: absolute; left: 0; right: 0; top: -0.6rem; height: 0.6rem; }   /* 마우스가 틈에서 떨어지지 않게 */
  .site-nav .nav-sub a { padding: 0.55rem 0.8rem; border-radius: 11px; font-size: 0.9rem; white-space: nowrap; }
  .nav-group:hover > .nav-sub, .nav-top[aria-expanded="true"] + .nav-sub { display: grid; }
  .nav-group:hover > .nav-top .chev, .nav-top[aria-expanded="true"] .chev { transform: rotate(180deg); }
}

.site-footer { position: relative; z-index: 1; margin-top: clamp(4rem, 8vw, 8rem); border-top: 1px solid var(--border); font-size: var(--step--1); color: var(--text-2); background: color-mix(in oklab, var(--bg) 70%, transparent); }
.site-footer .wrap { display: grid; gap: 1.5rem; padding-block: 2.5rem 3rem; }
.site-footer .big { font-size: clamp(3.5rem, 1.5rem + 11vw, 12rem); font-weight: 880; letter-spacing: -0.06em; line-height: 0.9; }
.footer-row { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; justify-content: space-between; }
.footer-row ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.footer-row a { color: var(--text-2); }
.token-stream { overflow: hidden; border-bottom: 1px solid var(--border); padding-block: 0.8rem; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.token-stream > div { display: flex; gap: 0.6rem; width: max-content; }
.token-stream span { font-family: var(--font-mono); font-size: 0.78rem; padding: 0.25rem 0.65rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); white-space: nowrap; }
.token-stream span:nth-child(5n+1) { color: var(--accent-text); border-color: var(--border-2); }

/* ---------- 4. 공용 부품 ---------- */
.glass {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: var(--shadow);
}
/* 회전하는 무지개 테두리 */
.glow-border {
  border: 1px solid transparent;
  background:
    linear-gradient(color-mix(in oklab, var(--bg-2) 82%, transparent), color-mix(in oklab, var(--bg-2) 82%, transparent)) padding-box,
    conic-gradient(from var(--angle), var(--g1), var(--g2), var(--g3), var(--g1)) border-box;
}
/* 마우스를 따라오는 빛 (site.js가 --mx/--my를 넣음) */
.spot { position: relative; isolation: isolate; overflow: hidden; }
.spot::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), color-mix(in oklab, var(--g2) 22%, transparent), transparent 60%);
}
.spot:hover::before, .spot:focus-within::before { opacity: 1; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.45rem; justify-self: start; align-self: start;
  font-family: var(--font-mono); font-size: 0.76rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 0.3rem 0.75rem; border-radius: 999px; color: var(--accent-text);
  border: 1px solid var(--border-2); background: var(--grad-soft);
}
.eyebrow::before { content: "✦"; color: var(--g2); }

.section { padding-block: clamp(3.5rem, 7vw, 7rem) 0; position: relative; }
.section-head { display: grid; gap: 0.9rem; margin-bottom: clamp(1.75rem, 3vw, 3rem); }
@media (min-width: 52rem) {
  .section-head { grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); align-items: end; column-gap: 3rem; }
  .section-head .eyebrow { grid-column: 1 / -1; }
}
.section-head h2 { font-size: var(--step-3); font-weight: 820; letter-spacing: -0.045em; }
.section-head p { color: var(--text-2); }

.mark { color: var(--text); background: linear-gradient(transparent 62%, color-mix(in oklab, var(--g2) 40%, transparent) 62%); padding-inline: 0.1em; }

.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.35rem; border-radius: 999px; border: 0; cursor: pointer; line-height: 1.2;
  font-weight: 700; text-decoration: none; color: var(--on-grad);
  background: var(--grad); background-size: 160% 100%; box-shadow: var(--glow);
  transition: transform 0.2s var(--ease-out), background-position 0.4s, box-shadow 0.2s;
}
.btn::after { /* 반짝이는 빛줄기 */
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / 0.45) 50%, transparent 70%);
}
.btn:hover { color: var(--on-grad); transform: translateY(-2px); background-position: 100% 0; }
.btn:hover::after { transform: translateX(120%); transition: transform 0.8s var(--ease-out); }
.btn.ghost { color: var(--text); background: var(--surface); border: 1px solid var(--border-2); box-shadow: none; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.btn.ghost::after { display: none; }
.btn.ghost:hover { color: var(--text); box-shadow: var(--glow-sm); }
.btn .arrow { transition: transform 0.2s var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }

.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tags li { font-family: var(--font-mono); font-size: 0.72rem; line-height: 1; padding: 0.4rem 0.6rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.tags .tag-ai { color: var(--accent-text); border-color: var(--border-2); background: var(--grad-soft); }
.tags .tag-ai::before { content: "✦ "; color: var(--g2); }

/* 상태 표시: 깜빡이는 점 + 알약 */
.stamp {
  display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap;
  font-size: 0.75rem; font-weight: 700; padding: 0.3rem 0.7rem; border-radius: 999px;
  color: var(--ok); background: color-mix(in oklab, var(--ok) 12%, transparent); border: 1px solid color-mix(in oklab, var(--ok) 35%, transparent);
}
.stamp::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.stamp[data-status="실험"] { color: var(--accent-text); background: var(--grad-soft); border-color: var(--border-2); }
.stamp[data-status="보관"] { color: var(--text-3); background: var(--surface); border-color: var(--border); }
.stamp[data-status="보관"]::before { box-shadow: none; }

/* 채팅 */
.chat { display: grid; gap: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 0.6rem; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.chat-head b { font-weight: 750; }
.chat-head .model { margin-left: auto; font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-3); }
.chat-head .live { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.chat-body { display: grid; gap: 0.9rem; padding: 1.1rem; }
.msg { max-width: 88%; padding: 0.75rem 1rem; border-radius: 18px; font-size: 0.95rem; line-height: 1.65; }
.msg.user { justify-self: end; background: var(--grad); color: var(--on-grad); border-bottom-right-radius: 6px; box-shadow: var(--glow-sm); }
.msg.ai { justify-self: start; display: grid; grid-template-columns: auto 1fr; gap: 0.7rem; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 6px; max-width: 94%; }
.msg.ai .orb { width: 1.6rem; height: 1.6rem; margin-top: 0.1rem; }
.msg.ai p + p { margin-top: 0.5rem; }
.caret { display: inline-block; width: 0.55em; height: 1.05em; vertical-align: -0.15em; margin-left: 2px; background: var(--g2); border-radius: 2px; }
.typing { display: inline-flex; gap: 0.25rem; align-items: center; height: 1.4em; }
.typing i { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--text-3); }
.ask { display: flex; align-items: center; gap: 0.5rem; margin: 0 1.1rem 1.1rem; padding: 0.35rem 0.35rem 0.35rem 1rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-2); }
.ask:focus-within { box-shadow: var(--glow); border-color: transparent; }
.ask input { flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: 0.5rem 0; }
.ask input::placeholder { color: var(--text-3); }
.ask button { flex: none; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: var(--grad); color: var(--on-grad); box-shadow: var(--glow-sm); }
.ask button svg { width: 1.05rem; height: 1.05rem; }

/* 터미널 */
.terminal { overflow: hidden; font-family: var(--font-mono); font-size: 0.82rem; background: color-mix(in oklab, var(--rs) 95%, transparent); color: #ecebe8; border: 1px solid var(--border-2); border-radius: 16px; box-shadow: var(--shadow); }
.terminal .bar { display: flex; align-items: center; gap: 0.4rem; padding: 0.65rem 0.9rem; border-bottom: 1px solid rgb(255 255 255 / 0.1); color: #b4b2ad; font-size: 0.72rem; }
.terminal .bar i { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: #ff5f57; }
.terminal .bar i:nth-child(2) { background: #febc2e; }
.terminal .bar i:nth-child(3) { background: #28c840; margin-right: 0.5rem; }
.terminal .screen { padding: 0.9rem 1rem 1.1rem; display: grid; gap: 0.15rem; }
.terminal .cmd { color: #f4f3f0; }
.terminal .cmd::before { content: "❯ "; color: var(--ra); }
.terminal .out { color: #bfbcb6; }
.terminal .ok { color: #a6d4b5; }
.terminal .hl { color: var(--ra); }
.terminal .log { list-style: none; margin: 0.25rem 0 0.5rem; padding: 0; display: grid; gap: 0.15rem; }
.terminal .log li { display: grid; grid-template-columns: 6.2rem 1fr; gap: 0.6rem; }
.terminal time { color: #b4b2ad; }
.terminal .now { color: #a6d4b5; font-weight: 700; }

/* 하위 페이지 머리 */
.page-head { padding-block: clamp(2.5rem, 6vw, 5.5rem) clamp(1.5rem, 3vw, 2.5rem); position: relative; display: grid; gap: 1.2rem; justify-items: start; }
.page-head h1 { font-size: var(--step-4); font-weight: 860; letter-spacing: -0.06em; line-height: 0.98; }
.page-head .lede { max-width: var(--measure); color: var(--text-2); font-size: var(--step-1); line-height: 1.6; }

/* ---------- 5. 메인 ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 5.5rem) 1rem; display: grid; gap: clamp(2rem, 4vw, 3.5rem); }
@media (min-width: 62rem) { .hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; } }
.hero-copy { display: grid; gap: 1.5rem; justify-items: start; }
.hero-word {
  font-size: clamp(4rem, 1rem + 11vw, 10.5rem); font-weight: 880; letter-spacing: -0.07em; line-height: 0.88;
  font-variation-settings: "wght" var(--hero-w, 850); margin-left: -0.04em;
  filter: drop-shadow(0 0 40px color-mix(in oklab, var(--g1) 18%, transparent));
}
.hero-sub { font-size: var(--step-2); font-weight: 380; line-height: 1.4; letter-spacing: -0.02em; max-width: 22ch; }
.hero-sub strong { font-weight: 780; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.stats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; }
.stats li { display: grid; }
.stats b { font-size: var(--step-2); font-weight: 820; letter-spacing: -0.04em; line-height: 1.1; }
.stats span { font-size: 0.78rem; color: var(--text-3); font-family: var(--font-mono); }
.hero-side { display: grid; gap: 1rem; }

/* 만든 것들: 빛나는 유리 카드 그리드 */
.works { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); }
.work {
  --tint: oklch(70% 0.17 var(--hue, 290));
  position: relative; display: grid; grid-template-rows: auto 1fr auto; gap: 0.9rem;
  padding: 1.5rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: var(--shadow); transition: transform 0.3s var(--ease-out), box-shadow 0.3s, border-color 0.3s;
  isolation: isolate; overflow: hidden;
}
.work::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%), color-mix(in oklab, var(--tint) 26%, transparent), transparent 60%);
}
.work::after { /* 카드 위쪽 색 띠 */
  content: ""; position: absolute; left: 1.5rem; right: 1.5rem; top: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--tint), transparent);
}
.work:hover, .work:focus-within { transform: translateY(-4px); border-color: color-mix(in oklab, var(--tint) 55%, transparent); box-shadow: 0 18px 50px -18px color-mix(in oklab, var(--tint) 65%, transparent); }
.work:hover::before, .work:focus-within::before { opacity: 1; }
.work:first-child { grid-column: 1 / -1; }
@media (min-width: 52rem) { .work:first-child { grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; } .work:first-child .work-main { grid-row: 1 / 3; } }
.work-no {
  position: absolute; right: 1.1rem; top: 0.4rem; font-size: 4.5rem; font-weight: 880; letter-spacing: -0.06em; line-height: 1;
  color: transparent; -webkit-text-stroke: 1px color-mix(in oklab, var(--tint) 60%, transparent); opacity: 0.8; z-index: -1;
}
.work-main { display: grid; gap: 0.7rem; align-content: start; min-width: 0; }
.work-title { font-size: var(--step-1); font-weight: 780; letter-spacing: -0.03em; padding-right: 3.5rem; }
.work-title a { color: var(--text); text-decoration: none; }
.work-title a::after { content: ""; position: absolute; inset: 0; } /* 카드 전체가 링크 */
.work-title a:hover { color: var(--text); }
.work-title a:focus-visible { outline: none; box-shadow: none; }
.work:has(.work-title a:focus-visible) { outline: 2px solid var(--g3); outline-offset: 3px; }
.work-prompt { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-2); padding: 0.55rem 0.75rem; border-radius: 10px; background: light-dark(rgb(22 15 51 / 0.05), rgb(0 0 0 / 0.28)); border: 1px solid var(--border); }
.work-prompt .mono { color: var(--g2); font-weight: 700; }
.work-summary { color: var(--text-2); font-size: 0.95rem; }
.work .tags { position: relative; z-index: 1; }
.work-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; font-size: 0.78rem; color: var(--text-3); }

/* 시스템 바로가기: 카드 전체가 링크, 같은 유리 카드 언어 */
.systems { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr)); }
.sys {
  --tint: oklch(70% 0.15 var(--hue, 290));
  position: relative; display: grid; grid-template-rows: auto auto auto 1fr auto auto; gap: 0.75rem;
  padding: 1.4rem 1.4rem 1.2rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: var(--shadow); transition: transform 0.3s var(--ease-out), box-shadow 0.3s, border-color 0.3s;
  isolation: isolate; overflow: hidden;
}
.sys::after { content: ""; position: absolute; left: 1.4rem; right: 1.4rem; top: 0; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--tint), transparent); }
.sys:hover, .sys:focus-within { transform: translateY(-4px); border-color: color-mix(in oklab, var(--tint) 55%, transparent); box-shadow: 0 18px 50px -18px color-mix(in oklab, var(--tint) 65%, transparent); }
.sys-code {
  justify-self: start; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; padding: 0.2rem 0.6rem; border-radius: 999px;
  color: color-mix(in oklab, var(--tint) 70%, var(--text)); background: color-mix(in oklab, var(--tint) 14%, transparent);
  border: 1px solid color-mix(in oklab, var(--tint) 35%, transparent);
}
.sys-name { font-size: var(--step-1); font-weight: 780; letter-spacing: -0.03em; }
.sys-name a { color: var(--text); text-decoration: none; }
.sys-name a::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* 카드 전체가 링크 */
.sys-name a:focus-visible { outline: none; box-shadow: none; }
.sys:has(.sys-name a:focus-visible) { outline: 2px solid var(--g3); outline-offset: 3px; }
.sys-summary { color: var(--text-2); font-size: 0.93rem; }
.sys-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; align-content: start; font-size: 0.86rem; color: var(--text-2); }
.sys-feats li { display: flex; gap: 0.5rem; }
.sys-feats li::before { content: "✓"; color: var(--tint); font-weight: 800; }
.sys-meta { margin: 0; display: grid; gap: 0.25rem; font-size: 0.78rem; color: var(--text-3); padding-top: 0.75rem; border-top: 1px solid var(--border); }
.sys-meta div { display: flex; gap: 0.6rem; }
.sys-meta dt { flex: none; width: 2.2rem; font-weight: 700; }
.sys-meta dd { margin: 0; min-width: 0; }
.sys-go { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; font-size: 0.85rem; }
.sys-go .mono { color: var(--text-3); font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sys-go span:last-child { flex: none; font-weight: 750; color: var(--accent-text); transition: transform 0.25s var(--ease-out); }
.sys:hover .sys-go span:last-child { transform: translateX(3px); }

/* 용어집 입구 */
.doors { display: grid; gap: 1rem; }
@media (min-width: 46rem) { .doors { grid-template-columns: 1fr 1fr; } }
.door {
  display: grid; gap: 1rem; align-content: space-between; min-height: 16rem; padding: clamp(1.4rem, 3vw, 2.2rem);
  border-radius: var(--radius); text-decoration: none; color: var(--text);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s;
}
.door:hover { color: var(--text); transform: translateY(-4px); box-shadow: var(--glow); }
.door h3 { font-size: var(--step-3); font-weight: 840; letter-spacing: -0.05em; }
.door p { color: var(--text-2); max-width: 32ch; }
.door .sample { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-3); }
.door .go { justify-self: start; font-weight: 750; color: var(--accent-text); }

/* ---------- 6. 용어집 ---------- */
.glossary-tools {
  position: sticky; top: var(--header-h); z-index: 20; padding-block: 0.9rem;
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.tools-inner { display: grid; gap: 0.75rem; }
.search {
  display: flex; align-items: center; gap: 0.6rem; max-width: 36rem;
  padding: 0 0.6rem 0 1rem; border-radius: 16px;
  background: var(--surface-2); border: 1px solid var(--border-2);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.search:focus-within { box-shadow: var(--glow); border-color: transparent; }
.search svg { width: 1.05rem; height: 1.05rem; flex: none; color: var(--accent-text); }
.search input { border: 0; background: none; padding: 0.8rem 0; width: 100%; outline: none; min-width: 0; }
.search input::placeholder { color: var(--text-3); }
.search kbd { flex: none; }
.chips {
  display: flex; gap: 0.4rem; overflow-x: auto; scrollbar-width: none; padding: 6px 2.5rem 6px 6px; margin: -6px;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 3rem), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 3rem), transparent);
}
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 48rem) { .chips { flex-wrap: wrap; overflow: visible; padding-right: 6px; -webkit-mask-image: none; mask-image: none; } }
.chip { flex: none; padding: 0.38rem 0.85rem; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; font-size: 0.86rem; font-weight: 600; transition: box-shadow 0.2s; }
.chip:hover { box-shadow: var(--glow-sm); }
.chip .mono { color: var(--text-3); font-size: 0.72rem; margin-left: 0.15rem; }
.chip[aria-pressed="true"] { background: var(--grad); color: var(--on-grad); border-color: transparent; box-shadow: var(--glow-sm); }
.chip[aria-pressed="true"] .mono { color: inherit; opacity: 0.85; }
.result-note { font-size: 0.85rem; color: var(--text-2); min-height: 1.4em; font-family: var(--font-mono); }

.terms { margin: 1.5rem 0 0; display: grid; gap: 1rem; }
@media (min-width: 64rem) { .terms { grid-template-columns: 1fr 1fr; } }
.term {
  position: relative; display: grid; gap: 0.6rem; align-content: start; padding: 1.4rem 1.5rem;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: border-color 0.25s, box-shadow 0.25s;
  scroll-margin-top: calc(var(--header-h) + var(--tools-h, 11rem) + 0.75rem);
}
.term:hover { border-color: var(--border-2); box-shadow: var(--glow-sm); }
.term[hidden] { display: none; }
@media (max-width: 40rem), (max-height: 34rem) {
  .glossary-tools { position: static; }
  .term { scroll-margin-top: calc(var(--header-h) + 0.75rem); }
}
.term dt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; }
.term dfn { font-style: normal; font-size: var(--step-2); font-weight: 800; letter-spacing: -0.04em; line-height: 1.2; }
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .term dfn { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
}
.term-en { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-3); }
.term-anchor { font-family: var(--font-mono); color: var(--text-3); text-decoration: none; opacity: 0; transition: opacity 0.15s; }
.term:hover .term-anchor, .term-anchor:focus-visible { opacity: 1; }
.term dd { margin: 0; display: grid; gap: 0.6rem; }
.term-cat { justify-self: start; font-size: 0.7rem; color: var(--accent-text); background: var(--grad-soft); border: 1px solid var(--border-2); padding: 0.15rem 0.55rem; border-radius: 999px; }
.term dd > p:not(.term-tip) { color: var(--text-2); }
.term-tip { font-size: 0.9rem; color: var(--text-2); padding: 0.6rem 0.8rem; border-radius: 12px; background: var(--grad-soft); border: 1px solid var(--border); }
.term-tip .mono { color: var(--g2); font-weight: 700; margin-right: 0.3rem; }
.term-tip .mono::before { content: "✦ "; }
.xref { color: var(--accent-text); text-decoration-style: dotted; }
.xref-out::after { content: "↗"; font-size: 0.75em; margin-left: 0.1em; }
.term:target { border-color: transparent; box-shadow: var(--glow); }
::highlight(term-hit) { background-color: color-mix(in oklab, var(--g2) 45%, transparent); color: var(--text); }
.empty { padding-block: 3rem; color: var(--text-2); display: grid; gap: 1rem; justify-items: start; }
.empty[hidden] { display: none; }
.glossary-foot { padding-block: 2rem; color: var(--text-3); font-size: 0.9rem; }

/* ---------- 7. 디자인 샘플 ---------- */
.swatches { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 1rem; }
.swatch { display: grid; gap: 0.45rem; font-size: 0.85rem; }
.swatch .chip-color { height: 6rem; border-radius: 16px; border: 1px solid var(--border); background: var(--c); box-shadow: 0 10px 30px -12px var(--c); }
.swatch b { font-weight: 700; }
.swatch code { color: var(--text-3); font-size: 0.72rem; }
.grad-bar { height: 5rem; border-radius: 18px; background: var(--grad); box-shadow: var(--glow); margin-bottom: 1.25rem; }

.type-lab { display: grid; gap: 1.5rem; padding: clamp(1.25rem, 3vw, 2rem); }
.type-sample { font-size: clamp(2.6rem, 1rem + 7vw, 6.5rem); line-height: 1.05; letter-spacing: -0.05em; font-variation-settings: "wght" var(--w, 500); font-weight: var(--w, 500); overflow-wrap: anywhere; }
.range { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.range input { accent-color: var(--g2); width: min(100%, 22rem); }
.range output { font-family: var(--font-mono); min-width: 3ch; }

.parts { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.part { padding: 1.4rem; display: grid; gap: 1rem; align-content: start; }
.part h3 { font-family: var(--font-mono); font-size: 0.76rem; font-weight: 600; color: var(--text-3); letter-spacing: 0.02em; }
.part .row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.glow-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.glow-levels span { aspect-ratio: 1; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-2); }
.glow-levels span:nth-child(2) { box-shadow: var(--glow-sm); }
.glow-levels span:nth-child(3) { box-shadow: var(--glow); }
.ring-demo { width: 100%; aspect-ratio: 16 / 7; border-radius: 18px; display: grid; place-items: center; font-weight: 750; }
.big-orb { width: 5rem; height: 5rem; }

.motion-demo { display: grid; gap: 1rem; }
.motion-track { height: 6rem; border-radius: 18px; display: flex; align-items: center; padding-inline: 1rem; overflow: hidden; }
.motion-ball { width: 3rem; height: 3rem; border-radius: 50%; background: var(--grad); box-shadow: var(--glow); }
.motion-note { font-size: 0.88rem; color: var(--text-2); }

/* ---------- 8. 작업 방식 ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; counter-reset: s; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.steps li { counter-increment: s; padding: 1.4rem; display: grid; gap: 0.5rem; align-content: start; }
.steps li::before { content: counter(s, decimal-leading-zero); font-size: 2.6rem; font-weight: 880; letter-spacing: -0.05em; line-height: 1; color: transparent; -webkit-text-stroke: 1px var(--g1); }
.steps h3 { font-size: var(--step-1); }
.steps p { color: var(--text-2); font-size: 0.94rem; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.checks li { display: grid; grid-template-columns: auto 1fr; gap: 0.8rem; padding: 1rem 1.1rem; }
.checks li::before { content: "✓"; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--grad); color: var(--on-grad); font-weight: 900; font-size: 0.85rem; box-shadow: var(--glow-sm); }
.checks small { display: block; color: var(--text-2); font-size: 0.86rem; margin-top: 0.15rem; }
.recipe { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.recipe th, .recipe td { text-align: left; vertical-align: top; padding: 0.95rem 1rem; border-top: 1px solid var(--border); }
.recipe thead th { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-3); font-weight: 600; border-top: 0; }
.recipe tbody th { font-weight: 720; width: 32%; }
.table-wrap { overflow-x: auto; padding: 0.5rem; }
.tools { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); margin: 0; }
.tools div { padding: 1.1rem 1.2rem; }
.tools dt { font-weight: 750; }
.tools dd { margin: 0.25rem 0 0; color: var(--text-2); font-size: 0.9rem; }
.callout { padding: 1.25rem 1.4rem; display: grid; gap: 0.5rem; }
.callout p { color: var(--text-2); }

/* ---------- 9. 모션 — 사용자가 원할 때만 ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.35s; }
  /* 밝기·테마 전환: 기본 페이드 대신 site.js가 원형으로 펼침. 로고도 함께 펼쳐지게 이름을 잠시 뗌 */
  .theme-vt::view-transition-old(root), .theme-vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
  .theme-vt .wordmark { view-transition-name: none; }
  /* 펼쳐지는 동안에도 버튼·링크를 바로 누를 수 있게 */
  .theme-vt::view-transition { pointer-events: none; }

  .orb, .glow-border { animation: spin 6s linear infinite; }
  @keyframes spin { to { --angle: 360deg; } }

  .aurora span { animation: drift 22s ease-in-out infinite alternate; }
  .aurora span:nth-child(2) { animation-duration: 28s; animation-direction: alternate-reverse; }
  .aurora span:nth-child(3) { animation-duration: 34s; }
  @keyframes drift { 50% { transform: translate(8vw, 6vh) scale(1.15); } to { transform: translate(-6vw, 10vh) scale(0.9); } }

  .grad-text { animation: shimmer 8s ease-in-out infinite alternate; }
  @keyframes shimmer { to { background-position: 100% 0; } }

  .token-stream > div { animation: stream 60s linear infinite; }
  .token-stream:hover > div { animation-play-state: paused; }
  @keyframes stream { to { transform: translateX(-50%); } }

  .caret { animation: blink 1s steps(2, start) infinite; }
  @keyframes blink { to { visibility: hidden; } }
  .typing i { animation: bounce 1.2s ease-in-out infinite; }
  .typing i:nth-child(2) { animation-delay: 0.15s; }
  .typing i:nth-child(3) { animation-delay: 0.3s; }
  @keyframes bounce { 30% { transform: translateY(-4px); background: var(--g2); } 60% { transform: none; } }

  .stamp::before { animation: pulse 2s ease-in-out infinite; }
  .stamp[data-status="보관"]::before { animation: none; }
  @keyframes pulse { 50% { opacity: 0.35; } }

  @supports (animation-timeline: scroll()) {
    .progress { animation: grow linear both; animation-timeline: scroll(root); }
    @keyframes grow { to { transform: scaleX(1); } }
    .hero-word { animation: thin linear both, shimmer 8s ease-in-out infinite alternate; animation-timeline: scroll(root), auto; animation-range: 0 60vh, normal; }
    @keyframes thin { to { --hero-w: 300; } }
    .motion-ball { animation: roll linear both; animation-timeline: view(); animation-range: cover 15% cover 85%; }
    @keyframes roll { to { transform: translateX(calc(min(60vw, 40rem) - 4rem)) rotate(1turn); border-radius: 22%; } }
    .work, .term, .door, .steps li { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
    @keyframes rise { from { opacity: 0; transform: translateY(24px) scale(0.98); filter: blur(6px); } }
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .neural { display: none; }
}
@media (forced-colors: active) {
  .grad-text, .term dfn { color: CanvasText; background: none; }
  .backdrop { display: none; }
  .btn, .chip, .stamp, .search, .glass, .work, .term { border: 1px solid CanvasText; }
}
@media print {
  .backdrop, .site-header, .glossary-tools, .token-stream { display: none !important; }
}
@media (min-width: 52rem) { .work:first-child .work-meta { grid-column: 2; grid-row: 2; align-self: end; justify-content: flex-end; } }

/* ---------- 10. 디자이너 검토 반영 ---------- */
/* 작품 그리드: 넓은 화면은 3열, 마지막 카드가 혼자 남으면 한 줄을 다 씀 */
@media (min-width: 64rem) {
  .works { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .work:last-child:nth-child(3n+2) { grid-column: 1 / -1; }
  .work:last-child:nth-child(3n) { grid-column: span 2; }
}
/* 카드 안 상태 줄을 바닥에 맞춤 */
.work { grid-template-rows: 1fr auto; }
.work-meta { align-self: end; }
/* 위계: 바닥글 워드마크는 히어로보다 작고 흐리게, 모바일 히어로는 더 크게 */
.site-footer .big { font-size: clamp(2.8rem, 1.5rem + 6vw, 6.5rem); opacity: 0.55; }
.hero-word { font-size: clamp(4.8rem, 1rem + 13vw, 10.5rem); }
/* 용어 분류 배지는 카드 오른쪽 위로 */
.term-cat { position: absolute; top: 1.5rem; right: 1.5rem; }
.term dt { padding-right: 4.5rem; }
/* 작은 고정폭 글자 바닥값 */
.term-en, .tags li, .chat-head .model, .swatch code, .work-prompt { font-size: max(0.8rem, 0.8em); }
.term-en { letter-spacing: 0.02em; }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) { .progress { animation-range: 0% 100%; } }
}
:root[data-theme="light"] .progress { box-shadow: none; }

/* ---------- 11. 개발자 검토 반영 ---------- */
/* 흰 글자가 올라가는 그라디언트는 어두운 화면에서도 진한 색으로(대비 5:1 이상) */
.btn, .msg.user, .site-nav a[aria-current="page"], .chip[aria-pressed="true"], .badge-ai, .ask button, .checks li::before, .skip-link { background: var(--grad-ui); background-size: 160% 100%; }
/* 채팅 스트리밍: 다 쓴 높이를 미리 잡아 둠 */
.streaming { position: relative; }
.stream-ghost { visibility: hidden; }
.stream-live { position: absolute; inset: 0; }
.hero { align-items: start; }
@media (min-width: 62rem) { .hero { align-items: center; } .hero-side { min-height: 0; } }
/* 떠오르는 효과에서 흐림 제거(유리 카드와 겹치면 비쌈), 용어 카드는 유리 흐림 대신 반투명만 */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    @keyframes rise { from { opacity: 0; transform: translateY(24px) scale(0.98); } }
  }
}
.term { -webkit-backdrop-filter: none; backdrop-filter: none; background: color-mix(in oklab, var(--bg-2) 70%, transparent); }
/* 좁은 화면: 큰 번호가 프롬프트와 겹치지 않게 */
@media (max-width: 52rem) {
  .work-no { font-size: 3.25rem; top: 0.2rem; }
  .work-prompt { margin-right: 0; }
  .work-title { padding-right: 4rem; }
}
.work-prompt { position: relative; z-index: 1; }
/* 밝은 화면의 '운영 중' 대비 */
/* 고대비 모드에서도 선택 상태가 보이게 */
@media (forced-colors: active) {
  .chip[aria-pressed="true"], .site-nav a[aria-current="page"], .msg.user, .btn {
    forced-color-adjust: none; background: Highlight; color: HighlightText;
  }
}

/* ---------- 12. 테마 선택 · 로봇 ---------- */
/* 헤더의 테마 고르기: 진짜 라디오 버튼이라 키보드(화살표)·화면 낭독기로 고를 수 있음 */
.palette-pick { display: flex; align-items: center; gap: 0.15rem; margin: 0; padding: 0.2rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.palette-pick legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.palette-pick label { position: relative; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; cursor: pointer; }
.palette-pick input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.palette-pick .sw { width: 1.15rem; height: 1.15rem; border-radius: 50%; background: linear-gradient(135deg, var(--g1) 50%, var(--g3) 50%); box-shadow: inset 0 0 0 1px var(--border-2); transition: transform 0.15s; pointer-events: none; }
.palette-pick label:hover .sw { transform: scale(1.12); }
/* 선택 표시는 html의 data-palette 기준이라 스크립트가 돌기 전 첫 화면부터 맞음 */
:root[data-palette="a"] .palette-pick label[data-palette="a"] .sw, :root[data-palette="b"] .palette-pick label[data-palette="b"] .sw, :root[data-palette="c"] .palette-pick label[data-palette="c"] .sw { outline: 2px solid var(--text); outline-offset: 2px; }
.palette-pick label:has(input:focus-visible) { outline: 2px solid var(--g1); outline-offset: 2px; }
@media (max-width: 22rem) { .palette-pick label { width: 1.5rem; height: 1.5rem; } .palette-pick .sw { width: 1rem; height: 1rem; } .badge-ai { display: none; } }
@media (max-width: 26rem) { .nav-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .nav-toggle { padding: 0.5rem; } }
@media (min-width: 60rem) { .palette-pick { order: 3; } .theme-toggle { order: 4; } }

/* 로봇: 색은 테마 변수 --rb(몸) --rb2(그림자) --rs(화면) --ra(눈·불빛) */
.bot { display: block; overflow: visible; }
.wordmark .bot { width: 1.9rem; height: 1.9rem; }
.msg.ai .bot { width: 2.2rem; height: 2.2rem; }
.hero-robot { position: relative; z-index: 2; width: clamp(7.5rem, 18vw, 10.5rem); margin: 0 0 -2.1rem 1.25rem; filter: drop-shadow(0 18px 24px rgb(0 0 0 / 0.22)); }
.page-head { position: relative; }
.page-bot { position: absolute; right: 0; bottom: clamp(1rem, 3vw, 2rem); width: clamp(5.5rem, 14vw, 10rem); opacity: 0.95; pointer-events: none; }
@media (max-width: 40rem) { .page-bot { width: 4.5rem; bottom: auto; top: clamp(2.5rem, 6vw, 5.5rem); } }
.bot-stage { display: grid; place-items: center; padding: 1rem; border-radius: 18px; background: radial-gradient(circle at 50% 45%, color-mix(in oklab, var(--g1) 18%, transparent), transparent 70%); }
.bot-stage .bot { width: min(12rem, 70%); }
.theme-compare { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.theme-card { display: grid; gap: 0.8rem; padding: 1.2rem; border-radius: var(--radius); background: var(--bg); color: var(--text); border: 1px solid var(--border-2); }
.theme-card .bot { width: 5rem; }
.theme-card h3 { font-size: 1.05rem; }
.theme-card p { color: var(--text-2); font-size: 0.88rem; }
.theme-card .btn { justify-self: start; padding: 0.55rem 1rem; font-size: 0.88rem; }
@media (prefers-reduced-motion: no-preference) {
  .bot .eye { transform-box: fill-box; transform-origin: center; animation: bot-blink 5s infinite; }
  .bot .wave { transform-box: view-box; transform-origin: 62px 178px; animation: wave 3.2s ease-in-out infinite; }
  .bot .beacon { animation: beacon 2.4s ease-in-out infinite; }
  @keyframes bot-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
  @keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-14deg); } 80% { transform: rotate(6deg); } 90% { transform: rotate(-10deg); } }
  @keyframes beacon { 50% { opacity: 0.35; } }
}
@media (forced-colors: active) { .palette-pick .sw { forced-color-adjust: none; } }
/* 얼굴만 잘라 쓰는 로봇은 viewBox 밖(몸통)을 숨김 */
.msg.ai .bot, .wordmark .bot { overflow: hidden; }

/* 페이지 머리 로봇이 소개 글을 가리지 않게 글 폭을 줄임 */
.page-head:has(.page-bot) .lede { max-width: min(var(--measure), calc(100% - clamp(5.5rem, 14vw, 10rem) - 1rem)); }
