/* Colours follow the app's design tokens (ui/src/app.css in sourcegull/sourcegull). */
:root {
  --bg: #ffffff;
  --bg-subtle: #f8f9fb;
  --bg-muted: #f1f3f6;
  --card: #ffffff;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #101828;
  --muted: #475467;
  --subtle: #667085;
  --brand: #214780;
  --accent: #3a62a4;
  --accent-soft: #eef3fb;
  --accent-2: #5f84c2;
  --link: #214780;
  --glow-a: rgb(58 98 164 / 0.22);
  --glow-b: rgb(95 132 194 / 0.16);
  --shadow: 0 1px 2px rgb(16 24 40 / 0.05), 0 12px 32px -8px rgb(16 24 40 / 0.12);
  --term-bg: #0f1420;
  --term-text: #e6e9ef;
  --font-sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0e14;
    --bg-subtle: #10141c;
    --bg-muted: #1a202b;
    --card: #12161e;
    --border: #242a36;
    --border-strong: #353d4d;
    --text: #e6e9ef;
    --muted: #98a1b3;
    --subtle: #687287;
    --brand: #7fa3e0;
    --accent: #5f84c2;
    --accent-soft: rgb(95 132 194 / 0.14);
    --accent-2: #8eaad9;
    --link: #8eaad9;
    --glow-a: rgb(58 98 164 / 0.35);
    --glow-b: rgb(127 163 224 / 0.18);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 16px 40px -12px rgb(0 0 0 / 0.6);
    --term-bg: #0a0d13;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--link); text-underline-offset: 3px; }
img { max-width: 100%; }

.ic {
  width: 1.15em; height: 1.15em;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .wrap { padding: 0 1.5rem; } }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.topbar-inner {
  max-width: 72rem; margin: 0 auto; padding: 0 1rem;
  height: 3.75rem; display: flex; align-items: center; gap: 1.5rem;
}
.brand {
  display: flex; align-items: center; gap: 0.55rem;
  color: var(--text); text-decoration: none;
  font-weight: 650; font-size: 1.125rem; letter-spacing: -0.02em;
}
.brand b { color: var(--brand); font-weight: inherit; }
.topnav { display: flex; gap: 1.5rem; margin-left: auto; }
.topnav a, .gh { color: var(--muted); text-decoration: none; font-size: 0.9375rem; font-weight: 500; }
.topnav a:hover, .gh:hover { color: var(--text); }
.gh { display: flex; align-items: center; gap: 0.4rem; }
@media (max-width: 640px) {
  .topnav { display: none; }
  .gh { margin-left: auto; }
}

/* Hero */
.hero { position: relative; padding-top: 4.5rem; }
.glow {
  position: absolute; inset: -10rem 0 auto 0; height: 46rem; z-index: -1;
  background:
    radial-gradient(40rem 22rem at 30% 30%, var(--glow-a), transparent 70%),
    radial-gradient(36rem 20rem at 75% 20%, var(--glow-b), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}
.glow::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 35%, #000 10%, transparent 65%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 35%, #000 10%, transparent 65%);
  opacity: 0.55;
}
.hero-inner { text-align: center; }
.pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0.85rem; border-radius: 999px;
  border: 1px solid var(--border); background: color-mix(in srgb, var(--card) 80%, transparent);
  color: var(--muted); font-size: 0.8125rem; font-weight: 500; text-decoration: none;
}
.pill:hover { color: var(--text); border-color: var(--border-strong); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 3px rgb(18 183 106 / 0.2); }

h1 {
  font-size: clamp(2.25rem, 6vw, 4rem);
  line-height: 1.05; letter-spacing: -0.035em; font-weight: 750;
  max-width: 52rem; margin: 1.5rem auto 1.25rem;
  text-wrap: balance;
}
.grad {
  background: linear-gradient(100deg, var(--brand) 10%, var(--accent-2) 60%, #12b76a 120%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede {
  color: var(--muted); font-size: clamp(1.0625rem, 2vw, 1.25rem);
  max-width: 40rem; margin: 0 auto 2rem; text-wrap: pretty;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  height: 2.875rem; padding: 0 1.25rem; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--card);
  color: var(--text); font-weight: 600; font-size: 0.9375rem; text-decoration: none;
  transition: transform 150ms, background 150ms, box-shadow 150ms;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.primary {
  background: linear-gradient(180deg, var(--accent), var(--brand));
  border-color: transparent; color: #fff;
  box-shadow: 0 6px 20px -6px var(--glow-a), inset 0 1px 0 rgb(255 255 255 / 0.18);
}
@media (prefers-color-scheme: dark) {
  .btn.primary { background: linear-gradient(180deg, #5f84c2, #3a62a4); }
}

.query {
  display: flex; align-items: center; gap: 0.75rem;
  max-width: 34rem; margin: 2.5rem auto 0;
  padding: 0.8rem 1rem; border-radius: 12px;
  background: var(--card); border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-family: var(--font-mono); font-size: 0.875rem; color: var(--text);
  text-align: left; overflow: hidden; white-space: nowrap;
}
.query > .ic { color: var(--subtle); }
.q { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.q::after { content: ""; display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: text-bottom; background: var(--accent); animation: blink 1.1s steps(1) infinite; }
.q .f { color: var(--accent); }
.q .s { color: #c4320a; }
@media (prefers-color-scheme: dark) { .q .s { color: #fdb022; } }
.kbd { font-size: 0.75rem; color: var(--subtle); border: 1px solid var(--border); border-radius: 5px; padding: 0 0.4rem; }
@keyframes blink { 50% { opacity: 0; } }

.shot { margin: 0; }
.shot img {
  display: block; width: 100%; height: auto;
  border-radius: 14px; border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.hero-shot {
  margin: 3.5rem auto 0; max-width: 64rem;
  padding: 0.5rem; border-radius: 20px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.hero-shot img { border-radius: 13px; }

/* Stats */
.stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  margin-top: 4rem; margin-bottom: 1rem;
  background: var(--border); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  padding: 0;
}
@media (min-width: 800px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--bg); padding: 1.5rem 1.25rem; color: inherit; text-decoration: none; transition: background 150ms; }
a.stat:hover { background: var(--bg-subtle); }
.stat b {
  display: block; font-size: clamp(1.75rem, 3.5vw, 2.25rem); letter-spacing: -0.03em; line-height: 1.1;
  background: linear-gradient(100deg, var(--text), var(--brand));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat span { display: block; margin-top: 0.35rem; color: var(--muted); font-size: 0.875rem; line-height: 1.45; }
.stats { max-width: calc(72rem - 3rem); }
@media (max-width: 640px) { .stats { margin-left: 1rem; margin-right: 1rem; } }

/* Section scaffolding */
.block { padding-top: 6rem; }
.eyebrow {
  margin: 0 0 0.6rem; color: var(--accent); font-weight: 650;
  font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase;
}
h2 {
  margin: 0 0 0.9rem; font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.12; letter-spacing: -0.03em; font-weight: 720; max-width: 42rem;
  text-wrap: balance;
}
.sub { color: var(--muted); font-size: 1.0625rem; max-width: 40rem; margin: 0 0 2.25rem; }

/* Feature cards */
.grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card {
  position: relative; padding: 1.5rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  transition: border-color 200ms, transform 200ms, box-shadow 200ms;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateY(-2px); box-shadow: var(--shadow); }
.card.wide { grid-column: 1 / -1; background: linear-gradient(135deg, var(--accent-soft), var(--card) 60%); }
@media (min-width: 1000px) { .card.wide { grid-column: span 2; grid-row: span 1; } }
.card h3 { margin: 1rem 0 0.4rem; font-size: 1.125rem; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.ico {
  width: 2.5rem; height: 2.5rem; display: grid; place-items: center;
  border-radius: 10px; color: var(--accent);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.ico .ic { width: 1.3rem; height: 1.3rem; }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.tags li {
  font-family: var(--font-mono); font-size: 0.75rem;
  padding: 0.2rem 0.55rem; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg-subtle); color: var(--muted);
}

/* Split: text + screenshot */
.split { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 960px) { .split { grid-template-columns: 5fr 7fr; } }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.checks li { position: relative; padding-left: 1.75rem; color: var(--text); }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 0.3em; width: 1.1rem; height: 1.1rem; border-radius: 50%;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233a62a4' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 70% no-repeat;
}

/* Agents */
.agents { display: grid; gap: 2.5rem; align-items: center; }
.agents .sub { margin-bottom: 0.5rem; }

/* Terminal */
.term {
  background: var(--term-bg); color: var(--term-text);
  border-radius: 14px; border: 1px solid #242a36; overflow: hidden;
  box-shadow: var(--shadow);
}
.term-bar {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.65rem 0.9rem; border-bottom: 1px solid #1f2532;
  font-size: 0.75rem; color: #687287;
}
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #353d4d; }
.term-bar span { margin-left: 0.5rem; }
.term pre { margin: 0; padding: 1.1rem 1.2rem; overflow-x: auto; }
.term code { font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.75; }
.term .c { color: #687287; }
.copy {
  margin-left: auto; display: grid; place-items: center;
  width: 1.9rem; height: 1.9rem; border-radius: 6px;
  border: 1px solid #2a3140; background: transparent; color: #98a1b3; cursor: pointer;
}
.copy:hover { color: #e6e9ef; border-color: #3a4357; }
.copy.done { color: #32d583; border-color: #32d583; }

/* Ops mini cards */
.grid.three { margin-top: 1.5rem; }
.mini {
  display: flex; gap: 0.9rem; padding: 1.25rem;
  border: 1px solid var(--border); border-radius: 14px; background: var(--bg-subtle);
}
.mini > .ic { color: var(--accent); margin-top: 0.15rem; }
.mini b { display: block; margin-bottom: 0.2rem; }
.mini span { color: var(--muted); font-size: 0.9rem; }

/* Install */
.tabs {
  display: inline-flex; gap: 0.25rem; padding: 0.25rem; margin: 0.5rem 0 1.25rem;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg-subtle);
}
.tabs button {
  border: 0; background: transparent; color: var(--muted);
  font: 600 0.875rem var(--font-sans); padding: 0.5rem 0.95rem; border-radius: 7px; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgb(16 24 40 / 0.12); }
.install .term { max-width: 52rem; }
.note { color: var(--muted); margin: 1rem 0 0; max-width: 52rem; }
code { font-family: var(--font-mono); font-size: 0.875em; }
.note code { background: var(--bg-muted); padding: 0.1em 0.35em; border-radius: 4px; }

/* CTA */
.cta {
  margin-top: 6rem; padding-top: 3.5rem; padding-bottom: 3.5rem;
  text-align: center; border-radius: 24px;
  background:
    radial-gradient(30rem 14rem at 50% 0%, var(--glow-a), transparent 70%),
    var(--bg-subtle);
  border: 1px solid var(--border);
  max-width: calc(72rem - 3rem);
}
@media (max-width: 640px) { .cta { margin-left: 1rem; margin-right: 1rem; } }
.cta h2 { margin-left: auto; margin-right: auto; }
.cta p { color: var(--muted); margin: 0 0 1.75rem; font-size: 1.0625rem; }

/* Footer */
.footer { margin-top: 4rem; border-top: 1px solid var(--border); }
.foot-inner {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between;
  padding-top: 1.75rem; padding-bottom: 2.5rem;
}
.footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.footer nav a { color: var(--muted); text-decoration: none; font-size: 0.875rem; }
.footer nav a:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Install guides */
.guides-title { margin: 3rem 0 1rem; font-size: 1.25rem; letter-spacing: -0.01em; }
.guides { display: grid; gap: 1rem; max-width: 52rem; }
@media (min-width: 720px) { .guides { grid-template-columns: 1fr 1fr; } }
.guide {
  display: flex; flex-direction: column; gap: 0.4rem; padding: 1.25rem;
  border: 1px solid var(--border); border-radius: 14px; background: var(--card);
  color: var(--text); text-decoration: none;
  transition: border-color 200ms, transform 200ms, box-shadow 200ms;
}
.guide:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateY(-2px); box-shadow: var(--shadow); }
.guide span { color: var(--muted); font-size: 0.9375rem; }
.guide em { margin-top: auto; padding-top: 0.4rem; color: var(--accent); font-style: normal; font-weight: 600; font-size: 0.875rem; }
