/* ==========================================================================
   base.css — Design tokens, reset, typography, layout primitives
   ========================================================================== */

/* ---- Design tokens -------------------------------------------------------- */
:root {
  /* Brand gradient stops — Solarin-inspired teal + warm sand */
  --brand-1: #116466; /* deep teal   */
  --brand-2: #16918c; /* mid teal    */
  --brand-3: #2cb1b3; /* bright teal */
  --brand-4: #ffcb9a; /* peach       */
  --tan: #d9b08c;     /* warm sand   */

  /* Accent shortcuts */
  --accent: var(--brand-1);
  --accent-soft: rgba(17, 100, 102, 0.18);
  --gradient: linear-gradient(135deg, var(--brand-1), var(--brand-3) 48%, var(--brand-4));
  --gradient-warm: linear-gradient(135deg, var(--tan), var(--brand-4));

  /* Dark theme surfaces (default) — deep teal-charcoal */
  --bg: #0d1a19;
  --bg-elev: #142322;
  --bg-elev-2: #2c3531;
  --surface: rgba(209, 232, 226, 0.05);
  --surface-strong: rgba(209, 232, 226, 0.09);
  --border: rgba(209, 232, 226, 0.10);
  --border-strong: rgba(209, 232, 226, 0.18);

  /* Text — mint-tinted */
  --text: #e6f1ee;
  --text-muted: #9fbbb6;
  --text-dim: #6a827e;

  /* Feedback */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Shape + motion */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.30);
  --shadow: 0 12px 34px rgba(3, 14, 13, 0.5);
  --shadow-glow: 0 0 0 1px var(--border), 0 18px 50px rgba(17, 100, 102, 0.30);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --max: 1200px;
  --nav-h: 68px;
  --font-sans: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Cascadia Code", "Fira Code", "SFMono-Regular", Consolas, monospace;
}

/* Light theme override */
[data-theme="light"] {
  --bg: #eaf4f1;
  --bg-elev: #ffffff;
  --bg-elev-2: #d8e9e4;
  --surface: rgba(17, 100, 102, 0.04);
  --surface-strong: rgba(17, 100, 102, 0.07);
  --border: rgba(17, 100, 102, 0.14);
  --border-strong: rgba(17, 100, 102, 0.22);
  --text: #12211f;
  --text-muted: #45605b;
  --text-dim: #7b938e;
  --accent-soft: rgba(17, 100, 102, 0.12);
  --shadow: 0 14px 40px rgba(17, 60, 58, 0.14);
  --shadow-glow: 0 0 0 1px var(--border), 0 18px 50px rgba(17, 100, 102, 0.18);
}

/* ---- Reset ---------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

img, svg, video, canvas { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button, input, textarea, select { font: inherit; color: inherit; }

button { cursor: pointer; background: none; border: none; }

ul { list-style: none; padding: 0; }

:focus-visible {
  outline: 2px solid var(--brand-3);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

::selection { background: var(--brand-2); color: #fff; }

/* ---- Typography ----------------------------------------------------------- */
h1, h2, h3, h4 { line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); }

p { color: var(--text-muted); }

code, kbd, pre { font-family: var(--font-mono); }

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-3);
}

/* ---- Layout primitives ---------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2.4rem);
}

.section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
  position: relative;
}

.section-head {
  max-width: 640px;
  margin-bottom: 2.8rem;
}
.section-head.center { margin-inline: auto; text-align: center; }
.section-head p { margin-top: 0.85rem; font-size: 1.05rem; }

.grid { display: grid; gap: 1.5rem; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.center-x { justify-content: center; }

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.mono { font-family: var(--font-mono); }
