/* Editorial system: story, instruments, and navigation share one responsive scale. */
:root {
  --font-body: "Inter", "Pretendard Variable", Pretendard, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Inter", "Pretendard Variable", Pretendard, sans-serif;
  --font-data: "IBM Plex Mono", "Pretendard Variable", monospace;
  --ink: #f3f6f8; --dim: #b6c2cd; --faint: #7e909e; --accent: #a6e4ee;
  --body: #edc8aa; --in: #e4dfc4; --out: #a6d9ed;
  --gutter: clamp(24px, 5.6vw, 40px);   /* 화면 좌우 여백: 고도계·본문·조작 막대가 이 선에 맞춘다 */
  --reader-bottom: max(20px, env(safe-area-inset-bottom));
  /* 계기 재질 (고도계·조작 막대·언어 스위치가 함께 쓴다) */
  --font-gauge: "Barlow Condensed", "Pretendard Variable", Pretendard, sans-serif;
  --cream: #ece6da; --amber: #e9c79a; --engrave: #b9c0c7;
  --screw: #9aa0a7 0 1.2px, #5c6268 1.6px, #15181b 2.2px, transparent 2.8px;
  --metal: repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px), linear-gradient(172deg, #30363c 0%, #1f2428 46%, #15191c 100%);
  --plate: radial-gradient(circle 2.8px at 6px 6px, var(--screw)), radial-gradient(circle 2.8px at calc(100% - 6px) 6px, var(--screw)),
    radial-gradient(circle 2.8px at 6px calc(100% - 6px), var(--screw)), radial-gradient(circle 2.8px at calc(100% - 6px) calc(100% - 6px), var(--screw)), var(--metal);
  --plate-shadow: inset 0 1px 0 rgba(255,255,255,.14), inset 0 -1px 0 rgba(0,0,0,.7), inset 1px 0 0 rgba(255,255,255,.05), 0 1px 0 rgba(0,0,0,.6), 0 10px 26px rgba(0,0,0,.55);
  --well-shadow: inset 0 3px 7px rgba(0,0,0,.95), inset 0 -2px 3px rgba(0,0,0,.7), 0 1px 0 rgba(255,255,255,.1), 0 -1px 0 rgba(0,0,0,.6);
  --key: linear-gradient(180deg, #3a4046 0%, #2a2f34 55%, #23272b 100%);
  --key-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 -1px 0 rgba(0,0,0,.5), 0 1px 0 rgba(0,0,0,.7), 0 2px 4px rgba(0,0,0,.4);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: #05080c; color-scheme: dark; }
body { color: var(--ink); font: 400 23px/1.65 var(--font-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; word-break: keep-all; }
button, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
::selection { color: #071117; background: var(--accent); }
canvas#gl, canvas#mid, canvas#plate, canvas#fx { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; pointer-events: none; }
canvas#gl { z-index: 0; } canvas#mid { z-index: 1; } canvas#plate { z-index: 2; } canvas#fx { z-index: 3; }
#doors{position:fixed;inset:0;z-index:3;pointer-events:none;overflow:hidden;opacity:0;visibility:hidden}
#doors i{position:absolute;top:0;bottom:0;width:50.1%;will-change:transform;
  background:
    linear-gradient(112deg, transparent 20%, #e2f4ff12 35%, transparent 45%),
    linear-gradient(180deg,#16314130 0,#13273118 50%,#14212b30 100%)}
#doors i::before{content:"";position:absolute;inset:6% 10% 9%;border:1px solid rgba(255,255,255,.07);border-radius:3px;
  background:linear-gradient(180deg,rgba(255,255,255,.035),rgba(255,255,255,0) 40%);box-shadow:inset 0 0 60px rgba(0,0,0,.28)}
#doors .l{left:0;box-shadow:inset -2px 0 0 rgba(255,255,255,.34),inset -22px 0 30px -18px rgba(0,0,0,.7)}
#doors .r{right:0;box-shadow:inset 2px 0 0 rgba(0,0,0,.92),inset 22px 0 30px -18px rgba(0,0,0,.7)}
#doors i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 75%, #eac08b18), linear-gradient(0deg, #c99a6524, transparent 55%); }

#ruler{position:fixed;z-index:6;right:158px;top:44px;bottom:124px;width:2px;pointer-events:none}
/* 게이지는 엘리베이터 통로처럼 그린다: 두 줄의 레일, 층마다 놓인 턱, 줄에 매달려 내려가는 객차 */
#ruler .track{position:absolute;top:0;bottom:0;left:-10px;right:-10px;border:solid rgba(255,255,255,.3);border-width:0 1px;background:rgba(255,255,255,.035)}
#ruler .fill{position:absolute;left:0;top:0;width:100%;height:0;background:rgba(255,255,255,.9)}
#ruler .tk{position:absolute;left:1px;width:0;height:0}
#ruler .tk::before{content:"";position:absolute;left:-15px;top:-1px;width:30px;height:2px;border-radius:1px;
  background:rgba(255,255,255,.5);transition:background .4s}
#ruler .tk.past::before{background:#fff}
#ruler .tk span{position:absolute;right:26px;top:-14px;white-space:nowrap;line-height:28px;opacity:0;
  transform-origin:100% 50%;transition:transform .45s ease,opacity .45s ease;
  text-shadow:0 1px 8px #000,0 0 3px #000,0 0 1px #000}
#ruler .tk b{font-size:14px;font-weight:600;letter-spacing:-.01em;color:#fff}
#ruler .tk.on span{opacity:1;transform:scale(1)}
#ruler .mk{position:absolute;left:1px;top:0;width:0;height:0}
/* 객차: 가운데 문 틈이 있는 흰 상자 */
#ruler .mk::before{content:"";position:absolute;left:-8px;top:-13px;width:16px;height:26px;border-radius:3px;
  background:linear-gradient(90deg,#fff calc(50% - .75px),#0b0d10 calc(50% - .75px) calc(50% + .75px),#fff calc(50% + .75px));
  box-shadow:0 0 0 1px rgba(11,13,16,.55),0 0 16px rgba(255,255,255,.5)}
#ruler .pill{position:absolute;left:26px;top:-17px;white-space:nowrap;font-variant-numeric:tabular-nums;
  text-shadow:0 1px 8px #000,0 0 3px #000,0 0 1px #000}
#ruler .pill b{display:block;font-size:15px;line-height:24px;font-weight:600;letter-spacing:-.01em}
/* 가는 방향 표시 (엘리베이터 층 표시기처럼) */
#ruler .pill b::before{content:"";display:inline-block;margin-right:8px;vertical-align:.12em;
  border:solid transparent;border-width:9px 5.5px 0;border-top-color:#fff}
body.ascending #ruler .pill b::before{border-width:0 5.5px 9px;border-top-color:transparent;border-bottom-color:#fff}
#ruler .pill i{display:block;font-style:normal;font-size:12px;line-height:18px;color:#c8ccd4}
/* 언어를 정하기 전에는 코드가 채우는 글자를 감춘다 (한국어 화면에서 영어가 잠깐 보이지 않게) */
.i18n-wait #hud .instrument-label, .i18n-wait #reader-nav, .i18n-wait #ruler { visibility: hidden; }


#scrim { position: fixed; inset: 0; z-index: 4; pointer-events: none;
  background: radial-gradient(ellipse at 0 100%, #03070cf0 0, #03070cb8 40%, #03070c40 62%, transparent 76%),
    linear-gradient(180deg, #03070ca8, transparent 24%), linear-gradient(0deg, #03070c99, transparent 18%); }
/* 넓은 화면: 오른쪽 게이지가 밝은 구름·도시 위에서도 읽히게 그 뒤만 조금 어둡게 한다 */
@media (min-width: 901px) {
  /* 글 뒤 어둠은 줄(화면 폭의 60%)에 닿기 전에 끝낸다. 줄을 가로지르면 줄을 경계로 왼쪽만 어두워 보이고 창이 탁해진다 */
  #scrim { background: radial-gradient(ellipse 57% 105% at 0 100%, #03070cf0 0, #03070cc4 42%, #03070c66 70%, #03070c1c 88%, transparent 100%),
    linear-gradient(270deg, #03070c8c, #03070c59 11%, transparent 24%),
    linear-gradient(180deg, #03070ca8, transparent 24%), linear-gradient(0deg, #03070c99, transparent 18%); }
  /* 도착 홀은 화면 전체가 밝다: 글이 놓이는 왼쪽을 따로 가라앉힌다 */
  body.arrived #scrim { background: linear-gradient(90deg, #03070ce0, #03070cb0 26%, #03070c40 46%, transparent 60%),
    linear-gradient(180deg, #03070ca8, transparent 24%), linear-gradient(0deg, #03070cb0, transparent 22%); }
}
#dim { position: fixed; inset: 0; z-index: 4; pointer-events: none; background: #05080ce8; opacity: 0; visibility: hidden; transition: opacity .5s, visibility .5s; }
body.notes #dim { opacity: 1; visibility: visible; }
main { position: relative; z-index: 5; }
main section { height: calc(var(--n, 3) * 105vh); }
.cap { position: fixed; left: var(--gutter); bottom: 124px; width: min(620px, calc(100vw - 2 * var(--gutter) - 220px));
  opacity: 0; transform: translateY(16px); transition: opacity .35s ease, transform .45s ease;
  pointer-events: none; padding-bottom: 8px; text-shadow: 0 1px 2px #03070ccc, 0 2px 18px #03070cc0, 0 0 34px #03070c99, 0 0 70px #03070c66; }
.cap.on { opacity: 1; transform: none; pointer-events: auto; max-height: calc(100dvh - 340px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #7e909e transparent; }
.cap > [lang] { display: contents; }
html[lang="en"] .cap > [lang="ko"], html[lang="ko"] .cap > [lang="en"] { display: none; }
.cap p { max-width: 54ch; line-height: 1.65; text-wrap: pretty; }
.cap p + p { margin-top: .85em; }
.cap h1, .cap h2, #science-notes h2, #science-notes h3 { font-family: var(--font-display); font-weight: 600; }
.cap h1 { font-size: clamp(48px, 5.2vw, 88px); line-height: 1.06; letter-spacing: -.055em; text-wrap: balance; }
/* 제목은 글 상자 폭을 넘지 않는다. 상자가 넘친 내용을 잘라 스크롤시키므로, 넘치면 잘리지 말고 줄을 바꾼다 */
.cap:has(h1) { container-type: inline-size; }
.cap h1, .cap h2 { max-width: 100%; overflow-wrap: break-word; }
/* 영문 표지 제목: 폭이 좁은 글꼴. 좁은 글꼴은 자간을 조이지 않는다.
   글자 크기는 화면폭이 아니라 글 상자 폭(cqi)에 묶는다. 가장 긴 줄이 글자 크기의 약 9.8배라 9.4cqi면 상자의 92%를 채운다 */
.cap h1.cover-title { font-family: "Barlow Condensed", var(--font-display); font-size: clamp(60px, 7.6vw, 128px); font-size: clamp(40px, 9.4cqi, 128px); line-height: .98; letter-spacing: -.005em; }
@media (min-width: 901px) { html[lang="en"] .cap:has(h1) { width: min(1240px, calc(100vw - 2 * var(--gutter) - 120px)); } }
/* 영문 표지 설명문: 글꼴은 그대로, 크기만 키운다 */
.cap h1.cover-title ~ .lead { font-size: clamp(24px, 1.95vw, 30px); line-height: 1.45; max-width: 48ch; }
.cap h1.cover-title ~ .premise { font-size: clamp(18px, 1.4vw, 21px); line-height: 1.6; max-width: 70ch; }
@media (max-width: 600px) {
  .cap h1.cover-title { font-size: 46px; }
  .cap h1.cover-title ~ .lead { font-size: 19px; }
  .cap h1.cover-title ~ .premise { font-size: 15px; }
}
.cap h2 { font-size: clamp(44px, 4.5vw, 72px); line-height: 1.08; letter-spacing: -.045em; margin-top: 18px; text-wrap: balance; }
.cap:has(h1) { width: min(980px, calc(100vw - 2 * var(--gutter) - 160px)); }
.cap:has(h1).on { max-height: calc(100dvh - 240px); }
.cap:has(h2) { bottom: 136px; }
.cap .lead { font-size: 23px; line-height: 1.55; margin-top: 24px; max-width: 56ch; }
.cap .premise { font-size: 17px; line-height: 1.65; color: var(--dim); max-width: 74ch; margin-top: 18px; }
.cap .tag { display: block; font: 400 13px/1.65 var(--font-data); color: var(--dim); letter-spacing: .015em; }
.cap .lb { display: block; margin-bottom: 16px; font-size: 13px; line-height: 1.5; font-weight: 600; letter-spacing: .12em; }
html[lang="en"] .cap .lb { text-transform: uppercase; }
.cap .lb .u { text-transform: none; }
.lb.b { color: var(--body); } .lb.i { color: var(--in); } .lb.o { color: var(--out); } .lb.s { color: var(--dim); }
.cap .why { margin-top: 1em; font-size: 19px; color: #dbe4eb; }
.cap.s { font-size: 21px; }
/* 글 위의 머리말: 구간 번호와 이름. 본문과 같은 글꼴로 작게 적는다 */
.chapter-marker { margin-bottom: 14px; color: var(--dim); font: 500 14px/1.5 var(--font-body); }
.chapter-marker b { margin-right: .7em; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
/* Keep the instruments subordinate to the landscape and the story. */
#hud { position: fixed; z-index: 6; left: var(--gutter); top: 30px; font-variant-numeric: tabular-nums; text-shadow: 0 1px 12px #000a; transition: opacity .3s; }
.instrument-label { display: block; margin-bottom: 8px; color: #d3dce4; font: 600 16px/1.4 var(--font-body); text-shadow: 0 1px 2px #03070ce0, 0 1px 12px #000c; }
/* 고도 계기: 선실 벽에 나사로 고정된 금속 판, 움푹 들어간 창, 그 안에서 도는 숫자 드럼 */
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gauge { --cell: 60px; position: relative; display: inline-grid; grid-template-columns: auto auto; align-items: end; column-gap: 9px; padding: 12px 12px 13px 12px; border-radius: 7px;
  background: var(--plate); box-shadow: var(--plate-shadow); }
.gauge .instrument-label { grid-column: 1 / -1; margin: 0 0 8px 2px; color: var(--engrave); font: 600 12.5px/1.2 var(--font-body); letter-spacing: .06em; text-shadow: 0 -1px 0 rgba(0,0,0,.7); }
.gauge-window { position: relative; padding: 3px 4px; border-radius: 4px; background: #050607; overflow: hidden; box-shadow: var(--well-shadow); }
/* 유리: 위쪽에 비스듬한 반사, 드럼의 위아래는 둥근 면이라 어둡다 */
.gauge-window::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.82) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 70%, rgba(0,0,0,.82) 100%),
    linear-gradient(162deg, rgba(255,255,255,.13) 0%, rgba(255,255,255,.04) 34%, rgba(255,255,255,0) 35%); }
.drums { display: flex; align-items: stretch; gap: 2px; height: var(--cell); font: 600 var(--cell)/1 "Barlow Condensed", var(--font-display); font-variant-numeric: tabular-nums; }
.drums .d { position: relative; font-style: normal; width: .56em; height: 1em; overflow: hidden; text-align: center; color: #ece6da; border-radius: 1px;
  background: linear-gradient(180deg, #08090a 0%, #1c2024 26%, #262b30 50%, #1c2024 74%, #08090a 100%); }
.drums .d b { display: block; font-weight: inherit; line-height: 1em; will-change: transform; }
.drums .d.tenth { color: #e9c79a; background: linear-gradient(180deg, #0a0807 0%, #221c17 26%, #2c241d 50%, #221c17 74%, #0a0807 100%); }
.drums .d.lead b { opacity: .26; }
.drums .d.spin b { filter: blur(.06em); opacity: .55; }
.drums.flip .d b { transition: transform .7s cubic-bezier(.3,.1,.2,1); }
.drums .gap { width: .1em; }
.drums .dot { align-self: flex-end; width: .1em; height: .1em; margin: 0 .04em .12em; border-radius: 50%; background: #ece6da; opacity: .8; }
.gauge-unit { align-self: end; margin-bottom: 4px; color: #cfc8bb; font: 600 22px/1 "Barlow Condensed", var(--font-body); text-shadow: 0 -1px 0 rgba(0,0,0,.7); }
.gauge-unit.flip { animation: unit-flip .7s ease; }
@keyframes unit-flip { 0% { transform: rotateX(0); } 45% { transform: rotateX(90deg); opacity: .2; } 100% { transform: rotateX(0); } }
#hud p { line-height: 1.6; color: #d3dce4; text-shadow: 0 1px 2px #03070ce0, 0 1px 12px #000c; font-family: "Barlow Condensed", var(--font-body); font-size: 16px; letter-spacing: .01em; }
#hud p:first-of-type { margin-top: 12px; color: var(--ink); }
#hud p:last-of-type { color: #c2ccd6; }
body.cover #hud p { display: none; }
body.cover #ruler .tk span, body.cover #ruler .pill { visibility: hidden; }
body.cover #ruler { opacity: .35; }
#lang { display: flex; gap: 2px; margin-left: 2px; padding-left: 8px; border-left: 1px solid rgba(0,0,0,.6); box-shadow: inset 1px 0 0 rgba(255,255,255,.07); }
#reader-nav #lang button { min-width: 42px; padding: 0 10px; font-weight: 600; color: var(--engrave); }
#reader-nav #lang button[aria-pressed="true"] { background: #050607; box-shadow: var(--well-shadow); color: var(--amber); }
#lang .short { display: none; }
#callout { position: fixed; z-index: 6; top: 205px; left: var(--gutter); max-width: calc(100vw - 2 * var(--gutter)); opacity: 0; pointer-events: none; text-shadow: 0 2px 12px #000; }
#callout b { display: block; color: var(--accent); font: 500 18px/1.3 var(--font-display); }
#callout i { display: block; margin-top: 4px; color: var(--dim); font: normal 12px/1.5 var(--font-data); }
body.notes #hud, body.notes #callout { opacity: 0 !important; }
#up, .up2 { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 12px 20px; border: 1px solid #ffffff50; border-radius: 6px; background: #10202bb3; backdrop-filter: blur(16px); color: var(--ink); font-size: 15px; font-weight: 500; text-decoration: none; transition: background .2s, opacity .3s, transform .3s; }
#up { position: fixed; z-index: 7; left: var(--gutter); bottom: 104px; opacity: 0; transform: translateY(8px); pointer-events: none; }
#up.on { opacity: 1; transform: none; pointer-events: auto; }
#up:hover, .up2:hover { background: var(--ink); color: #071019; }
#up svg, .up2 svg { width: 18px; height: 18px; flex: none; }
/* 마지막 글만 아래의 '되돌아가기' 버튼 자리를 비워 둔다 */
section[data-look] .cap:last-child { bottom: 184px; }
section[data-look] .arrival-title { bottom: 132px; width: min(620px, calc(100vw - 2 * var(--gutter))); max-height: calc(100dvh - 280px); }
.arrival-title h2 { font-size: clamp(44px, 5.2vw, 76px); }
.arrival-title .arrival-line { font-size: 18px; margin-top: 22px; color: #e4ded7; }
.journey-stats { display: flex; gap: 32px; margin-top: 28px; padding-top: 20px; border-top: 1px solid #e9c69a55; font-size: 12px; color: #d0c4b8; }
.journey-stats b { display: block; font: 500 24px/1.4 var(--font-data); color: #fff2dd; margin-bottom: 3px; }
body.arrived #hud p { display: none; }
body.arrived #ruler { opacity: 0; }
#ruler { transition: opacity .8s; }
body.arrival-reveal section[data-look] .cap.on { opacity: 0; transform: translateY(14px); pointer-events: none; }
section[data-look] .cap { transition: opacity 1.1s ease, transform 1.1s ease; }
body.notes #up, body.notes #ruler { visibility: hidden; }
/* 해설 패널이 올라오기 시작하면 마지막 글을 먼저 치우고, 탐색 막대는 아래 글이 비치지 않게 채운다 */
body.notes-over section[data-look] .cap.on { opacity: 0; transform: translateY(14px); pointer-events: none; transition-duration: .25s; }
body.notes-near #reader-nav { background: var(--plate); }
/* 해설 글은 탐색 막대에 잘리지 않고 그 아래에서 어둠 속으로 사라진다 */
body::after { content: ""; position: fixed; z-index: 8; left: 0; right: 0; bottom: 0; height: 132px; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: linear-gradient(0deg, #070c12 40%, #070c12cc 68%, #070c1200); }
body.notes-near::after { opacity: 1; }
body.riding .cap { opacity: 0 !important; }
/* The appendix stays comfortably readable instead of shrinking to fit a screen. */
#science-notes { position: relative; z-index: 5; min-height: 100vh; padding: 110px var(--gutter) 130px; background: #070c12fa; color: #dce4eb; font-size: 20px; line-height: 1.75; }
#science-notes > [lang] { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 40px 44px; max-width: 1280px; margin: auto; }
html[lang="ko"] #science-notes > [lang="en"], html[lang="en"] #science-notes > [lang="ko"] { display: none; }
#science-notes .q { grid-column: 1/-1; max-width: 19ch; font-size: clamp(40px, 4vw, 64px); line-height: 1.08; letter-spacing: -.045em; color: var(--ink); }
#science-notes .q::before { content: "SCIENCE NOTES"; display: block; margin-bottom: 24px; color: var(--accent); font: 500 12px/1.5 var(--font-data); letter-spacing: .16em; }
html[lang="ko"] #science-notes .q::before { content: "과학 해설"; }
#science-notes .notes-intro { grid-column: 1/-1; max-width: 60ch; color: var(--dim); margin-bottom: 16px; }
#science-notes > [lang] > div:has(h3) { border-top: 1px solid #a6e4ee44; padding-top: 24px; }
#science-notes h3 { color: var(--ink); font-size: 28px; line-height: 1.25; letter-spacing: -.025em; }
#science-notes ul { list-style: none; }
#science-notes li { margin-top: 22px; text-wrap: pretty; }
#science-notes .upslot, #science-notes .cred, #science-notes .chosen, #science-notes .scale { grid-column: 1/-1; }
#science-notes .scale, #science-notes .car, #science-notes .refs { border-top: 1px solid #a6e4ee44; padding-top: 24px; }
#science-notes .car { grid-column: 1 / span 2; }
#science-notes .scale svg { display: block; width: 100%; max-width: 1000px; height: auto; margin-top: 18px; overflow: visible; }
#science-notes .scale text { fill: #dce4eb; font: 500 17px var(--font-body); }
#science-notes .scale text.n { fill: var(--dim); font: 400 14px var(--font-data); }
#science-notes .cap-note { margin-top: 14px; max-width: 70ch; color: var(--dim); font-size: 17px; }
#science-notes .refs li { font-size: 15px; line-height: 1.6; color: var(--dim); margin-top: 14px; }
#science-notes .chosen { border-top: 1px solid #a6e4ee44; padding-top: 24px; }
#science-notes .chosen ul { columns: 2; column-gap: 44px; }
#science-notes .chosen li { break-inside: avoid; }
#science-notes .upslot { padding-top: 12px; }
#science-notes .cred { border-top: 1px solid #ffffff24; padding-top: 30px; margin-top: 12px; }
#science-notes dl { display: flex; flex-wrap: wrap; gap: 24px 44px; }
#science-notes dt { color: var(--dim); font-size: 12px; }
#science-notes dd { color: var(--ink); font-size: 16px; margin-top: 6px; }
#science-notes a { color: inherit; text-underline-offset: 5px; }
#fine { max-width: 1280px; margin: 44px auto 0; color: var(--faint); font-size: 12px; line-height: 1.8; }
#fine span { display: inline-block; margin-right: 22px; }
html[lang="en"] #fine p[lang="ko"], html[lang="ko"] #fine p[lang="en"] { display: none; }
@media (min-width: 901px) { #callout { display: none; } }
@media (max-width: 1100px) {
  #science-notes > [lang] { grid-template-columns: 1fr; max-width: 720px; gap: 36px; }
  #science-notes .chosen ul { columns: 1; }
  #science-notes .car { grid-column: 1/-1; }
}
@media (max-width: 900px) {
  :root { --gutter: clamp(24px, 5.6vw, 40px); --reader-bottom: max(16px, env(safe-area-inset-bottom)); }
  body { font-size: 20px; }
  #ruler { display: none; }
  #hud { top: 24px; }
  .gauge { --cell: 44px; padding: 10px 14px 12px 12px; column-gap: 9px; }
  .gauge-unit { font-size: 18px; margin-bottom: 2px; }
  #hud p { font-size: 14.5px; }
  #hud .gauge .instrument-label { font-size: 11.5px; margin-bottom: 7px; }
  #hud p:first-of-type { margin-top: 10px; }

  .cap, .cap:has(h1) { width: calc(100vw - 2 * var(--gutter)); bottom: 116px; }
  .cap.on { max-height: calc(100dvh - 330px); }
  .cap:has(h1).on { max-height: calc(100dvh - 240px); }
  .cap h1 { font-size: clamp(40px, 7.2vw, 64px); }
  .cap h2 { font-size: clamp(36px, 6.6vw, 56px); }
  .cap h1 br { display: none; }
  .cap .lead { font-size: 21px; margin-top: 22px; }
  .cap .premise { font-size: 16px; margin-top: 16px; }
  .cap .why, .cap.s { font-size: 19px; }
  .cap .lb { font-size: 12px; }
  .cap .tag { font-size: 12px; }
  .chapter-marker { font-size: 13px; margin-bottom: 12px; }
  /* 글이 화면 아래 절반을 차지한다: 밝은 지구·구름 위에서도 꼬리표가 읽히게 그 높이까지 가라앉힌다 */
  #scrim { background: linear-gradient(0deg, #03070cf2, #03070cc8 30%, #03070c80 50%, #03070c30 64%, transparent 76%), linear-gradient(180deg, #03070cd8, #03070ca0 15%, #03070c40 26%, transparent 36%); }
  .cap .lb, .cap .tag, .chapter-marker { text-shadow: 0 1px 2px #03070c, 0 0 12px #03070ce0, 0 0 26px #03070cb0; }
  /* 좁은 화면의 도착 홀: 글이 사람들 위에 놓이므로 아래쪽을 더 가라앉힌다 */
  body.arrived #scrim { background: linear-gradient(0deg, #03070cf4, #03070cd0 30%, #03070c88 52%, transparent 76%), linear-gradient(180deg, #03070cd8, #03070ca0 15%, #03070c40 26%, transparent 36%); }
  #science-notes { padding-top: 148px; font-size: 19px; }
  #science-notes .q { font-size: 40px; }
  #science-notes h3 { font-size: 27px; }
  #science-notes dl { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 480px) {
  #hud p { max-width: calc(100vw - 2 * var(--gutter)); font-size: 12px; }
  #hud p:first-of-type { margin-top: 12px; }
  .gauge { --cell: 40px; }

  .cap .lead { font-size: 20px; }
}
/* 낮은 화면(노트북): 계기는 고도와 첫 줄만 남기고, 글은 한 단계 작게 해서 계기 아래 빈자리에 들어가게 한다 */
@media (min-width: 901px) and (max-height: 780px) {
  .gauge { --cell: 48px; padding: 10px 15px 12px 13px; }
  #hud p:nth-of-type(n+2) { display: none; }
  #hud p:first-of-type { margin-top: 10px; }
  body { font-size: 19px; }
  .cap { bottom: 112px; }
  .cap.on { max-height: calc(100dvh - 300px); }
  .cap:has(h2) { bottom: 120px; }
  .cap h2 { font-size: clamp(36px, 3.8vw, 52px); margin-top: 12px; }
  .cap .why { font-size: 16.5px; }
  .cap .lb { margin-bottom: 10px; }
  .chapter-marker { margin-bottom: 8px; }
  section[data-look] .arrival-title { bottom: 124px; max-height: calc(100dvh - 258px); }
  .arrival-title h2 { font-size: clamp(36px, 4vw, 54px); }
  .arrival-title .arrival-line { margin-top: 14px; }
  .journey-stats { margin-top: 16px; padding-top: 12px; }
  section[data-look] .cap:last-child { bottom: 172px; }
  #up { bottom: 96px; }
}
@media (max-height: 700px) {
  .cap.on, .cap:has(h1).on { max-height: calc(100dvh - 280px); }
  .cap h1 { font-size: clamp(36px, 4.5vw, 64px); }
  .cap .lead { margin-top: 16px; }
  .cap .premise { margin-top: 12px; }
}
/* 작은 휴대폰: 영어 본문은 한국어보다 길다. 한 단계 작게 해서 글 상자 안에서 굴리지 않아도 되게 한다 */
@media (max-width: 600px) and (max-height: 760px) {
  body { font-size: 18px; }
  .cap .why { font-size: 16.5px; }
  .cap p + p { margin-top: .6em; }
  .cap .lb { margin-bottom: 10px; }
}
/* 휴대폰: 글이 그림을 너무 덮지 않게 제목과 본문을 한 단계씩 줄이고, 글 뒤 어둠도 그만큼 낮춘다 */
@media (max-width: 600px) {
  body { font-size: 16.5px; }
  .cap h1 { font-size: 30px; line-height: 1.12; }
  .cap h2 { font-size: 28px; line-height: 1.14; margin-top: 12px; }
  .arrival-title h2 { font-size: 30px; }
  .cap .lead { font-size: 16.5px; margin-top: 14px; }
  .cap .premise { font-size: 13.5px; margin-top: 10px; }
  .cap .why { font-size: 15px; }
  .cap p { line-height: 1.6; }
  .cap p + p { margin-top: .6em; }
  .cap .lb { font-size: 11px; margin-bottom: 8px; }
  .cap .tag { font-size: 11px; }
  .chapter-marker { font-size: 12px; margin-bottom: 6px; }
  .cap.on { max-height: calc(100dvh - 300px); }
  .arrival-title .arrival-line { font-size: 15px; margin-top: 12px; }
  .journey-stats { margin-top: 14px; padding-top: 10px; gap: 20px; }
  .journey-stats b { font-size: 18px; }
  #hud p { font-size: 13px; }
  #scrim { background: linear-gradient(0deg, #03070cf2, #03070cc0 24%, #03070c70 40%, #03070c24 52%, transparent 62%), linear-gradient(180deg, #03070cd8, #03070ca0 15%, #03070c40 26%, transparent 36%); }
  body.arrived #scrim { background: linear-gradient(0deg, #03070cf4, #03070cc8 26%, #03070c70 44%, transparent 62%), linear-gradient(180deg, #03070cd8, #03070ca0 15%, #03070c40 26%, transparent 36%); }
}
@media (max-width: 600px) and (max-height: 760px) {
  body { font-size: 15.5px; }
  .cap .why { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media (max-width: 600px) {
  #science-notes .scale text { font-size: 40px; }
  #science-notes .scale text.n { font-size: 32px; }
  #science-notes .scale text.j { display: none; }
  #science-notes .scale svg { margin: 30px 0 24px; }
  section[data-look] .arrival-title { bottom: 116px; }
  .arrival-title .arrival-line { font-size: 17px; }
  .journey-stats { gap: 24px; margin-top: 22px; padding-top: 16px; }
  .journey-stats b { font-size: 21px; }
}

/* 단말기는 글 뒤 어둠(#scrim)보다 위에 그린다. 그 아래에 두면 어둠이 덮여 반투명한 것처럼 보인다. 본문 글(main)보다는 아래 */
#phone { position:fixed; inset:0; width:100vw; height:100vh; z-index:5; pointer-events:none; }
body.landing-in-progress .cap[data-at="0"].on { opacity:0; pointer-events:none; }

/* ───────── 아래 조작 막대 ─────────
   왼쪽부터: 한 칸 이동(↑ ↓) · 지금 구간 · 끝까지(우주정거장, 지구) · 소리.
   아래 줄의 눈금은 멈추는 곳 하나하나이고, 묶음 하나가 구간이다 (↑ ↓는 눈금 하나, 구간 목록은 묶음 하나를 움직인다) */
#reader-nav { position: fixed; z-index: 9; left: var(--gutter); right: var(--gutter); bottom: var(--reader-bottom); padding: 9px 10px 0;
  border-radius: 7px; background: var(--plate); box-shadow: var(--plate-shadow); color: var(--cream); font-family: var(--font-gauge); }
.nav-row { display: flex; align-items: center; gap: 6px; }
#reader-nav button { min-height: 42px; border: 0; border-radius: 4px; background: transparent; color: inherit; font: 500 15px/1 var(--font-gauge); letter-spacing: .01em; }
#reader-nav button:hover { background: rgba(255,255,255,.06); }
#reader-nav button:disabled { opacity: .3; cursor: default; }
#reader-nav svg { width: 19px; height: 19px; flex: none; }
/* 한 칸 이동: 계기판의 키. 아래로 가는 키가 주 동작이라 글자가 호박색으로 켜져 있다 */
.nav-move { display: flex; gap: 5px; }
.nav-move button { flex: 0 0 42px; display: inline-flex; align-items: center; justify-content: center; }
#reader-nav .nav-move button { background: var(--key); box-shadow: var(--key-shadow); }
#reader-nav .nav-move button:hover:not(:disabled) { background: linear-gradient(180deg, #444a51 0%, #30353a 55%, #282c31 100%); }
#reader-nav .nav-move button:active:not(:disabled) { background: #1d2125; box-shadow: inset 0 2px 3px rgba(0,0,0,.6); }
#reader-nav #reader-next { color: var(--amber); }
/* 판에 새긴 구분선 */
#chapter, #ride, #reader-nav #sound-toggle { border-left: 1px solid rgba(0,0,0,.6); box-shadow: inset 1px 0 0 rgba(255,255,255,.07); }
/* 조작 안내: 표지에서만 보인다 */
#nav-hint { display: none; margin: 0 4px 0 10px; color: var(--engrave); font-size: 15px; line-height: 1.4; white-space: nowrap; }
#nav-hint .mo { display: none; }
body.cover #nav-hint { display: block; }
/* 지금 구간: 고도계처럼 움푹 들어간 창에 이름이 보인다 (목록은 막대 위로 펼쳐진다) */
#chapter { position: relative; flex: 0 1 340px; min-width: 0; margin-left: 4px; padding-left: 8px; }
#reader-nav #chapter-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 0 10px; text-align: left; background: #050607; box-shadow: var(--well-shadow); border-radius: 4px; color: var(--cream); font-weight: 600; font-size: 16px; }
#reader-nav #chapter-btn:hover { background: #0b0d0f; }
#chapter-now { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#reader-nav #chapter-btn svg { width: 15px; height: 15px; color: var(--amber); transition: transform .2s; }
#chapter-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
#chapter-list { position: absolute; left: 8px; bottom: calc(100% + 14px); width: max(100%, 300px); max-height: min(62vh, 560px); overflow-y: auto; overscroll-behavior: contain;
  list-style: none; padding: 12px 8px; border-radius: 7px; background: var(--plate); box-shadow: var(--plate-shadow), 0 14px 40px rgba(0,0,0,.6); outline: none; scrollbar-width: thin; scrollbar-color: #5c6268 transparent; }
#chapter-list li { display: flex; gap: 12px; padding: 8px 12px; border-radius: 3px; font: 500 16px/1.4 var(--font-gauge); color: var(--cream); cursor: pointer; }
#chapter-list li b { flex: 0 0 1.5em; color: var(--engrave); opacity: .7; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
#chapter-list li.active { background: rgba(255,255,255,.06); }
#chapter-list li[aria-selected="true"] { background: #050607; box-shadow: var(--well-shadow); }
#chapter-list li[aria-selected="true"], #chapter-list li[aria-selected="true"] b { color: var(--amber); opacity: 1; }
/* 끝까지 한 번에 */
#ride { display: flex; gap: 2px; margin-left: auto; padding-left: 8px; }
#reader-nav .ride { display: inline-flex; align-items: center; gap: 8px; padding: 0 11px; font-weight: 600; white-space: nowrap; color: var(--cream); }
#reader-nav .ride[aria-pressed="true"] { background: #050607; box-shadow: var(--well-shadow); color: var(--amber); }
/* 소리: 계기판의 밀어 켜는 스위치. 손잡이의 자리가 켜짐·꺼짐을 보여 준다 */
#reader-nav #sound-toggle { display: inline-flex; align-items: center; gap: 9px; padding: 0 10px 0 12px; margin-left: 2px; border-radius: 0 4px 4px 0; color: var(--engrave); font-weight: 600; }
.sound-track { display: inline-block; width: 32px; height: 16px; border-radius: 3px; background: #050607; padding: 2px; box-shadow: var(--well-shadow); }
.sound-track i { display: block; width: 14px; height: 12px; border-radius: 2px; background: var(--key); box-shadow: var(--key-shadow); transition: transform .2s, background .2s; }
#sound-toggle[aria-checked="true"] { color: var(--amber); }
#sound-toggle[aria-checked="true"] .sound-track i { transform: translateX(14px); background: linear-gradient(180deg, #f0d3ad, #c9a473); }
#sound-toggle[aria-checked="false"] .sound-waves, #sound-toggle[aria-checked="true"] .sound-muted { display: none; }
/* 눈금: 움푹 들어간 홈 안의 칸. 지나온 칸은 크림색, 지금 칸은 호박색 */
#reader-track { display: flex; gap: 7px; margin: 9px 0 9px; padding: 5px 6px; border-radius: 3px; background: #050607; box-shadow: var(--well-shadow); cursor: pointer; }
#reader-track .grp { display: flex; gap: 2px; min-width: 0; }
#reader-track i { flex: 1 1 0; height: 4px; border-radius: 1px; background: #1e2226; transition: background .3s; }
#reader-track i.past { background: rgba(236,230,218,.55); }
#reader-track i.on { background: var(--amber); box-shadow: 0 0 6px rgba(233,199,154,.45); }
@media (max-width: 1100px) {
  /* 안내가 한 줄에 들어가지 않으면 표지에서만 막대 맨 윗줄로 올린다 */
  .nav-row { flex-wrap: wrap; }
  #nav-hint { order: -1; flex: 0 0 100%; margin: 2px 6px 8px; white-space: normal; }
  body.cover .cap:has(h1) { bottom: 148px; }
  #chapter { flex: 1 1 0; }
}
@media (max-width: 900px) {
  #nav-hint .pc { display: none; }
  #nav-hint .mo { display: inline; }
}
@media (max-width: 600px) {
  #reader-nav { padding: 8px 8px 0; }
  .nav-row { gap: 2px; }
  .nav-move button { flex-basis: 40px; }
  #chapter { margin-left: 4px; padding-left: 4px; }
  #reader-nav #chapter-btn { padding: 0 8px; font-size: 14.5px; }
  /* 좁은 화면: 목록은 막대의 폭에 맞춰 펼친다 (화면 밖으로 나가지 않게) */
  #chapter { position: static; }
  #chapter-list { left: 0; right: 0; width: auto; bottom: calc(100% + 8px); }
  #ride { margin-left: 2px; padding-left: 4px; gap: 0; }
  #reader-nav .ride { padding: 0 8px; }
  #reader-nav #sound-toggle { padding: 0 8px; margin-left: 2px; }
  .ride span, .sound-track, #sound-label { display: none; }
  #lang { padding-left: 4px; }
  #reader-nav #lang button { min-width: 34px; padding: 0 6px; }
  #lang .full { display: none; }
  #lang .short { display: inline; }
  /* 좁은 화면: 지금 언어는 감추고 바꿀 언어 버튼 하나만 둔다. 막대는 화면 가장자리까지 조금 더 넓게 쓴다 */
  #reader-nav #lang button[aria-pressed="true"] { display: none; }
  #reader-nav { left: 12px; right: 12px; }
  #reader-track { gap: 4px; margin: 8px 0; padding: 4px 5px; }
  #reader-track .grp { gap: 1.5px; }
}
