/* Hopper — site design system.
   Deep blue-slate ink, one confident blue accent + the app's live-green signal.
   Bricolage Grotesque (display) / Hanken Grotesk (text) / JetBrains Mono (code). */

@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500..800&family=Hanken+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  color-scheme: dark;

  --ink:        oklch(0.155 0.018 258);
  --ink-raised: oklch(0.185 0.020 258);
  --ink-sunk:   oklch(0.130 0.016 258);
  --paper:      oklch(0.965 0.006 250);
  --muted:      oklch(0.740 0.020 250);
  --dim:        oklch(0.630 0.022 252);

  --blue:        oklch(0.660 0.150 248);
  --blue-bright: oklch(0.740 0.150 248);
  --live:        oklch(0.760 0.150 155);   /* the app's "running/connected" green */
  --warn:        oklch(0.780 0.130 70);

  --edge:      color-mix(in oklch, var(--paper) 10%, transparent);
  --edge-soft: color-mix(in oklch, var(--paper) 6%, transparent);

  --shadow: 0 1px 0 var(--edge-soft), 0 24px 60px -24px oklch(0 0 0 / 0.7);
  --glow:   0 0 120px -20px color-mix(in oklch, var(--blue) 60%, transparent);

  --measure: 62ch;
  --radius: 14px;

  --step--1: clamp(0.82rem, 0.79rem + 0.15vw, 0.9rem);
  --step-0:  clamp(1rem, 0.95rem + 0.25vw, 1.15rem);
  --step-1:  clamp(1.3rem, 1.15rem + 0.7vw, 1.7rem);
  --step-2:  clamp(1.9rem, 1.5rem + 1.9vw, 3rem);
  --step-3:  clamp(2.8rem, 2rem + 3.8vw, 5.3rem);
  --step-4:  clamp(3.6rem, 2.2rem + 6vw, 7.2rem);

  --font-display: "Bricolage Grotesque", ui-sans-serif, sans-serif;
  --font-text: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* A slow, low aurora — restrained, not neon. Sits behind everything. */
.aurora {
  position: fixed;
  inset: -20vh -10vw auto -10vw;
  height: 90vh;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 60% at 22% 8%, color-mix(in oklch, var(--blue) 26%, transparent), transparent 70%),
    radial-gradient(50% 50% at 82% -4%, color-mix(in oklch, var(--live) 12%, transparent), transparent 65%);
  filter: blur(30px) saturate(115%);
  opacity: 0.75;
  animation: drift 26s ease-in-out infinite alternate;
}
.grid-floor {
  position: fixed;
  inset: auto 0 0 0;
  height: 44vh;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(to top, var(--ink), transparent),
    repeating-linear-gradient(to right, var(--edge-soft) 0 1px, transparent 1px 84px),
    repeating-linear-gradient(to top, var(--edge-soft) 0 1px, transparent 1px 84px);
  -webkit-mask-image: radial-gradient(80% 120% at 50% 120%, #000, transparent);
          mask-image: radial-gradient(80% 120% at 50% 120%, #000, transparent);
  opacity: 0.5;
}
@keyframes drift {
  to { transform: translate3d(3%, 2%, 0) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) { .aurora { animation: none; } }

a { color: inherit; text-decoration: none; }

.wrap { width: min(1160px, 92vw); margin-inline: auto; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--blue); color: var(--ink); padding: 0.6rem 1rem; border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip:focus { left: 0; }

/* nav */

.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 2rem;
  padding: 1rem 0;
  width: min(1160px, 92vw); margin-inline: auto;
  backdrop-filter: blur(8px);
}
.nav::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 1px;
  background: var(--edge-soft);
  width: 100vw; left: 50%; transform: translateX(-50%);
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand svg { width: 24px; height: 24px; }
.nav nav { display: flex; gap: 1.6rem; margin-left: auto; font-size: var(--step--1); color: var(--muted); }
.nav nav a { transition: color 0.2s; }
.nav nav a:hover { color: var(--paper); }
.nav .ghjump {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.9rem; border: 1px solid var(--edge); border-radius: 999px;
  font-size: var(--step--1); color: var(--paper);
  transition: border-color 0.2s, background 0.2s;
}
.nav .ghjump:hover { border-color: color-mix(in oklch, var(--blue) 55%, var(--edge)); background: color-mix(in oklch, var(--blue) 10%, transparent); }

/* hero */

.hero { padding: clamp(3rem, 8vh, 7rem) 0 2rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.02em;
  color: var(--muted);
  padding: 0.4rem 0.8rem; border: 1px solid var(--edge-soft); border-radius: 999px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--live) 22%, transparent); }

h1.title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-4);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 1.4rem 0 0;
  max-width: 16ch;
}
h1.title em { font-style: normal; color: var(--blue-bright); }
.lede { margin: 1.4rem 0 0; max-width: 54ch; font-size: var(--step-1); color: var(--muted); line-height: 1.4; }
.lede strong { color: var(--paper); font-weight: 600; }

.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; align-items: center; }
.button {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.3rem; border-radius: 11px;
  font-weight: 600; font-size: var(--step-0);
  border: 1px solid var(--edge);
  transition: transform 0.15s cubic-bezier(0.2,0.8,0.2,1), border-color 0.2s, background 0.2s;
}
.button:hover { transform: translateY(-2px); }
.button.primary { background: var(--blue); color: oklch(0.16 0.02 258); border-color: transparent; box-shadow: 0 12px 30px -14px oklch(0 0 0 / 0.5); }
.button.primary:hover { background: var(--blue-bright); }
.button.ghost:hover { border-color: color-mix(in oklch, var(--blue) 50%, var(--edge)); }
.install {
  font-family: var(--font-mono); font-size: var(--step--1); color: var(--muted);
  display: inline-flex; align-items: center; gap: 0.6rem;
}
.install code { color: var(--paper); }
.install b { color: var(--blue-bright); font-weight: 500; }

/* the floating app window */
.stage { position: relative; margin-top: clamp(3rem, 7vh, 5.5rem); }
.stage .halo {
  position: absolute; inset: -8% -4% 12% -4%; z-index: -1;
  background: var(--glow); filter: blur(10px); opacity: 0.8;
}
.window {
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--edge-soft);
  background: var(--ink-sunk);
}
.window img { display: block; width: 100%; height: auto; }
.stage figcaption {
  margin-top: 1rem; text-align: center; font-family: var(--font-mono);
  font-size: var(--step--1); color: var(--dim);
}

/* marquee strip */

.strip {
  display: flex; flex-wrap: wrap; gap: 2.4rem 3.2rem; justify-content: center;
  padding: 2.6rem 0; margin-top: 3rem;
  border-block: 1px solid var(--edge-soft);
  color: var(--muted); font-size: var(--step--1); font-family: var(--font-mono);
}
.strip b { color: var(--paper); font-weight: 500; }

/* sections */

section { padding: clamp(4rem, 10vh, 8rem) 0; }
.section-head { max-width: 40ch; }
.kicker { font-family: var(--font-mono); font-size: var(--step--1); color: var(--blue-bright); letter-spacing: 0.04em; text-transform: uppercase; }
h2 { font-family: var(--font-display); font-weight: 700; font-size: var(--step-3); line-height: 1.02; letter-spacing: -0.03em; margin: 0.8rem 0 0; }
h2 em { font-style: normal; color: var(--muted); }
.section-head p { color: var(--muted); font-size: var(--step-1); margin-top: 1rem; line-height: 1.4; }

/* alternating feature rows */
.feature { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.feature + .feature { margin-top: clamp(4rem, 9vh, 7rem); }
.feature:nth-child(even) .copy { order: 2; }
.feature .copy h3 { font-family: var(--font-display); font-weight: 700; font-size: var(--step-2); letter-spacing: -0.02em; line-height: 1.05; margin: 0.4rem 0 0; }
.feature .copy p { color: var(--muted); margin-top: 1rem; max-width: 46ch; }
.feature .copy .tag { font-family: var(--font-mono); font-size: var(--step--1); color: var(--live); }
.feature .copy .more { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 1.4rem; color: var(--blue-bright); font-weight: 600; font-size: var(--step--1); }
.feature .more:hover { gap: 0.7rem; transition: gap 0.2s; }
.feature .shot { border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--edge-soft); background: var(--ink-sunk); }
.feature .shot img { display: block; width: 100%; height: auto; }

/* engine — the differentiator, given its own treatment */
.engine { border-block: 1px solid var(--edge-soft); position: relative; }
.engine .wrap { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.pipeline { display: flex; flex-direction: column; gap: 0; counter-reset: step; }
.pipeline li { list-style: none; display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; padding: 1.3rem 0; border-top: 1px solid var(--edge-soft); }
.pipeline li:first-child { border-top: none; }
.pipeline li .n { counter-increment: step; font-family: var(--font-mono); color: var(--blue-bright); font-size: var(--step--1); padding-top: 0.2rem; }
.pipeline li .n::before { content: "0" counter(step); }
.pipeline li h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); letter-spacing: -0.01em; }
.pipeline li p { margin: 0.3rem 0 0; color: var(--muted); font-size: var(--step-0); }
.pipeline li code { font-family: var(--font-mono); color: var(--live); font-size: 0.92em; }

.termcard {
  position: sticky; top: 6rem;
  border-radius: 14px; overflow: hidden; border: 1px solid var(--edge-soft);
  background: var(--ink-sunk); box-shadow: var(--shadow);
  font-family: var(--font-mono); font-size: var(--step--1);
}
.termcard .bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--edge-soft); color: var(--dim); }
.termcard .bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--ink-raised); display: inline-block; }
.termcard .bar i:nth-child(1) { background: oklch(0.68 0.17 25); }
.termcard .bar i:nth-child(2) { background: oklch(0.82 0.14 85); }
.termcard .bar i:nth-child(3) { background: oklch(0.78 0.15 150); }
.termcard .bar b { margin-left: 0.6rem; color: var(--muted); font-weight: 400; }
.termcard pre { margin: 0; padding: 1.2rem 1.3rem; line-height: 1.7; overflow-x: auto; }
.termcard .p { color: var(--blue-bright); }
.termcard .c { color: var(--dim); }
.termcard .g { color: var(--live); }
.termcard .o { color: var(--muted); }

/* capability grid — deliberately not identical cards */
.caps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--edge-soft); border: 1px solid var(--edge-soft); border-radius: var(--radius); overflow: hidden; margin-top: 3rem; }
.caps div { background: var(--ink); padding: 1.6rem; }
.caps div:nth-child(1) { grid-column: span 3; }
.caps div:nth-child(2) { grid-column: span 3; }
.caps div:nth-child(3) { grid-column: span 2; }
.caps div:nth-child(4) { grid-column: span 2; }
.caps div:nth-child(5) { grid-column: span 2; }
.caps h3 { margin: 0 0 0.4rem; font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); letter-spacing: -0.01em; }
.caps p { margin: 0; color: var(--muted); font-size: var(--step--1); }

/* closing */
.closing { text-align: center; }
.closing h2 { max-width: 20ch; margin-inline: auto; }
.closing .actions { justify-content: center; margin-top: 2.4rem; }

/* footer */
.sitefooter { border-top: 1px solid var(--edge-soft); padding: 3rem 0; }
.sitefooter .wrap { display: flex; flex-wrap: wrap; gap: 1.4rem; align-items: center; }
.sitefooter nav { display: flex; gap: 1.6rem; margin-left: auto; color: var(--muted); font-size: var(--step--1); }
.sitefooter nav a:hover { color: var(--paper); }
.sitefooter p { color: var(--dim); font-size: var(--step--1); width: 100%; margin: 0.5rem 0 0; }

/* docs page */

.docs-layout { display: grid; grid-template-columns: 240px 1fr; gap: clamp(2rem, 5vw, 4.5rem); padding-top: 3rem; align-items: start; }
.docs-nav { position: sticky; top: 6rem; font-size: var(--step--1); }
.docs-nav h5 { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--dim); font-size: 0.72rem; margin: 1.6rem 0 0.6rem; }
.docs-nav h5:first-child { margin-top: 0; }
.docs-nav a { display: block; padding: 0.35rem 0; color: var(--muted); border-left: 2px solid transparent; padding-left: 0.8rem; transition: color 0.15s, border-color 0.15s; }
.docs-nav a:hover, .docs-nav a.active { color: var(--paper); border-color: var(--blue); }

.docs-body { max-width: var(--measure); min-width: 0; }
.docs-body h1 { font-family: var(--font-display); font-weight: 800; font-size: var(--step-3); letter-spacing: -0.03em; margin: 0 0 0.5rem; }
.docs-body > p:first-of-type { color: var(--muted); font-size: var(--step-1); }
.docs-body h2 { font-size: var(--step-2); margin-top: 3.5rem; scroll-margin-top: 6rem; }
.docs-body h3 { font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); letter-spacing: -0.01em; margin-top: 2.2rem; scroll-margin-top: 6rem; }
.docs-body p, .docs-body li { color: var(--paper); }
.docs-body p { margin: 1rem 0; }
.docs-body strong { font-weight: 600; }
.docs-body a:not(.button) { color: var(--blue-bright); border-bottom: 1px solid color-mix(in oklch, var(--blue) 40%, transparent); }
.docs-body ul { padding-left: 1.2rem; }
.docs-body li { margin: 0.4rem 0; }
.docs-body li::marker { color: var(--blue); }

.docs-body code { font-family: var(--font-mono); font-size: 0.88em; background: var(--ink-raised); padding: 0.15em 0.4em; border-radius: 5px; color: var(--live); }
.docs-body pre { background: var(--ink-sunk); border: 1px solid var(--edge-soft); border-radius: 11px; padding: 1.2rem 1.4rem; overflow-x: auto; font-family: var(--font-mono); font-size: var(--step--1); line-height: 1.7; }
.docs-body pre code { background: none; padding: 0; color: var(--paper); }
.docs-body pre .c { color: var(--dim); }
.docs-body pre .k { color: var(--blue-bright); }

.callout { border: 1px solid var(--edge); border-left: 1px solid var(--blue); border-radius: 0 11px 11px 0; padding: 1rem 1.3rem; margin: 1.6rem 0; background: color-mix(in oklch, var(--blue) 5%, transparent); }
.callout p { margin: 0.3rem 0; }
.callout strong { color: var(--blue-bright); }
.callout.warn { border-left-color: var(--warn); background: color-mix(in oklch, var(--warn) 5%, transparent); }
.callout.warn strong { color: var(--warn); }

/* reveal motion */

[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1), transform 0.8s cubic-bezier(0.16,1,0.3,1); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal][data-delay="1"] { transition-delay: 0.08s; }
[data-reveal][data-delay="2"] { transition-delay: 0.16s; }
[data-reveal][data-delay="3"] { transition-delay: 0.24s; }
[data-reveal][data-delay="4"] { transition-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* responsive */

@media (max-width: 900px) {
  .feature, .engine .wrap, .docs-layout { grid-template-columns: 1fr; }
  .feature:nth-child(even) .copy { order: 0; }
  .caps { grid-template-columns: repeat(2, 1fr); }
  .caps div { grid-column: span 2 !important; }
  .termcard { position: static; }
  .docs-nav { position: static; display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; border-bottom: 1px solid var(--edge-soft); padding-bottom: 1rem; }
  .docs-nav h5 { width: 100%; margin: 0.6rem 0 0; }
  .docs-nav a { border-left: none; padding-left: 0; }
}
@media (max-width: 620px) {
  .nav nav { display: none; }
  .caps { grid-template-columns: 1fr; }
  .caps div { grid-column: span 1 !important; }
}

/* docs: generated pages */

/* A page's one-line summary, under its title. */
.docs-body .lede-sm {
  font-size: var(--step-0);
  color: var(--muted);
  margin: -0.4rem 0 2rem;
  max-width: 60ch;
}

/* The docs and tutorials indexes. */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.9rem;
  margin: 1rem 0 2.4rem;
}
.card {
  display: block;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--edge-soft);
  border-radius: 12px;
  background: var(--ink-raised);
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover {
  border-color: color-mix(in oklch, var(--blue) 45%, var(--edge));
  transform: translateY(-2px);
}
.card h3 {
  margin: 0 0 0.35rem;
  font-size: var(--step-0);
  color: var(--paper);
}
.card p {
  margin: 0;
  font-size: var(--step--1);
  color: var(--dim);
  line-height: 1.5;
}

/* Previous / next, so the docs read as a sequence. */
.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--edge-soft);
}
.pager a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--edge-soft);
  border-radius: 10px;
  color: var(--paper);
  font-size: var(--step--1);
  transition: border-color 0.15s;
}
.pager a:hover { border-color: color-mix(in oklch, var(--blue) 45%, var(--edge)); }
.pager .next { text-align: right; margin-left: auto; }
.pager span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dim);
}

/* Tables in generated pages — the capability matrix leans on these. */
.docs-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0 2rem;
  font-size: var(--step--1);
}
.docs-body th, .docs-body td {
  text-align: left;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--edge-soft);
  vertical-align: top;
}
.docs-body th { color: var(--dim); font-weight: 600; }
.docs-body tbody tr:hover { background: color-mix(in oklch, var(--paper) 3%, transparent); }

@media (max-width: 900px) {
  .pager { flex-direction: column; }
  .pager .next { margin-left: 0; text-align: left; }
  .docs-body table { display: block; overflow-x: auto; }
}
