/* ============================================================
   AiWma · Design System Tokens & Base
   ============================================================ */

:root {
  /* Brand */
  --brand-navy: #1B3A5C;
  --brand-navy-light: #2A5580;
  --brand-navy-dark: #122840;
  --brand-orange: #E8703A;
  --brand-orange-light: #F08555;
  --brand-orange-dark: #CC5A27;

  /* Dark ground (warmer than spec for artistic depth) */
  --ink-900: #07101C;
  --ink-800: #0B1726;
  --ink-700: #122334;
  --ink-600: #1C3148;
  --ink-500: #2A4360;

  /* Light ground */
  --paper-50: #FAFBFD;
  --paper-100: #F4F6FA;
  --paper-200: #E8ECF2;

  /* Text on dark */
  --text-d-1: #F4F6FA;
  --text-d-2: rgba(244, 246, 250, 0.72);
  --text-d-3: rgba(244, 246, 250, 0.46);
  --text-d-4: rgba(244, 246, 250, 0.26);
  --line-d: rgba(244, 246, 250, 0.10);

  /* Text on light */
  --text-l-1: #0E1A28;
  --text-l-2: #4A5A6C;
  --text-l-3: #8A98A8;
  --line-l: rgba(14, 26, 40, 0.08);

  /* Spacing */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;
  --s-16: 64px; --s-20: 80px; --s-24: 96px; --s-32: 128px;

  /* Type */
  --font-sans: 'Inter Tight', 'Inter', 'Noto Sans SC', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  --font-serif: 'Newsreader', 'Source Han Serif SC', Georgia, serif;

  /* Radius */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-2xl: 28px;

  /* Easing */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.16, 0.64, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font-sans);
  background: var(--ink-900);
  color: var(--text-d-1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv02", "cv11";
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body { line-height: 1.6; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

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

/* Typography classes */
.font-mono { font-family: var(--font-mono); font-feature-settings: "ss01"; }
.font-serif { font-family: var(--font-serif); font-style: italic; }

.label-xs {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.label-sm {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  font-weight: 500;
}

/* ============================================================
   Page sections
   ============================================================ */

.section {
  position: relative;
  width: 100%;
  padding: var(--s-24) 0;
}
.section.dark { background: var(--ink-900); color: var(--text-d-1); }
.section.light { background: var(--paper-50); color: var(--text-l-1); }
.section.paper { background: #FFFFFF; color: var(--text-l-1); }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--s-8);
}

.wide-container {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 var(--s-8);
}

@media (max-width: 720px) {
  .container, .wide-container { padding: 0 var(--s-5); }
  .section { padding: var(--s-16) 0; }
}

/* ============================================================
   Top nav
   ============================================================ */

.nav-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 var(--s-8);
  background: rgba(7, 16, 28, 0.62);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--line-d);
  transition: background 240ms var(--ease-out);
}

.nav-inner {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  gap: var(--s-12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 22px; height: 22px;
  display: grid; place-items: center;
}

.nav-links {
  display: flex;
  gap: 32px;
  margin-left: var(--s-8);
  font-size: 13.5px;
  color: var(--text-d-2);
  font-weight: 450;
}
.nav-links a {
  position: relative;
  padding: 4px 0;
  transition: color 160ms;
}
.nav-links a:hover { color: var(--text-d-1); }
.nav-links a.active { color: var(--text-d-1); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -22px;
  height: 2px;
  background: var(--brand-orange);
}

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s-5);
}
.nav-right .docs-link {
  font-size: 13.5px;
  color: var(--text-d-3);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.nav-right .docs-link:hover { color: var(--text-d-1); }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: all 200ms var(--ease-out);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--brand-orange);
  color: white;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 8px 24px -8px rgba(232,112,58,0.55);
}
.btn-primary:hover {
  background: var(--brand-orange-dark);
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 12px 32px -8px rgba(232,112,58,0.7);
}

.btn-ghost-light {
  background: transparent;
  color: var(--text-d-1);
  border: 1px solid var(--line-d);
}
.btn-ghost-light:hover { border-color: rgba(244, 246, 250, 0.4); background: rgba(244, 246, 250, 0.04); }

.btn-ghost-dark {
  background: transparent;
  color: var(--text-l-1);
  border: 1px solid rgba(14,26,40,0.16);
}
.btn-ghost-dark:hover { border-color: rgba(14,26,40,0.36); background: rgba(14,26,40,0.04); }

.btn-sm { height: 34px; padding: 0 16px; font-size: 12.5px; }

.btn-icon {
  font-family: var(--font-mono);
  display: inline-block;
  transform: translateX(0);
  transition: transform 200ms var(--ease-out);
}
.btn:hover .btn-icon { transform: translateX(3px); }

/* ============================================================
   Pill tag
   ============================================================ */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pill-accent {
  background: rgba(232,112,58,0.12);
  color: var(--brand-orange-light);
  border: 1px solid rgba(232,112,58,0.28);
}
.pill-mute-d { background: rgba(244,246,250,0.06); color: var(--text-d-2); border: 1px solid var(--line-d); }
.pill-mute-l { background: rgba(14,26,40,0.05); color: var(--text-l-2); border: 1px solid var(--line-l); }
.pill-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ============================================================
   Living tickers & utility
   ============================================================ */

.divider-grad {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-d), transparent);
  width: 100%;
}

.eyebrow-rule {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-d-3);
}
.eyebrow-rule::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--brand-orange);
}

/* ============================================================
   Cursor ambient glow
   ============================================================ */

.cursor-glow {
  pointer-events: none;
  position: fixed;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232,112,58,0.10) 0%, transparent 60%);
  transform: translate(-50%, -50%);
  z-index: 1;
  mix-blend-mode: screen;
  transition: opacity 400ms;
}

/* ============================================================
   Reveal animation (scroll)
   Defaults to visible — only hides if JS adds .reveal-armed.
   ============================================================ */

.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 800ms var(--ease-out), transform 900ms var(--ease-out);
}
.reveal-armed .reveal:not(.in) {
  opacity: 0;
  transform: translateY(24px);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}
.pulse-dot {
  animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes wave-row {
  0% { transform: scaleY(0.3); }
  100% { transform: scaleY(1); }
}

/* ============================================================
   Headings — fluid
   ============================================================ */

.h-display {
  font-size: clamp(46px, 7vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 600;
}

.h-1 {
  font-size: clamp(36px, 4.6vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.028em;
  font-weight: 600;
}

.h-2 {
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.022em;
  font-weight: 600;
}

.h-3 {
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.2;
  letter-spacing: -0.014em;
  font-weight: 600;
}

.lede {
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.55;
  color: var(--text-d-2);
  font-weight: 400;
}
.lede.on-light { color: var(--text-l-2); }

/* Orange gradient text */
.grad-text {
  background: linear-gradient(94deg, #F08555 8%, #E8703A 50%, #F8C291 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Subtle paper grain on light sections */
.section.light::before, .section.paper::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(14,26,40,0.012) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(232,112,58,0.02) 0%, transparent 50%);
}

/* Dark ambient layer */
.section.dark .ambient {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
}
