/* HEBE — skin "hebe" on the RISCON readability guideline (riscon-guidelines/readability, tokens.json).
   Skin profile is in AGENTS.md. Sizes used: 12 · 14 · 17 · 21 · 24 · 28 · 40 (seven steps). No text below 12px. */

@font-face {
  font-family: 'Pretendard Variable';
  src: url('assets/fonts/PretendardVariable.woff2') format('woff2');
  font-weight: 45 930;
  font-style: normal;
  font-display: swap;
}

:root, [data-theme="light"] {
  --ink: #1d1d1f;
  --ink-secondary: #5f5f64;
  --surface: #ffffff;
  --surface-alt: #f5f5f7;
  --navy: #0b1527;
  --navy-deep: #081121;
  --navy-tint: #f0f2f6;
  --link: #0b1527;
  --hairline: #d2d2d7;
  --point: #0b6e63;
  --point-tint: #e6f3f1;
  --warn: #9a4a00;
  --neg: #b42318;
}
[data-theme="dark"] {
  --ink: #ededed;
  --ink-secondary: #a3a7ae;
  --surface: #0b1527;
  --surface-alt: #0e1b2e;
  --navy: #0b1527;
  --navy-deep: #081121;
  --navy-tint: #14243a;
  --link: #ffffff;
  --hairline: #2a3548;
  --point: #5fd0bf;
  --point-tint: #11312f;
  --warn: #f5b25c;
  --neg: #ff8a80;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --ink: #ededed;
    --ink-secondary: #a3a7ae;
    --surface: #0b1527;
    --surface-alt: #0e1b2e;
    --navy: #0b1527;
    --navy-deep: #081121;
    --navy-tint: #14243a;
    --link: #ffffff;
    --hairline: #2a3548;
    --point: #5fd0bf;
    --point-tint: #11312f;
    --warn: #f5b25c;
    --neg: #ff8a80;
  }
}

:root {
  --font-sans: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Pretendard Variable", monospace;
  --measure-reading: 36em;
  --page: 1120px;
  --gutter: 20px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--surface); color: var(--ink);
  font-family: var(--font-sans); font-size: 17px; line-height: 27px; font-weight: 400; letter-spacing: 0;
  word-break: keep-all; overflow-wrap: break-word;
}
a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--point); }
:focus-visible { outline: 2px solid var(--point); outline-offset: 2px; }
.mono, code { font-family: var(--font-mono); font-size: 14px; overflow-wrap: anywhere; }
.url { overflow-wrap: anywhere; }

/* header band: navy, 52px, menu text 14px */
.top { position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; }
.top-in { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); height: 52px; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 17px; line-height: 23px; }
.brand:hover { color: #fff; }
.brand-lab { font-weight: 600; }
.brand-rule { width: 1px; height: 16px; background: rgba(255,255,255,.45); display: inline-block; }
.brand b { font-weight: 700; }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav a { color: #d9dee8; text-decoration: none; font-size: 14px; line-height: 20px; padding: 8px 10px; border-radius: 6px; white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.1); }
.menu-btn { font: inherit; font-size: 14px; line-height: 20px; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.5); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.menu-btn:hover { border-color: #fff; }
@media (max-width: 860px) { .nav { display: none; } .menu-btn { margin-left: auto; } }

main { max-width: var(--page); margin: 0 auto; padding: 40px var(--gutter) 64px; }
h1 { font-size: 40px; line-height: 48px; font-weight: 700; margin: 8px 0 16px; letter-spacing: 0; }
h2 { font-size: 28px; line-height: 35px; font-weight: 700; margin: 48px 0 12px; letter-spacing: 0; }
h3 { font-size: 21px; line-height: 29px; font-weight: 600; margin: 0 0 8px; letter-spacing: 0; }
p { margin: 0 0 14px; }
.lede { font-size: 21px; line-height: 32px; max-width: var(--measure-reading); color: var(--ink); }
.read { max-width: var(--measure-reading); }
.eyebrow { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--point); margin: 0 0 4px; }
.eyebrow a { color: inherit; }
.note { font-size: 14px; line-height: 22px; color: var(--ink-secondary); }
.src { font-size: 14px; line-height: 22px; color: var(--ink-secondary); }
@media (max-width: 640px) {
  main { padding-top: 28px; }
  h1 { font-size: 28px; line-height: 35px; }
  h2 { font-size: 24px; line-height: 31px; margin-top: 40px; }
  .lede { font-size: 17px; line-height: 27px; }
}

/* blocks */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3 { grid-template-columns: 1fr; } }
.card { border: 1px solid var(--hairline); border-radius: 12px; background: var(--surface); padding: 20px; }
.card.alt { background: var(--surface-alt); }
a.card { display: block; text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--point); }
.card h3 a { text-decoration: none; }
.area-card .num { font-size: 28px; line-height: 35px; font-weight: 700; }
.area-card.quiet { background: var(--surface-alt); }
.stats { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 12px 0 0; padding: 0; list-style: none; }
.stats li { font-size: 14px; line-height: 20px; color: var(--ink-secondary); }
.stats b { display: block; font-size: 24px; line-height: 31px; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.tag { display: inline-block; font-size: 12px; line-height: 17px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--surface-alt); color: var(--ink); border: 1px solid var(--hairline); }
.tag.pos { background: var(--point-tint); border-color: transparent; color: var(--ink); }
.tag.neg { color: var(--neg); border-color: currentColor; background: transparent; }
.tag.mix { color: var(--warn); border-color: currentColor; background: transparent; }
.tag.quiet { color: var(--ink-secondary); }
.pill { font: inherit; font-size: 14px; line-height: 20px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--surface); color: var(--ink); cursor: pointer; }
.pill[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
[data-theme="dark"] .pill[aria-pressed="true"] { background: var(--point); border-color: var(--point); color: #0b1527; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .pill[aria-pressed="true"] { background: var(--point); border-color: var(--point); color: #0b1527; } }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 20px; }

.unit { border-top: 1px solid var(--hairline); padding: 20px 0; }
.unit:first-of-type { border-top: 0; }
.unit h3 { margin-bottom: 6px; }
.unit .claim { max-width: var(--measure-reading); }
.unit .limits { max-width: var(--measure-reading); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 10px 0; font-size: 14px; line-height: 22px; }
.kv dt { color: var(--ink-secondary); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; gap: 0; } .kv dd { margin-bottom: 6px; } }
ul.plain { margin: 6px 0; padding-left: 20px; }
ul.plain li { margin: 4px 0; }
.refs { font-size: 14px; line-height: 22px; margin: 8px 0 0; padding-left: 20px; }
.refs li { margin: 3px 0; }

.pair { border: 1px solid var(--hairline); border-radius: 12px; padding: 24px; margin: 0 0 16px; }
.pair h3 { font-size: 24px; line-height: 31px; }
.pair .q { color: var(--ink-secondary); }
.pair .j { font-size: 17px; line-height: 27px; max-width: var(--measure-reading); }
.pair h4 { font-size: 14px; line-height: 20px; font-weight: 600; margin: 18px 0 4px; color: var(--point); }
.pair .basis li, .pair .next li { max-width: var(--measure-reading); }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
table.t th, table.t td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
table.t th { font-weight: 600; color: var(--ink-secondary); }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; }

.callout { border-left: 3px solid var(--point); background: var(--surface-alt); padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 20px 0; max-width: 48em; }
.empty { border: 1px dashed var(--hairline); border-radius: 12px; padding: 20px; color: var(--ink-secondary); }

/* full menu */
dialog { color: var(--ink); background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; padding: 0; max-width: min(960px, calc(100vw - 32px)); width: 100%; }
dialog::backdrop { background: rgba(8, 17, 33, .55); }
.fullmenu .fm { display: grid; grid-template-columns: minmax(0, 1fr) 280px; }
@media (max-width: 720px) { .fullmenu .fm { grid-template-columns: 1fr; } }
.fm-map { padding: 24px; }
.fm-map h3 { font-size: 14px; line-height: 20px; color: var(--ink-secondary); margin: 16px 0 6px; }
.fm-map h3:first-child { margin-top: 0; }
.fm-map a { display: block; padding: 6px 0; font-size: 17px; line-height: 23px; text-decoration: none; }
.fm-set { background: var(--surface-alt); padding: 24px; border-left: 1px solid var(--hairline); }
.fm-set h3 { font-size: 14px; line-height: 20px; color: var(--ink-secondary); margin: 0 0 8px; }
.fm-set .row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.icon-btn { font: inherit; font-size: 14px; line-height: 20px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--hairline); background: var(--surface); color: var(--ink); cursor: pointer; }
.fm-close { display: flex; justify-content: flex-end; padding: 12px 16px 0; }
.rec-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 24px 0; }
.rec-b { padding: 8px 24px 24px; }

/* footer and family bar */
.foot { max-width: var(--page); margin: 0 auto; padding: 24px var(--gutter) 32px; border-top: 1px solid var(--hairline); font-size: 14px; line-height: 22px; color: var(--ink-secondary); }
.riscon-family-bar { background: var(--navy); color: #fff; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px var(--gutter); font-size: 14px; line-height: 20px; }
.riscon-family-bar a { color: #d9dee8; text-decoration: none; }
.riscon-family-bar a:hover, .riscon-family-bar a[aria-current="page"] { color: #fff; text-decoration: underline; }
.riscon-family-lab { font-weight: 600; color: #fff !important; }
.riscon-family-rule { width: 1px; height: 14px; background: rgba(255,255,255,.35); }
.riscon-family-sites { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }

/* Structure Lab (assets/structure-viewer.js). The stage stays dark in both themes; HUD text is 12px or larger. */
.sv-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; margin-top: 12px; scrollbar-width: thin; }
.sv-tab { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--hairline); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; text-align: left; }
.sv-tab b { font-size: 14px; line-height: 20px; font-weight: 600; }
.sv-tab small { font-size: 12px; line-height: 17px; color: var(--ink-secondary); }
.sv-tab[aria-selected="true"] { border-color: var(--point); box-shadow: inset 0 0 0 1px var(--point); background: var(--point-tint); }
.sv-tab.exp b::before { content: "◇ "; }
.sv-tab[hidden] { display: none; }
.sv-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 980px) { .sv-wrap { grid-template-columns: 1fr; } }
.sv { position: relative; border-radius: 12px; overflow: hidden; }
.sv-stage { position: relative; height: clamp(360px, 60vh, 640px); background-color: #04060b; background-image: radial-gradient(120% 90% at 50% 38%, #16213a 0%, #0b1120 52%, #04060b 100%); }
.sv:fullscreen .sv-stage { height: 100vh; }
.sv-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; outline: none; }
.sv-gl.grab { cursor: grabbing; }
.sv-gl:focus-visible { box-shadow: inset 0 0 0 2px #5fd0bf; }
.sv-hud { position: absolute; z-index: 2; font-size: 12px; line-height: 17px; }
.sv-tl { left: 16px; top: 14px; display: flex; flex-direction: column; gap: 2px; max-width: 55%; pointer-events: none; }
.sv-tl .sv-kind { font-size: 12px; line-height: 17px; font-weight: 600; color: #a9b2c8; }
.sv-tl b { font-size: 21px; line-height: 29px; font-weight: 600; color: #f3f6fc; }
.sv-tl span:last-child { color: #b9c1d3; font-size: 12px; }
.sv-tr { right: 12px; top: 12px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 46%; }
.sv-tr button { font: inherit; font-size: 12px; line-height: 17px; color: #e3e8f2; background: rgba(20,28,46,.8); border: 1px solid rgba(170,190,230,.35); border-radius: 6px; padding: 6px 9px; cursor: pointer; }
.sv-tr button:hover { border-color: rgba(200,215,245,.7); color: #fff; }
.sv-tr button[aria-pressed="true"] { background: rgba(95,208,191,.28); border-color: #5fd0bf; color: #fff; }
.sv-seg { display: inline-flex; }
.sv-seg button { border-radius: 0; }
.sv-seg button:first-child { border-radius: 6px 0 0 6px; }
.sv-seg button:last-child { border-radius: 0 6px 6px 0; margin-left: -1px; }
.sv-legend { position: absolute; left: 16px; bottom: 36px; right: 16px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; line-height: 17px; color: #d3d9e6; pointer-events: none; z-index: 2; }
.sv-key { display: inline-flex; align-items: center; gap: 6px; }
.sv-key i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sv-key em { font-style: normal; color: #a9b2c8; }
.sv-key-note { color: #a9b2c8; }
.sv-ramp { width: 120px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #6f63d9, #4fb3c9, #7fc8a9, #d3a065, #e8899e); }
.sv-hint { position: absolute; left: 16px; bottom: 12px; font-size: 12px; line-height: 17px; color: #a9b2c8; pointer-events: none; z-index: 2; }
.sv-tip { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; background: rgba(8,12,22,.94); border: 1px solid rgba(160,175,230,.35); border-radius: 8px; padding: 7px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 12px; line-height: 17px; max-width: 260px; color: #e3e8f2; }
.sv-tip b { color: #fff; }
.sv-tip small { color: #b9c1d3; font-size: 12px; }
.sv-msg { position: absolute; left: 16px; right: 16px; bottom: 64px; z-index: 2; background: rgba(60,24,20,.85); border: 1px solid rgba(255,140,120,.5); color: #fff; padding: 10px 12px; border-radius: 8px; font-size: 14px; line-height: 20px; }
.sv-side { border: 1px solid var(--hairline); border-radius: 12px; background: var(--surface); padding: 16px 18px; font-size: 14px; line-height: 22px; }
.sv-side h3 { margin: 2px 0 10px; }
.sv-side h3 small { display: block; font-size: 14px; color: var(--ink-secondary); font-weight: 400; }
.sv-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0; }
.sv-chains { margin: 10px 0; }
.sv-btn { font: inherit; font-size: 14px; line-height: 20px; font-weight: 600; color: #fff; background: var(--navy); border: 0; border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.sv-trackbox { margin-top: 12px; border-radius: 10px; background: #070a12; border: 1px solid #1b2436; padding: 10px 10px 4px; color: #d7deee; }
.sv-trackhead { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; line-height: 17px; color: #b9c1d3; padding: 0 2px 6px; }
.sv-track { display: block; width: 100%; cursor: crosshair; }
.sv-pae { display: grid; grid-template-columns: minmax(220px, 360px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 760px) { .sv-pae { grid-template-columns: 1fr; } }
.sv-paecv { width: 100%; display: block; border-radius: 6px; border: 1px solid var(--hairline); cursor: crosshair; image-rendering: pixelated; }
.sv-paekey { display: flex; align-items: center; gap: 8px; font-size: 12px; line-height: 17px; color: var(--ink-secondary); margin-top: 6px; }
.sv-paekey i { flex: 1; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgb(8,46,26), rgb(40,150,84), rgb(236,244,236)); }
.sv-paeread { font-size: 14px; line-height: 22px; min-height: 22px; }
@media (max-width: 640px) { .sv-tl { max-width: calc(100% - 28px); } .sv-tr { left: 12px; right: 12px; top: 86px; max-width: none; justify-content: flex-start; } .sv-legend { bottom: 12px; left: 12px; right: 12px; } .sv-key em, .sv-hint { display: none; } }
.sv-side .kv { grid-template-columns: 1fr; gap: 0; }
.sv-side .kv dt { margin-top: 8px; }
.sv-side .kv dt:first-child { margin-top: 0; }
