:root {
  --bg: #0f1110;
  --bg2: #171a18;
  --ink: #ece8e1;
  --mute: #a19d95;
  --line: rgba(236, 232, 225, .14);
  --accent: #eaa25e;
  --accent2: #8fb3d1;
  --cut: #cc4d36;
  --card: rgba(15, 17, 16, .74);
  --sans: "Pretendard Variable", Pretendard, system-ui, sans-serif;
  --serif: "Instrument Serif", "Pretendard Variable", serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --gut: clamp(16px, 4vw, 56px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); color-scheme: dark; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.65 var(--sans); letter-spacing: -.005em; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
h2 { font-size: clamp(28px, 3.4vw, 44px); }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; color: var(--accent); }
.eyebrow { font: 500 12px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--mute); margin-bottom: 14px; }

/* ── top bar ─────────────────────────── */
.bar { position: fixed; inset: 0 0 auto; z-index: 40; display: flex; align-items: center; justify-content: space-between; padding: 14px var(--gut); mix-blend-mode: difference; color: #fff; }
.bar__name { text-decoration: none; font-weight: 700; font-size: 15px; }
.bar__name span { font: 400 12px var(--mono); opacity: .7; margin-left: 8px; }
.bar__nav { display: flex; gap: 22px; font: 500 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.bar__nav a { text-decoration: none; opacity: .75; }
.bar__nav a:hover { opacity: 1; }
.bar__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; }
.bar__progress i { display: block; height: 100%; background: #fff; transform-origin: 0 50%; transform: scaleX(0); }
@media (max-width: 720px) { .bar__nav { display: none; } }

/* ── 3D story ────────────────────────── */
.story { position: relative; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: #1c241b; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage__hero { position: absolute; inset: 0; pointer-events: none; }
.stage__hero img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.stage__hud { position: absolute; right: var(--gut); bottom: 20px; display: flex; gap: 16px; font: 500 11px var(--mono); letter-spacing: .1em; color: rgba(255,255,255,.8); text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.stage__hud span:first-child { padding-left: 14px; position: relative; }
.stage__hud span:first-child::before { content: ""; position: absolute; left: 0; top: 50%; width: 7px; height: 7px; margin-top: -4px; border-radius: 50%; background: var(--accent); }
.loader { position: absolute; left: var(--gut); bottom: 20px; font: 500 11px var(--mono); letter-spacing: .08em; color: rgba(255,255,255,.75); display: flex; gap: 10px; transition: opacity .6s; }
.loader.done { opacity: 0; }

.labels { position: absolute; inset: 0; pointer-events: none; }
.lab { position: absolute; left: 0; top: 0; white-space: nowrap; font: 600 13px var(--sans); color: #fff; opacity: 0; will-change: transform, opacity; }
.lab span { display: inline-block; padding: 5px 10px 5px 12px; background: rgba(10,12,11,.72); border-left: 2px solid var(--accent); backdrop-filter: blur(6px); transform: translate(-50%, -130%); }
.lab span small { display: block; font: 400 11px var(--mono); color: var(--mute); letter-spacing: .04em; }
.lab--floor span { border-color: var(--accent2); transform: translate(-100%, -50%); }

.steps { position: relative; margin-top: -100vh; margin-top: -100svh; pointer-events: none; }
.step { height: 100vh; height: 100svh; display: flex; align-items: center; padding: 0 var(--gut); }
.step--hero { align-items: flex-end; padding-bottom: 12vh; }
.hero { max-width: 760px; text-shadow: 0 2px 30px rgba(0,0,0,.45); }
.hero h1 { font-size: clamp(56px, 9vw, 132px); line-height: .95; margin-bottom: 18px; }
.hero__sub { font-size: clamp(17px, 1.6vw, 22px); font-weight: 500; margin-bottom: 26px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 10px 32px; margin-bottom: 28px; }
.hero__meta dt { font: 500 11px var(--mono); letter-spacing: .1em; color: rgba(255,255,255,.65); text-transform: uppercase; }
.hero__meta dd { font-size: 14px; }
.hero__hint { font-size: 13px; color: rgba(255,255,255,.85); display: flex; align-items: center; gap: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(234,162,94,.7); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(234,162,94,0); } 100% { box-shadow: 0 0 0 0 rgba(234,162,94,0); } }

.card { pointer-events: auto; width: min(400px, 100%); padding: 26px 28px; background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.card--wide { width: min(460px, 100%); }
.card__no { font: 500 12px var(--mono); letter-spacing: .1em; color: var(--accent); margin-bottom: 10px; }
.card h2 { font-size: clamp(24px, 2.4vw, 32px); margin-bottom: 14px; }
.card p { font-size: 15px; color: #d9d5ce; }
.card p + p { margin-top: 10px; }
.card__note { font-size: 13px !important; color: var(--mute) !important; margin-top: 14px !important; }
.floors { list-style: none; display: grid; gap: 8px; }
.floors li { display: grid; grid-template-columns: 38px 1fr; font-size: 14px; color: #d9d5ce; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.floors b { font: 500 13px var(--mono); color: var(--accent2); }
.ctl { display: grid; gap: 6px; margin-top: 16px; font: 500 12px var(--mono); color: var(--mute); }
.ctl span { color: var(--ink); font-size: 22px; font-family: var(--mono); }
.ctl__k { font: 500 12px var(--mono); color: var(--mute); letter-spacing: .04em; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; background: rgba(255,255,255,.25); }
input[type=range]::-moz-range-track { height: 2px; background: rgba(255,255,255,.25); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); margin-top: -7px; border: 0; }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 0; }
input[type=range]:focus-visible { outline: 1px dashed var(--accent); outline-offset: 4px; }
.sunctl { margin-top: 6px; }
.seg { display: flex; border: 1px solid var(--line); margin-top: 14px; }
.seg button { flex: 1; background: none; border: 0; padding: 8px 0; font-size: 13px; color: var(--mute); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--ink); color: var(--bg); font-weight: 600; }
.play { margin-top: 10px; background: none; border: 1px solid var(--line); padding: 7px 12px; font: 500 12px var(--mono); }
.play.on { border-color: var(--accent); color: var(--accent); }
.sunread { display: grid; grid-template-columns: repeat(4, auto); gap: 4px 14px; margin-top: 14px !important; font: 400 12px var(--mono) !important; color: var(--mute) !important; }
.sunread b { color: var(--ink); font-weight: 500; }
.cta { margin-top: 18px; background: var(--accent); color: #1b1309; border: 0; padding: 12px 18px; font-weight: 700; font-size: 15px; }
.cta:hover { filter: brightness(1.08); }

/* view tools (zoom / reset / fold cards / fullscreen) */
#gl { cursor: grab; touch-action: pan-y; }
#gl.drag { cursor: grabbing; }
.viewtools { position: absolute; right: var(--gut); top: 50%; transform: translateY(-50%); z-index: 3; display: flex; flex-direction: column; gap: 6px; transition: opacity .4s; }
.viewtools button { width: 42px; height: 42px; display: grid; place-items: center; background: rgba(12,14,13,.74); border: 1px solid var(--line); font-size: 19px; line-height: 1; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.viewtools button:hover, .viewtools button:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.viewtools button[aria-pressed=true] { background: var(--ink); color: var(--bg); }
.viewtools__hint { margin: 8px auto 0; writing-mode: vertical-rl; font: 500 10px var(--mono); letter-spacing: .12em; color: rgba(255,255,255,.72); text-shadow: 0 1px 6px rgba(0,0,0,.6); }
body.exploring .viewtools { display: none; }
.card { position: relative; }
.card__min { position: absolute; top: 14px; right: 14px; background: none; border: 1px solid var(--line); padding: 3px 9px; font: 500 11px var(--mono); color: var(--mute); }
.card__min:hover { color: var(--ink); border-color: var(--ink); }
body.cards-min .card > :not(.card__no):not(h2):not(.card__min) { display: none; }
body.cards-min .card { width: auto; max-width: 360px; padding: 14px 92px 14px 18px; }
body.cards-min .card h2 { font-size: 18px; margin: 0; }
body.cards-min .card__no { margin-bottom: 4px; }
@media (max-width: 720px) {
  .viewtools { top: 64px; transform: none; gap: 4px; }
  .viewtools button { width: 38px; height: 38px; }
  .viewtools__hint { display: none; }
}

@media (max-width: 720px) {
  .step:not(.step--hero) { align-items: flex-end; padding-bottom: 5vh; }
  .card { padding: 16px 18px; }
  .card h2 { font-size: 21px; margin-bottom: 8px; }
  .card p { font-size: 13.5px; }
  .card__note { display: none; }
  .floors li { font-size: 13px; padding-bottom: 5px; }
  .sunread { grid-template-columns: repeat(2, auto); }
}

/* explore (free orbit) mode */
body.exploring { overflow: hidden; }
body.exploring .stage { position: fixed; inset: 0; z-index: 60; }
body.exploring .steps, body.exploring .bar { visibility: hidden; }
.explore-ui { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; padding: 10px; background: rgba(12,14,13,.82); border: 1px solid var(--line); backdrop-filter: blur(12px); z-index: 2; max-width: calc(100% - 32px); }
.explore-ui[hidden] { display: none; }
.explore-ui__group { display: flex; border: 1px solid var(--line); }
.explore-ui__group button { background: none; border: 0; padding: 8px 14px; font-size: 13px; }
.explore-ui__group button + button { border-left: 1px solid var(--line); }
.explore-ui__group button.on { background: var(--ink); color: var(--bg); font-weight: 600; }
.explore-ui input[type=range] { width: 180px; }
.explore-ui__render { background: none; border: 1px solid var(--accent); color: var(--accent); padding: 8px 14px; font-size: 13px; font-weight: 600; }
.explore-ui__render.on { background: var(--accent); color: #1b1309; }
.pt-badge { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); z-index: 3; display: flex; align-items: baseline; gap: 10px; padding: 8px 14px; background: rgba(12,14,13,.8); border: 1px solid var(--line); font: 500 11px var(--mono); letter-spacing: .08em; }
.pt-badge[hidden] { display: none; }
.pt-badge span { color: var(--accent); }
.pt-badge b { font-weight: 500; }
.pt-badge small { color: var(--mute); letter-spacing: 0; font-family: var(--sans); }
.explore-ui__close { background: none; border: 1px solid var(--line); padding: 8px 12px; font-size: 13px; }
kbd { font: 400 10px var(--mono); opacity: .6; margin-left: 4px; }
body.exploring .stage__hud { bottom: 86px; }

/* ── time of day ─────────────────────── */
.tod { position: relative; height: 520vh; }
.tod__stick { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.tod__frames, .tod__frames img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tod__frames img { opacity: 0; }
.tod__frames img:first-child { opacity: 1; }
.tod__panel { position: absolute; left: var(--gut); top: 50%; transform: translateY(-50%); width: min(360px, calc(100% - 2 * var(--gut))); padding: 26px 28px; background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.tod__panel h2 { font-size: clamp(26px, 2.6vw, 34px); margin-bottom: 14px; }
.tod__clock { font: 400 clamp(48px, 5vw, 68px)/1 var(--serif); color: var(--accent); }
.tod__read { font: 400 12px var(--mono); color: var(--mute); margin: 8px 0 14px; }
.tod__read b { color: var(--ink); font-weight: 500; }
.tod__arc { width: 100%; height: auto; }
.tod__arc .hz { stroke: rgba(255,255,255,.3); stroke-width: 1; stroke-dasharray: 3 4; }
.tod__arc .path { fill: none; stroke: rgba(234,162,94,.55); stroke-width: 1.5; }
.tod__arc .sun { fill: var(--accent); }
.tod__arc text { font: 400 10px var(--mono); fill: var(--mute); }
.tod__ticks { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); margin-top: 10px; border-top: 1px solid var(--line); }
.tod__ticks li { font: 400 11px var(--mono); color: var(--mute); padding-top: 6px; cursor: pointer; text-align: center; }
.tod__ticks li.on { color: var(--ink); box-shadow: inset 0 2px 0 var(--accent); }
@media (max-width: 720px) {
  .tod__panel { top: auto; bottom: 16px; transform: none; padding: 18px; }
  .tod__panel h2, .tod__panel .card__note { display: none; }
  .tod__clock { font-size: 44px; }
}

/* ── compare / axon ──────────────────── */
.pair { padding: 18vh var(--gut) 10vh; max-width: 1440px; margin: 0 auto; }
.pair__head { max-width: 640px; margin-bottom: 32px; }
.pair__head p:last-child { color: var(--mute); margin-top: 10px; }
.compare { position: relative; aspect-ratio: 16 / 9; overflow: hidden; user-select: none; touch-action: pan-y; background: #111; }
.compare > img, .compare__top img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare__top { position: absolute; inset: 0; clip-path: inset(0 50% 0 0); }
.compare__line { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: #fff; pointer-events: none; }
.compare__line i { position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.35); backdrop-filter: blur(4px); }
.compare__line i::before { content: "‹ ›"; position: absolute; inset: 0; display: grid; place-items: center; font: 600 15px var(--mono); color: #fff; }
.compare__tag { position: absolute; top: 16px; font: 500 12px var(--mono); padding: 4px 8px; background: rgba(0,0,0,.5); }
.compare__tag.l { left: 16px; } .compare__tag.r { right: 16px; }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }

.axon { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(24px, 4vw, 64px); align-items: center; padding: 10vh var(--gut) 18vh; max-width: 1440px; margin: 0 auto; }
.axon figure { background: #eaeaeb; }
.axon__text p:last-child { color: #cfcac2; margin-top: 12px; }
@media (max-width: 900px) { .axon { grid-template-columns: 1fr; } }

/* ── horizontal gallery ──────────────── */
.hscroll { position: relative; height: 100vh; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; background: var(--bg2); }
.hscroll__head { padding: 0 var(--gut); margin-bottom: 28px; }
.hscroll__track { display: flex; gap: 24px; padding: 0 var(--gut); will-change: transform; }
.hscroll__track figure { flex: none; width: clamp(280px, 56vw, 860px); }
.hscroll__track img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.hscroll__track figcaption { margin-top: 12px; font-size: 14px; color: var(--mute); }
.hscroll__track figcaption b { display: block; color: var(--ink); font-size: 16px; }

/* ── drawings ────────────────────────── */
.drawings { padding: 18vh var(--gut); max-width: 1440px; margin: 0 auto; }
.tabs { display: inline-flex; border: 1px solid var(--line); margin: 24px 0 18px; }
.tabs button { background: none; border: 0; padding: 9px 18px; font: 500 13px var(--mono); color: var(--mute); }
.tabs button + button { border-left: 1px solid var(--line); }
.tabs button[aria-selected=true] { background: var(--ink); color: var(--bg); }
.sheet { background: #f4f2ee; padding: clamp(12px, 3vw, 40px); }
.sheet img { width: 100%; height: auto; aspect-ratio: 5 / 2; object-fit: contain; }
.sheet p { color: #4b4740; font-size: 14px; margin-top: 18px; }

/* ── process ─────────────────────────── */
.process { padding: 16vh var(--gut) 12vh; border-top: 1px solid var(--line); max-width: 1440px; margin: 0 auto; }
.process__head { max-width: 720px; margin-bottom: 48px; }
.process__head p:last-child { color: #cfcac2; margin-top: 12px; }
.pipe { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; counter-reset: s; }
.pipe li { display: grid; gap: 8px; align-content: start; position: relative; }
.pipe li:not(:last-child)::after { content: "→"; position: absolute; right: -14px; top: 22%; font: 400 14px var(--mono); color: var(--mute); }
.pipe figure { aspect-ratio: 4 / 3; background: #f1efea; overflow: hidden; }
.pipe figure img { width: 100%; height: 100%; object-fit: cover; }
.pipe__code { display: grid; place-items: center; background: #1d211f !important; border: 1px solid var(--line); }
.pipe__code code { font: 400 13px/1.7 var(--mono); color: var(--accent); text-align: center; }
.pipe b { font-size: 15px; }
.pipe span { font-size: 13px; color: var(--mute); line-height: 1.55; }
@media (max-width: 1000px) { .pipe { grid-template-columns: repeat(2, 1fr); } .pipe li::after { display: none; } }
.credits { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 32px; margin-top: 72px; padding-top: 32px; border-top: 1px solid var(--line); }
.credits h3 { font-size: 14px; margin-bottom: 12px; }
.credits ul { list-style: none; display: grid; gap: 6px; font-size: 14px; color: var(--mute); }
.credits a { color: var(--ink); text-decoration-color: rgba(236,232,225,.35); text-underline-offset: 3px; }
.credits__honest p { font-size: 14px; color: var(--mute); }
@media (max-width: 900px) { .credits { grid-template-columns: 1fr; } }

.foot { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding: 56px var(--gut) 64px; border-top: 1px solid var(--line); }
.foot__big { font-size: 28px; font-weight: 700; }
.foot img { background: #fff; padding: 6px; }
.foot__small { flex-basis: 100%; font: 400 11px var(--mono); color: var(--mute); }

[data-reveal] { opacity: 0; transform: translateY(24px); }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1; transform: none; } .dot { animation: none; } }
