:root {
  --bg: #16130e;
  --surface: #2A241C;
  --surface-2: #211C16;
  --paper: #F2EEE6;
  --ink: #ECE7DD;
  --ink-dark: #1C1A16;
  --muted: #A39C8E;
  --muted-dark: #4F4A3F;
  --faint: #8E8678;
  --accent: #F0A23A;
  --accent-hover: #FFC57A;
  --accent-dark: #A85A14;
  --danger: #F08A6A;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.12);
  --line-dark: rgba(20, 18, 14, 0.14);
  --display: 'Space Grotesk', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'IBM Plex Sans', sans-serif;
  --serif: 'IBM Plex Serif', Georgia, serif;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(72px, 9vw, 120px);
  --radius: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body { color: var(--ink); font-family: var(--sans); min-height: 100vh; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
::selection { background: var(--accent); color: var(--bg); }
input, textarea, select, button { font: inherit; }
button { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; }
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip-link { position: absolute; left: 16px; top: -60px; z-index: 60; background: var(--accent); color: var(--bg); padding: 10px 16px; border-radius: 999px; }
.skip-link:focus { top: 12px; color: var(--bg); }

.wrap { max-width: 1240px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; color: var(--accent); }
.h2 { font-size: clamp(32px, 3.8vw, 48px); line-height: 1.06; letter-spacing: -.015em; margin-top: 16px; text-wrap: balance; }
.lede { font-size: 18px; line-height: 1.62; color: var(--muted); }
.note { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 12px; letter-spacing: .06em; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 500; padding: 15px 26px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .15s var(--ease); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-hover); color: var(--bg); }
.btn-ghost { border-color: rgba(255, 255, 255, 0.2); color: var(--ink); background: none; }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-sm { font-size: 13px; padding: 9px 16px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: 14px; }
.link-btn:hover { color: var(--accent-hover); }

.pill { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; padding: 8px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; border: 1px solid rgba(255, 255, 255, 0.14); background: transparent; color: var(--muted); transition: background .15s, border-color .15s, color .15s; }
.pill:hover { border-color: rgba(240, 162, 58, 0.6); color: var(--ink); }
.pill[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--bg); }

.tag { font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 11px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }

/* ---------- Header / nav ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(22, 19, 14, 0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s, background .2s; }
.site-header.scrolled { border-bottom-color: var(--line); background: rgba(22, 19, 14, 0.92); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 16px; padding-bottom: 16px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 32px; height: 32px; background: var(--accent); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--bg); flex-shrink: 0; }
.brand-name { font-family: var(--display); font-weight: 600; font-size: 16px; white-space: nowrap; }
.brand-name span { color: var(--faint); font-weight: 400; }
.nav { display: flex; align-items: center; gap: 24px; font-size: 14px; }
.nav a, .nav-link { color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; font-size: 14px; }
.nav a:hover, .nav-link:hover { color: var(--ink); }
.nav .nav-cta { background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 999px; font-weight: 500; white-space: nowrap; }
.nav .nav-cta:hover { background: var(--accent); color: var(--bg); }
.account { display: contents; }
.acct { position: relative; }
.acct-btn { display: inline-flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; font-size: 14px; color: var(--ink); }
.acct-btn:hover { border-color: rgba(240, 162, 58, .6); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 1px solid rgba(240, 162, 58, .5); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 600; font-size: 12px; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); z-index: 5; }
.acct-who { font-family: var(--mono); font-size: 11px; color: var(--faint); padding: 2px 4px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; word-break: break-all; }
.acct-menu button { width: 100%; text-align: left; background: none; border: 0; padding: 8px 4px; cursor: pointer; color: var(--ink); font-size: 14px; border-radius: 6px; }
.acct-menu button:hover { color: var(--accent); }

.nav-toggle { display: none; background: none; border: 1px solid var(--line-strong); border-radius: 999px; width: 40px; height: 40px; color: var(--ink); cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { display: block; width: 16px; height: 1.5px; background: currentColor; position: relative; transition: transform .2s, background .2s; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 900px) {
  .brand-name span { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 20px; background: var(--bg); box-shadow: 0 30px 60px rgba(0, 0, 0, .5); border-bottom: 1px solid var(--line); display: none; }
  .nav.open { display: flex; }
  .nav a, .nav-link { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; text-align: left; }
  .acct { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .acct-menu { position: static; margin-top: 10px; box-shadow: none; }
  .nav .nav-cta { margin-top: 16px; text-align: center; border-bottom: none; padding: 13px 16px; }
}

/* ---------- Hero ---------- */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 70%; height: 140%; background: radial-gradient(closest-side, rgba(240, 162, 58, 0.10), transparent 70%); pointer-events: none; }
.hero-grid { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 48px; padding-top: clamp(56px, 8vw, 104px); padding-bottom: clamp(56px, 8vw, 104px); align-items: center; }
.badge { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 999px; padding: 6px 14px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); white-space: nowrap; }
.dot { display: inline-block; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }
.hero h1 { font-size: clamp(40px, 5.6vw, 72px); line-height: 1.02; letter-spacing: -.02em; margin-top: 24px; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--accent); }
.decode { font-variant-ligatures: none; }
.hero .lede { max-width: 500px; margin-top: 26px; }
.actions { display: flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; }

.swarm { position: relative; margin: 0; min-height: 420px; height: 100%; border-radius: var(--radius); background: var(--bg); border: 1px solid rgba(255, 255, 255, 0.08); background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px); background-size: 20px 20px; overflow: hidden; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(240, 162, 58, 0.04); }
.swarm canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: pan-y; }
.hud { position: absolute; left: 14px; right: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--faint); pointer-events: none; }
.hud-top { top: 14px; }
.hud-top span:first-child { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.hud-bottom { bottom: 14px; flex-wrap: wrap; }
.modes { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(22, 19, 14, 0.8); border: 1px solid var(--line-strong); pointer-events: auto; backdrop-filter: blur(6px); }
.mode { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; padding: 6px 12px; border-radius: 999px; border: 0; background: none; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.mode:hover { color: var(--ink); }
.mode[aria-pressed="true"] { background: var(--accent); color: var(--bg); }
.hud-hint { text-transform: uppercase; }

.sectors { border-top: 1px solid var(--line); position: relative; }
.ticker { display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; padding-top: 20px; padding-bottom: 20px; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--faint); list-style: none; margin-top: 0; margin-bottom: 0; }
.ticker li:first-child { color: var(--muted); }

/* ---------- Cards / spotlight ---------- */
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .2s, translate .3s var(--ease); isolation: isolate; }
.card:hover { border-color: rgba(240, 162, 58, 0.45); }
.spot::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), rgba(240, 162, 58, 0.09), transparent 60%); opacity: 0; transition: opacity .25s; pointer-events: none; z-index: -1; }
.spot:hover::before { opacity: 1; }

/* ---------- Services ---------- */
.intro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 24px 48px; align-items: end; }
.intro-grid p { font-size: 17px; line-height: 1.62; color: var(--muted); max-width: 480px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; margin-top: 52px; }
.service { padding: 32px 30px 34px; display: flex; flex-direction: column; gap: 18px; }
.service:hover { translate: 0 -3px; }
.service-head { display: flex; justify-content: space-between; align-items: center; }
.service-num { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(240, 162, 58, 0.5); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 13px; color: var(--accent); transition: background .2s, color .2s; }
.service:hover .service-num { background: var(--accent); color: var(--bg); }
.service-kind { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--faint); }
.service h3 { font-size: 26px; margin-top: 8px; }
.service p { font-size: 15px; line-height: 1.62; color: var(--muted); }
.service .tags { margin-top: auto; padding-top: 8px; }

/* ---------- Approach ---------- */
.approach { background: var(--paper); color: var(--ink-dark); }
.approach ::selection { background: var(--accent-dark); color: var(--paper); }
.approach-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 56px; }
.approach .eyebrow { color: var(--accent-dark); }
.approach h2 { font-size: clamp(34px, 4.4vw, 56px); line-height: 1.04; letter-spacing: -.02em; margin-top: 16px; text-wrap: balance; }
.approach .lede { color: var(--muted-dark); margin-top: 28px; max-width: 520px; }
.principles { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line-dark); }
.principles li { display: grid; grid-template-columns: 56px 1fr; gap: 16px; padding: 26px 0; border-top: 1px solid var(--line-dark); transition: padding-left .25s var(--ease); }
.principles li:hover { padding-left: 8px; }
.principles .idx { font-family: var(--mono); font-size: 13px; color: var(--accent-dark); }
.principles h3 { font-size: 21px; }
.principles p { font-size: 15px; line-height: 1.6; color: var(--muted-dark); margin-top: 8px; }

/* ---------- Work ---------- */
.work-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 16px; margin-top: 44px; }
.case { padding: 30px; display: flex; flex-direction: column; gap: 14px; min-height: 300px; }
.case.pop { animation: pop .45s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.case-meta, .paper-meta { display: flex; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; }
.case-meta span:first-child, .paper-meta span:first-child { color: var(--accent); }
.case-meta span:last-child, .paper-meta span:last-child { color: var(--faint); }
.case h3 { font-size: 23px; line-height: 1.2; margin-top: 6px; text-wrap: balance; }
.case p { font-size: 15px; line-height: 1.6; color: var(--muted); }
.metric { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.08); display: flex; align-items: baseline; gap: 12px; }
.metric strong { font-family: var(--display); font-weight: 600; font-size: 30px; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.metric span { font-size: 13px; color: var(--faint); }

/* ---------- Research ---------- */
.research { background: var(--surface-2); border-top: 1px solid var(--line); }
.research-lede { font-size: 16px; color: var(--muted); margin-top: 14px; max-width: 520px; }
.member-state .lock { font-size: 12px; }
.paper-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; margin-top: 44px; }
.paper-card { display: flex; flex-direction: column; gap: 14px; padding: 30px; color: var(--ink); min-height: 360px; }
.paper-card:hover { color: var(--ink); translate: 0 -3px; }
.paper-card h3 { font-size: 25px; line-height: 1.15; margin-top: 4px; text-wrap: balance; }
.paper-sub { font-size: 14px; color: var(--faint); }
.paper-abs { font-size: 15px; line-height: 1.6; color: var(--muted); }
.ghost-lines { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; filter: blur(2px); opacity: .55; }
.ghost-lines span { height: 7px; border-radius: 4px; background: linear-gradient(90deg, rgba(236, 231, 221, .16), rgba(236, 231, 221, .05)); }
.ghost-lines span:nth-child(1) { width: 92%; } .ghost-lines span:nth-child(2) { width: 78%; } .ghost-lines span:nth-child(3) { width: 86%; } .ghost-lines span:nth-child(4) { width: 54%; }
.paper-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.08); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.read { font-size: 14px; color: var(--accent); transition: transform .2s var(--ease); }
.paper-card:hover .read { transform: translateX(4px); }
.lock { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.lock::before { content: ""; width: 12px; height: 12px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2'%3E%3Crect x='4.5' y='10.5' width='15' height='10' rx='2'/%3E%3Cpath d='M8 10.5V7.5a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2'%3E%3Crect x='4.5' y='10.5' width='15' height='10' rx='2'/%3E%3Cpath d='M8 10.5V7.5a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center / contain no-repeat; }
.lock.open { color: var(--accent); }
.lock.open::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2'%3E%3Crect x='4.5' y='10.5' width='15' height='10' rx='2'/%3E%3Cpath d='M8 10.5V7.5a4 4 0 0 1 7.6-1.7'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2'%3E%3Crect x='4.5' y='10.5' width='15' height='10' rx='2'/%3E%3Cpath d='M8 10.5V7.5a4 4 0 0 1 7.6-1.7'/%3E%3C/svg%3E"); }
.skeleton { min-height: 360px; border-radius: var(--radius); background: linear-gradient(100deg, var(--surface) 30%, #322b22 50%, var(--surface) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* ---------- Process ---------- */
.process { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.process h2 { max-width: 720px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 40px 0; margin-top: 56px; list-style: none; padding: 0; margin-bottom: 0; }
.step { padding: 0 28px 8px 0; display: flex; flex-direction: column; gap: 14px; }
.step-track { display: flex; align-items: center; gap: 12px; }
.step-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--accent); flex-shrink: 0; transition: background .3s, box-shadow .3s; }
.step-dot.filled { background: var(--accent); animation: nodePulse 2.4s infinite; }
.step-dot.end { background: var(--ink); border-color: var(--ink); }
.step-line { flex: 1; height: 1px; background: rgba(240, 162, 58, 0.4); transform-origin: left; }
.step-when { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--faint); margin-top: 10px; }
.step h3 { font-size: 23px; }
.step p { font-size: 15px; line-height: 1.6; color: var(--muted); }
.steps.armed .step { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.steps.armed .step-line { transform: scaleX(0); transition: transform .7s var(--ease); }
.steps.armed.run .step { opacity: 1; transform: none; }
.steps.armed.run .step-line { transform: scaleX(1); }
.steps.armed.run .step:nth-child(2), .steps.armed.run .step:nth-child(2) .step-line { transition-delay: .25s; }
.steps.armed.run .step:nth-child(3), .steps.armed.run .step:nth-child(3) .step-line { transition-delay: .5s; }
.steps.armed.run .step:nth-child(4) { transition-delay: .75s; }
.steps.armed.run .step:nth-child(1) .step-line { transition-delay: .1s; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 56px; }
.contact h2 { font-size: clamp(36px, 4.6vw, 60px); line-height: 1.02; letter-spacing: -.02em; margin-top: 16px; text-wrap: balance; }
.contact .lede { margin-top: 24px; max-width: 440px; }
.contact-details { display: flex; flex-direction: column; gap: 10px; margin-top: 36px; font-family: var(--mono); font-size: 14px; }
.contact-details span { color: var(--faint); font-size: 12px; letter-spacing: .06em; }
.panel { background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: var(--radius); padding: clamp(22px, 3vw, 36px); }
.form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--faint); border: 0; padding: 0; margin: 0; min-width: 0; }
.field legend { padding: 0; margin-bottom: 8px; }
.field input, .field textarea { background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px; padding: 13px 14px; color: var(--ink); font-family: var(--sans); font-size: 15px; letter-spacing: 0; outline: none; width: 100%; transition: border-color .15s, box-shadow .15s; }
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240, 162, 58, 0.15); }
.field input::placeholder, .field textarea::placeholder { color: #6b6457; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form > .btn { align-self: flex-start; }
.form-error { color: var(--danger); font-size: 14px; }
.form-error:empty { display: none; }
.sent { min-height: 360px; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.check { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; color: var(--bg); font-size: 20px; font-weight: 700; animation: pop .45s var(--ease); }
.sent h3 { font-size: 28px; margin-top: 8px; }
.sent p { font-size: 16px; line-height: 1.6; color: var(--muted); max-width: 380px; }
.sent .btn { align-self: flex-start; font-size: 14px; padding: 10px 18px; margin-top: 8px; }

/* ---------- Auth dialog ---------- */
dialog.auth { width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 18px; padding: 34px 30px 28px; box-shadow: 0 40px 100px rgba(0, 0, 0, .6); }
dialog.auth[open] { animation: rise .3s var(--ease); }
dialog.auth::backdrop { background: rgba(10, 8, 6, 0.7); backdrop-filter: blur(4px); }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.auth h2 { font-size: 26px; margin-top: 18px; letter-spacing: -.01em; }
.auth-sub { font-size: 14px; line-height: 1.55; color: var(--muted); margin: 8px 0 22px; }
.auth-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.auth-close:hover { color: var(--ink); border-color: var(--ink); }
.auth .form { gap: 14px; }
.auth .form > .btn { align-self: stretch; margin-top: 4px; }
.auth-foot { text-align: center; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 28px; padding-bottom: 28px; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--faint); }

/* ---------- Reader ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 40; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .1s linear; }
.paper-hero { background: var(--surface); border-bottom: 1px solid var(--line); }
.paper-hero .wrap { padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(36px, 5vw, 60px); }
.crumbs { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--faint); display: flex; gap: 8px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.paper-meta.big { justify-content: flex-start; gap: 18px; margin-top: 28px; flex-wrap: wrap; }
.paper-hero h1 { font-size: clamp(34px, 5vw, 64px); line-height: 1.04; letter-spacing: -.02em; margin-top: 14px; max-width: 900px; text-wrap: balance; }
.paper-subtitle { font-size: 19px; line-height: 1.5; color: var(--muted); margin-top: 18px; max-width: 720px; }
.paper-hero .tags { margin-top: 24px; }
.related { margin-top: 22px; font-size: 14px; color: var(--faint); }

.reader { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; padding-top: 48px; padding-bottom: 96px; }
.toc-inner { position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow: auto; padding-right: 6px; }
.toc-inner { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.toc-inner::-webkit-scrollbar { width: 6px; }
.toc-inner::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); border-radius: 3px; }
.toc-title { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; color: var(--faint); }
.toc ol { list-style: none; padding: 0; margin: 14px 0 0; border-left: 1px solid var(--line-strong); }
.toc li a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 1px solid transparent; font-size: 13px; line-height: 1.4; color: var(--muted); transition: color .15s, border-color .15s; }
.toc li.sub a { padding-left: 26px; font-size: 12.5px; color: var(--faint); }
.toc li a:hover { color: var(--ink); }
.toc li a.active { color: var(--accent); border-left-color: var(--accent); }

.reader-main { position: relative; min-width: 0; }
.doc { background: var(--paper); color: var(--ink-dark); border-radius: var(--radius); padding: clamp(24px, 5vw, 64px); font-family: var(--serif); font-size: 17.5px; line-height: 1.72; box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .8); transition: filter .8s var(--ease), opacity .8s var(--ease); min-height: 60vh; }
.doc ::selection { background: var(--accent-dark); color: var(--paper); }
.doc > :first-child { margin-top: 0; }
.doc h2 { font-family: var(--display); font-size: clamp(24px, 2.6vw, 30px); line-height: 1.2; letter-spacing: -.01em; margin: 2.1em 0 .6em; padding-top: .9em; border-top: 1px solid var(--line-dark); }
.doc > h2:first-child { border-top: 0; padding-top: 0; }
.doc h3 { font-family: var(--display); font-size: 20px; line-height: 1.3; margin: 1.7em 0 .4em; }
.doc p { margin: 0 0 1em; }
.doc p.note { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; letter-spacing: 0; color: var(--muted-dark); background: rgba(168, 90, 20, 0.07); border-left: 2px solid var(--accent-dark); padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 0 0 1.2em; }
.doc ul { margin: 0 0 1.2em; padding-left: 1.2em; }
.doc li { margin: 0 0 .55em; padding-left: .2em; }
.doc li::marker { color: var(--accent-dark); }
.doc li.sub { margin-left: 1.2em; }
.doc strong { font-weight: 600; }
.doc a { color: var(--accent-dark); text-decoration: underline; text-decoration-color: rgba(168, 90, 20, .35); text-underline-offset: 3px; }
.doc a:hover { color: #7a3f0b; text-decoration-color: currentColor; }
.table-wrap { overflow-x: auto; margin: 1.4em 0 1.8em; border: 1px solid var(--line-dark); border-radius: 10px; }
.doc table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 14px; line-height: 1.5; min-width: 640px; }
.doc th { text-align: left; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-dark); background: rgba(20, 18, 14, 0.04); }
.doc th, .doc td { padding: 12px 14px; border-bottom: 1px solid var(--line-dark); vertical-align: top; }
.doc tr:last-child td { border-bottom: 0; }
.doc td:first-child { font-weight: 600; }

.doc.locked { filter: blur(7px); user-select: none; pointer-events: none; opacity: .9; max-height: 1500px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 40%, transparent 98%); mask-image: linear-gradient(#000 40%, transparent 98%); }
.doc.unlocking { max-height: none; -webkit-mask-image: none; mask-image: none; }
.gate { position: absolute; inset: 0; display: flex; justify-content: center; align-items: flex-start; padding: 140px 16px 0; }
.gate-card { position: sticky; top: 140px; width: min(460px, 100%); background: rgba(33, 28, 22, 0.94); backdrop-filter: blur(10px); border: 1px solid var(--line-strong); border-radius: 18px; padding: 32px 30px; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); animation: rise .4s var(--ease); }
.gate-lock { width: 52px; height: 52px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--accent); border: 1px solid rgba(240, 162, 58, .5); background: rgba(240, 162, 58, .08); }
.gate-card h2 { font-size: 24px; margin-top: 18px; }
.gate-card p { font-size: 15px; line-height: 1.6; color: var(--muted); margin-top: 10px; }
.gate-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.gate-note { display: block; margin-top: 16px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--faint); text-transform: uppercase; }

@media (max-width: 900px) {
  .reader { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 28px; }
  .toc { display: none; }
  .doc { font-size: 16.5px; }
  .gate { padding-top: 80px; }
  .gate-card { top: 100px; padding: 26px 20px; }
}

/* 404 */
.lost { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 18px; }
.lost h1 { font-size: clamp(40px, 6vw, 72px); letter-spacing: -.02em; }
.lost p { color: var(--muted); font-size: 18px; }

/* ---------- Motion ---------- */
@keyframes nodePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(240, 162, 58, .55); } 70% { box-shadow: 0 0 0 12px rgba(240, 162, 58, 0); } }
.pulse { animation: nodePulse 2.4s infinite; }
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease), border-color .2s, translate .3s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media (max-width: 480px) {
  .swarm { min-height: 360px; }
  .hud { left: 10px; right: 10px; }
  .hud-hint { display: none; }
  .paper-card, .case, .service { padding: 24px 22px; }
}

@media print {
  .site-header, .progress, .toc, .gate, .site-footer { display: none !important; }
  .reader { display: block; }
  .doc { box-shadow: none; padding: 0; }
}
