/* 만든 기록 시제품: 이야기(낮의 종이) ↔ 개발(새벽 3시 수유등) */
@view-transition { navigation: auto; }
@property --ms { syntax: '<length>'; inherits: false; initial-value: 0px; }

:root {
  --paper: #fbf6ec; --paper-2: #f1e8d6; --ink: #2b241c; --ink-sub: #685c4d; --pen: #34507f; --stamp: #d9590b;
  --night: #0a0c16; --night-2: #121526; --cream: #efe6d6; --cream-sub: #a8a093; --amber: #ffb547; --amber-deep: #e88a1a;
  --type: #9aa6d1; --muted: #858193;
  --lamp: 0; --ox: 50vw; --oy: 92vh;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; min-height: 100svh; -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere; }
img { display: block; max-width: 100%; }
a { color: inherit; }

/* ───── 공통 뼈대 ───── */
.top { position: fixed; inset: 0 0 auto; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 16px) 20px 0; font-size: 13px; }
.top a { font-weight: 700; text-decoration: none; }
/* 사이트 공통 헤더(#gh)를 두 세계 색에 맞춘다. 전환 중에도 헤더는 제자리에서 색만 바뀐다 */
html[data-page="story"] body { --gh-fg: var(--ink); --gh-bg: var(--paper); }
html[data-page="dev"] body { --gh-fg: var(--cream); --gh-bg: var(--night); }
#gh { view-transition-name: made-header; }
::view-transition-group(made-header) { animation-duration: .6s; }
.status { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 22px; font: 500 12px/1.4 "IBM Plex Mono", monospace; color: var(--ink-sub); }
html[data-page="dev"] .status { color: var(--cream-sub); padding-right: 56px; }
.col { max-width: 37rem; margin: 0 auto; padding: 104px 20px 120px; }
.toggle { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 22px); z-index: 6; transform: translateX(-50%);
  display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; view-transition-name: made-toggle; }
.toggle a { position: relative; z-index: 1; display: grid; place-items: center; min-width: 92px; height: 44px; padding: 0 20px;
  border-radius: 999px; font-size: 15px; font-weight: 700; text-decoration: none; transition: color .2s; }
.toggle .knob { position: absolute; top: 4px; bottom: 4px; width: calc(50% - 4px); border-radius: 999px; }
html[data-page="story"] .knob { left: 4px; }
html[data-page="dev"] .knob { left: 50%; }

/* ───── 이야기: 낮의 종이 ───── */
html[data-page="story"] { background: var(--paper); color-scheme: light; }
html[data-page="story"] body { color: var(--ink); font: 17px/1.85 "Gowun Batang", serif;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(255, 214, 150, .28), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .47 0 0 0 0 .36 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    var(--paper); }
html[data-page="story"] ::selection { background: #ffd37a; color: var(--ink); }
html[data-page="story"] :focus-visible { outline: 2px solid var(--stamp); outline-offset: 3px; border-radius: 6px; }
html[data-page="story"] .top { color: var(--ink-sub); }
html[data-page="story"] .top a { color: var(--ink); }
.story { position: relative; }
.story .stamp { position: absolute; top: 100px; right: 20px; margin: 0; font: 700 15px/1 "Pretendard Variable", Pretendard, sans-serif; letter-spacing: .14em; color: var(--stamp);
  font-variant-numeric: tabular-nums; transform: rotate(-4deg); }
.story h1 { margin: 0; font: 700 clamp(34px, 8.4vw, 50px)/1.22 "Gowun Batang", serif; letter-spacing: -.02em; text-wrap: balance; }
.story .hand { margin: 14px 0 0; font: 400 clamp(28px, 6.4vw, 34px)/1.1 "Nanum Pen Script", cursive; color: var(--pen); transform: rotate(-1.4deg); }
.story .print { margin: 34px -6px 38px; padding: 10px 10px 34px; background: #fff; transform: rotate(-1deg);
  box-shadow: 0 1px 1px rgba(60, 40, 20, .08), 0 18px 30px -16px rgba(60, 40, 20, .45); }
.story .print img { width: 100%; height: auto; aspect-ratio: 900 / 560; object-fit: cover; background: var(--paper-2); }
.story .print figcaption { margin-top: 10px; font: 400 22px/1 "Nanum Pen Script", cursive; color: var(--ink-sub); text-align: center; }
.story p.b { margin: 0 0 1.25em; text-wrap: pretty; }
.story .sign { margin-top: 2.4em; font: 400 26px/1.2 "Nanum Pen Script", cursive; color: var(--pen); text-align: right; }
html[data-page="story"] .toggle { background: rgba(43, 36, 28, .06); box-shadow: inset 0 0 0 1px rgba(43, 36, 28, .14), 0 10px 24px -14px rgba(60, 40, 20, .5);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
html[data-page="story"] .toggle a { color: var(--ink-sub); }
html[data-page="story"] .toggle a[aria-current] { color: var(--paper); }
html[data-page="story"] .toggle a:not([aria-current]):hover { color: var(--ink); }
html[data-page="story"] .knob { background: var(--ink); }

/* ───── 개발: 새벽 3시 수유등 ───── */
html[data-page="dev"] { background: var(--night); color-scheme: dark; }
html[data-page="dev"] body { color: var(--cream); font: 16px/1.75 "IBM Plex Sans KR", sans-serif;
  background: color-mix(in oklab, #10141f, var(--night) calc(var(--lamp) * 100%)); transition: background 1.2s ease; }
html[data-page="dev"] ::selection { background: var(--amber); color: var(--night); }
html[data-page="dev"] :focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
html[data-page="dev"] .top { color: var(--cream-sub); font-family: "IBM Plex Mono", monospace; font-size: 12px; }
html[data-page="dev"] .top a { color: var(--cream); font-family: "IBM Plex Sans KR", sans-serif; font-size: 13px; }
/* 수유등: 오른쪽 위 작은 등과 방을 채우는 빛. 세기 = --lamp */
.glow { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: var(--lamp); transition: opacity 1.4s ease;
  background:
    radial-gradient(60vmax 50vmax at 92% 6%, rgba(255, 170, 70, .22), transparent 62%),
    radial-gradient(30vmax 26vmax at 92% 6%, rgba(255, 196, 120, .16), transparent 60%); }
.lamp { position: absolute; top: 92px; right: 14px; z-index: 1; width: 46px; height: 52px; pointer-events: none; }
.lamp .shade { fill: color-mix(in oklab, #3a3646, #ffd08a calc(var(--lamp) * 100%)); transition: fill 1.4s ease; }
.lamp .base { fill: #2a2836; }
.lamp .halo { opacity: var(--lamp); transition: opacity 1.4s ease; }
.top .r { display: grid; justify-items: end; gap: 2px; text-align: right; }
/* 머리맡 시계: 늘 새벽 3시대. 가운데 콜론이 1초마다 깜빡인다 */
.clock { color: var(--cream-sub); }
.clock b { margin-left: .3em; font: 500 15px/1 "IBM Plex Mono", monospace; color: var(--amber); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.clock i { font-style: normal; animation: colon 1s steps(1, end) infinite; }
@keyframes colon { 50% { opacity: .18; } }
/* 수유등: 개발 화면에 들어오면 탁, 타닥 하고 켜지고, 그 뒤로는 가끔 한 번씩 떨린다(오래된 수유등처럼) */
html[data-page="dev"] .glow, html[data-page="dev"] .lamp .halo { animation: lamp-flicker 13s 2.4s infinite; }
html.t-dev .glow, html.t-dev .lamp .halo { animation: lamp-on 1.3s .5s both, lamp-flicker 13s 2.4s infinite; }
@keyframes lamp-on { 0% { opacity: 0; } 18% { opacity: .9; } 24% { opacity: .1; } 36% { opacity: .75; } 42% { opacity: .2; } 60%, 100% { opacity: 1; } }
@keyframes lamp-flicker { 0%, 88% { opacity: 1; } 89% { opacity: .45; } 90% { opacity: .95; } 91.5% { opacity: .3; } 93%, 100% { opacity: 1; } }
.dev { position: relative; z-index: 2; }
.dev .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 0 0; font: 500 12px/1.4 "IBM Plex Mono", monospace; color: var(--cream-sub); font-variant-numeric: tabular-nums; }
.dev .meta b { color: var(--amber); font-weight: 500; }
.dev h1 { margin: 0; font: 600 clamp(30px, 7.4vw, 44px)/1.28 "IBM Plex Sans KR", sans-serif; letter-spacing: -.025em; text-wrap: balance; }
.dev h1 .hash { color: var(--amber); font-family: "IBM Plex Mono", monospace; font-weight: 500; margin-right: .3em; }
.dev h2 { margin: 2.6em 0 .7em; font: 500 13px/1.3 "IBM Plex Mono", monospace; color: var(--amber); letter-spacing: .02em; }
.dev p { margin: 0 0 1em; color: var(--cream); text-wrap: pretty; }
.dev .who { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; margin: 18px 0 0; }
.dev .who > div { padding-top: 12px; border-top: 1px solid rgba(239, 230, 214, .14); }
.dev .who .me { border-top-color: var(--amber); }
.dev .who dt { font-size: 14px; font-weight: 600; color: var(--cream-sub); margin-bottom: 8px; }
.dev .who dd { margin: 0; }
.dev .who ul { margin: 0; padding: 0; list-style: none; font-size: 15px; line-height: 1.6; }
.dev .who li + li { margin-top: 6px; }
.dev .who .me dt { color: var(--amber); }
.code { position: relative; margin: 0 -6px; padding: 16px 0; border-radius: 10px; overflow-x: auto;
  background: rgba(5, 6, 12, .55); box-shadow: inset 0 0 0 1px rgba(239, 230, 214, .08);
  font: 400 13px/1.75 "IBM Plex Mono", monospace; counter-reset: ln; scrollbar-width: thin; scrollbar-color: #3a3646 transparent; }
.code code { display: block; min-width: max-content; }
.code .l { display: block; padding: 0 18px 0 0; white-space: pre; }
.code .l::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 3.2ch; margin-right: 1.6ch; text-align: right; color: #565365; }
.code .kw { color: var(--amber); } .code .ty { color: var(--type); } .code .fn { color: #f4d7a6; } .code .cm { color: var(--muted); font-style: italic; }
.dev .foot { margin-top: 3em; font-size: 13px; color: var(--cream-sub); }
html[data-page="dev"] .toggle { background: rgba(10, 12, 22, .6); box-shadow: inset 0 0 0 1px rgba(255, 181, 71, .22), 0 12px 30px -12px rgba(0, 0, 0, .8);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
html[data-page="dev"] .toggle a { color: var(--cream-sub); font-family: "IBM Plex Sans KR", sans-serif; }
html[data-page="dev"] .toggle a[aria-current] { color: var(--night); }
html[data-page="dev"] .toggle a:not([aria-current]):hover { color: var(--cream); }
html[data-page="dev"] .knob { background: var(--amber); }

/* 개발 글 본문 블록 */
.dev code { font: 400 .88em "IBM Plex Mono", monospace; color: #f4d7a6; }
/* 요약: 카드 세 칸이 아니라 위아래 선만 있는 세 줄 */
.dev .pick3 { margin: 30px 0 0; border-top: 1px solid rgba(239, 230, 214, .14); }
.dev .pick3 > div { display: grid; grid-template-columns: 6.5em 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid rgba(239, 230, 214, .14); }
.dev .pick3 dt { font-size: 14px; color: var(--cream-sub); }
.dev .pick3 dt.k { color: var(--amber); }
.dev .pick3 dd { margin: 0; font-size: 15px; }
.dev .tbl { margin: 18px -6px 0; overflow-x: auto; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(239, 230, 214, .1); }
.dev table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.dev th, .dev td { padding: 10px 14px; text-align: right; border-top: 1px solid rgba(239, 230, 214, .08); white-space: nowrap; }
.dev thead th { border-top: 0; font: 500 11px/1.3 "IBM Plex Mono", monospace; color: var(--cream-sub); }
.dev tbody th { text-align: left; font-weight: 400; color: var(--cream-sub); }
.dev td { font-family: "IBM Plex Mono", monospace; color: var(--cream-sub); }
.dev td.win { color: var(--amber); }
.dev .diagram { margin: 18px -6px 0; padding: 18px; border-radius: 10px; overflow-x: auto; background: rgba(5, 6, 12, .55);
  box-shadow: inset 0 0 0 1px rgba(239, 230, 214, .08); font: 400 12.5px/1.6 "IBM Plex Mono", monospace; color: var(--cream-sub); }
.dev .diagram .n { color: var(--cream); } .dev .diagram .q { color: var(--amber); }
.dev .cap { margin-top: 10px; font-size: 13px; color: var(--cream-sub); }
.dev .file { margin: 22px 0 8px; font: 400 12px/1.4 "IBM Plex Mono", monospace; color: var(--muted); overflow-wrap: anywhere; }
.code + p { margin-top: 1.4em; }
.code .str { color: #b7d39a; } .code .nu { color: #e7a2a2; }
.dev .ck { margin: 14px 0 0; padding: 0; list-style: none; }
.dev .ck li { position: relative; padding-left: 22px; margin-top: 8px; font-size: 15px; }
.dev .ck li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 2px; box-shadow: inset 0 0 0 1.5px var(--amber); }
.dev .cost { margin: 0; }
.dev .cost > div { padding: 14px 0; border-top: 1px solid rgba(239, 230, 214, .1); }
.dev .cost dt { font-weight: 600; }
.dev .cost dd { margin: 4px 0 0; font-size: 15px; color: var(--cream-sub); }
/* 토스식 읽기: 장 제목은 문장, 번호는 작게 위에. 핵심 문장은 굵게 + 호박색 형광펜 */
.dev h2 { margin: 3.2em 0 .8em; font: 600 23px/1.4 "IBM Plex Sans KR", sans-serif; color: var(--cream); letter-spacing: -.02em; }
/* 장 번호: 제목과 같은 줄 앞에. 목차 번호와 같은 숫자 */
.dev h2 .n { margin-right: .55em; font: 500 .72em "IBM Plex Mono", monospace; color: var(--amber); vertical-align: .1em; font-variant-numeric: tabular-nums; }
.story h2 .n { margin-right: .5em; font: 700 .8em "Gowun Batang", serif; color: var(--stamp); font-variant-numeric: tabular-nums; }
.dev .lead { margin: 26px 0 0; font-size: 18px; line-height: 1.75; }
.dev strong { font-weight: 600; color: var(--cream); background: linear-gradient(transparent 62%, rgba(255, 181, 71, .32) 0); }
/* 장을 맺는 문장: 상자 없이 조금 크게. 첫 낱말만 호박색 */
.dev .sum { margin: 26px 0 0; font-size: 18px; line-height: 1.7; }
.dev .sum strong { background: none; color: var(--amber); margin-right: .3em; }
/* 그림: 둥이 이야기 그림 말투(docs/figure-style.md). 흰 카드 + 남색 2px + 단단한 그림자, 강조는 코랄 하나 */
.fig { margin: 22px -6px 24px; }
.fig svg { display: block; width: 100%; height: auto; }
.fig .ft { font: 22px "Song Myung", serif; fill: #1d2340; }
.fig .fs { font: 14px "Gowun Dodum", sans-serif; fill: #545a78; }
.fig .fs2 { font: 13px "Gowun Dodum", sans-serif; fill: #545a78; }
.fig .fl { font: 17px "Gowun Dodum", sans-serif; fill: #1d2340; }
.fig .fi { font: 14px "Gowun Dodum", sans-serif; fill: #1d2340; }
.fig .fc { font: 14px "Gowun Dodum", sans-serif; fill: #b8321a; }
.fig .fm text { font: 500 12px "IBM Plex Mono", monospace; fill: #545a78; }
.fig .fv { font: 500 18px "IBM Plex Mono", monospace; fill: #1d2340; }
.fig .fb { font-family: "Gowun Dodum", sans-serif; font-weight: 400; }
.fig .fmo { font-family: "IBM Plex Mono", monospace; font-weight: 500; }
.fig .fx { fill: #b8321a; }
.fig .fw { fill: #fff; }
.fig .seg rect, .fig .chip rect { fill: #fff; stroke: #1d2340; stroke-width: 2; }
.fig .grid line { stroke: #dfe1ea; stroke-width: 1; }
/* 개발(밤) 화면의 그림: 같은 그림의 밤 버전. 흰 카드 → 짙은 남색 카드, 남색 선 → 크림 선, 코랄 강조 → 수유등 호박색 */
.dev .fig { --f-ink: #efe6d6; --f-sub: #a8a093; --f-acc: #ffb547; --f-acc-t: #ffc977; --f-card: #141828; --f-el: #1c2135; }
.dev .fig [fill="#1d2340"] { fill: #04050a; }
.dev .fig [stroke="#1d2340"] { stroke: var(--f-ink); }
.dev .fig [fill="#fff"], .dev .fig .seg rect, .dev .fig .chip rect { fill: var(--f-el); }
.dev .fig .seg rect, .dev .fig .chip rect { stroke: var(--f-ink); }
.dev .fig rect[width="634"][fill="#fff"] { fill: var(--f-card); stroke: rgba(239, 230, 214, .2); }
.dev .fig [fill="#ff6f4f"] { fill: var(--f-acc); }
.dev .fig [stroke="#ff6f4f"] { stroke: var(--f-acc); }
.dev .fig [fill="#ffe3da"] { fill: rgba(255, 181, 71, .14); }
.dev .fig [fill="#fbf3d5"] { fill: rgba(239, 230, 214, .07); }
.dev .fig [stroke="#b8321a"] { stroke: var(--f-acc-t); }
.dev .fig marker path[fill] { fill: var(--f-ink); }
.dev .fig #ah3 path { fill: var(--f-acc); }
.dev .fig .pill { fill: var(--f-acc); }
.dev .fig .ft, .dev .fig .fl, .dev .fig .fi, .dev .fig .fv { fill: var(--f-ink); }
.dev .fig .fs, .dev .fig .fs2, .dev .fig .fm text { fill: var(--f-sub); }
.dev .fig .fc, .dev .fig .fx { fill: var(--f-acc-t); }
.dev .fig .fd { fill: #0a0c16; }
.dev .fig .grid line { stroke: rgba(239, 230, 214, .12); }
.story h2 { margin: 2.4em 0 .6em; font: 700 21px/1.4 "Gowun Batang", serif; letter-spacing: -.01em; }
section[data-sec] { scroll-margin-top: 84px; }

/* ───── 목차: 두 화면이 같은 장 번호를 쓴다. 넓은 화면은 왼쪽 레일, 좁은 화면은 제목 아래 ───── */
.toc { margin: 30px 0 0; }
.toc ol { margin: 0; padding: 0; list-style: none; }
.toc a { display: flex; gap: 10px; align-items: baseline; padding: 5px 0 5px 14px; text-decoration: none; border-left: 2px solid transparent;
  transition: color .2s, border-color .2s; }
.toc .toc-h { margin: 0 0 6px; }
html[data-page="story"] .toc-h { font: 400 24px/1 "Nanum Pen Script", cursive; color: var(--pen); }
html[data-page="story"] .toc a { color: var(--ink-sub); font-size: 15px; line-height: 1.5; padding: 12px 0 12px 16px; border-left-color: rgba(43, 36, 28, .12); }
html[data-page="story"] .toc a.on i { color: var(--stamp); }
html[data-page="story"] .toc a:hover { color: var(--ink); }
html[data-page="story"] .toc a.on { color: var(--ink); border-left-color: var(--stamp); }
html[data-page="dev"] .toc-h { font: 500 11px/1.3 "IBM Plex Mono", monospace; color: var(--cream-sub); }
html[data-page="dev"] .toc a { color: var(--cream-sub); font-size: 14px; line-height: 1.5; border-left-color: rgba(239, 230, 214, .1); }
html[data-page="dev"] .toc a:hover { color: var(--cream); }
html[data-page="dev"] .toc a.on { color: var(--cream); border-left-color: var(--amber); }
.toc i { flex: none; white-space: nowrap; font: normal 500 11px/1 "IBM Plex Mono", monospace; color: var(--muted); font-variant-numeric: tabular-nums; }
.toc a.on i { color: var(--amber); }
@media screen and (min-width: 1080px) {
  .toc { position: fixed; z-index: 3; top: 50%; left: max(24px, calc(50vw - 18.5rem - 260px)); width: 200px; margin: 0; transform: translateY(-50%);
    view-transition-name: made-toc; transition: opacity .3s, visibility .3s; }
  /* 푸터가 올라오면 레일은 비켜 준다 */
  .toc.away { opacity: 0; visibility: hidden; }
}
::view-transition-group(made-toc) { animation-duration: .5s; }

/* ───── 전환 공통 ───── */
::view-transition-old(root), ::view-transition-new(root) { mix-blend-mode: normal; }
::view-transition-group(made-toggle) { animation-duration: .45s; animation-timing-function: var(--ease-out); }
::view-transition-old(made-toggle) { animation: made-out .18s ease both; }
::view-transition-new(made-toggle) { animation: made-in .3s ease both; }
/* 도착한 쪽 토글 손잡이가 반대편에서 미끄러져 온다 */
html.t-dev .knob { animation: knob-r .6s var(--ease-out) both; }
html.t-story .knob { animation: knob-l .6s var(--ease-out) both; }
@keyframes knob-r { from { transform: translateX(calc(-100% + 0px)); } }
@keyframes knob-l { from { transform: translateX(100%); } }
@keyframes made-out { to { opacity: 0; } }
@keyframes made-in { from { opacity: 0; } }

/* ═════ 화면 전환: 해독과 잉크 ═════
   개발로: 수유등이 꺼지듯 종이가 어두워지고, 호박색 주사선이 위에서 아래로 새 화면을 찍어 낸다. 글자는 암호에서 풀린다(made.js)
   이야기로: 누른 자리에서 잉크 방울이 번져 종이가 스며 나오고, 손글씨가 써진다 */
html .story h1, html .dev h1 { view-transition-name: made-title; }
html::view-transition-group(made-title) { animation-duration: .95s; animation-timing-function: cubic-bezier(.65, 0, .25, 1); }
html.t-dev::view-transition-old(root) { animation: f1-dim .95s ease both; }
html.t-dev::view-transition-new(root) { animation: f1-print .95s cubic-bezier(.65, 0, .35, 1) both; }
@keyframes f1-dim { to { filter: brightness(.28) saturate(.6) blur(2px); transform: scale(.985); } }
@keyframes f1-print { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.scan { display: none; }
html.t-dev .scan { display: block; position: fixed; left: 0; right: 0; top: 0; z-index: 9; height: 140px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(255, 181, 71, .1) 70%, rgba(255, 196, 120, .55) 98%, #ffe2b0);
  animation: f1-scan .95s cubic-bezier(.65, 0, .35, 1) both; }
@keyframes f1-scan { from { transform: translateY(-100%); } 96% { opacity: 1; } to { transform: translateY(calc(100vh - 100%)); opacity: 0; } }
html.t-story::view-transition-old(root) { animation: f1-fade 1.15s ease both; }
html.t-story::view-transition-new(root) { animation: f1-ink 1.15s cubic-bezier(.55, 0, .2, 1) both;
  -webkit-mask: url("ink.svg") no-repeat; mask: url("ink.svg") no-repeat;
  -webkit-mask-size: var(--ms) var(--ms); mask-size: var(--ms) var(--ms);
  -webkit-mask-position: calc(var(--ox) - var(--ms) / 2) calc(var(--oy) - var(--ms) / 2);
  mask-position: calc(var(--ox) - var(--ms) / 2) calc(var(--oy) - var(--ms) / 2); }
@keyframes f1-ink { from { --ms: 0px; } to { --ms: 360vmax; } }
@keyframes f1-fade { 30% { filter: none; } to { filter: blur(4px) brightness(.6); transform: scale(.98); } }
html.t-story .hand { animation: f1-write 1s .7s cubic-bezier(.45, 0, .2, 1) both; }
@keyframes f1-write { from { clip-path: inset(-20% 100% -20% 0); } to { clip-path: inset(-20% -2% -20% 0); } }
html.t-story .b, html.t-story .print { animation: f1-dry .9s calc(.55s + var(--i, 0) * .08s) var(--ease-out) both; }
@keyframes f1-dry { from { opacity: 0; filter: blur(5px); } }

/* ───── 움직임 줄이기: 공간 이동은 빼고 짧은 크로스페이드만 ───── */
@media (prefers-reduced-motion: reduce) {
  html::view-transition-old(root) { animation: made-out .22s ease both !important; -webkit-mask: none !important; mask: none !important; }
  html::view-transition-new(root) { animation: made-in .22s ease both !important; -webkit-mask: none !important; mask: none !important; }
  html::view-transition-group(*) { animation-duration: .22s !important; }
  html .knob, html .scan, html .crt, html .hand, html .b, html .print, html .glow, html .lamp .halo, html .clock i { animation: none !important; }
  .glow, .lamp *, html[data-page="dev"] body { transition: none; }
}

@media screen and (max-width: 520px) {
  .dev .who, .dev .pick3 { grid-template-columns: 1fr; }
  .lamp { top: 88px; right: 12px; width: 38px; height: 44px; }
  .dev h2 span[data-decode] { font-size: 21px; }
}
