:root {
  color-scheme: light;
  --bg: #f2f2f5; --ink: #1d1d1f; --ink-2: #6e6e73; --ink-3: #8e8e93;
  --hair: rgba(0, 0, 0, .08); --hair-2: rgba(0, 0, 0, .17); --sig: #e8440e;
  --glass: rgba(255, 255, 255, .62); --glass-2: rgba(255, 255, 255, .9); --edge: rgba(255, 255, 255, .78);
  --lift-1: 0 1px 1px rgba(20, 20, 40, .02), 0 6px 18px rgba(20, 20, 40, .05);
  --lift-2: 0 1px 2px rgba(20, 20, 40, .03), 0 18px 48px rgba(20, 20, 40, .1);
  --radius: 22px;
  --sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: clamp(20px, 4vw, 48px);
  --head: 64px; --headH: 200px;
  /* 제목 아래 남은 자리의 가운데에 설계도를 놓아요 */
  --avail: calc(100vh - var(--head) - var(--headH));
  --mapGap: clamp(20px, 4.2vh, 56px);
  --mapH: min(740px, calc(var(--avail) - 2 * var(--mapGap)));
  --mapTop: calc((var(--avail) - var(--mapH)) / 2);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html.ready { scroll-behavior: smooth; }
html { scroll-padding-top: calc(var(--head) + 16px); -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { position: relative; color: var(--ink); background: var(--bg); font: 400 1.0625rem/1.7 var(--sans); word-break: keep-all; overflow-wrap: break-word; -webkit-font-smoothing: antialiased; overflow-x: clip; }
/* 바탕: 연한 회색 위로 아주 옅은 빛. 유리 판이 이 위에 놓여요 */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background:
  radial-gradient(1000px 680px at 10% 6%, rgba(255, 255, 255, .95), transparent 62%),
  radial-gradient(900px 760px at 92% 14%, rgba(224, 230, 244, .8), transparent 62%),
  radial-gradient(1000px 760px at 72% 100%, rgba(246, 233, 226, .6), transparent 62%),
  var(--bg); }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--sig); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); font-size: .75rem; line-height: 1.4; letter-spacing: .02em; color: var(--ink-2); font-weight: 500; }
.lab { font-size: .8125rem; line-height: 1.4; letter-spacing: -.004em; color: var(--ink-2); font-weight: 500; }

/* 위 */
header { position: sticky; top: 0; z-index: 10; height: var(--head); background: rgba(242, 242, 245, .72); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); }
header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { display: block; flex: none; }
.logo img { display: block; height: 42px; width: auto; }
header .right { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 32px); }
header nav.menu { display: flex; gap: clamp(14px, 2.6vw, 32px); font-size: .9375rem; font-weight: 500; }
.lang { display: flex; align-items: center; padding-left: clamp(14px, 2.4vw, 32px); border-left: 1px solid var(--hair-2); font-size: .8125rem; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.lang a { padding: 6px 0; transition: color .15s ease; }
.lang a + a { margin-left: 8px; }
.lang a + a::before { content: "·"; display: inline-block; margin-right: 8px; color: var(--ink-3); text-decoration: none; }
.lang a[aria-current="true"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
.lang a:hover { color: var(--sig); }
.lang a:active { opacity: .6; transition: none; }
header nav.menu a { padding: 8px 0; transition: color .15s ease; }
header nav.menu a:hover { color: var(--sig); }
header nav.menu a:active { opacity: .6; transition: none; }

/* 칸 머리 */
section.wrap { padding-top: clamp(72px, 13vh, 150px); }
.head h2 { font-size: clamp(2rem, 4.4vw, 3.75rem); font-weight: 600; line-height: 1.16; letter-spacing: -.03em; }
.head p { margin-top: 18px; max-width: 60em; font-size: clamp(1.0625rem, 1.5vw, 1.25rem); line-height: 1.6; letter-spacing: -.008em; color: var(--ink-2); }
section#layers { padding-top: 0; }
#layers .head { position: relative; z-index: 2; grid-column: 1 / -1; padding: clamp(20px, 4vh, 44px) 0 0; pointer-events: auto; }
/* 제목은 유리: 오른쪽 글이 이 아래로 흐리게 지나가요 */
#layers .head::before { content: ""; position: absolute; z-index: -1; top: 0; bottom: -28px; left: 50%; width: 100vw; transform: translateX(-50%); background: rgba(242, 242, 245, .8); -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%); -webkit-mask-image: linear-gradient(#000 calc(100% - 28px), transparent); mask-image: linear-gradient(#000 calc(100% - 28px), transparent); pointer-events: none; }
#layers .head p { margin-top: 12px; }
.head h1 { font-size: clamp(2rem, min(3.7vw, 6.4vh), 3.375rem); font-weight: 600; line-height: 1.22; letter-spacing: -.03em; }
:lang(en) .head h1 { line-height: 1.14; letter-spacing: -.036em; }

/* 설계도: 아홉 장의 판 */
.stage, .pinned { display: grid; grid-template-columns: minmax(0, 1.34fr) minmax(0, 1fr); column-gap: clamp(40px, 5vw, 80px); }
.pinned { grid-column: 1 / -1; grid-row: 1; align-self: start; position: sticky; top: var(--head); z-index: 3; height: calc(100vh - var(--head)); grid-template-rows: auto minmax(0, 1fr); pointer-events: none; }
.notes { grid-column: 2; grid-row: 1; padding-top: calc(var(--headH) + var(--mapTop)); position: relative; z-index: 1; min-width: 0; }
.plan { grid-column: 1; display: flex; align-items: center; min-height: 0; pointer-events: none; transition: none; }
.map { --labelW: 172px; --g: 5px; --rg: calc((100% + var(--g)) / 9); position: relative; width: 100%; height: var(--mapH); display: grid; grid-template-columns: var(--labelW) repeat(3, minmax(0, 1fr)) 12px; grid-template-rows: repeat(9, minmax(0, 1fr)); row-gap: var(--g); pointer-events: auto; }
:lang(en) .map { --labelW: 204px; }
.slab { position: relative; grid-column: 1 / -1; display: flex; flex-direction: column; justify-content: center; gap: 1px; padding-left: 18px; min-height: 0; background: rgba(255, 255, 255, var(--a)); border: 1px solid var(--edge); border-radius: 14px; box-shadow: 0 1px 1px rgba(20, 20, 40, .02), 0 4px 12px rgba(20, 20, 40, .04), inset 0 -1px 0 rgba(20, 20, 40, .035); transition: background .25s ease, box-shadow .25s ease; }
.slab::before { content: ""; position: absolute; left: 7px; top: 28%; bottom: 28%; width: 3px; border-radius: 2px; background: var(--sig); opacity: 0; transition: opacity .2s ease; }
.slab .mono { font-size: .6875rem; line-height: 1.2; color: var(--ink-3); transition: color .2s ease; }
.slab b { max-width: calc(var(--labelW) - 26px); font-size: .90625rem; line-height: 1.25; font-weight: 500; letter-spacing: -.012em; transition: opacity .2s ease; }
:lang(en) .slab b { font-size: .875rem; letter-spacing: -.006em; }
.slab:hover { background: rgba(255, 255, 255, .94); }
.slab:active { background: #fff; transition: none; }
.slab.on { background: #fff; box-shadow: 0 2px 4px rgba(20, 20, 40, .04), 0 14px 34px rgba(20, 20, 40, .12); }
.slab.on::before { opacity: 1; }
.slab.on .mono { color: var(--sig); }
.slab.on b { font-weight: 700; }

.wires { position: absolute; inset: 0; z-index: 1; pointer-events: none; transition: opacity .2s ease; }
.wire { position: absolute; left: calc(var(--labelW) + (var(--t) - .5) * (100% - var(--labelW) - 12px) / 3); top: calc(var(--a) * var(--rg) + (var(--rg) - var(--g)) / 2); height: calc((var(--b) - var(--a)) * var(--rg)); width: 1px; background: var(--hair-2); }
.sig { position: absolute; left: -.5px; top: 0; bottom: 0; width: 2px; background: var(--sig); box-shadow: 0 0 10px rgba(232, 68, 14, .35); transform: scaleY(0); transform-origin: bottom; transition: transform .2s ease; }
.wire.down .sig { transform-origin: top; }
.sig.on { transform: scaleY(1); transition: transform .42s cubic-bezier(.2, .7, .2, 1) var(--d, 0s); }

.node { position: relative; z-index: 2; align-self: center; height: clamp(28px, 60%, 44px); margin: 0 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: #fff; border: 1px solid rgba(0, 0, 0, .07); border-radius: 11px; font-size: .84375rem; line-height: 1.15; font-weight: 500; letter-spacing: -.012em; box-shadow: 0 1px 2px rgba(20, 20, 40, .05), 0 5px 14px rgba(20, 20, 40, .06), inset 0 1px 0 rgba(255, 255, 255, .9); transition: background .2s ease var(--d, 0s), color .2s ease var(--d, 0s), border-color .2s ease var(--d, 0s), opacity .2s ease, box-shadow .2s ease, transform .12s ease; }
:lang(en) .node { letter-spacing: -.004em; font-size: .8125rem; }
.node .big { font-size: 1.375rem; line-height: 1.15; font-weight: 600; letter-spacing: -.02em; }
.node .small { margin-top: 4px; font-size: .75rem; color: var(--ink-2); font-weight: 500; transition: color .2s ease var(--d, 0s); }
.node.real { align-self: stretch; height: auto; margin-top: 7px; margin-bottom: 7px; border-radius: 15px; }
.node.paper { font-style: normal; }
:lang(en) .node.paper { font-style: italic; }
.node:hover { background: #fafafb; box-shadow: 0 1px 2px rgba(20, 20, 40, .06), 0 8px 20px rgba(20, 20, 40, .09); }
.node:active { transform: scale(.97); transition: transform .08s ease; }
.node.on { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 4px 10px rgba(20, 20, 40, .16), 0 14px 30px rgba(20, 20, 40, .16); }
.node.on .small { color: rgba(255, 255, 255, .72); }
.plan[data-mode="thread"] .node:not(.on) { opacity: .34; }
.plan[data-mode="thread"] .wires .wire { background: rgba(0, 0, 0, .09); }
.plan[data-mode="thread"] .slab b { opacity: .5; }

/* 층마다의 글: 위로 올라가 제목 유리 아래로 지나가요 */
.step { margin-bottom: clamp(36px, 20vh, 180px); padding: clamp(22px, 2.4vw, 32px); background: var(--glass); border: 1px solid var(--edge); border-radius: var(--radius); box-shadow: var(--lift-1); scroll-margin-top: calc(var(--headH) + var(--mapTop) - 16px); transition: opacity .25s ease, background .25s ease, box-shadow .25s ease; }
.js .step { opacity: .46; }
.js .step.cur { opacity: 1; background: var(--glass-2); box-shadow: var(--lift-2); }
.step:last-child { margin-bottom: 40vh; }
.step .mono, .step .lab { color: var(--sig); }
.step h3 { margin-top: 8px; font-size: clamp(1.625rem, 2.5vw, 2.25rem); font-weight: 600; line-height: 1.2; letter-spacing: -.026em; }
.step .q { margin-top: 6px; font-size: clamp(1.0625rem, 1.5vw, 1.3125rem); line-height: 1.4; letter-spacing: -.014em; color: var(--ink-2); }
.step .think { margin-top: 18px; font-size: 1rem; line-height: 1.68; }
.items { margin-top: 20px; border-top: 1px solid var(--hair); }
.items li { padding: 13px 0; border-bottom: 1px solid var(--hair); }
.items li:last-child { border-bottom: 0; padding-bottom: 0; }
.items .t { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 14px; font-size: 1rem; font-weight: 600; letter-spacing: -.012em; line-height: 1.45; }
.items .tag { font-size: .8125rem; line-height: 1.4; font-weight: 500; color: var(--ink-2); letter-spacing: -.004em; }
.items a.tag { color: var(--ink); text-decoration: underline; text-decoration-color: var(--hair-2); text-underline-offset: 3px; }
.items a.tag:hover { color: var(--sig); text-decoration-color: currentColor; }
.items .d { margin-top: 3px; font-size: .9375rem; line-height: 1.6; color: var(--ink-2); }
.chain { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 7px 8px; font-size: .875rem; font-weight: 500; line-height: 1.35; }
.chain span { padding: 5px 11px; background: #fff; border: 1px solid rgba(0, 0, 0, .07); border-radius: 9px; box-shadow: 0 1px 2px rgba(20, 20, 40, .04); }
.chain i { color: var(--ink-3); font-style: normal; }
.threads-head { margin-bottom: clamp(32px, 14vh, 130px); font-size: clamp(1.5rem, 2.3vw, 2rem); font-weight: 600; line-height: 1.28; letter-spacing: -.024em; text-wrap: balance; }

/* 폰에서 보는 차례 */
.overview, .rail { display: none; }

/* 한 층을 끝까지 */
.deep { padding-top: clamp(72px, 13vh, 150px); }
.flow { margin-top: clamp(32px, 6vh, 60px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.flow > div { padding: clamp(20px, 2vw, 28px); min-width: 0; background: var(--glass); border: 1px solid var(--edge); border-radius: var(--radius); box-shadow: var(--lift-1); }
.flow > div:last-child { background: var(--glass-2); box-shadow: var(--lift-2); }
.flow > div:last-child .lab { color: var(--sig); }
.flow h3 { margin-top: 10px; font-size: clamp(1.1875rem, 1.65vw, 1.4375rem); font-weight: 600; line-height: 1.32; letter-spacing: -.02em; }
.flow p { margin-top: 12px; font-size: .9375rem; line-height: 1.65; color: var(--ink-2); }
.flow p.lab { margin-top: 0; font-size: .8125rem; }
.flow code { display: block; margin-top: 14px; padding: 10px 12px; background: rgba(0, 0, 0, .045); border-radius: 10px; font: 500 .6875rem/1.55 var(--mono); color: var(--ink); overflow-wrap: anywhere; word-break: normal; }
.flow p.num { color: var(--ink); margin-top: 18px; font-size: clamp(1.5rem, 2.3vw, 2rem); font-weight: 600; line-height: 1.15; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.flow p.num + p { margin-top: 6px; }
.more { display: inline-block; margin-top: 16px; font-weight: 600; font-size: .9375rem; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--hair-2); transition: color .15s ease; }
.more:hover { color: var(--sig); text-decoration-color: currentColor; }
.more:active { opacity: .6; transition: none; }

/* 논문 · 오픈소스 */
.list { margin-top: clamp(28px, 5vh, 52px); padding: 6px clamp(18px, 2.2vw, 30px); background: var(--glass); border: 1px solid var(--edge); border-radius: var(--radius); box-shadow: var(--lift-1); }
.list a { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 4px 20px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--hair); transition: color .15s ease; }
.list a:last-child { border-bottom: 0; }
.list a:hover { color: var(--sig); }
.list a:active { opacity: .6; transition: none; }
.list b { font-size: clamp(1.0625rem, 1.55vw, 1.3125rem); font-weight: 600; line-height: 1.35; letter-spacing: -.018em; }
.list small { display: block; margin-top: 3px; font-size: .875rem; line-height: 1.45; color: var(--ink-2); font-weight: 400; word-break: normal; }
.list .mono, .list .lab { color: inherit; }

/* 제품 */
.prods { margin-top: clamp(28px, 5vh, 56px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.prods article { padding: clamp(24px, 2.6vw, 36px); background: var(--glass); border: 1px solid var(--edge); border-radius: var(--radius); box-shadow: var(--lift-1); transition: background .2s ease, box-shadow .2s ease; }
.prods article:hover { background: var(--glass-2); box-shadow: var(--lift-2); }
.prods h3 { margin-top: 10px; font-size: clamp(2rem, 3.1vw, 2.75rem); font-weight: 600; line-height: 1.1; letter-spacing: -.034em; }
.prods .line { margin-top: 12px; font-size: clamp(1.0625rem, 1.45vw, 1.25rem); line-height: 1.4; font-weight: 500; letter-spacing: -.014em; }
.prods p + p { margin-top: 10px; font-size: .9375rem; line-height: 1.65; color: var(--ink-2); }
.prods p.state { margin-top: 16px; font-size: .8125rem; }

/* 회사 */
.co { margin-top: clamp(28px, 5vh, 56px); display: grid; gap: 14px; }
.co > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 16px clamp(24px, 4vw, 64px); padding: clamp(28px, 3.4vw, 48px); background: var(--glass); border: 1px solid var(--edge); border-radius: var(--radius); box-shadow: var(--lift-1); }
.co .say { font-size: clamp(1.625rem, 3vw, 2.625rem); font-weight: 600; line-height: 1.28; letter-spacing: -.028em; }
.co .plain { margin-top: 16px; font-size: clamp(1.0625rem, 1.5vw, 1.25rem); line-height: 1.75; color: var(--ink-2); letter-spacing: -.008em; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px clamp(20px, 3vw, 40px); }
.three b { display: block; font-size: clamp(1.25rem, 2vw, 1.625rem); font-weight: 600; letter-spacing: -.02em; }
.three span { display: block; margin-top: 6px; font-size: .9375rem; line-height: 1.6; color: var(--ink-2); }
.mail { display: inline-block; font-size: clamp(1.25rem, 2.4vw, 1.875rem); font-weight: 600; letter-spacing: -.016em; text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--hair-2); overflow-wrap: anywhere; transition: color .15s ease; }
.mail:hover { color: var(--sig); text-decoration-color: currentColor; }
.mail:active { opacity: .6; transition: none; }

footer { margin-top: clamp(48px, 9vh, 96px); padding-bottom: 40px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: .875rem; color: var(--ink-2); }
footer a:hover { color: var(--sig); }

/* 데스크톱에서 설계도 칸이 좁을 때 */
@media (max-width: 1240px) {
  .map, :lang(en) .map { --labelW: 150px; }
  .node, :lang(en) .node { font-size: .75rem; margin: 0 4px; }
  .slab b, :lang(en) .slab b { font-size: .8125rem; line-height: 1.15; }
}
/* 세로가 짧을 때: 층 번호와 이름을 한 줄로 */
@media (max-height: 800px) and (min-width: 1001px) {
  .slab { flex-direction: row; align-items: center; justify-content: flex-start; gap: 7px; }
  .slab b { max-width: calc(var(--labelW) - 50px); }
  .map { --g: 4px; }
  .slab, .node { border-radius: 10px; }
  .node.real { margin-top: 5px; margin-bottom: 5px; }
  .node .big { font-size: 1.1875rem; }
}

@media (max-width: 1000px) {
  .stage, .pinned { display: block; }
  .pinned { position: static; height: auto; pointer-events: auto; }
  .plan { display: none; }
  #layers .head { padding-bottom: 28px; }
  #layers .head::before { display: none; }
  .notes { padding-top: 0; }
  .js .step { opacity: 1; }
  .step { margin-bottom: 14px; scroll-margin-top: 70px; }
  .step:last-child { margin-bottom: 0; }
  .threads-head { margin: 40px 4px 18px; }
  .overview { display: block; padding: 4px clamp(16px, 3vw, 24px); background: var(--glass); border: 1px solid var(--edge); border-radius: var(--radius); box-shadow: var(--lift-1); }
  .overview a { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 8px; padding: 12px 0; border-bottom: 1px solid var(--hair); }
  .overview li:last-child a { border-bottom: 0; }
  .overview a:active { opacity: .6; }
  .overview b { font-weight: 600; font-size: 1rem; line-height: 1.4; letter-spacing: -.012em; }
  .overview small { grid-column: 2; font-size: .875rem; line-height: 1.45; color: var(--ink-2); }
  .overview .mono { line-height: 1.9; }
  .rail { position: sticky; top: calc(var(--head) + 6px); z-index: 5; display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; padding: 10px 14px; background: rgba(255, 255, 255, .78); -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%); border: 1px solid var(--edge); border-radius: 14px; box-shadow: var(--lift-1); }
  .rail .segs { display: flex; gap: 3px; flex: none; }
  .rail i { width: 8px; height: 16px; background: rgba(0, 0, 0, .1); border-radius: 2px; transition: background .15s ease; }
  .rail i.on { background: var(--sig); }
  .rail span { font-size: .875rem; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prods { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --head: 56px; }
  .logo img { height: 28px; }
  header .wrap { gap: 10px; }
  header .right { gap: 10px; }
  header nav.menu { gap: 10px; font-size: .8125rem; }
  .lang { padding-left: 10px; font-size: .75rem; }
  .lang a + a { margin-left: 5px; }
  .lang a + a::before { margin-right: 5px; }
  .lang .rest { display: none; }
  .flow { grid-template-columns: 1fr; }
  .list a { grid-template-columns: 40px minmax(0, 1fr); gap: 2px 10px; }
  .list a > .lab:last-child { grid-column: 2; }
  .co > div { grid-template-columns: 1fr; }
  .three { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html.ready { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass: #fff; --glass-2: #fff; }
  header, #layers .head::before, .rail { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .slab { background: #fff; }
}
@media (prefers-contrast: more) {
  :root { --ink-2: #333338; --ink-3: #55555a; --hair: rgba(0, 0, 0, .35); --hair-2: rgba(0, 0, 0, .6); --glass: #fff; --glass-2: #fff; --edge: #55555a; }
  header, #layers .head::before, .rail { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .slab { background: #fff; }
}
@media (max-width: 340px) {
  .logo { display: none; }
  header .wrap { justify-content: flex-end; }
}
