:root {
  --bg: #101c18;
  --panel: #1a2a23;
  --panel-2: #22362b;
  --ink: #edf2eb;
  --muted: #acbcb0;
  --line: #34473b;
  --green: #c3ed9a;
  --on-green: #15251a;
  --focus: #83beee;
  --font: 'Switzer', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: inherit; text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
a, button { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }
h1 { font-size: clamp(38px, 5vw, 66px); line-height: 1.06; letter-spacing: -0.045em; font-weight: 550; }
h2 { font-size: clamp(28px, 3vw, 40px); line-height: 1.12; letter-spacing: -0.03em; font-weight: 550; }
h3 { font-size: 20px; line-height: 1.3; font-weight: 550; }
.wrap { max-width: 1240px; margin-inline: auto; padding-inline: 5%; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--green); color: var(--on-green); padding: 8px 14px; }
.skip:focus { left: 8px; }

/* Header and footer */
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 24px; }
.brand { font-weight: 650; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.site-head nav { display: flex; gap: 24px; }
.site-head nav a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.site-head nav a:hover, .site-head nav a[aria-current] { color: var(--ink); }
.contact { margin-top: 70px; padding-block: 40px; background: var(--panel); display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.contact h2 { font-size: 24px; }
.contact p { margin-top: 6px; }
.contact ul { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-start; }
.contact ul a { display: inline-flex; align-items: center; min-height: 44px; }

/* Shared blocks */
.action { display: inline-block; margin-top: 24px; background: var(--green); color: var(--on-green); padding: 12px 20px; text-decoration: none; font-weight: 600; }
.action:hover { background: #d5f6b4; }
.textlink { display: inline-flex; align-items: center; min-height: 44px; margin-top: 22px; }
.section { padding-block: 64px; }
.section-top { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-bottom: 28px; }
.section-top p { max-width: 440px; color: var(--muted); }
.role { color: var(--green); margin-top: 12px; }
.caption { font-size: 13px; color: var(--muted); margin-top: 16px; }
details { background: var(--panel); padding: 18px; margin-top: 24px; }
summary { cursor: pointer; padding-block: 10px; min-height: 44px; }
details > :not(summary) { margin-top: 12px; color: var(--muted); }

/* Diagrams */
.graph { background: #111e19; padding: 26px; }
.graph-label { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.flow { display: flex; align-items: stretch; gap: 10px; }
.node { flex: 1; min-width: 0; background: #293e32; text-align: center; padding: 14px 10px; font-size: 14px; display: flex; flex-direction: column; justify-content: center; }
.node small { display: block; font-size: 13px; color: #c1cfc5; margin-top: 4px; }
.node.key { background: var(--green); color: var(--on-green); font-weight: 600; }
.node.key small { color: #344b35; font-weight: 400; }
.node.gone { background: none; border: 1px dashed #5d7865; color: var(--muted); }
.connector { color: #97bd9a; align-self: center; flex: none; }
.down { text-align: center; color: #97bd9a; font-size: 13px; padding: 8px; }
.branch { width: min(100%, 60%); margin-inline: auto; }
.branch.under-key { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 36px; width: 100%; }
.branch.under-key > * { grid-column: 2; }
.node { border-radius: 12px; }
.node.key { border-radius: 18px; }
/* Animated wires replace the text arrows when the script runs. */
.graph.wired { position: relative; }
.graph.wired .connector { visibility: hidden; }
.graph.wired .down { position: relative; z-index: 1; width: max-content; margin-inline: auto; background: #111e19; padding: 4px 10px; margin-block: 14px; }
.graph.wired .down .connector { display: none; }
.graph.wired .flow, .graph.wired .branch { position: relative; z-index: 1; }
.graph.wired .flow { gap: 36px; }
.graph.wired .branch { margin-top: 0; }
.wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.wire { fill: none; stroke: #5d7865; stroke-width: 2; }
.wire.manual { stroke-dasharray: 5 7; }
.pulse { fill: none; stroke: var(--green); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 9 32; animation: wire-flow 0.65s linear infinite; }
.pulse.back { stroke: var(--focus); stroke-dasharray: 4 37; animation-direction: reverse; }
.graph.paused .pulse, .graph.offscreen .pulse { animation-play-state: paused; }
.wire-toggle { background: none; border: 1px solid var(--line); color: var(--muted); padding: 8px 14px; min-height: 44px; margin-top: 16px; border-radius: 8px; }
.wire-toggle:hover { color: var(--ink); }
@keyframes wire-flow { to { stroke-dashoffset: -41; } }

/* Home */
.intro { display: grid; grid-template-columns: 1.7fr 1fr; gap: 60px; padding-block: 56px 64px; }
.intro p { margin-top: 20px; max-width: 560px; color: var(--muted); font-size: 18px; }
.intro aside { align-self: end; font-size: 16px; color: var(--muted); }
.intro aside b { display: block; color: var(--ink); font-weight: 500; margin-bottom: 6px; }
.feature { background: var(--panel); padding: 32px; display: grid; grid-template-columns: 0.85fr 1.4fr; gap: 44px; align-items: center; }
.feature h2 { font-size: clamp(36px, 4vw, 48px); }
.feature p { margin-top: 16px; max-width: 400px; color: var(--muted); }
.ai-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 28px; }
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tool { background: var(--panel); }
.tool button { all: unset; box-sizing: border-box; display: block; width: 100%; min-height: 92px; padding: 16px 14px; cursor: pointer; overflow-wrap: anywhere; }
.tool button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tool small { display: block; color: var(--muted); margin-top: 4px; font-size: 13px; }
.tool p { padding: 0 14px 16px; color: var(--muted); font-size: 14px; }
.tool.wide { grid-column: 1 / -1; background: var(--panel-2); }
.tool.wide button { min-height: 0; text-align: center; }
.ai-ready .tool p { display: none; }
.ai-ready .tool:hover { background: var(--panel-2); }
.ai-ready .tool.selected { background: var(--green); color: var(--on-green); }
.ai-ready .tool.selected small { color: #304c36; }
.tool-detail { display: none; }
.ai-ready .tool-detail { display: flex; flex-direction: column; justify-content: center; padding: 26px; background: var(--panel); }
.tool-detail p { margin-top: 12px; color: var(--muted); }
.tool-detail a { margin-top: 18px; align-self: flex-start; padding-block: 4px; }
.work-row { display: grid; grid-template-columns: 1.1fr 1.5fr auto; gap: 24px; padding: 22px 16px; align-items: center; text-decoration: none; }
.work-row:nth-of-type(odd) { background: var(--panel); }
.work-row:hover h3, .work-row:hover .metric { color: var(--green); }
.work-row small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.work-row p { color: var(--muted); font-size: 15px; }
.metric { font-size: 22px; white-space: nowrap; }
.more li { padding-block: 10px; }
.more li:first-child { border-top: 0; }
.more b { color: var(--ink); font-weight: 500; }

/* Detail pages */
.back { display: inline-flex; align-items: center; min-height: 44px; margin: 20px 0 32px; color: var(--muted); }
.detail-head { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: end; margin-bottom: 36px; }
.detail-head > p { color: var(--muted); font-size: 17px; }
.results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-block: 36px; }
.results div { padding: 20px; background: var(--panel); }
.results strong { display: block; color: var(--green); font-size: clamp(26px, 3vw, 36px); font-weight: 500; line-height: 1.2; }
.results span { color: var(--muted); font-size: 14px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: start; }
.decision + .decision { margin-top: 24px; }
.decision p { color: var(--muted); margin-top: 8px; }
.chart { margin-top: 28px; }
.bar { height: 28px; background: #9aaf9d; margin: 14px 0 6px; }
.bar.after { background: var(--green); }
.chart span { color: var(--muted); font-size: 14px; }
.subhead { margin: 56px 0 20px; }
.shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.shots a { display: block; background: var(--panel); }
.shots img { aspect-ratio: 16 / 10; width: 100%; object-fit: cover; object-position: top; }
.shots span { display: block; padding: 10px 12px; font-size: 14px; color: var(--muted); }
.shots a:hover span { color: var(--ink); }

/* Screenshot dialog (enhancement) */
.viewer { width: min(1100px, 94vw); max-height: 92vh; padding: 16px; border: 0; background: var(--panel); color: var(--ink); }
.viewer::backdrop { background: rgba(0, 0, 0, 0.75); }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.viewer-bar button { background: var(--green); color: var(--on-green); border: 0; min-height: 44px; padding: 8px 14px; font-weight: 600; }
.viewer img { width: 100%; }

@media (max-width: 860px) {
  .intro, .feature, .ai-grid, .detail-head, .detail-grid { grid-template-columns: 1fr; gap: 28px; }
  .shots { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .site-head { flex-wrap: wrap; padding-block: 18px; }
  .site-head nav { gap: 16px; font-size: 15px; }
  .intro { padding-block: 32px 40px; }
  .intro h1 { font-size: clamp(28px, 7.8vw, 38px); }
  .feature, .graph { padding: 18px; }
  .section { padding-block: 44px; }
  .section-top { display: block; }
  .section-top p { margin-top: 12px; }
  .flow { flex-direction: column; gap: 4px; }
  .flow .connector { transform: rotate(90deg); }
  .graph.wired .flow { gap: 24px; }
  .graph.wired .down { margin-block: 12px; }
  .branch { width: 100%; }
  .branch.under-key { display: block; }
  .tools { grid-template-columns: 1fr 1fr; }
  .work-row { grid-template-columns: 1fr; gap: 12px; }
  .metric { font-size: 17px; }
  .results { grid-template-columns: 1fr; gap: 8px; }
  .results div { padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .pulse, .wire-toggle { display: none; }
}
