/* A · 심해 (Deep Tide) */
@font-face {
  font-family: "Pretendard Variable";
  src: url("./assets/PretendardVariable.woff2") format("woff2-variations");
  font-weight: 45 920; font-display: swap;
}

:root {
  /* 지금 사이트의 색을 그대로: 남색 바탕 + 토스 블루 */
  --abyss: #0f1116;          /* 바탕 */
  --abyss-deep: #0f1116;
  --surface: #15171d;
  --surface-2: #1a1d24;
  --surface-3: #242833;
  --rule: #232630;
  --rule-strong: #2b2f3a;
  --rule-hover: #3a4152;
  --ink: #f7f8f8;            /* 글자 */
  --ink-2: #d0d6e0;          /* 보조 글자 */
  --ink-3: #a3a9b3;          /* 흐린 글자: 띠 없이 은하 위에서도 읽히도록 기존 #8a8f98보다 한 단계 밝게 */
  --biolume: #5b9cff;        /* 어두운 바탕 위 글자·링크 파랑 */
  --biolume-hover: #7db0ff;
  --fill: #3182f6;           /* 글자 없는 채움(점·선) */
  --biolume-dim: rgba(91, 156, 255, 0.16);
  --ember: #22e5ff;          /* 아주 드물게: 강조 청록 */
  --ember-soft: rgba(34, 229, 255, 0.35);
  --band: rgba(15, 17, 22, 0.93);   /* 흰 입자가 비쳐도 흐린 글자 4.9:1 이상 */

  --f-ko: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --f-latin: "Raleway", var(--f-ko);
  --gutter: clamp(20px, 5vw, 72px);
  --max: 1240px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --z-canvas: 0; --z-labels: 1; --z-content: 2; --z-bar: 10; --z-fab: 20; --z-chat: 30; --z-sheet: 40;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  font-family: var(--f-ko);
  font-size: 17px; line-height: 1.75;
  color: var(--ink-2);
  /* 아래로 갈수록 더 깊어진다 */
  background: var(--abyss);
  overflow-x: hidden;
  word-break: keep-all; overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--biolume); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--abyss); padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }
.muted { color: var(--ink-3); }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.wrap-wide { width: min(100% - 2 * var(--gutter), 1400px); margin-inline: auto; }

h1, h2, h3 { color: var(--ink); text-wrap: balance; margin: 0; font-weight: 300; }
p { text-wrap: pretty; margin: 0; }

/* ---------- 배경 캔버스 ---------- */
#deep { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: var(--z-canvas); pointer-events: none; transition: opacity .2s linear; }
.static #deep { display: none; }
main, .foot { position: relative; z-index: var(--z-content); }

.thread-labels { position: fixed; inset: 0; z-index: var(--z-labels); pointer-events: none; opacity: 0; }
.static .thread-labels { display: none; }
.tl { position: absolute; left: 0; top: 0; will-change: transform; }
.tl i, .tl small { position: absolute; left: 0; transform: translate(-50%, 0); white-space: nowrap; font-style: normal; }
.tl i { bottom: 22px; font-size: 15px; letter-spacing: .02em; color: var(--ink-2); }
.tl.low i { bottom: auto; top: 20px; }
.tl.student i { top: 28px; color: var(--ember); font-weight: 500; font-size: 17px; }
.tl.student small { top: 54px; font-size: 13px; color: var(--ink-3); }

/* ---------- 상단 바 ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-bar);
  display: flex; align-items: center; gap: 40px;
  height: 72px; padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  transition: transform .45s var(--ease);
  text-shadow: 0 0 1px rgba(15, 17, 22, .95), 0 0 8px rgba(15, 17, 22, .9);
}
/* 띠 없이 투명하게 두어 고래·은하를 가리지 않는다. 내려 읽을 땐 숨고, 올리면 다시 나온다 */
.bar.away { transform: translateY(-100%); }
.bar::before { content: ""; position: absolute; inset: 0 0 -32px 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .35s var(--ease);
  background: linear-gradient(rgba(15, 17, 22, .78), rgba(15, 17, 22, .5) 50%, rgba(15, 17, 22, 0)); }
/* 바가 보이는 동안 본문은 바 아래 경계에서 사라진다. 배경(은하)은 가리지 않고 그대로 이어진다. --cut은 page.js가 채운다 */
main, .foot {
  -webkit-mask-image: linear-gradient(to bottom, transparent var(--cut, -16px), #000 calc(var(--cut, -16px) + 16px));
  mask-image: linear-gradient(to bottom, transparent var(--cut, -16px), #000 calc(var(--cut, -16px) + 16px));
}
.menu-panel, .sheet, .bar .pearl-text { text-shadow: none; }
/* 기존 브랜드 표식 그대로 */
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); }
.brand-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: 66% 32%; box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 0 14px rgba(255, 140, 60, .25); flex: none; }
.brand-text { display: flex; flex-direction: column; gap: 4px; }
.brand-name { font-family: var(--f-ko); font-size: 1.12rem; font-weight: 800; letter-spacing: -0.05em; color: #f7f8f8; line-height: 1; white-space: nowrap; }
.brand-name s { text-decoration: none; font-weight: 400; color: #8a8f98; margin: 0 .04em; }
.brand-name b { font-weight: 800; }
.brand-sub { font: 600 .6rem/1 ui-monospace, "SF Mono", monospace; letter-spacing: .14em; text-transform: uppercase; color: #8a8f98; white-space: nowrap; }
/* 기존 브랜드의 진주빛 글자 (브랜드 정체성이라 예외로 유지) */
.pearl-text { background: linear-gradient(110deg, #fff 0%, #dfe6f2 18%, #fff 36%, #c9d5ea 54%, #fff 72%, #e6ecf6 88%, #fff 100%); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: pearl-sheen 4s linear infinite; }
@keyframes pearl-sheen { to { background-position: -300% 0; } }
.mark { min-height: 44px; font-family: var(--f-latin); font-size: 22px; letter-spacing: .01em; color: var(--ink); display: inline-flex; align-items: center; white-space: nowrap; }
.mark span:first-child { font-weight: 300; }
.mark span:last-child { font-weight: 200; }
.mark b { font-weight: 200; color: var(--ember); margin: 0 1px; }
.mark.small { font-size: 18px; }
.nav-primary { margin-left: auto; }
.menubar { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 10px;
  background: none; border: 0; cursor: pointer; font-size: 17px; font-weight: 500; color: var(--ink);
  transition: background-color .25s var(--ease), color .25s;
}
.nav-btn:hover, .nav-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .06); }
.nav-btn[aria-expanded="true"] { color: var(--biolume-hover); }
.caret { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .7; transition: transform .3s var(--ease); }
.nav-btn[aria-expanded="true"] .caret { transform: translateY(1px) rotate(225deg); }
.menu-panel {
  position: fixed; z-index: calc(var(--z-bar) + 1); width: 380px; max-width: calc(100vw - 32px);
  display: flex; gap: 28px; padding: 22px 22px 18px; border-radius: 18px;
  background: #15171d; border: 1px solid var(--rule-strong);
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .02) inset;
  animation: panel-in .28s var(--ease);
}
.menu-panel { max-height: calc(100vh - 96px); max-height: calc(100svh - 96px); overflow-y: auto; overscroll-behavior: contain; }
.menu-panel[hidden] { display: none; }
@keyframes panel-in { from { opacity: 0; transform: translateY(-6px); } }
.mp-lab { width: 440px; }
.mp-posts { width: 720px; }
.mp-main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.mp-label { font-family: var(--f-latin); font-size: 14px; letter-spacing: .02em; color: var(--ink-3); margin: 0 0 10px 12px; }
.mp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mp-link, .mp-post { display: block; padding: 10px 12px; border-radius: 10px; transition: background-color .2s; }
.mp-link b { display: block; font-size: 16px; font-weight: 500; color: var(--ink); line-height: 1.4; }
.mp-link small { display: block; font-size: 14px; color: var(--ink-3); line-height: 1.5; margin-top: 2px; }
.mp-link:hover, .mp-link:focus-visible, .mp-post:hover, .mp-post:focus-visible { background: #1a1d24; outline-offset: -2px; }
.mp-link:hover b { color: var(--biolume-hover); }
.mp-foot { align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; margin-top: 6px; font-size: 14.5px; color: var(--biolume); }
.mp-foot:hover { color: var(--biolume-hover); }
.mp-latest { flex: 1.1 1 0; min-width: 0; padding-left: 24px; border-left: 1px solid var(--rule-strong); }
.mp-latest ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mp-post { font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.mp-post:hover { color: var(--ink); }
.menu-panel :is(a, b, small, p) { text-shadow: none; }
.nav-secondary { display: flex; gap: 18px; padding-left: 28px; border-left: 1px solid var(--rule); }
.nav-secondary a { font-size: 14px; color: var(--ink-3); padding: 0 4px; min-width: 44px; justify-content: center; transition: color .3s; }
.nav-secondary a:hover { color: var(--ink); }
.menu-btn { display: none; }

@media (max-width: 860px) {
  .bar { height: 64px; justify-content: space-between; }
  .nav-primary, .nav-secondary { display: none; }
  .menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; margin-right: -10px; background: none; border: 0; cursor: pointer;
  }
  .menu-lines, .menu-lines::before { display: block; width: 22px; height: 1.5px; background: var(--ink); position: relative; }
  .menu-lines::before { content: ""; position: absolute; top: 7px; width: 14px; }
  .menu-lines { transform: translateY(-3px); }
}

/* 모바일 메뉴 시트 */
.sheet {
  position: fixed; inset: 0; z-index: var(--z-sheet);
  background: var(--abyss-deep);
  padding: calc(env(safe-area-inset-top) + 8px) var(--gutter) calc(env(safe-area-inset-bottom) + 28px);
  display: flex; flex-direction: column; overflow-y: auto;
}
.sheet[hidden] { display: none; }
.sheet-top .brand { min-height: 48px; }
.sheet-top { display: flex; justify-content: space-between; align-items: center; height: 56px; }
.sheet-close { min-width: 48px; height: 48px; background: none; border: 1px solid var(--rule); border-radius: 999px; padding: 0 18px; font-size: 15px; color: var(--ink-2); cursor: pointer; }
.sheet-primary { display: flex; flex-direction: column; margin-top: 4vh; }
.sheet-group { border-bottom: 1px solid var(--rule); }
.sg-btn { width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: center; text-align: left; padding: 16px 0; min-height: 64px; background: none; border: 0; cursor: pointer; color: var(--ink); }
.sg-btn span { font-size: 32px; font-weight: 300; line-height: 1.25; letter-spacing: -.02em; }
.sg-btn em { grid-column: 1; font-family: var(--f-latin); font-style: normal; font-weight: 300; font-size: 15px; color: var(--ink-3); margin-top: 4px; letter-spacing: .02em; }
.sg-caret { grid-column: 2; grid-row: 1 / span 2; width: 12px; height: 12px; margin-right: 6px; border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2); transform: rotate(45deg); transition: transform .3s var(--ease); }
.sg-btn[aria-expanded="true"] .sg-caret { transform: rotate(225deg); }
.sg-list { list-style: none; margin: 0 0 14px; padding: 0 0 0 2px; display: grid; gap: 2px; }
.sg-list[hidden] { display: none; }
.sg-link { display: block; padding: 10px 0; min-height: 44px; }
.sg-link b { display: block; font-size: 17px; font-weight: 500; color: var(--ink); line-height: 1.45; }
.sg-link small { display: block; font-size: 14px; color: var(--ink-3); line-height: 1.5; }
.sg-post b { font-weight: 400; font-size: 16px; color: var(--ink-2); }
.sg-foot { display: inline-flex; align-items: center; min-height: 44px; font-size: 15.5px; color: var(--biolume); }
.sheet-secondary { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: auto; padding-top: 40px; }
.sheet-secondary a { font-size: 16px; color: var(--ink-3); padding: 0; min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; }
.sheet.open { animation: sheet-in .5s var(--ease); }
.sheet.open .sheet-group { animation: rise .6s var(--ease) both; }
.sheet.open .sheet-group:nth-child(2) { animation-delay: .05s; }
.sheet.open .sheet-group:nth-child(3) { animation-delay: .1s; }
@keyframes sheet-in { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- 첫 화면 ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 120px 0 96px; }
.still { display: none; }
/* 움직임 줄이기: 정지 화면은 첫 화면에만 두고 스크롤하면 함께 지나간다(본문 뒤에 고래가 남지 않게) */
.static .still { display: block; position: absolute; inset: 0; z-index: var(--z-canvas); }
.static .still img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; }
.hero-copy { position: relative; isolation: isolate; }
.kicker { font-family: var(--f-latin); font-weight: 300; font-size: clamp(22px, 2vw, 28px); letter-spacing: .04em; color: var(--biolume-hover); margin-bottom: 28px; display: flex; align-items: center; gap: 16px; }
.kicker::before { content: ""; width: 36px; height: 1px; background: currentColor; opacity: .7; }
.hero h1 {
  font-size: clamp(36px, 4.6vw, 66px); line-height: 1.24; letter-spacing: -0.03em; font-weight: 250;
  max-width: 11.5em;
}
.hero h1 .lit { color: var(--ember); font-weight: 400; }

.lede { margin-top: 32px; max-width: 30em; font-size: clamp(17px, 1.3vw, 19px); line-height: 1.8; color: var(--ink-2); }
.descend {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 56px; min-height: 44px;
  font-size: 16px; color: var(--ink); border-bottom: 1px solid var(--rule-strong); padding-bottom: 4px;
  transition: border-color .4s var(--ease), color .4s;
}
.descend:hover { border-color: var(--biolume); color: var(--biolume); }
.descend .arrow { width: 1px; height: 22px; background: currentColor; position: relative; overflow: visible; }
.descend .arrow::after { content: ""; position: absolute; left: -3.5px; bottom: 0; width: 7px; height: 7px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); }
.live .descend .arrow { animation: sink 2.8s var(--ease) infinite; }
@keyframes sink { 0%, 100% { transform: translateY(-3px); } 50% { transform: translateY(4px); } }

@media (min-width: 980px) {
  .hero-copy > :not(.lede) { max-width: min(600px, 44vw); }
  .hero h1 { max-width: none; white-space: nowrap; }
  .hero { align-items: flex-end; padding-bottom: 14vh; }
}
@media (max-width: 979px) {
  .hero { align-items: flex-end; padding-bottom: 72px; }
}
@media (max-width: 639px) {
  .hero { padding-top: 46svh; padding-bottom: 56px; min-height: 100svh; }
  .kicker { margin-bottom: 18px; font-size: 20px; }
  .hero h1 { font-size: clamp(28px, 9.2vw, 40px); }
  .lede { margin-top: 22px; }
  .descend { margin-top: 32px; }
}

/* ---------- 글이 놓이는 어두운 띠: 배경과 상관없이 읽힌다 ---------- */
/* 띠·상자 없이 글자만으로 읽히게: 은은한 글자 그림자(국소 어둠) + 조금 밝힌 흐린 글자 */
.band { margin-top: clamp(96px, 20vh, 220px); }
.os.band { margin-top: 0; }
main :is(h1, h2, h3, p, li, figcaption, a, small, b, strong, span) {
  text-shadow: 0 0 1px rgba(15, 17, 22, .95), 0 0 6px rgba(15, 17, 22, .9), 0 1px 18px rgba(15, 17, 22, .8);
}
main .frame *, main .chip, main .chip *, main .tool-open, main .tool-open * { text-shadow: none; }

/* ---------- 아카데미 OS ---------- */
.os { position: relative; }
.os-intro { padding: clamp(110px, 14vh, 170px) 0 clamp(72px, 9vh, 110px); }
.os h2, .lab h2, .notes h2 { font-size: clamp(32px, 3.8vw, 56px); line-height: 1.22; letter-spacing: -0.025em; }
.os-def { margin-top: 28px; max-width: 34em; font-size: clamp(17px, 1.35vw, 20px); line-height: 1.85; }
.os-def strong { color: var(--ink); font-weight: 500; }
/* ---------- 기록 그래프 (교재당 노드 그래프 문법: 묶음 테두리·칸 칩·포트 점·흐르는 선) ---------- */
.rg-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.record-graph {
  --g-class: #5b9cff; --g-test: #b49bff; --g-care: #f5b84a; --g-out: #4ade80;
  position: relative; margin: 64px 0 0; max-width: 1120px;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(220px, .8fr) minmax(0, 1fr); gap: 0 72px; align-items: center;
}
.rg-wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.rg-col, .rg-hub, .record-graph figcaption { position: relative; z-index: 1; }
.rg-col { display: grid; gap: 14px; }
.rg-in { padding-left: 46px; }
.rg-group { --c: var(--g-class); display: grid; gap: 6px; padding: 10px 12px 12px; border: 1px solid color-mix(in srgb, var(--c) 34%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--c) 6%, rgba(15, 17, 22, .82)); box-shadow: 0 0 28px -12px var(--c); }
.rg-group[data-g="test"] { --c: var(--g-test); }
.rg-group[data-g="care"] { --c: var(--g-care); }
.rg-glabel { display: flex; justify-content: space-between; align-items: baseline; margin: 0 2px 2px; font-size: 13px; font-weight: 600; color: var(--c, var(--g-out)); }
.rg-glabel em { font-style: normal; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 10.5px; letter-spacing: .08em; color: var(--ink-3); font-weight: 400; }
.rg-glabel.out { --c: var(--g-out); }
.rg-node { --c: inherit; position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; padding: 7px 12px; border: 1px solid var(--rule-strong); border-radius: 8px; background: rgba(21, 23, 29, .92); transition: border-color .3s var(--ease), box-shadow .3s var(--ease); }
.rg-group .rg-node { --c: inherit; }
.rg-node b { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.rg-node b i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); box-shadow: 0 0 10px var(--c); flex: none; }
.rg-group[data-g] .rg-node b i { background: var(--c); }
.rg-f { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.rg-f s { text-decoration: none; font-size: 11.5px; line-height: 1; padding: 4px 6px; border-radius: 4px; color: var(--ink-2); background: var(--surface-3); white-space: nowrap; }
.rg-node.lit { border-color: color-mix(in srgb, var(--c) 70%, transparent); box-shadow: 0 0 18px -6px var(--c); }
.rg-out .rg-node { --c: var(--g-out); flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 14px; border-color: color-mix(in srgb, var(--g-out) 30%, transparent); }
.rg-out .rg-node small { font-size: 13px; color: var(--ink-3); line-height: 1.45; }
.rg-out .rg-node.draft { border-style: dashed; --c: #8a8f98; }
.rg-out .rg-node.draft b i { background: transparent; border: 1.5px solid #a3a9b3; box-shadow: none; }
/* 가운데 학생 */
.rg-hub { display: grid; place-items: center; }
.rg-core { position: relative; width: 220px; aspect-ratio: 1; border-radius: 50%; display: grid; place-content: center; justify-items: center; gap: 4px; text-align: center;
  background: radial-gradient(circle at 50% 42%, rgba(34, 229, 255, .16), rgba(15, 17, 22, .94) 62%); border: 1.5px solid rgba(34, 229, 255, .7);
  box-shadow: 0 0 0 8px rgba(34, 229, 255, .06), 0 0 60px -6px rgba(34, 229, 255, .55), inset 0 0 40px -10px rgba(34, 229, 255, .45); }
.rg-core b { font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.rg-core small { font-size: 13px; color: var(--ink-2); }
.rg-core em { font-style: normal; font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.rg-bars { display: flex; gap: 4px; margin-top: 8px; }
.rg-bars i { width: 30px; height: 4px; border-radius: 2px; background: var(--g-class); box-shadow: 0 0 8px currentColor; }
.rg-bars i[data-g="test"] { background: var(--g-test); }
.rg-bars i[data-g="care"] { background: var(--g-care); }
.rg-ring { position: absolute; inset: -14px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 70%, rgba(34, 229, 255, .9) 88%, transparent 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px)); }
.rg-ring.r2 { inset: -28px; opacity: .45; background: conic-gradient(from 180deg, transparent 0 80%, rgba(91, 156, 255, .9) 94%, transparent 100%); }
.live .rg-ring { animation: rg-spin 9s linear infinite; }
.live .rg-ring.r2 { animation-duration: 15s; animation-direction: reverse; }
@keyframes rg-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .rg-ring, .rg-wires path.flow { animation: none !important; } }
/* 선 */
.rg-wires path { fill: none; stroke-width: 1.4; stroke-opacity: .5; }
.rg-wires path.flow { stroke-width: 2; stroke-opacity: 1; stroke-dasharray: 2 16; stroke-linecap: round; }
.rg-wires path.link { stroke-dasharray: 4 5; stroke-opacity: .75; }
.live .rg-wires path.flow { animation: current 2.4s linear infinite; }
.rg-wires circle.port { stroke: var(--abyss); stroke-width: 2; }
.rg-wires circle.pk { filter: drop-shadow(0 0 4px currentColor); }
.rg-wires text { font-size: 11px; fill: var(--g-care); font-family: var(--f-ko); }
.record-graph figcaption { grid-column: 1 / -1; margin-top: 28px; font-size: 13.5px; line-height: 1.6; color: var(--ink-3); }
@media (max-width: 979px) {
  .record-graph { grid-template-columns: 1fr; gap: 56px 0; max-width: 560px; }
  .rg-in { padding-right: 34px; padding-left: 40px; }
  .rg-out { padding-left: 34px; }
  .rg-core { width: 190px; }
}
@media (max-width: 639px) {
  .record-graph { margin-top: 44px; gap: 48px 0; }
  .rg-in { padding-right: 30px; padding-left: 30px; }
  .rg-out { padding-left: 30px; }
  .rg-node { flex-wrap: wrap; gap: 6px 10px; }
  .rg-node b { font-size: 14.5px; }
  .rg-f { justify-content: flex-start; }
  .rg-out .rg-node small { font-size: 12.5px; }
}

.os-body {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 88px);
  align-items: start; padding-bottom: clamp(120px, 16vh, 200px);
}
.reel { margin: 0; }
.graph { margin: 0 auto; }
.frame { position: relative; border-radius: 16px; overflow: hidden; background: #000; border: 1px solid var(--rule-strong); }
.vid-toggle {
  position: absolute; left: 12px; bottom: 12px; z-index: 1;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 12px;
  border-radius: 999px; border: 1px solid var(--rule-hover); background: rgba(15, 17, 22, .88);
  color: var(--ink); font-size: 14px; cursor: pointer;
}
.vid-toggle b { font-weight: 500; }
.vid-toggle span { width: 10px; height: 12px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.vid-toggle[data-state="paused"] span { width: 0; height: 0; border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent currentColor; }
.vid-toggle:hover { border-color: var(--biolume); }
.frame video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; }
figcaption { margin-top: 14px; font-size: 15px; color: var(--ink-3); line-height: 1.6; }
.strand { list-style: none; margin: 0; padding: 0; position: relative; }
.strand::before { content: ""; position: absolute; left: 6px; top: 12px; bottom: 12px; width: 1px; background: linear-gradient(var(--biolume), rgba(91, 156, 255, .15)); }
.strand li { position: relative; padding: 0 0 32px 36px; }
.strand li::before { content: ""; position: absolute; left: 1px; top: 9px; width: 11px; height: 11px; border-radius: 50%; background: var(--abyss); border: 1.5px solid var(--biolume); }
.strand li:last-child::before { border-color: var(--ember); background: var(--ember); box-shadow: 0 0 14px var(--ember-soft); }
.strand h3 { font-size: 20px; font-weight: 500; line-height: 1.4; }
.strand p { margin-top: 6px; font-size: 16.5px; line-height: 1.7; }
.os-links { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 12px; padding-top: 28px; border-top: 1px solid var(--rule); }
.link-main { font-size: 18px; color: var(--ink); border-bottom: 1px solid var(--biolume); padding: 6px 0 4px; transition: color .3s; }
.link-main:hover { color: var(--biolume-hover); }
.link-quiet { font-size: 15.5px; color: var(--ink-3); padding: 8px 0; transition: color .3s; }
.link-quiet:hover { color: var(--biolume-hover); }

@media (max-width: 979px) {
  .os-body { grid-template-columns: 1fr; }
}
@media (max-width: 639px) {
  .os-intro { padding-top: 96px; }
  .os-def { margin-top: 20px; }
}

/* ---------- SEIS 그래프 ---------- */
.seis { padding: clamp(40px, 6vh, 80px) 0 clamp(120px, 16vh, 200px); }
.seis-head { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 88px); align-items: end; margin-bottom: clamp(40px, 5vw, 64px); }
.seis-mark { font-family: var(--f-latin); font-weight: 200; font-size: clamp(56px, 7.4vw, 96px); line-height: .95; letter-spacing: -0.02em; color: var(--ink); }
.seis-copy h2 { font-size: clamp(28px, 2.8vw, 40px); line-height: 1.3; letter-spacing: -0.02em; }
.seis-copy p { margin-top: 20px; max-width: 34em; }
.seis-copy .seis-note { margin-top: 14px; font-size: 15.5px; color: var(--biolume); }
.graph .frame { border-radius: 18px; }
.graph .frame { overflow: visible; }
.graph video { border-radius: 18px; }
.badge {
  position: absolute; right: 18px; top: -15px; z-index: 1;
  font-size: 13.5px; line-height: 1; padding: 9px 12px; border-radius: 999px;
  background: rgba(15, 17, 22, .88); color: var(--ink); border: 1px solid var(--rule-hover);
}
.flow { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px 0; font-size: 16px; color: var(--ink-2); }
.flow li { display: inline-flex; align-items: center; }
.flow li + li::before { content: ""; width: 28px; height: 1px; margin: 0 10px; background: var(--rule-strong); }
.flow li:last-child { color: var(--ember); }
@media (max-width: 860px) {
  .seis-head { grid-template-columns: 1fr; align-items: start; }
}
@media (max-width: 639px) {
  .vid-toggle { left: 10px; bottom: 10px; }
  .flow li + li::before { width: 14px; margin: 0 6px; }
  .badge { right: 10px; top: -13px; font-size: 12.5px; padding: 7px 10px; }
}

/* ---------- 실험실 ---------- */
.lab { padding: clamp(60px, 10vh, 120px) 0 clamp(110px, 15vh, 180px); position: relative; }
.lab-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 110px); align-items: center; }
.lab-label { display: flex; align-items: center; gap: 14px; font-size: 15px; color: var(--ink-3); margin-bottom: 22px; }
.ping { position: relative; width: 10px; height: 10px; border-radius: 50%; background: var(--fill); box-shadow: 0 0 12px var(--fill); }
.ping::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 1px solid var(--biolume); }
.live .ping::after { animation: ping 3.2s var(--ease) infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: .9; } 70%, 100% { transform: scale(5.5); opacity: 0; } }
.lab-sub { margin-top: 18px; max-width: 28em; }
.chips { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.chip {
  min-height: 48px; padding: 10px 20px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--rule-hover); color: var(--ink);
  font-size: 16px; line-height: 1.4; text-align: left;
  transition: border-color .3s var(--ease), background-color .3s var(--ease), color .3s;
}
.chip:hover { border-color: var(--biolume); }
.chip[aria-pressed="true"] { background: var(--biolume); border-color: var(--biolume); color: #0f1116; font-weight: 600; }

.lab-answer {
  position: relative; min-height: 380px; padding: clamp(28px, 3vw, 44px);
  border-radius: 24px; border: 1px solid var(--rule);
  background: radial-gradient(90% 80% at 50% 0%, rgba(49, 130, 246, .14), transparent 70%), var(--surface);
  overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
}
.sonar { position: absolute; left: 50%; top: 42%; width: 0; height: 0; }
.sonar i { position: absolute; left: -60px; top: -60px; width: 120px; height: 120px; border-radius: 50%; border: 1px solid rgba(91, 156, 255, .35); }
.sonar i:nth-child(2) { transform: scale(1.8); opacity: .55; }
.sonar i:nth-child(3) { transform: scale(2.7); opacity: .3; }
.lab-answer.picked .sonar { top: 30px; left: auto; right: 30px; }
.lab-answer.picked .sonar i { width: 40px; height: 40px; left: -20px; top: -20px; }
.lab-answer.pulse .sonar i { animation: sonar 1.4s var(--ease) both; }
.lab-answer.pulse .sonar i:nth-child(2) { animation-delay: .15s; }
.lab-answer.pulse .sonar i:nth-child(3) { animation-delay: .3s; }
@keyframes sonar { from { transform: scale(.4); opacity: 1; } to { transform: scale(3.2); opacity: 0; } }
.lab-wait { position: absolute; left: 0; right: 0; top: calc(42% + 100px); text-align: center; color: var(--ink-3); font-size: 16px; padding: 0 24px; }
.lab-answer.picked .lab-wait { display: none; }
.tool-pick { position: relative; }
.tool-pick .tool-name { font-size: clamp(28px, 2.6vw, 38px); font-weight: 400; letter-spacing: -0.02em; line-height: 1.25; }
.tool-why { margin-top: 14px; font-size: 17px; color: var(--ink-2); max-width: 30em; }
.tool-meta { margin-top: 12px; font-size: 14px; color: var(--ink-3); }
.tool-open {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 24px; min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 1px solid var(--biolume); color: var(--ink); font-size: 16px; font-weight: 500;
  transition: background-color .3s var(--ease), color .3s;
}
.tool-open:hover { background: var(--biolume); color: #0f1116; }
.tool-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 24px; }
.tool-actions .tool-open { margin-top: 0; }
.tool-done { min-height: 48px; padding: 0 4px; background: none; border: 0; border-bottom: 1px solid var(--rule-strong); border-radius: 0; color: var(--ink-3); font-size: 15.5px; cursor: pointer; }
.tool-done:hover { color: var(--ink); border-color: var(--biolume); }
.tool-pick .next-label { font-size: 14.5px; color: var(--biolume); margin-bottom: 8px; }
.tool-next { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--rule); }
.next-label { font-size: 14.5px; color: var(--ink-3); }
.next-link { display: block; margin-top: 8px; padding: 6px 0; }
.next-name { display: block; font-size: 18px; color: var(--ink); }
.next-name::after { content: "  ↗"; color: var(--biolume); }
.next-why { display: block; margin-top: 2px; font-size: 15.5px; color: var(--ink-3); line-height: 1.6; }
.next-link:hover .next-name { color: var(--biolume-hover); }
.reveal { animation: surface .9s var(--ease) both; }
.tool-next.reveal { animation-delay: .55s; }
@keyframes surface { from { opacity: 0; transform: translateY(16px); filter: blur(6px); } }
.lab-all { margin-top: 28px; text-align: right; }
.lab-all a { display: inline-block; padding: 10px 0; font-size: 15.5px; color: var(--ink-3); border-bottom: 1px solid transparent; }
.lab-all a:hover { color: var(--ink); border-color: var(--rule-strong); }
@media (max-width: 860px) {
  .lab-grid { grid-template-columns: 1fr; }
  .lab-answer { min-height: 300px; }
  .lab-all { text-align: left; }
}

/* ---------- 글: 이어 읽기 ---------- */
.notes { padding: clamp(60px, 9vh, 110px) 0 clamp(100px, 14vh, 170px); }
.notes-sub { margin-top: 20px; max-width: 36em; }
.currents { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 110px); margin-top: clamp(48px, 6vw, 80px); }
.current { position: relative; }
.current-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 28px; padding-left: 44px; }
.current-mark { font-family: var(--f-latin); font-weight: 200; font-size: clamp(30px, 2.8vw, 40px); color: var(--ink); line-height: 1.1; }
.current-head h3 { font-size: 16px; font-weight: 400; color: var(--ink-3); }
.current-line { position: absolute; left: 0; top: 0; width: 44px; height: 100%; overflow: visible; pointer-events: none; }
.current-line path { fill: none; stroke: rgba(91, 156, 255, .35); stroke-width: 1.2; }
.current-line .flow-dash { stroke: var(--biolume); stroke-width: 1.6; stroke-dasharray: 2 26; stroke-linecap: round; }
.live .current-line .flow-dash { animation: current 3.6s linear infinite; }
@keyframes current { to { stroke-dashoffset: -28; } }
.stream { list-style: none; margin: 0; padding: 0; }
.stream li { position: relative; padding: 0 0 0 44px; }
.stream li::before { content: ""; position: absolute; left: 9px; top: 10px; width: 11px; height: 11px; border-radius: 50%; background: var(--abyss); border: 1.5px solid var(--biolume); }
.stream li > a { display: block; font-size: clamp(18px, 1.45vw, 20px); line-height: 1.55; color: var(--ink); font-weight: 400; padding: 2px 0; transition: color .3s; }
.stream li > a:hover { color: var(--biolume); }
.bridge { margin: 14px 0 0; padding: 0 0 40px; font-size: 16px; color: var(--ink-3); line-height: 1.6; }
.bridge::before { content: "↓ "; color: var(--biolume); }
.stream li.more { padding-top: 32px; }
.stream li.more::before { width: 7px; height: 7px; left: 11px; top: 44px; background: var(--rule-strong); border: 0; }
.stream li.more a { font-size: 16px; color: var(--ink-3); }
.stream li.more a:hover { color: var(--ink); }
@media (max-width: 860px) {
  .currents { grid-template-columns: 1fr; gap: 64px; }
}

/* ---------- 끝 ---------- */
.end { min-height: 80vh; display: flex; align-items: center; padding: 80px 0 140px; }
/* 끝 문장: 끊어도 되는 자리(구절 사이)에서만 줄이 바뀌고, 링크 구절은 화살표까지 한 덩어리 */
.end-line { font-size: clamp(22px, 2.5vw, 36px); line-height: 1.6; font-weight: 300; color: var(--ink); letter-spacing: -0.015em; margin: 0; }
.end-line .nb { white-space: nowrap; }
.end-q { display: block; text-wrap: balance; }
.end-line a { display: inline-flex; align-items: center; min-height: 44px; margin-top: .1em; color: var(--biolume); border-bottom: 1px solid rgba(91, 156, 255, .45); transition: border-color .3s, color .3s; }
.end-line a:hover { color: var(--biolume-hover); border-color: var(--biolume-hover); }
@media (max-width: 979px) { .end { align-items: flex-end; min-height: 90svh; } }
@media (max-width: 639px) { .end-line { font-size: clamp(20px, 6.4vw, 26px); } }

.foot { border-top: 1px solid var(--rule); padding: 36px 0 calc(40px + env(safe-area-inset-bottom)); background: var(--abyss); }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding-right: 84px; }
.foot-who { font-size: 15px; color: var(--ink-3); }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 20px; margin-left: auto; }
.foot nav a { font-size: 15px; color: var(--ink-3); padding: 10px 0; }
.foot nav a:hover { color: var(--ink); }
@media (max-width: 860px) { .foot nav { margin-left: 0; } .foot-in { padding-right: 72px; } }

/* ---------- 챗봇 ---------- */
.panda-btn {
  position: fixed; z-index: var(--z-fab);
  right: calc(40px + env(safe-area-inset-right)); bottom: calc(44px + env(safe-area-inset-bottom));
  width: 64px; height: 64px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1.5px solid oklch(0.74 0.15 40 / 0.7); background: var(--abyss-deep);
  box-shadow: 0 0 0 6px oklch(0.74 0.15 40 / 0.08), 0 0 32px oklch(0.74 0.15 40 / 0.35), 0 10px 30px -8px #000;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.panda-btn img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.panda-btn:hover { transform: translateY(-2px); box-shadow: 0 0 0 8px oklch(0.74 0.15 40 / 0.12), 0 0 44px oklch(0.74 0.15 40 / 0.5), 0 10px 30px -8px #000; }
.live .panda-btn::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 1px solid oklch(0.74 0.15 40); animation: ember 4.5s var(--ease) infinite; pointer-events: none; }
@keyframes ember { 0%, 60% { transform: scale(1); opacity: .6; } 100% { transform: scale(1.5); opacity: 0; } }
.panda-tip {
  position: absolute; right: 76px; top: 50%; transform: translateY(-50%); white-space: nowrap;
  font-size: 14px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--rule);
  padding: 8px 12px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .3s;
}
.panda-btn:hover .panda-tip, .panda-btn:focus-visible .panda-tip { opacity: 1; }
.panda-btn[aria-expanded="true"] { transform: scale(.9); }

.chat {
  position: fixed; z-index: var(--z-chat);
  right: calc(40px + env(safe-area-inset-right)); bottom: calc(124px + env(safe-area-inset-bottom));
  width: min(392px, calc(100vw - 40px)); height: min(600px, calc(100vh - 140px));
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 22px;
  box-shadow: 0 30px 80px -20px #000, 0 0 60px -30px rgba(49, 130, 246, .35);
  overflow: hidden; transform-origin: bottom right;
}
.chat[hidden] { display: none; }
.chat.open { animation: chat-in .45s var(--ease); }
@keyframes chat-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 10px 14px 16px; border-bottom: 1px solid var(--rule); }
.chat-head img { width: 40px; height: 40px; border-radius: 50%; border: 1px solid oklch(0.74 0.15 40 / 0.6); }
.chat-head h2 { font-size: 17px; font-weight: 500; line-height: 1.3; display: flex; align-items: center; gap: 8px; }
.chat-head p { font-size: 13px; color: var(--ink-3); line-height: 1.4; }
.ai-tag { font-size: 12px; font-weight: 500; padding: 3px 8px; border-radius: 999px; color: var(--biolume); border: 1px solid rgba(91, 156, 255, .45); }
.chat-close { margin-left: auto; width: 44px; height: 44px; border-radius: 50%; border: 0; background: none; cursor: pointer; font-size: 26px; line-height: 1; color: var(--ink-2); }
.chat-close:hover { background: var(--surface-2); }
.chat-log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.msg { max-width: 88%; font-size: 16px; line-height: 1.65; padding: 11px 14px; border-radius: 16px; animation: rise .4s var(--ease) both; }
.msg.bot { background: var(--surface-2); color: var(--ink); border-bottom-left-radius: 6px; }
.msg.me { align-self: flex-end; background: #1f3f78; color: var(--ink); border-bottom-right-radius: 6px; }
.msg a { color: var(--biolume); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.msg ul { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 6px; }
.quick button { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--rule-strong); background: transparent; font-size: 16px; color: var(--ink); cursor: pointer; }
.quick button:hover { border-color: var(--biolume); color: var(--biolume); }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--rule); }
.chat-form input { flex: 1; min-width: 0; min-height: 46px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--rule-strong); background: var(--abyss-deep); color: var(--ink); font: inherit; font-size: 16px; }
.chat-form input::placeholder { color: var(--ink-3); }
.chat-form button { min-width: 64px; min-height: 46px; border-radius: 999px; border: 0; background: var(--biolume); color: #0f1116; font-weight: 600; font-size: 15px; cursor: pointer; }

@media (max-width: 639px) {
  .panda-btn { width: 58px; height: 58px; right: calc(22px + env(safe-area-inset-right)); bottom: calc(30px + env(safe-area-inset-bottom)); }
  .panda-tip { display: none; }
  .chat {
    inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0;
    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
  }
  .chat-head { padding: 10px 8px 10px 16px; }
  .chat-close { width: 48px; height: 48px; border: 1px solid var(--rule); }
  .chat.open { animation: chat-sheet .45s var(--ease); }
  @keyframes chat-sheet { from { transform: translateY(24px); opacity: 0; } }
  body.chat-open .panda-btn { display: none; }
  body.chat-open { overflow: hidden; }
}
body.sheet-open { overflow: hidden; }
html.locked, html.locked body { overflow: hidden; overscroll-behavior: none; }

/* 터치 대상 44px 이상 */
.link-quiet, .lab-all a, .foot nav a, .nav-secondary a, .stream li.more a { display: inline-flex; align-items: center; gap: .3em; min-height: 44px; }
.link-main { display: inline-flex; align-items: center; min-height: 44px; }
.next-link { min-height: 44px; }
.chat-head p { font-size: 14px; }
@media (max-width: 639px) {
  .chat-form button { min-height: 48px; }
  .chat-form input { min-height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pearl-text { animation: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
