:root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --ink: #0f172a;
    --muted: #475569;
    --faint: #94a3b8;
    --rule: #e2e8f0;
    --accent: #2563eb;
    --accent-ink: #1d4ed8;
    --accent-soft: #dbeafe;
    --ok: #16a34a;
    --warn: #dc2626;
    --panel: #eef2f7;
    --panel-2: #ffffff;
    --panel-rule: #d9e0ea;
    --panel-ink: #0f172a;
    --panel-muted: #475569;
    --d-bg: #ffffff;
    --d-bg2: #f8fafc;
    --d-line: #cbd5e1;
    --d-line2: #dde3ec;
    --d-line3: #94a3b8;
    --d-blk: #e2e8f0;
    --d-dim: #64748b;
    --c-blue-soft: #1d4ed8;
    --c-blue: #2563eb;
    --c-blue-mid: #2563eb;
    --c-teal: #0d9488;
    --c-teal-soft: #0f766e;
    --c-violet: #7c3aed;
    --c-violet-soft: #6d28d9;
    --c-red: #dc2626;
    --c-red-soft: #b91c1c;
    --c-amber: #d97706;
    --c-amber-soft: #b45309;
    --c-green-soft: #15803d;
    --c-green: #16a34a;
    --d-server-fill: rgba(15, 23, 42, .02);
    --d-glow: rgba(37, 99, 235, .45);
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .08);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #0b1220;
      --surface: #111a2e;
      --ink: #e5e9f0;
      --muted: #a3adbf;
      --faint: #6b7590;
      --rule: #1f2a44;
      --accent: #60a5fa;
      --accent-ink: #93c5fd;
      --accent-soft: #172554;
      --ok: #4ade80;
      --warn: #f87171;
      --panel: #0b1220;
      --panel-2: #111a2e;
      --panel-rule: #243049;
      --panel-ink: #e2e8f0;
      --panel-muted: #94a3b8;
      --d-bg: #0b1220;
      --d-bg2: #070d19;
      --d-line: #334155;
      --d-line2: #1f2937;
      --d-line3: #475569;
      --d-blk: #1e293b;
      --d-dim: #64748b;
      --c-blue-soft: #93c5fd;
      --c-blue: #60a5fa;
      --c-blue-mid: #3b82f6;
      --c-teal: #2dd4bf;
      --c-teal-soft: #5eead4;
      --c-violet: #a78bfa;
      --c-violet-soft: #c4b5fd;
      --c-red: #f87171;
      --c-red-soft: #fca5a5;
      --c-amber: #fbbf24;
      --c-amber-soft: #fcd34d;
      --c-green-soft: #86efac;
      --c-green: #4ade80;
      --d-server-fill: rgba(255, 255, 255, .02);
      --d-glow: rgba(59, 130, 246, .8);
      --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    }
  }
  :root[data-theme="dark"] {
      --bg: #0b1220;
      --surface: #111a2e;
      --ink: #e5e9f0;
      --muted: #a3adbf;
      --faint: #6b7590;
      --rule: #1f2a44;
      --accent: #60a5fa;
      --accent-ink: #93c5fd;
      --accent-soft: #172554;
      --ok: #4ade80;
      --warn: #f87171;
      --panel: #0b1220;
      --panel-2: #111a2e;
      --panel-rule: #243049;
      --panel-ink: #e2e8f0;
      --panel-muted: #94a3b8;
      --d-bg: #0b1220;
      --d-bg2: #070d19;
      --d-line: #334155;
      --d-line2: #1f2937;
      --d-line3: #475569;
      --d-blk: #1e293b;
      --d-dim: #64748b;
      --c-blue-soft: #93c5fd;
      --c-blue: #60a5fa;
      --c-blue-mid: #3b82f6;
      --c-teal: #2dd4bf;
      --c-teal-soft: #5eead4;
      --c-violet: #a78bfa;
      --c-violet-soft: #c4b5fd;
      --c-red: #f87171;
      --c-red-soft: #fca5a5;
      --c-amber: #fbbf24;
      --c-amber-soft: #fcd34d;
      --c-green-soft: #86efac;
      --c-green: #4ade80;
      --d-server-fill: rgba(255, 255, 255, .02);
      --d-glow: rgba(59, 130, 246, .8);
      --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
  * { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
  body {
    margin: 0; background: var(--bg); color: var(--ink);
    font: 400 16px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
  }
  a { color: var(--accent-ink); text-decoration: none; }
  a:hover { text-decoration: underline; text-underline-offset: 3px; }
  .wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }
  h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.15; }
  h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 700; }
  h3 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
  p { margin: 0; }
  .kicker {
    display: inline-flex; align-items: center; gap: .5rem;
    font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink);
  }
  .kicker::before { content: ""; width: 1.4rem; height: 2px; background: var(--accent); border-radius: 2px; }
  .muted { color: var(--muted); }
  code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--accent-ink); padding: .08em .38em; border-radius: 4px; }

  /* top bar */
  .top {
    position: sticky; top: 0; z-index: 10;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--rule);
  }
  .top .wrap { display: flex; align-items: center; gap: 1.5rem; height: 3.75rem; }
  .mark { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.15rem; color: var(--ink); letter-spacing: -0.02em; }
  .mark svg { color: var(--accent); }
  .tm { font-size: .55em; vertical-align: super; color: var(--faint); font-weight: 500; }
  .top nav { display: flex; gap: 1.4rem; margin-left: auto; font-size: .92rem; }
  .top nav a { color: var(--muted); }
  .top nav a:hover { color: var(--ink); text-decoration: none; }
  .btn {
    display: inline-flex; align-items: center; gap: .45rem; padding: .6rem 1.05rem; border-radius: 8px;
    font-weight: 600; font-size: .93rem; border: 1px solid var(--rule); background: var(--surface); color: var(--ink);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  }
  .btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
  .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
  .btn.primary:hover { background: var(--accent-ink); }
  .top .btn { padding: .45rem .9rem; font-size: .88rem; }
  @media (max-width: 52rem) { .top .btn { display: none; } }

  /* hero */
  .hero { padding: 4.5rem 0 3rem; }
  .hero .wrap { display: grid; gap: 3rem; align-items: center; }
  @media (min-width: 62rem) { .hero .wrap { grid-template-columns: 1.05fr 1fr; } }
  .hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 800; margin-top: 1.1rem; }
  .hero h1 .accent { color: var(--accent-ink); }
  .hero .sub { margin-top: 1.25rem; font-size: 1.15rem; color: var(--muted); max-width: 34rem; }
  .hero .actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
  .proof { display: grid; gap: .55rem; margin: 1.9rem 0 0; padding: 0; list-style: none; font-size: .95rem; color: var(--muted); }
  .proof li { display: flex; gap: .6rem; align-items: flex-start; }
  .proof svg { flex: none; margin-top: .2rem; color: var(--ok); }
  .frame {
    background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden;
    animation: rise .9s ease both;
  }
  .frame .bar { display: flex; gap: .4rem; padding: .55rem .8rem; border-bottom: 1px solid var(--rule); background: color-mix(in srgb, var(--rule) 40%, var(--surface)); }
  .frame .bar i { width: .65rem; height: .65rem; border-radius: 50%; background: var(--rule); display: block; }
  .frame img { display: block; width: 100%; height: auto; }
  .frame figcaption { padding: .7rem .9rem; font-size: .84rem; color: var(--muted); border-top: 1px solid var(--rule); }
  @keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

  section { padding: 4.5rem 0; scroll-margin-top: 4rem; }
  section + section { border-top: 1px solid var(--rule); }
  .head { max-width: 42rem; margin-bottom: 2.25rem; }
  .head p { margin-top: .9rem; color: var(--muted); font-size: 1.05rem; }

  /* diagram */
  .panel {
    background: var(--panel); color: var(--panel-ink); border-radius: 16px; border: 1px solid var(--panel-rule);
    padding: 1.25rem; box-shadow: var(--shadow);
  }
  @media (min-width: 92rem) { #how .panel { margin-inline: -7rem; } }
  .diagram-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .diagram { display: block; width: 100%; min-width: 64rem; height: auto; }
  .legend { display: flex; flex-wrap: wrap; gap: 1.1rem 1.6rem; margin-top: 1rem; font-size: .9rem; color: var(--panel-muted); }
  .legend span { display: inline-flex; align-items: center; gap: .45rem; }
  .legend i { width: .7rem; height: .7rem; border-radius: 50%; display: inline-block; }
  .explain { display: grid; gap: 1rem; margin-top: 1.5rem; }
  @media (min-width: 48rem) { .explain { grid-template-columns: 1fr 1fr; } }
  @media (min-width: 70rem) { .explain { grid-template-columns: repeat(4, 1fr); } }
  .card {
    background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 1.25rem 1.3rem;
    display: flex; flex-direction: column; gap: .55rem;
  }
  .card .ico {
    width: 2.1rem; height: 2.1rem; border-radius: 8px; display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent-ink); margin-bottom: .2rem;
  }
  .card p { color: var(--muted); font-size: .93rem; }

  /* diagram svg */
  .diagram text { font-family: Inter, ui-sans-serif, system-ui, sans-serif; fill: var(--panel-ink); }
  .diagram .t-title { font-size: 17px; font-weight: 700; }
  .diagram .t-body { font-size: 13px; fill: var(--panel-muted); }
  .diagram .t-small { font-size: 12.5px; fill: var(--panel-muted); }
  .diagram .t-label { font-size: 14px; font-weight: 600; }
  .diagram .t-mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
  .diagram .box { fill: var(--panel-2); stroke: var(--panel-rule); stroke-width: 1.2; }
  .diagram .box.actor { stroke: var(--d-line); }
  .diagram .gate { fill: rgba(37, 99, 235, .07); stroke: var(--c-blue-mid); stroke-width: 1.2; }
  .diagram .gate-pulse { animation: gatepulse 4s ease-in-out infinite; }
  .diagram .gate-pulse.g2 { animation-delay: 1.3s; }
  .diagram .gate-pulse.g3 { animation-delay: 2.6s; }
  @keyframes gatepulse { 0%, 100% { stroke-opacity: .55; } 50% { stroke-opacity: 1; filter: drop-shadow(0 0 6px var(--d-glow)); } }
  .diagram .wire { fill: none; stroke: var(--d-line); stroke-width: 1.6; }
  .diagram .wire.flow { stroke-dasharray: 6 8; animation: dash 1.6s linear infinite; }
  .diagram .wire.ret { stroke: var(--d-line2); stroke-dasharray: 3 6; animation: dash 2.4s linear infinite reverse; }
  .diagram .wire.maybe { stroke-dasharray: 2 6; stroke: var(--d-line3); }
  @keyframes dash { to { stroke-dashoffset: -28; } }
  .diagram .https { fill: url(#httpsGrad); stroke: #1d4ed8; }
  .diagram .sheen { fill: url(#sheen); animation: sheen 3.5s linear infinite; }
  @keyframes sheen { from { transform: translateY(-600px); } to { transform: translateY(600px); } }
  .diagram .pkt { filter: drop-shadow(0 0 5px currentColor); }
  .diagram .chip rect { fill: var(--panel); stroke: currentColor; stroke-width: 1; }
  .diagram .chip text { fill: currentColor; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; font-weight: 600; }
  .diagram .log-line { fill: var(--panel-muted); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
  .diagram .log-line.ok { fill: var(--c-green-soft); }
  .diagram .log-line.no { fill: var(--c-red-soft); }
  .diagram .shield { animation: shield 2.4s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
  @keyframes shield { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.08); opacity: 1; } }
  @media (prefers-reduced-motion: reduce) {
    .diagram .pkt, .diagram .chip, .diagram .sheen { display: none; }
    .diagram .wire.flow, .diagram .wire.ret, .diagram .gate-pulse, .diagram .shield, .frame { animation: none; }
  }

  /* features */
  .grid { display: grid; gap: 1rem; }
  @media (min-width: 44rem) { .grid { grid-template-columns: 1fr 1fr; } }
  @media (min-width: 66rem) { .grid.three { grid-template-columns: repeat(3, 1fr); } }

  /* screenshots */
  .shots { display: grid; gap: 1.5rem; }
  @media (min-width: 62rem) { .shots { grid-template-columns: 1.15fr .85fr; align-items: start; } }
  .shots .frame { animation: none; }
  .callout {
    border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 10px 10px 0;
    padding: 1rem 1.2rem; color: var(--muted); font-size: .95rem; margin-top: 1.25rem;
  }
  .callout strong { color: var(--ink); }

  /* security list */
  .sec { display: grid; gap: 1rem; }
  @media (min-width: 44rem) { .sec { grid-template-columns: 1fr 1fr; } }
  .sec .card { flex-direction: row; gap: .9rem; align-items: flex-start; }
  .sec .card .ico { flex: none; margin: 0; }

  /* roadmap */
  .plan { display: grid; gap: 1rem; }
  @media (min-width: 62rem) { .plan { grid-template-columns: 1.4fr 1fr; align-items: start; } }
  .steps { display: grid; gap: 0; counter-reset: step; }
  .step { display: grid; grid-template-columns: 2.4rem 1fr; gap: .9rem; padding: 1.1rem 0; border-top: 1px solid var(--rule); }
  .step:first-child { border-top: 0; padding-top: 0; }
  .step .n {
    counter-increment: step; width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: .9rem;
  }
  .step .n::before { content: counter(step); }
  .step p { color: var(--muted); font-size: .95rem; margin-top: .3rem; }
  .tag {
    display: inline-block; vertical-align: middle; margin-left: .45rem;
    font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: var(--muted); border: 1px solid var(--rule); border-radius: 999px; padding: .08rem .5rem;
  }
  .aside-stack { display: grid; gap: 1rem; }
  .aside h3 { font-size: .78rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); margin-bottom: .5rem; }
  .aside p { color: var(--muted); font-size: .93rem; }
  .aside p + p { margin-top: .6rem; }
  .aside strong { color: var(--ink); font-weight: 600; }

  /* status */
  .status { display: grid; gap: 1.5rem; align-items: center; }
  @media (min-width: 52rem) { .status { grid-template-columns: 1fr auto; } }
  .status .card { padding: 1.6rem 1.8rem; }
  .status .card p { font-size: 1.02rem; }

  footer { border-top: 1px solid var(--rule); padding: 2rem 0 2.5rem; color: var(--faint); font-size: .86rem; }
  footer .wrap { display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between; }

  /* dropdown menus */
  .menus { display: flex; gap: .35rem; margin-left: auto; font-size: .92rem; }
  .menu { position: relative; }
  .menu summary {
    list-style: none; cursor: pointer; padding: .45rem .7rem; border-radius: 8px; color: var(--muted);
    display: flex; align-items: center; gap: .45rem; user-select: none;
  }
  .menu summary::-webkit-details-marker { display: none; }
  .menu summary::after {
    content: ""; width: .42rem; height: .42rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px); transition: transform .15s ease;
  }
  .menu[open] summary::after { transform: rotate(225deg) translateY(-1px); }
  .menu summary:hover, .menu[open] summary { color: var(--ink); background: color-mix(in srgb, var(--rule) 60%, transparent); }
  .menu.current summary { color: var(--ink); font-weight: 600; }
  .menu ul {
    position: absolute; right: 0; top: calc(100% + .4rem); min-width: 15rem; margin: 0; padding: .4rem; list-style: none;
    background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow); z-index: 20;
  }
  .menu li a { display: block; padding: .5rem .7rem; border-radius: 6px; color: var(--ink); }
  .menu li a:hover { background: var(--accent-soft); text-decoration: none; }
  .menu li.head { padding: .35rem .7rem .2rem; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
  .menu .short { display: none; }
  @media (max-width: 52rem) {
    .menu .long { display: none; } .menu .short { display: inline; }
    .menu summary { padding: .4rem .5rem; }
    .mark span { display: none; }
  }

  /* full-width hero */
  .hero-wide {
    padding: 5.5rem 0 4rem;
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--bg)) 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--rule);
  }
  .hero-wide h1 { font-size: clamp(2.2rem, 5.2vw, 4.1rem); font-weight: 800; margin-top: 1.1rem; max-width: 62rem; }
  .hero-wide h1 .accent { color: var(--accent-ink); }
  .hero-wide .sub { margin-top: 1.4rem; font-size: 1.2rem; color: var(--muted); max-width: 46rem; }
  .proof.row { display: flex; flex-wrap: wrap; gap: .6rem 2rem; margin-top: 2rem; }
  .proof.row li { align-items: center; }

  /* capability lists */
  .cols { display: grid; gap: 2rem; }
  @media (min-width: 48rem) { .cols { grid-template-columns: 1fr 1fr; } }
  @media (min-width: 66rem) { .cols.three { grid-template-columns: repeat(3, 1fr); } }
  .col h3 { padding-bottom: .7rem; border-bottom: 2px solid var(--accent); margin-bottom: 1rem; display: inline-block; }
  .list { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
  .list li { position: relative; padding-left: 1.1rem; color: var(--muted); font-size: .93rem; }
  .list li::before { content: ""; position: absolute; left: 0; top: .5rem; width: .4rem; height: .4rem; border-radius: 50%; background: var(--accent); }
  .list strong { display: block; color: var(--ink); font-weight: 600; }
  .soon { color: var(--accent-ink); font-weight: 700; font-size: .9em; margin-left: .1rem; }
  .footnote { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: .9rem; }
  .footnote .soon { margin-right: .3rem; }
  .more { margin-top: .6rem; font-size: .93rem; font-weight: 600; }
  .aside.compact { margin-top: 2rem; }

  .hero-wide .subhead { margin-top: .9rem; font-size: clamp(1.25rem, 2.4vw, 1.75rem); font-weight: 600; letter-spacing: -0.01em; color: var(--muted); }

  /* "an agent asks" panel */
  .ask .tr { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
  .ask .cmd { fill: var(--c-teal-soft); }
  .ask .ans { fill: var(--panel-ink); }
  .ask .dim { fill: #94a3b8; }
  .ask .warn { fill: var(--c-amber-soft); }
  .ask .blk { fill: var(--d-blk); }
  .ask .hit { fill: var(--c-blue-mid); filter: drop-shadow(0 0 4px var(--d-glow)); }
  .ask .scan { fill: url(#scanGrad); }
  .ask .cite { fill: none; stroke: var(--c-blue); stroke-width: 1.3; stroke-dasharray: 4 4; }
  .ask .chipc rect { fill: var(--d-bg); stroke: var(--c-blue); stroke-width: 1; }
  .ask .chipc text { fill: var(--c-blue-soft); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; font-weight: 700; }
  @media (prefers-reduced-motion: reduce) {
    .ask .seq { opacity: 1 !important; }
    .ask .scan { display: none; }
  }

  /* scenario tabs */
  .tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
  .tab {
    border: 1px solid var(--rule); background: var(--surface); color: var(--muted); padding: .5rem 1rem;
    border-radius: 999px; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  }
  .tab:hover { color: var(--ink); }
  .tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
  .tab:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
  .ask .ok { fill: #86efac; }

  /* theme toggle */
  .theme-btn {
    display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 8px;
    border: 1px solid var(--rule); background: var(--surface); color: var(--muted); cursor: pointer; padding: 0;
  }
  .theme-btn:hover { color: var(--ink); }
  .theme-btn:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
  .theme-btn .moon { display: none; }
  :root[data-theme="dark"] .theme-btn .sun { display: none; }
  :root[data-theme="dark"] .theme-btn .moon { display: block; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
    :root:not([data-theme="light"]) .theme-btn .moon { display: block; }
  }
