/* ==========================================================================
   LionFS — main.css
   Design tokens (dark-first + light theme), reset, base typography, layout.
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
/* Palette follows a Vercel/Geist-style minimal system: one ink tone
   carries headings, body, and borders; the amber brand accent is
   used sparingly (small fills, CTAs) instead of as glow/gradient
   chrome; the hero's soft orbs are the only place color blooms. */
:root {
  /* Color: brand */
  --amber-300: #ffd47e;
  --amber-400: #ffc24d;
  --amber-500: #f5a524;
  --amber-600: #f5880e;
  --amber-700: #d96c06;

  /* Accent pairs */
  --accent:        #f5a524;
  --accent-bright: #ffc24d;
  --accent-deep:   #d96c06;
  --accent-contrast: #171717;   /* text on amber */
  --accent-soft:   rgba(245, 165, 36, 0.09);
  --accent-line:   rgba(245, 165, 36, 0.24);

  --cyan:        #38d6f5;
  --cyan-soft:   rgba(56, 214, 245, 0.10);

  --ok:   #3ddc97;
  --bad:  #f47174;
  --warn: #f5c542;

  /* Surfaces -- near-black canvas, one step up for cards/nav, no
     separate "raised strip" tone: flat by default, distinguished by
     a hairline border rather than a lighter fill. */
  --bg-0: #0a0a0a;             /* page background            */
  --bg-1: #0e0e0e;             /* nav / raised strips        */
  --bg-2: #111111;             /* cards                      */
  --bg-3: #1a1a1a;             /* nested / hover cards       */
  --bg-inset: #0d0d0d;         /* terminal, code wells       */

  /* Text */
  --text:   #fafafa;
  --text-2: #a8a8a8;
  --text-3: #8f8f8f;

  /* Lines -- the hairline is the structural workhorse; nothing else
     signals a card boundary. */
  --line:   rgba(250, 250, 250, 0.10);
  --line-2: rgba(250, 250, 250, 0.16);

  /* Effects -- flat and whisper-soft; no colored glow. */
  --glow-amber: 0 0 0 transparent;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 4px 16px -8px rgba(0, 0, 0, 0.5);
  --shadow-pop: 0 10px 28px -12px rgba(0, 0, 0, 0.55);

  /* Typography -- one sans face (Geist Sans, substituted with Inter)
     for both display and body; one mono face for code and eyebrows.
     No third face. */
  --font-display: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;

  /* Geometry */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 100px;

  --container: 1180px;
  --gutter: clamp(18px, 4vw, 40px);
  --section-pad: clamp(72px, 10vh, 120px);
  --nav-h: 64px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.2s;
}

/* Light theme -- the Vercel/Geist reference values directly: a
   near-white canvas, near-black ink, and a single #ebebeb hairline. */
html[data-theme="light"] {
  --accent:        #d97706;
  --accent-bright: #f5a524;
  --accent-deep:   #b45f04;
  --accent-contrast: #fffaf0;
  --accent-soft:   rgba(217, 119, 6, 0.08);
  --accent-line:   rgba(217, 119, 6, 0.28);

  --cyan:        #0e91b4;
  --cyan-soft:   rgba(14, 145, 180, 0.10);

  --ok:   #0f9d61;
  --bad:  #d43f45;
  --warn: #b58500;

  --bg-0: #fafafa;
  --bg-1: #ffffff;
  --bg-2: #ffffff;
  --bg-3: #f2f2f2;
  --bg-inset: #f2f2f2;

  --text:   #171717;
  --text-2: #4d4d4d;
  --text-3: #8f8f8f;

  --line:   rgba(23, 23, 23, 0.09);
  --line-2: rgba(23, 23, 23, 0.16);

  --glow-amber: 0 0 0 transparent;
  --shadow-1: 0 1px 2px rgba(23, 23, 23, 0.06);
  --shadow-2: 0 4px 16px -8px rgba(23, 23, 23, 0.10);
  --shadow-pop: 0 10px 28px -12px rgba(23, 23, 23, 0.14);
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: dark;
  overflow-x: hidden;
  width: 100%;
}
html[data-theme="light"] { color-scheme: light; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
  position: relative;
  text-rendering: optimizeLegibility;
}

img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
table { border-collapse: collapse; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
::selection { background: var(--accent-soft); color: var(--accent-bright); }

/* Scrollbar (webkit) */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb {
  background: var(--bg-3);
  border-radius: 8px;
  border: 2px solid var(--bg-0);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ---------- 3. Base typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--text);
  text-wrap: balance;
}

p { text-wrap: pretty; }

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

code.inline {
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.1em 0.42em;
  color: var(--accent-bright);
  white-space: nowrap;
}

/* ---------- 4. Layout primitives ---------- */
.container {
  width: min(var(--container), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

.section {
  position: relative;
  padding-block: var(--section-pad);
  scroll-margin-top: calc(var(--nav-h) + 12px);
}

.section + .section { border-top: 1px solid var(--line); }

/* Slim variant (honesty banner, CTA) */
.section.slim { padding-block: clamp(28px, 4vh, 44px); }
.section.cta-section { border-top: none; }

/* Section header block */
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vh, 56px); }
.section-head.center { margin-inline: auto; text-align: center; }

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.section-eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-bright));
  border-radius: 2px;
}
.section-head.center .section-eyebrow::after {
  content: "";
  width: 22px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-bright), var(--accent-deep));
  border-radius: 2px;
}

.section-title {
  font-size: clamp(1.65rem, 3.4vw, 2.5rem);
  margin-bottom: 14px;
}

.section-lead {
  color: var(--text-2);
  font-size: clamp(0.98rem, 1.4vw, 1.08rem);
  line-height: 1.7;
}

.section-lead strong { color: var(--text); font-weight: 600; }
.section-lead code { color: var(--accent-bright); }

/* Utility: gradient text */
.grad-text {
  background: linear-gradient(100deg, var(--amber-300), var(--amber-500) 55%, var(--amber-600));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
html[data-theme="light"] .grad-text {
  background: linear-gradient(100deg, var(--amber-600), #b45309 80%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Utility: muted / mono */
.muted   { color: var(--text-2); }
.dim     { color: var(--text-3); }
.mono    { font-family: var(--font-mono); }

/* Skip link + progress bar + back-to-top base */
.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 2000;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  font-size: 0.9rem;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 12px; }

.scroll-progress {
  position: fixed;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  z-index: 1200;
  pointer-events: none;
  background: transparent;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-deep), var(--amber-300));
  box-shadow: 0 0 12px rgba(245, 165, 36, 0.55);
  transition: width 0.08s linear;
}

/* Subtle page texture: fixed grid + vignette (no images, pure CSS) */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 520px at 78% -8%,  var(--accent-soft), transparent 62%),
    radial-gradient(900px 480px at 12% 12%,  rgba(56, 214, 245, 0.05), transparent 60%);
}
.page-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(1200px 700px at 50% 0%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(1200px 700px at 50% 0%, #000 30%, transparent 78%);
  opacity: 0.55;
}

/* Screen-reader only helper */
.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;
}
