/* Tokens, reset, type, nav, buttons and shared pieces. */

:root {
  --bg: #07070a;
  --bg-raised: #0d0d11;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f5f5f6;
  --text-2: rgba(255, 255, 255, 0.62);
  --text-3: rgba(255, 255, 255, 0.4);
  --amber: #f5a524;
  --amber-hi: #ffd466;
  --amber-mid: #f7ab17;
  --amber-lo: #f77d10;
  --brand: linear-gradient(135deg, var(--amber-hi), var(--amber-mid) 50%, var(--amber-lo));
  --sans: "Geist", ui-sans-serif, -apple-system, "SF Pro Text", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --max: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 16px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

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

/* Film grain over everything, very faint, so the dark never looks flat. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: rgba(245, 165, 36, 0.35); color: #fff; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 8px;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.035em; line-height: 1.05; }
h2 { font-size: clamp(34px, 5.2vw, 60px); }
h3 { font-size: 17px; letter-spacing: -0.015em; line-height: 1.3; }
p { margin: 0; }

code, kbd { font-family: var(--mono); font-size: 0.86em; }
code { color: var(--text); background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; }

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.7em;
  height: 1.7em;
  padding: 0 0.4em;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 0.78em;
  font-weight: 500;
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border-strong);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
  vertical-align: 0.1em;
}
kbd + kbd { margin-left: 3px; }

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--text);
  color: #000;
  font-weight: 600;
}
.skip:focus { top: 12px; }

/* ── Nav ─────────────────────────────────────────────── */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  height: 60px;
  padding: 0 max(var(--gutter), calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}
.nav.scrolled {
  background: rgba(7, 7, 10, 0.72);
  border-color: var(--border);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}
.nav-brand { justify-self: start; display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.02em; font-size: 17px; }
.nav-brand img { width: 20px; height: auto; }
.nav-links { grid-column: 2; display: flex; gap: 4px; }
.nav-links a {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-2);
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-actions { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 8px; }
.nav-github {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-2);
  transition: color 0.2s, background 0.2s;
}
.nav-github svg { flex: none; width: 17px; height: 17px; max-width: none; }
.nav-github:hover { color: var(--text); background: var(--surface-2); }

/* ── Buttons ─────────────────────────────────────────── */

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #0b0b0d;
  background: linear-gradient(180deg, #ffffff, #e7e7ea);
  box-shadow:
    inset 0 -1px 0 rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.25),
    0 10px 34px -10px rgba(247, 171, 23, 0.65);
  transition: transform 0.2s var(--ease), box-shadow 0.25s;
}
.button svg { flex: none; width: 16px; height: 16px; max-width: none; margin-top: -2px; }
.button:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 -1px 0 rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.35),
    0 14px 44px -10px rgba(247, 171, 23, 0.85);
}
.button:active { transform: translateY(0); }
.button-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.button-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}
.button-small { height: 34px; padding: 0 14px; border-radius: 10px; font-size: 14px; }

/* ── Sections ────────────────────────────────────────── */

section { position: relative; padding: clamp(80px, 12vw, 140px) var(--gutter); }
section > * { max-width: var(--max); margin-left: auto; margin-right: auto; }

.section-head { text-align: center; margin-bottom: clamp(40px, 6vw, 64px); }
.section-head p { max-width: 560px; margin: 20px auto 0; color: var(--text-2); font-size: 18px; }
.eyebrow {
  display: inline-block;
  margin-bottom: 18px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
}

.card {
  position: relative;
  padding: 28px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--border);
  overflow: hidden;
}
.card::before {
  /* A hairline of light along the top edge, like a lit bevel. */
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
}
.card h3 + p { margin-top: 8px; color: var(--text-2); font-size: 15px; }

/* Scroll reveal. JS adds .in; without JS everything is simply visible. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--delay, 0s);
}
.js .reveal.in { opacity: 1; transform: none; }

/* ── Footer ──────────────────────────────────────────── */

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px var(--gutter) 48px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-3);
}
.footer-brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
.footer-brand img { width: 16px; height: auto; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer nav a:hover { color: var(--text); }
.footer-note { margin-left: auto; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav { gap: 12px; }
  .footer-note { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { transform: none; }
}
