/* ---------- tokens ---------- */
:root {
  --body-font: 'Inter Tight', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --accent: #3b6dff;
}
:root[data-theme="dark"] {
  --bg: #07090f;
  --bg-soft: #0c111c;
  --bg-card: #0e1422;
  --fg: #eef0f5;
  --muted: #6c7689;
  --rule: #1b2233;
  --rule-soft: #131a28;
}
:root[data-theme="light"] {
  --bg: #f6f5f1;
  --bg-soft: #efede7;
  --bg-card: #ffffff;
  --fg: #0a0e1a;
  --muted: #6b6e78;
  --rule: #d8d5cc;
  --rule-soft: #e6e3da;
}
:root[data-density="compact"] {
  --space-section: 96px;
  --space-block: 32px;
}
:root[data-density="comfortable"] {
  --space-section: 160px;
  --space-block: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; min-width: 0; }
html, body { background: var(--bg); color: var(--fg); font-family: var(--body-font); -webkit-font-smoothing: antialiased; width: 100%; max-width: 100%; overflow-x: clip; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- ambient bg ---------- */
.ambient-hex {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: 0.035;
  mask-image: radial-gradient(ellipse 80% 60% at 80% 20%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 80% 20%, #000 0%, transparent 70%);
}
:root[data-theme="light"] .ambient-hex { opacity: 0.06; }
.ambient-hex__pre {
  font-family: var(--mono); font-size: 11px; line-height: 1.6; color: var(--fg);
  white-space: pre; padding: 80px 40px;
}

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(12px); }
.nav__inner { max-width: 1440px; margin: 0 auto; padding: 18px 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav__brand { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: -0.01em; }
.nav__mark { display: inline-flex; color: var(--fg); }
.nav__name { color: var(--fg); }
.nav__dot { color: var(--accent); }
.nav__links { display: flex; gap: 28px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.nav__links a:hover { color: var(--fg); }
.nav__right { display: flex; align-items: center; gap: 16px; }
.theme-toggle { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 1px solid var(--rule); color: var(--muted); transition: color .15s, border-color .15s; }
.theme-toggle:hover { color: var(--fg); border-color: var(--fg); }
.nav__cta { font-family: var(--mono); font-size: 12px; color: var(--fg); padding: 8px 14px; border: 1px solid var(--rule); }
.nav__cta:hover { border-color: var(--accent); color: var(--accent); }
.nav__rule { height: 1px; background: var(--rule); }

/* ---------- hero ---------- */
.hero { position: relative; z-index: 1; max-width: 1440px; margin: 0 auto; padding: 0 32px; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; padding: 80px 0 64px; align-items: start; }
.hero__right { min-width: 0; max-width: 100%; }
.hero__eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.02em; margin-bottom: 32px; }
.hero__eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 20%, transparent); }
.hero__h1 { font-size: clamp(44px, 5.4vw, 76px); font-weight: 500; letter-spacing: -0.035em; line-height: 0.98; color: var(--fg); }
.hero__h1-accent { font-style: italic; font-weight: 400; color: var(--muted); }
.hero__lede { margin-top: 28px; max-width: 480px; font-size: 17px; line-height: 1.55; color: var(--muted); }
.hero__cta-row { margin-top: 36px; display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 20px; font-family: var(--mono); font-size: 13px; transition: transform .12s; }
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--ghost { border: 1px solid var(--rule); color: var(--fg); }
.btn--ghost:hover { border-color: var(--fg); }
.btn__arrow { display: inline-block; transition: transform .15s; }
.btn:hover .btn__arrow { transform: translateX(3px); }

.hero__principles { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 14px; max-width: 520px; }
.principle { display: grid; grid-template-columns: 50px 1fr; gap: 16px; align-items: baseline; }
.principle__k { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: 0.04em; }
.principle__v { font-size: 15px; color: var(--fg); line-height: 1.5; }

.hero__right { position: relative; }
.hero__variant-tabs { margin-top: 12px; display: flex; gap: 0; border: 1px solid var(--rule); border-top: 0; }
.tab { flex: 1; padding: 10px 12px; font-family: var(--mono); font-size: 11px; color: var(--muted); border-right: 1px solid var(--rule); transition: background .15s, color .15s; }
.tab:last-child { border-right: 0; }
.tab.is-active { color: var(--fg); background: var(--bg-soft); }
.tab:hover { color: var(--fg); }

/* ---------- disassembly ---------- */
.disasm { background: var(--bg-card); border: 1px solid var(--rule); font-family: var(--mono); font-size: 12px; width: 100%; max-width: 100%; overflow: hidden; }
.disasm__chrome { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--rule); background: var(--bg-soft); min-width: 0; }
.disasm__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rule); flex-shrink: 0; }
.disasm__path { color: var(--muted); font-size: 11px; margin-left: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.disasm__status { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; letter-spacing: 0.08em; flex-shrink: 0; }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.disasm__body { padding: 16px 14px; min-height: 360px; overflow: hidden; }
.disasm__row { display: grid; grid-template-columns: 90px 180px 60px minmax(0, 1fr); align-items: baseline; padding: 3px 0; color: var(--muted); position: relative; }
.disasm__row.is-current { color: var(--fg); }
.disasm__row.is-done { color: color-mix(in oklab, var(--fg) 70%, transparent); }
.disasm__addr { color: var(--muted); min-width: 0; }
.disasm__bytes { color: color-mix(in oklab, var(--muted) 80%, transparent); white-space: pre; font-size: 11px; min-width: 0; overflow: hidden; }
.disasm__op { font-weight: 500; min-width: 0; }
.disasm__args { color: var(--fg); min-width: 0; overflow: hidden; word-break: break-all; overflow-wrap: anywhere; }
.caret { display: inline-block; width: 7px; height: 14px; background: var(--accent); margin-left: 2px; vertical-align: text-bottom; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.disasm__note { grid-column: 4; margin-top: 1px; font-size: 10px; opacity: 0.85; color: var(--accent); }
.disasm__ioc { color: var(--accent); }
.disasm__footer { display: flex; gap: 18px; padding: 10px 14px; border-top: 1px solid var(--rule); background: var(--bg-soft); font-size: 10px; color: var(--muted); }
.disasm__footer span:last-child { margin-left: auto; }

/* ---------- hex dump ---------- */
.hexdump { background: var(--bg-card); border: 1px solid var(--rule); font-family: var(--mono); font-size: 12px; padding: 16px; min-height: 420px; width: 100%; max-width: 100%; overflow: hidden; }
.hexdump__row { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 16px; padding: 2px 0; }
.hexdump__off { color: var(--muted); }
.hexdump__bytes { color: color-mix(in oklab, var(--fg) 75%, transparent); min-width: 0; overflow: hidden; word-break: break-all; }
.hexdump__bytes .hi { color: var(--accent); transition: color .2s; }

/* ---------- cfg ---------- */
.cfg { display: block; background: var(--bg-card); border: 1px solid var(--rule); width: 100%; max-width: 100%; height: 480px; padding: 20px; }

/* ---------- marquee ---------- */
.hero__marquee { margin-top: 24px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); overflow: hidden; padding: 16px 0; }
.marquee__track { display: flex; gap: 0; animation: marquee 40s linear infinite; width: max-content; }
.marquee__group { display: flex; gap: 0; padding-right: 0; }
.marquee__item { font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 0 28px; letter-spacing: 0.06em; white-space: nowrap; }
.marquee__sep { color: var(--accent); margin-right: 14px; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- section heads ---------- */
.section__head { max-width: 1440px; margin: 0 auto; padding: 0 32px; display: grid; grid-template-columns: 80px 1fr; gap: 32px; row-gap: 16px; align-items: baseline; }
.section__num { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.section__h { font-size: clamp(32px, 3.5vw, 52px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; max-width: 700px; }
.section__sub { grid-column: 2; max-width: 620px; color: var(--muted); font-size: 16px; line-height: 1.55; }

/* ---------- capabilities ---------- */
.capabilities { padding: var(--space-section) 0 0; position: relative; z-index: 1; }
.caps__grid { max-width: 1440px; margin: 56px auto 0; padding: 0 32px; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule); }
.cap { padding: 40px 32px 40px 0; border-right: 1px solid var(--rule); }
.cap:last-child { border-right: 0; padding-left: 32px; padding-right: 0; }
.cap__head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 18px; }
.cap__num { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.cap__title { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; }
.cap__body { color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 520px; }
.cap__list { margin-top: 24px; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.cap__list li { display: flex; gap: 10px; font-size: 14px; color: var(--fg); }
.cap__bullet { color: var(--accent); font-family: var(--mono); }

/* ---------- process ---------- */
.process { padding: var(--space-section) 0 80px; position: relative; z-index: 1; }
.process__list { max-width: 1440px; margin: 64px auto 0; padding: 0 32px; }
.step { display: grid; grid-template-columns: 80px 1fr 320px; gap: 40px; padding: 48px 0; border-top: 1px solid var(--rule); position: relative; }
.step:last-child { border-bottom: 1px solid var(--rule); }
.step__rail { position: relative; padding-top: 6px; }
.step__num { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.step__line { position: absolute; left: 6px; top: 32px; bottom: -48px; width: 1px; background: var(--rule); }
.step:last-child .step__line { display: none; }
.step__title { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 16px; }
.step__text { color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 560px; }
.step__meta { margin-top: 24px; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.step__meta li { display: flex; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--fg); }
.step__meta-dash { color: var(--muted); }
.step__aside-label { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px; }
.step__aside-doc { background: var(--bg-card); border: 1px solid var(--rule); }
.doc__chrome { padding: 8px 12px; border-bottom: 1px solid var(--rule); font-family: var(--mono); font-size: 10px; color: var(--muted); background: var(--bg-soft); }
.doc__lines { padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.doc__line { height: 6px; background: color-mix(in oklab, var(--muted) 30%, transparent); }
.doc__line:first-child { background: color-mix(in oklab, var(--accent) 60%, transparent); }

/* ---------- engagement ---------- */
.engagement { padding: var(--space-section) 0; background: var(--bg-soft); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); position: relative; z-index: 1; }
.engagement__inner { max-width: 1440px; margin: 0 auto; padding: 0 32px; display: grid; grid-template-columns: 360px 1fr; gap: 64px; align-items: start; }
.engagement__eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-bottom: 16px; }
.engagement__eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.engagement__h { font-size: clamp(28px, 3vw, 42px); font-weight: 500; letter-spacing: -0.025em; line-height: 1.05; }
.engagement__models { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.model { background: var(--bg); padding: 28px 24px; display: flex; flex-direction: column; gap: 14px; }
.model--feature { background: var(--bg-card); border: 1px solid var(--accent); outline: 1px solid var(--accent); outline-offset: -1px; }
.model--feature .model__name { color: var(--accent); }
.model__name { font-family: var(--mono); font-size: 12px; color: var(--fg); letter-spacing: 0.04em; text-transform: uppercase; }
.model__desc { color: var(--muted); font-size: 14px; line-height: 1.55; }
.model__from { margin-top: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.model__from strong { color: var(--fg); font-size: 18px; font-weight: 500; }

/* ---------- footer ---------- */
.footer { padding: var(--space-section) 0 32px; position: relative; z-index: 1; }
.footer__top { max-width: 1440px; margin: 0 auto; padding: 0 32px; display: grid; grid-template-columns: 1.2fr 1.5fr; gap: 80px; }
.footer__eyebrow { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-bottom: 18px; }
.footer__h { font-size: clamp(40px, 4.5vw, 64px); font-weight: 500; letter-spacing: -0.03em; line-height: 0.98; }
.footer__lede { margin-top: 24px; max-width: 460px; color: var(--muted); font-size: 16px; line-height: 1.55; }
.footer__mail { display: inline-block; margin-top: 28px; font-family: var(--mono); font-size: 16px; color: var(--accent); border-bottom: 1px solid var(--accent); padding-bottom: 4px; }
.footer__meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; padding-top: 8px; }
.footer__col-h { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px; }
.footer__mono { font-family: var(--mono); font-size: 12px; color: var(--fg); line-height: 1.7; }
.footer__rule { height: 1px; background: var(--rule); margin: 80px 32px 24px; max-width: 1440px; margin-left: auto; margin-right: auto; }
.footer__bottom { max-width: 1440px; margin: 0 auto; padding: 0 32px; display: flex; justify-content: space-between; gap: 32px; font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero__grid, .caps__grid, .engagement__inner, .footer__top, .engagement__models { grid-template-columns: 1fr; }
  .hero__grid { gap: 48px; padding: 56px 0 48px; }
  .caps__grid { margin-top: 40px; }
  .cap { padding: 32px 0; border-right: 0; border-bottom: 1px solid var(--rule); }
  .cap:last-child { padding-left: 0; padding-right: 0; border-bottom: 0; }
  .engagement__inner { gap: 40px; }
  .footer__top { gap: 48px; }
  .step { grid-template-columns: 60px 1fr; gap: 24px; padding: 36px 0; }
  .step__aside { grid-column: 1 / -1; padding-left: 60px; }
  .footer__meta { grid-template-columns: 1fr 1fr; }
  .nav__links { display: none; }
  .hero__h1 br { display: none; }
  .hero__h1 { word-break: break-word; }
}

@media (max-width: 640px) {
  .nav__inner,
  .hero,
  .section__head,
  .caps__grid,
  .process__list,
  .engagement__inner,
  .footer__top,
  .footer__bottom { padding-left: 20px; padding-right: 20px; }
  .footer__rule { margin-left: 20px; margin-right: 20px; }

  .nav__inner { padding: 14px 20px; gap: 12px; }
  .nav__cta { padding: 6px 10px; font-size: 11px; }

  .hero__grid { padding: 40px 0 32px; gap: 36px; }
  .hero__eyebrow { font-size: 10px; margin-bottom: 24px; }
  .hero__lede { font-size: 15px; }
  .hero__cta-row { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; padding: 14px 18px; }
  .hero__principles { margin-top: 40px; }

  .section__head { grid-template-columns: 1fr; gap: 12px; }
  .section__sub { grid-column: 1; }

  .capabilities { padding-top: calc(var(--space-section) - 32px); }
  .process { padding: calc(var(--space-section) - 32px) 0 48px; }

  .step { grid-template-columns: 40px 1fr; gap: 16px; }
  .step__aside { padding-left: 0; }
  .step__title { font-size: 22px; }

  .engagement { padding: calc(var(--space-section) - 32px) 0; }
  .engagement__models { grid-template-columns: 1fr; }
  .model { padding: 24px 20px; }

  .footer { padding: calc(var(--space-section) - 32px) 0 24px; }
  .footer__rule { margin-top: 56px; }
  .footer__bottom { flex-direction: column; gap: 8px; align-items: flex-start; }
  .footer__meta { grid-template-columns: 1fr; gap: 24px; }

  /* disassembly: drop the bytes column entirely so the panel fits without
     a horizontal scroll. address + op + args carries the meaning. */
  .disasm { font-size: 11px; }
  .disasm__chrome { padding: 8px 12px; gap: 6px; }
  .disasm__path { font-size: 10px; margin-left: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .disasm__status { font-size: 9px; flex-shrink: 0; }
  .disasm__body { padding: 12px 10px; overflow-x: hidden; }
  .disasm__row { grid-template-columns: 88px 56px 1fr; column-gap: 8px; }
  .disasm__bytes { display: none; }
  .disasm__note { grid-column: 1 / -1; padding-left: 96px; }
  .disasm__footer { flex-wrap: wrap; gap: 8px 14px; padding: 8px 12px; }
  .disasm__footer span:last-child { margin-left: 0; }

  /* hex dump: smaller type + allow byte cells to wrap so it fits the viewport */
  .hexdump { font-size: 9.5px; padding: 12px; min-height: 320px; overflow-x: hidden; }
  .hexdump__row { grid-template-columns: 56px 1fr; gap: 8px; }
  .hexdump__bytes { word-break: break-all; }

  /* control flow graph: shorter on phones */
  .cfg { height: 360px; padding: 12px; }

  .marquee__item { font-size: 11px; padding: 0 18px; }
}

@media (max-width: 380px) {
  .hero__h1 { font-size: clamp(34px, 9vw, 44px); }
  .nav__cta { display: none; }
  .disasm__row { grid-template-columns: 76px 48px 1fr; column-gap: 6px; }
  .disasm__note { padding-left: 82px; }
  .disasm__footer span { font-size: 9px; }
}

