/* ==========================================================================
   main.css — Design tokens, reset, base typography, layout primitives
   Dark mode lives on :root (default). Light mode overrides via [data-theme="light"].
   ========================================================================== */

:root {
  /* Brand palette (theme-independent) */
  --navy: #0B1220;
  --emerald: #123C3A;
  --gold: #D4A84F;
  --gold-strong: #B88D36;
  --paper: #F7F5F0;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  /* Shape, motion, layout */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 0.28s var(--ease);
  --container: 1200px;
  --gutter: 1.15rem;
  --header-h: 64px;

  /* Dark theme (default) */
  color-scheme: dark;
  --bg-body: #070C15;
  --bg-alt: #0B1220;
  --bg-card: #0F1829;
  --bg-elevated: #111A2C;
  --bg-emerald: #123C3A;
  --border: rgba(255, 255, 255, 0.09);
  --border-focus: rgba(212, 168, 79, 0.55);
  --text: #F8FAFC;
  --text-2: #A3B1C6;
  --text-muted: #8190A6;
  --accent: #D4A84F;
  --accent-text: #D4A84F;
  --accent-hover: #B88D36;
  --accent-soft: rgba(212, 168, 79, 0.12);
  --on-accent: #0B1220;
  --tag-bg: rgba(255, 255, 255, 0.06);
  --tag-text: #CBD5E1;
  --nav-glass: rgba(11, 18, 32, 0.88);
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 20px 35px -10px rgba(0, 0, 0, 0.7);
  --danger: #F87171;
  --success: #34D399;
}

[data-theme="light"] {
  color-scheme: light;
  --bg-body: #F7F5F0;
  --bg-alt: #EFEBE1;
  --bg-card: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-emerald: #E2ECEB;
  --border: rgba(11, 18, 32, 0.1);
  --border-focus: rgba(184, 141, 54, 0.7);
  --text: #0B1220;
  --text-2: #475569;
  --text-muted: #5B6778;
  --accent: #D4A84F;
  --accent-text: #7A5C14; /* darker gold keeps text readable on light surfaces */
  --accent-hover: #B88D36;
  --accent-soft: rgba(18, 60, 58, 0.09);
  --tag-bg: rgba(11, 18, 32, 0.06);
  --tag-text: #1E293B;
  --nav-glass: rgba(247, 245, 240, 0.92);
  --shadow: 0 10px 30px -10px rgba(11, 18, 32, 0.08);
  --shadow-hover: 0 20px 35px -10px rgba(11, 18, 32, 0.16);
  --danger: #B91C1C;
  --success: #047857;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

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

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

/* Custom subtle scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-body);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}

body {
  min-height: 100vh;
  background: var(--bg-body);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.no-scroll { overflow: hidden; }

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

h1, h2, h3, h4 { line-height: 1.2; text-wrap: balance; }
p { text-wrap: pretty; }

/* ---------- Accessibility primitives ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem; left: 0.75rem;
  z-index: 2000;
  padding: 0.65rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
  transition: transform var(--transition);
}
.skip-link:focus { transform: translateY(0); }

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

.section { padding-block: 3.5rem; }
.section--alt { background: var(--bg-alt); }

.section-header {
  max-width: 680px;
  margin: 0 auto 2.25rem;
  text-align: center;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.section-eyebrow::before { content: '//'; color: var(--text-muted); }

.section-title {
  margin-bottom: 1rem;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section-subtitle {
  font-size: 0.97rem;
  line-height: 1.65;
  color: var(--text-2);
}

/* One orchestrated entrance: the hero only */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@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;
  }
}
