/* Hook404 landing — "a 404 page for humans". Uses tokens.css. */

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.nowrap { white-space: nowrap; }
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }

/* ── header ─────────────────────────────────────────── */
.top { height: var(--header-h); border-bottom: 1px solid var(--line); background: var(--bg); }
.top__in { height: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.mark { font-family: var(--font-display); font-size: 22px; line-height: 1; letter-spacing: .01em; text-decoration: none; color: var(--ink); }
.mark b { font-weight: 400; color: var(--red); }
.top__nav { display: flex; gap: var(--s-5); font-family: var(--font-mono); font-size: var(--fs-sm); }
.top__nav a { text-decoration: none; color: var(--ink-2); }
.top__nav a:hover { color: var(--ink); text-decoration: underline; }

/* ── hero: one desktop viewport, 7/5 grid ───────────── */
.hero { position: relative; min-height: calc(100svh - var(--header-h)); display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
.hero__in {
  flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: clamp(20px, 3.4vh, 40px) var(--gutter) clamp(36px, 5vh, 56px);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(24px, 3vw, 48px); align-items: stretch;
}
.hero__left { grid-column: 1 / span 7; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.hero__right { grid-column: 8 / span 5; display: flex; min-width: 0; min-height: 0; }

.eyebrow { margin: 0 0 var(--s-3); font-size: var(--fs-sm); color: var(--ink-3); display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.eyebrow__code { color: var(--ink); border: 1px solid var(--ink); padding: 1px 6px; border-radius: var(--radius); font-weight: 500; }

.big { margin: 0; font-weight: 400; }
.big__num {
  display: block; font-family: var(--font-display); font-weight: 400; color: var(--ink);
  font-size: min(43vh, 28vw); line-height: .8; letter-spacing: -.01em;
  padding-top: .06em;
}
.big__msg {
  display: block; margin-top: clamp(10px, 1.6vh, 18px);
  font-family: var(--font-body); font-weight: 600; letter-spacing: -.035em; line-height: 1;
  font-size: clamp(30px, min(5.4vh, 3.6vw), 56px);
}
.sub { margin: clamp(10px, 1.6vh, 16px) 0 0; font-size: var(--fs-md); color: var(--ink-2); max-width: 46ch; line-height: var(--lh-snug); }
.sub sup a { text-decoration: none; color: var(--ink-3); margin-left: 1px; }
.sub__meta { color: var(--ink-3); white-space: nowrap; }

.actions { display: flex; gap: var(--s-3); margin-top: clamp(16px, 2.8vh, 28px); flex-wrap: wrap; }
.curl {
  margin: var(--s-3) 0 0; font-size: var(--fs-xs); color: var(--ink-3); cursor: copy;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.curl:hover { color: var(--ink-2); }
.curl__p { color: var(--ink-3); }

.ca {
  margin-top: clamp(14px, 2.4vh, 24px); padding: var(--s-2) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: var(--s-2) var(--s-3); flex-wrap: wrap;
}
.ca__k { color: var(--ink); }
.ca__v { font-size: var(--fs-base); font-weight: 500; letter-spacing: .01em; }
.ca__note { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-3); }
.ca__sym { font-size: var(--fs-sm); font-weight: 600; }
.ca__sp { flex: 1; }

.stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: var(--s-6); margin: clamp(14px, 2.4vh, 24px) 0 0; }
.stats div { margin: 0; }
.stats dt { margin-bottom: 2px; }
.stats dd { margin: 0; font-size: clamp(22px, 2.6vh, 28px); font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; }
.demo-note { margin: var(--s-3) 0 0; font-size: var(--fs-sm); color: var(--ink-3); }

.hero__more { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); text-decoration: none; }
.hero__more:hover { color: var(--ink); }

/* ── terminal ───────────────────────────────────────── */
.term {
  flex: 1; display: flex; flex-direction: column; min-height: 0; max-height: calc(100svh - var(--header-h) - 64px);
  background: var(--term); color: var(--term-ink); border-radius: 4px; overflow: hidden;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7;
}
.term__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); height: 40px; padding: 0 var(--s-2) 0 var(--s-2); border-bottom: 1px solid var(--term-line); flex: none; }
.term__tabs { display: flex; }
.term__tabs button {
  font: inherit; font-size: var(--fs-sm); background: none; border: 0; color: var(--term-dim); padding: 6px 10px; cursor: pointer; border-radius: var(--radius);
}
.term__tabs button[aria-selected="true"] { color: #FFFFFF; background: #1A1A1A; }
.term__tabs button:hover { color: #FFFFFF; }
.term__tabs button:focus-visible { outline-color: #FFFFFF; }
.term__tabs .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--term-ink); margin-left: 6px; vertical-align: 2px; }
.term__title { color: var(--term-dim); font-size: var(--fs-xs); padding-right: var(--s-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.term__body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: var(--s-3) var(--s-4) var(--s-3); }
.term__pane { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.term__pane[hidden] { display: none; }
.term__lines { overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.term__lines::-webkit-scrollbar { display: none; }
.term__prompt { flex: none; padding-top: var(--s-1); color: var(--term-ink); }
.term__ps { color: var(--term-dim); margin-right: 8px; }
.cursor { display: inline-block; width: .6em; height: 1.15em; vertical-align: -.22em; background: var(--term-ink); animation: blink 1.06s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.ln { white-space: pre-wrap; word-break: break-word; }
.ln.in { animation: rise .22s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ln .t { color: var(--term-dim); }
.ln .who { color: var(--term-ink); }
.ln .addr { color: #FFFFFF; }
.ln a { color: var(--term-ink); text-decoration: none; border-bottom: 1px solid #3A3A3A; }
.ln a:hover { color: #FFFFFF; border-color: #FFFFFF; }
.ln.dim, .ln .dim { color: var(--term-dim); }
.ln .g, .ln.g { color: var(--green); }
.ln .r, .ln.r { color: var(--red); }
.ln .y, .ln.y { color: var(--amber); }
.ln .cmd { color: #FFFFFF; }
.ln.gap { height: .7em; }
.ln.big404 { color: var(--red); font-weight: 600; font-size: 15px; }
.ln.big200 { color: var(--green); font-weight: 600; font-size: 15px; }
.ln button.linkish { font: inherit; color: var(--term-ink); background: none; border: 0; padding: 0; border-bottom: 1px solid #3A3A3A; cursor: pointer; }
.ln button.linkish:hover { color: #FFFFFF; border-color: #FFFFFF; }
.ln.stub { color: var(--amber); }

/* ── sections below the fold ────────────────────────── */
.sec { padding: var(--s-9) 0; border-bottom: 1px solid var(--line); }
.sec__h { margin: 0 0 var(--s-6); font-family: var(--font-display); font-weight: 400; font-size: var(--fs-2xl); line-height: 1; letter-spacing: .005em; text-transform: uppercase; display: flex; align-items: baseline; gap: var(--s-4); }
.sec__h .label { font-family: var(--font-mono); font-size: var(--fs-xs); }
.sec__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(24px, 3vw, 48px); }
.sec__grid > .sec__h { grid-column: 1 / span 4; }
.sec__grid > :not(.sec__h) { grid-column: 5 / span 8; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); }
.card { padding: var(--s-5); border-right: 1px solid var(--line); min-width: 0; }
.card:last-child { border-right: 0; }
.card__n { display: block; font-size: var(--fs-sm); font-weight: 600; text-transform: uppercase; letter-spacing: var(--track-label); counter-increment: step; }
.cards { counter-reset: step; }
.card__n::before { content: "0" counter(step) "  "; color: var(--ink-3); white-space: pre; }
.card__ep { display: block; margin: var(--s-3) 0 var(--s-3); font-size: var(--fs-sm); color: var(--ink); overflow-wrap: anywhere; }
.card p { margin: 0; color: var(--ink-2); }
.card p code, .how__alt code, .muted code { font-size: .9em; }

.code { margin-top: var(--s-5); background: var(--term); color: var(--term-ink); border-radius: 4px; overflow: hidden; }
.code__bar { display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--term-line); }
.code__bar .label { color: var(--term-dim); }
.code__rule { font-size: var(--fs-xs); color: var(--term-ink); }
.code pre { margin: 0; padding: var(--s-4); overflow-x: auto; font-size: 13px; line-height: 1.75; }
.c-k { color: #FFFFFF; font-weight: 500; }
.c-s { color: #A8A8A8; }
.c-c { color: var(--term-dim); }
.how__alt { margin: var(--s-4) 0 0; color: var(--ink-2); }
.how__alt code { background: var(--paper-2); padding: 1px 5px; border-radius: var(--radius); overflow-wrap: anywhere; }

.sec--rule { padding: var(--s-9) 0 calc(var(--s-9) + 16px); }
.rule { margin: 0; font-family: var(--font-body); font-weight: 600; letter-spacing: -.035em; line-height: 1.08; font-size: clamp(32px, 5.2vw, 76px); max-width: 18ch; text-wrap: balance; }
.rule__end { color: var(--ink-3); }

.lead { margin: 0; font-size: var(--fs-xl); line-height: var(--lh-snug); letter-spacing: -.015em; font-weight: 500; max-width: 30ch; }
.muted { margin: var(--s-4) 0 0; color: var(--ink-3); }

.risks { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.risks li { padding: var(--s-4) 0; border-bottom: 1px solid var(--line); color: var(--ink-2); max-width: 68ch; }
.risks b { color: var(--ink); font-weight: 600; }

/* ── footer ─────────────────────────────────────────── */
.foot { padding: var(--s-7) 0 var(--s-8); }
.foot__row { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.foot__nav { display: flex; gap: var(--s-5); flex-wrap: wrap; font-family: var(--font-mono); font-size: var(--fs-sm); }
.foot__nav a { color: var(--ink-2); text-decoration: none; }
.foot__nav a:hover { color: var(--ink); text-decoration: underline; }
.contracts { margin: var(--s-6) 0 0; display: grid; gap: var(--s-2); font-size: var(--fs-sm); }
.contracts div { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: var(--s-3); }
.contracts dt { color: var(--ink-3); }
.contracts dd { margin: 0; overflow-wrap: anywhere; color: var(--ink-2); }
.disclaimer { margin: var(--s-6) 0 0; max-width: 88ch; font-size: var(--fs-sm); color: var(--ink-3); line-height: var(--lh-body); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); font-size: var(--fs-sm); padding: 8px 14px; border-radius: var(--radius);
  transition: opacity .15s ease, transform .15s ease; z-index: 10; max-width: calc(100vw - 32px);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ── shorter desktops ───────────────────────────────── */
@media (min-width: 769px) and (max-height: 760px) {
  .big__num { font-size: min(42vh, 30vw); }
  .eyebrow { display: none; }
}

/* ── tablet ─────────────────────────────────────────── */
@media (max-width: 1100px) and (min-width: 769px) {
  .hero__left { grid-column: 1 / span 7; }
  .hero__right { grid-column: 8 / span 5; }
  .stats { gap: var(--s-5); }
  .sub__meta { white-space: normal; }
}

/* ── mobile ≤ 768: stacked ──────────────────────────── */
@media (max-width: 768px) {
  :root { --header-h: 48px; }
  .top__nav { gap: var(--s-4); font-size: var(--fs-xs); }
  .mark { font-size: 20px; }
  .hero { min-height: 0; }
  .hero__in { display: flex; flex-direction: column; padding: var(--s-4) var(--gutter) var(--s-6); gap: var(--s-5); }
  .hero__left, .hero__right { grid-column: auto; }
  .eyebrow { display: none; }
  .big__num { font-size: min(26vh, 50vw); line-height: .8; }
  .big__msg { font-size: clamp(26px, 8vw, 40px); margin-top: 10px; }
  .sub { font-size: var(--fs-base); margin-top: 8px; }
  .sub__meta { white-space: normal; }
  .actions { margin-top: var(--s-4); gap: var(--s-2); }
  .actions .btn { flex: 1 1 auto; padding: 0 var(--s-3); height: 42px; font-size: 14px; }
  .curl { display: none; }
  .ca { margin-top: var(--s-3); gap: 6px 8px; }
  .ca__v { font-size: var(--fs-sm); }
  .ca__sp { display: none; }
  .ca__note { order: 9; flex-basis: 100%; }
  .stats { margin-top: var(--s-3); gap: var(--s-4); }
  .stats dd { font-size: 20px; }
  .demo-note { font-size: var(--fs-xs); }
  .term { height: 46vh; max-height: none; flex: none; width: 100%; font-size: 11.5px; }
  .hero__more { display: none; }
  .sec { padding: var(--s-7) 0; }
  .sec__grid { display: block; }
  .cards { grid-template-columns: 1fr; }
  .card { border-right: 0; border-bottom: 1px solid var(--line); }
  .card:last-child { border-bottom: 0; }
  .code pre { font-size: 11.5px; }
  .contracts div { grid-template-columns: 64px minmax(0, 1fr); }
}
@media (max-width: 380px) {
  .top__nav a[href^="https://x.com"] { display: none; }
  .stats { gap: var(--s-3); }
  .stats .label { font-size: 10.5px; letter-spacing: .05em; }
}

/* ══ v2: dark futuristic theme — scoped to the landing (body.landing); tokens.css stays light for /docs /proof /feed ══ */
body.landing {
  --bg: #07080A; --ink: #E8EAED; --ink-2: #A4A9B1; --ink-3: #6A7079;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.18); --paper-2: #121419;
  --term: rgba(10,12,15,.72); --term-ink: #CDD1D6; --term-dim: #646A73; --term-line: rgba(255,255,255,.07);
  background-color: var(--bg); color: var(--ink); color-scheme: dark;
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 64px 64px; background-position: -1px -1px;
}
body.landing ::selection { background: var(--ink); color: #07080A; }
body.landing .top { background: rgba(7,8,10,.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 5; }
body.landing .btn { background: var(--ink); color: #07080A; border-color: var(--ink); }
body.landing .btn:hover { background: #FFFFFF; }
body.landing .btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
body.landing .btn--ghost:hover { background: rgba(255,255,255,.06); border-color: var(--ink); }
body.landing .btn[disabled], body.landing .btn[aria-disabled="true"] { background: rgba(255,255,255,.04); color: var(--ink-3); border-color: var(--line); }
body.landing .eyebrow__code { border-color: var(--ink-2); color: var(--ink); }
body.landing :focus-visible { outline-color: var(--ink); }

/* hero: canvas behind, HTML on top; subtle scanlines */
.hero { overflow: hidden; isolation: isolate; }
.hero__gl { position: absolute; inset: 0; z-index: 0; pointer-events: none; display: block; }
.hero__in { position: relative; z-index: 1; }
.hero__more { z-index: 3; }
body.landing .hero::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.014) 0 1px, transparent 1px 3px);
}
body.has3d .big__num { visibility: hidden; }
.big__num { color: var(--ink); }

/* terminal as a glass HUD panel with corner brackets */
body.landing .term {
  position: relative; overflow: visible; background: var(--term); border: 1px solid rgba(255,255,255,.09); border-radius: 6px;
  backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.05);
}
body.landing .term::before, body.landing .term::after {
  content: ""; position: absolute; width: 14px; height: 14px; border: 1px solid rgba(255,255,255,.45); pointer-events: none;
}
body.landing .term::before { top: -5px; left: -5px; border-right: 0; border-bottom: 0; }
body.landing .term::after { bottom: -5px; right: -5px; border-left: 0; border-top: 0; }
body.landing .term__body { overflow: hidden; border-radius: 0 0 6px 6px; }
body.landing .term__tabs button[aria-selected="true"] { background: rgba(255,255,255,.08); }
body.landing .code { background: #0C0E12; border: 1px solid var(--line); }
body.landing .how__alt code { background: #121419; }
body.landing .card { background: rgba(7,8,10,.6); }
body.landing .stats dd { color: #FFFFFF; }
body.landing .toast { background: #E8EAED; color: #07080A; }
