/* ==========================================================================
   Utilith — Design tokens, reset and base typography
   Dark-first (black canvas) with an optional light theme.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Canvas */
  --bg: #060607;
  --bg-soft: #0a0a0d;
  --surface: #101014;
  --surface-2: #16161c;
  --surface-3: #1d1d25;

  /* Lines */
  --border: #24242e;
  --border-strong: #33333f;

  /* Ink */
  --text: #f3f4f7;
  --text-2: #a3a8ba;
  --text-3: #81869c;

  /* Brand */
  --brand: #c4f542;
  --brand-strong: #a8d92b;
  --brand-soft: rgba(196, 245, 66, 0.12);
  --brand-ink: #0b0f02;
  --accent: #8b7cf6;
  --accent-soft: rgba(139, 124, 246, 0.14);

  /* Status */
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.12);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);

  /* Shape */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 30px 70px -24px rgba(0, 0, 0, 0.85);
  --ring: 0 0 0 3px rgba(196, 245, 66, 0.28);

  /* Type */
  --font-sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: "Space Grotesk", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, "Cascadia Mono", Consolas,
    "Liberation Mono", monospace;

  /* Layout */
  --container: 1200px;
  --gutter: 20px;
  --header-h: 68px;
}

[data-theme="light"] {
  color-scheme: light;

  --bg: #f7f7f9;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f3f6;
  --surface-3: #e8e9ee;

  --border: #e0e2e9;
  --border-strong: #c9ccd6;

  --text: #101116;
  --text-2: #525867;
  --text-3: #5f667a;

  --brand: #5f8f0a;
  --brand-strong: #4d7707;
  --brand-soft: rgba(95, 143, 10, 0.1);
  --brand-ink: #ffffff;
  --accent: #6a54e8;
  --accent-soft: rgba(106, 84, 232, 0.1);

  --success: #059669;
  --success-soft: rgba(5, 150, 105, 0.1);
  --warning: #b45309;
  --warning-soft: rgba(180, 83, 9, 0.1);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.1);

  --shadow-sm: 0 1px 2px rgba(16, 17, 22, 0.06);
  --shadow: 0 12px 30px -14px rgba(16, 17, 22, 0.22);
  --shadow-lg: 0 28px 60px -28px rgba(16, 17, 22, 0.28);
  --ring: 0 0 0 3px rgba(95, 143, 10, 0.24);
}

/* --------------------------------------------------------------- Reset -- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body::before {
  /* Ambient brand wash — kept extremely subtle so text contrast stays high. */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 420px at 78% -8%, rgba(196, 245, 66, 0.09), transparent 70%),
    radial-gradient(700px 400px at 8% 4%, rgba(139, 124, 246, 0.08), transparent 72%);
}

h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  color: var(--text);
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.2rem + 3.4vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 1.1rem + 2.1vw, 2.4rem); }
h3 { font-size: clamp(1.15rem, 1rem + 0.6vw, 1.35rem); letter-spacing: -0.01em; }
h4 { font-size: 1.02rem; letter-spacing: -0.01em; }

p {
  margin: 0 0 1rem;
  color: var(--text-2);
  text-wrap: pretty;
}

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

img,
svg,
video,
canvas {
  max-width: 100%;
  display: block;
}

/* Inline UI icons scale with their surrounding text. */
.icon {
  width: 1.05em;
  height: 1.05em;
  flex: none;
  display: inline-block;
  vertical-align: -0.15em;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

ul,
ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--text-2);
}

li { margin-bottom: 0.35rem; }

strong { color: var(--text); font-weight: 650; }

code,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  color: var(--brand);
}

kbd {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.1em 0.45em;
  color: var(--text);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

::selection {
  background: var(--brand);
  color: var(--brand-ink);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
  border: 3px solid var(--bg);
}
*::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ------------------------------------------------------------- Layout -- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main { position: relative; z-index: 1; }

.section {
  padding-block: clamp(3rem, 2rem + 4vw, 5.5rem);
}

.section--tight { padding-block: clamp(2rem, 1.4rem + 2.4vw, 3.25rem); }

.section--alt { background: var(--bg-soft); border-block: 1px solid var(--border); }

.section-head {
  max-width: 46rem;
  margin-bottom: clamp(1.75rem, 1.2rem + 2vw, 3rem);
}

.section-head p {
  font-size: 1.05rem;
  margin-bottom: 0;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.65rem;
}

.lede {
  font-size: clamp(1rem, 0.95rem + 0.35vw, 1.15rem);
  color: var(--text-2);
}

.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.stack > * + * { margin-top: 1rem; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

@media (min-width: 900px) {
  :root { --gutter: 32px; }
}

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