:root {
  --paper: #f3f0e8;
  --paper-deep: #e9e4d8;
  --ink: #101b1d;
  --ink-soft: #465153;
  --line: rgba(16, 27, 29, 0.18);
  --lime: #c9ff4a;
  --orange: #ff7048;
  --blue: #6a7cff;
  --white: #fffdf8;
  --radius: 18px;
  --shadow: 0 24px 80px rgba(16, 27, 29, 0.12);
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); overflow-x: hidden; }
a { color: inherit; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.skip-link { position: fixed; z-index: 100; top: 12px; left: 12px; padding: 10px 14px; background: var(--ink); color: white; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.site-header { width: min(1380px, calc(100% - 48px)); height: 82px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; letter-spacing: -0.02em; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--lime); background: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.version { color: var(--ink-soft); padding: 4px 7px; border: 1px solid var(--line); border-radius: 99px; font: 600 10px ui-monospace, monospace; }
nav { display: flex; align-items: center; gap: 30px; font-size: 14px; font-weight: 650; }
nav a { text-decoration: none; }
nav a:hover { opacity: 0.6; }
.github-link { padding: 10px 14px; border: 1px solid var(--ink); border-radius: 9px; }

.hero { width: min(1380px, calc(100% - 48px)); min-height: 730px; margin: 0 auto; display: grid; grid-template-columns: 0.9fr 1.1fr; align-items: center; gap: 60px; padding: 80px 0 100px; }
.kicker, .eyebrow { color: var(--ink-soft); font: 700 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: 0.13em; }
.kicker { display: flex; align-items: center; gap: 9px; }
.kicker span { width: 7px; height: 7px; background: var(--orange); border-radius: 50%; box-shadow: 0 0 0 5px rgba(255,112,72,0.15); }
h1 { max-width: 720px; margin: 24px 0; font-size: clamp(60px, 6.2vw, 102px); line-height: 0.97; letter-spacing: -0.065em; }
h1 em { color: transparent; -webkit-text-stroke: 2px var(--ink); font-weight: 500; }
.hero-lede { max-width: 650px; margin: 34px 0 0; color: var(--ink-soft); font-size: clamp(18px, 1.5vw, 22px); line-height: 1.7; letter-spacing: -0.02em; }
.hero-lede strong { display: block; margin-bottom: 7px; color: var(--ink); font-weight: 800; }
.hero-actions { display: flex; align-items: center; gap: 28px; margin-top: 34px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 24px; min-height: 50px; padding: 0 20px; border: 0; border-radius: 10px; cursor: pointer; text-decoration: none; font-weight: 750; }
.button-primary { color: var(--lime); background: var(--ink); box-shadow: 6px 6px 0 var(--orange); transition: transform 150ms, box-shadow 150ms; }
.button-primary:hover { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--orange); }
.text-link { font-weight: 750; text-underline-offset: 5px; }
.hero-tagline { margin-top: 42px; color: var(--ink-soft); font: 650 13px ui-monospace, monospace; }

.relay-visual { position: relative; min-height: 560px; border: 1px solid var(--line); border-radius: 28px; background: var(--white); overflow: hidden; box-shadow: var(--shadow); }
.relay-grid { position: absolute; inset: 0; opacity: 0.45; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(to bottom right, black, transparent 78%); }
.relay-visual::before { content: "LOCAL RELAY · QHOP 0.1"; position: absolute; top: 22px; left: 24px; color: var(--ink-soft); font: 650 10px ui-monospace, monospace; letter-spacing: 0.13em; }
.relay-visual::after { content: ""; position: absolute; z-index: 0; width: 380px; height: 380px; right: -150px; top: -140px; border-radius: 50%; background: var(--lime); opacity: 0.55; filter: blur(8px); }
.agent-card { position: absolute; z-index: 2; display: flex; align-items: center; gap: 16px; width: 210px; padding: 18px; border: 1px solid var(--ink); border-radius: 14px; background: var(--white); box-shadow: 7px 7px 0 var(--paper-deep); }
.agent-card small, .semantic-ack small { display: block; margin-bottom: 4px; color: var(--ink-soft); font: 600 9px ui-monospace, monospace; letter-spacing: 0.12em; }
.agent-card strong { font-size: 18px; }
.agent-index { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: var(--lime); font: 700 12px ui-monospace, monospace; }
.agent-planner { left: 8%; top: 17%; }
.agent-backend { right: 10%; top: 38%; }
.agent-frontend { left: 13%; bottom: 11%; }
.packet { position: absolute; z-index: 3; display: flex; justify-content: space-between; align-items: center; width: 150px; padding: 11px 13px; background: var(--orange); color: var(--ink); transform: rotate(-4deg); box-shadow: 4px 4px 0 var(--ink); }
.packet span { font: 800 13px ui-monospace, monospace; }
.packet small { font: 700 8px ui-monospace, monospace; letter-spacing: 0.08em; }
.packet-one { left: 41%; top: 28%; }
.packet-two { left: 38%; bottom: 23%; background: var(--lime); transform: rotate(3deg); }
.semantic-ack { position: absolute; z-index: 2; right: 15%; top: 59%; display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 99px; color: var(--white); background: var(--ink); }
.semantic-ack strong { font-size: 12px; }
.pulse { width: 10px; height: 10px; background: var(--lime); border-radius: 50%; box-shadow: 0 0 0 0 rgba(201,255,74,0.5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(201,255,74,0); } 100% { box-shadow: 0 0 0 0 rgba(201,255,74,0); } }

.contrast-section, .workflow-section, .playground-section, .install-section { padding: 120px max(24px, calc((100vw - 1380px) / 2)); }
.contrast-section { color: var(--white); background: var(--ink); }
.section-heading { max-width: 880px; margin-bottom: 56px; }
.section-heading h2, .install-section h2 { margin: 14px 0 0; font-size: clamp(42px, 5.2vw, 78px); line-height: 0.98; letter-spacing: -0.055em; }
.contrast-section .eyebrow { color: var(--lime); }
.contrast-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 36px; }
.contrast-card { min-height: 480px; padding: 30px; border: 1px solid rgba(255,255,255,0.22); border-radius: var(--radius); }
.contrast-card header { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,0.18); padding-bottom: 20px; }
.contrast-card h3 { margin: 0; font-size: 20px; }
.contrast-card header > span:last-child { margin-left: auto; font: 650 9px ui-monospace, monospace; letter-spacing: .12em; opacity: .6; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); }
.after-card .status-dot { background: var(--lime); }
.contrast-card p { max-width: 560px; color: rgba(255,255,255,.7); line-height: 1.6; }
.contrast-card ul { display: flex; gap: 8px; padding: 0; margin: 26px 0 0; list-style: none; flex-wrap: wrap; }
.contrast-card li { padding: 8px 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 99px; font: 650 10px ui-monospace, monospace; }
.contrast-arrow { display: grid; place-items: center; width: 52px; height: 52px; color: var(--ink); background: var(--lime); border-radius: 50%; font-size: 26px; }
.fake-transcript { height: 220px; margin: 30px 0; padding: 20px; border-radius: 11px; background: #192527; overflow: hidden; }
.fake-transcript span { display: block; width: var(--w); height: 9px; margin-bottom: 15px; background: rgba(255,255,255,.13); border-radius: 5px; }
.fake-transcript span:nth-child(3n) { background: rgba(255,112,72,.35); }
.mini-qhop { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 30px 0; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.18); }
.mini-qhop div { min-height: 109px; padding: 17px; background: #192527; }
.mini-qhop small { display: block; color: var(--lime); margin-bottom: 10px; font: 650 9px ui-monospace, monospace; letter-spacing: .1em; }
.mini-qhop strong { font-size: 14px; line-height: 1.45; }

.heading-row { display: flex; justify-content: space-between; align-items: end; gap: 60px; max-width: none; }
.heading-row > div { max-width: 860px; }
.section-note { max-width: 350px; margin: 0; color: var(--ink-soft); line-height: 1.6; }
.workflow-shell { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 28px; }
.workflow-rail { display: grid; gap: 8px; }
.workflow-step { width: 100%; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px; padding: 18px; text-align: left; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 12px; cursor: pointer; }
.workflow-step:hover { background: rgba(255,255,255,.5); }
.workflow-step.active { border-color: var(--ink); background: var(--white); box-shadow: 5px 5px 0 var(--paper-deep); }
.workflow-step small { display: block; color: var(--ink-soft); margin-bottom: 5px; font: 650 9px ui-monospace, monospace; text-transform: uppercase; letter-spacing: .1em; }
.workflow-step strong { display: block; font-size: 16px; }
.step-number { color: var(--ink-soft); font: 700 12px ui-monospace, monospace; }
.workflow-step.active .step-number { color: var(--orange); }
.workflow-detail { min-height: 425px; padding: clamp(28px, 4vw, 58px); border-radius: 20px; color: var(--white); background: var(--ink); box-shadow: 10px 10px 0 var(--orange); }
.detail-topline { display: flex; justify-content: space-between; color: var(--lime); font: 700 10px ui-monospace, monospace; letter-spacing: .1em; }
.detail-eyebrow { margin-top: 70px; color: rgba(255,255,255,.5); font: 650 10px ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; }
.workflow-detail h3 { margin: 12px 0 18px; font-size: clamp(32px, 4vw, 56px); letter-spacing: -.045em; }
.detail-summary { max-width: 700px; font-size: 17px; line-height: 1.55; }
.command-line { display: flex; align-items: center; gap: 10px; margin-top: 30px; padding: 14px 15px; border: 1px solid rgba(255,255,255,.16); border-radius: 10px; background: #182527; overflow: hidden; }
.command-line > span { color: var(--lime); }
.command-line code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-button, .reset-button { margin-left: auto; border: 0; color: inherit; background: transparent; cursor: pointer; font-size: 11px; font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.detail-note { margin: 18px 0 0; color: rgba(255,255,255,.55); font-size: 13px; line-height: 1.5; }

.playground-section { background: var(--paper-deep); }
.playground-shell { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 22px; align-items: start; }
.handoff-form, .preview-card, .score-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.handoff-form { padding: 24px; }
.form-toolbar, .preview-toolbar { display: flex; justify-content: space-between; align-items: center; padding-bottom: 20px; margin-bottom: 22px; border-bottom: 1px solid var(--line); font: 750 11px ui-monospace, monospace; text-transform: uppercase; letter-spacing: .09em; }
.reset-button { color: var(--ink-soft); text-transform: none; letter-spacing: 0; }
.field-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; }
.arrow-field { padding-bottom: 13px; color: var(--orange); }
.field { margin-bottom: 16px; }
.field label { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.field label span { font: 600 9px ui-monospace, monospace; }
.field input, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; color: var(--ink); background: #faf8f2; resize: vertical; line-height: 1.45; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--blue); border-color: transparent; }
.generate-button { width: 100%; margin-top: 4px; }
.preview-column { position: sticky; top: 20px; display: grid; gap: 14px; }
.score-card { display: flex; align-items: center; gap: 20px; padding: 20px; }
.score-ring { --score: 360deg; flex: 0 0 auto; width: 100px; height: 100px; display: grid; place-content: center; text-align: center; border-radius: 50%; background: radial-gradient(circle at center, var(--white) 60%, transparent 61%), conic-gradient(var(--lime) 0 var(--score), var(--paper-deep) var(--score) 360deg); }
.score-ring strong { font-size: 30px; letter-spacing: -.05em; }
.score-ring span { color: var(--ink-soft); font: 600 9px ui-monospace, monospace; }
.score-card p { margin: 0 0 3px; color: var(--ink-soft); font: 650 10px ui-monospace, monospace; text-transform: uppercase; }
.score-card > div:last-child strong { display: block; font-size: 22px; }
.score-card small { display: block; margin-top: 5px; color: var(--ink-soft); }
.preview-card { min-width: 0; overflow: hidden; }
.preview-toolbar { padding: 17px 19px; margin: 0; background: #faf8f2; }
.preview-toolbar span { display: flex; align-items: center; gap: 9px; }
.preview-toolbar i { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.preview-card pre { height: 485px; margin: 0; padding: 24px; overflow: auto; color: #d8e5de; background: var(--ink); font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.score-breakdown { display: flex; flex-wrap: wrap; gap: 7px; }
.score-chip { padding: 7px 9px; border: 1px solid var(--line); border-radius: 99px; font: 650 9px ui-monospace, monospace; text-transform: uppercase; }
.score-chip.complete { background: rgba(201,255,74,.32); }
.score-chip.missing { color: #8b321d; background: rgba(255,112,72,.2); }

.install-section { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; color: var(--white); background: var(--blue); }
.install-section .eyebrow { color: var(--lime); }
.install-copy > p:not(.eyebrow) { max-width: 560px; line-height: 1.6; color: rgba(255,255,255,.78); }
.command-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.command-list code { padding: 8px 10px; border: 1px solid rgba(255,255,255,.3); border-radius: 7px; font-size: 11px; }
.install-terminal { border-radius: 17px; overflow: hidden; color: var(--white); background: var(--ink); box-shadow: 12px 12px 0 var(--lime); }
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 15px 18px; border-bottom: 1px solid rgba(255,255,255,.14); }
.terminal-bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); }
.terminal-bar span:nth-child(2) { background: #ffd05a; }
.terminal-bar span:nth-child(3) { background: var(--lime); }
.terminal-bar small { margin-left: auto; color: rgba(255,255,255,.45); font: 650 9px ui-monospace, monospace; letter-spacing: .1em; }
.terminal-body { padding: 28px 24px; font: 12px/1.7 ui-monospace, monospace; }
.terminal-body span, .terminal-success { color: var(--lime); }
.button-light { margin: 0 24px 18px; color: var(--ink); background: var(--lime); }
.install-terminal > small { display: block; padding: 0 24px 22px; color: rgba(255,255,255,.45); }

footer { min-height: 110px; padding: 30px max(24px, calc((100vw - 1380px) / 2)); display: flex; justify-content: space-between; align-items: center; gap: 30px; color: var(--white); background: var(--ink); border-top: 1px solid rgba(255,255,255,.12); }
footer p { color: rgba(255,255,255,.5); font: 600 11px ui-monospace, monospace; }
footer > a:last-child { color: var(--lime); font-size: 12px; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 24px; transform: translate(-50%, 20px); padding: 11px 16px; border-radius: 99px; color: var(--lime); background: var(--ink); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: 180ms ease; font-size: 12px; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .relay-visual { min-height: 520px; }
  .contrast-grid { grid-template-columns: 1fr; }
  .contrast-arrow { margin: -8px auto; transform: rotate(90deg); }
  .workflow-shell, .playground-shell, .install-section { grid-template-columns: 1fr; }
  .preview-column { position: static; }
  .heading-row { align-items: start; flex-direction: column; gap: 20px; }
}

@media (max-width: 700px) {
  .site-header { width: min(100% - 28px, 1380px); height: 68px; }
  nav a:not(.github-link) { display: none; }
  .hero { width: min(100% - 28px, 1380px); min-height: auto; padding: 64px 0 80px; }
  h1 { font-size: clamp(50px, 15vw, 68px); }
  h1 em { -webkit-text-stroke-width: 1px; }
  .relay-visual { min-height: 500px; }
  .agent-card { width: 185px; padding: 14px; }
  .agent-planner { left: 5%; }
  .agent-backend { right: 5%; top: 40%; }
  .agent-frontend { left: 5%; bottom: 8%; }
  .packet-one { left: 44%; top: 29%; }
  .packet-two { left: 37%; bottom: 24%; }
  .semantic-ack { right: 4%; top: 61%; }
  .contrast-section, .workflow-section, .playground-section, .install-section { padding: 82px 18px; }
  .section-heading { margin-bottom: 38px; }
  .contrast-card { padding: 20px; }
  .mini-qhop { grid-template-columns: 1fr; }
  .workflow-step { padding: 15px 10px; }
  .workflow-step i { display: none; }
  .workflow-detail { min-height: 440px; padding: 26px 20px; }
  .detail-eyebrow { margin-top: 48px; }
  .command-line code { font-size: 11px; }
  .handoff-form { padding: 17px; }
  .score-card { align-items: flex-start; }
  .score-ring { width: 82px; height: 82px; }
  .preview-card pre { height: 420px; }
  footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
