/* ============================================================
   base.css — reset, design tokens, typography, utilities
   Ember palette — near-black base, orange accent (aiwithrauf-
   style dark cinematic look).
   ============================================================ */

/* self-hosted webfonts (downloaded from Fontshare, self-hosting permitted) */
@font-face {
  font-family: "Clash Display";
  src: url("../assets/fonts/clashdisplay-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Clash Display";
  src: url("../assets/fonts/clashdisplay-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../assets/fonts/satoshi-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../assets/fonts/satoshi-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

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

:root {
  /* palette — near-black navy + white, azure accent (premium dark) */
  --bg-0: #05080F;
  --bg-1: #0A101D;
  --bg-2: #101A2E;
  --line: rgba(235, 242, 255, 0.08);
  --line-strong: rgba(235, 242, 255, 0.17);
  --text-1: #F4F7FC;
  --text-2: #9FADC6;
  --text-3: #5D6A85;
  --accent: #4D8DFF;
  --accent-2: #9CC4FF;
  --ember: #1E40AF;
  --grad: linear-gradient(120deg, #4D8DFF 0%, #9CC4FF 100%);

  /* type */
  --font-display: "Clash Display", "Segoe UI", system-ui, sans-serif;
  --font-body: "Satoshi", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, "Courier New", monospace;

  --fs-display: clamp(2.75rem, 7vw, 5.75rem);
  --fs-h2: clamp(2.25rem, 5.2vw, 4.25rem);
  --fs-h3: clamp(1.5rem, 2.6vw, 2.25rem);
  --fs-body: clamp(1rem, 1.05vw, 1.125rem);
  --fs-label: 0.8125rem;

  /* layout */
  --container: 1360px;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --section-pad: clamp(6rem, 12vh, 9rem);
  --radius: 18px;
  --radius-panel: 1.75rem;
  --nav-h: 72px;

  color-scheme: dark;
}

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: #223350 var(--bg-0);
  overflow-x: clip;
}

/* Lenis recommended styles */
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-stopped {
  overflow: hidden;
}

body {
  background: var(--bg-0);
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-weight: 400;
  min-height: 100vh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-1);
  font-weight: 600;
  line-height: 1;
}

p {
  max-width: 62ch;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

canvas {
  display: block;
}

ul {
  list-style: none;
}

::selection {
  background: rgba(77, 141, 255, 0.35);
  color: var(--text-1);
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-0);
}
::-webkit-scrollbar-thumb {
  background: #223350;
  border-radius: 8px;
  border: 2px solid var(--bg-0);
}

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

/* ---------- utilities ---------- */

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

.section {
  padding-block: var(--section-pad);
  position: relative;
}

.label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-3);
}

.section-label {
  display: block;
  margin-bottom: clamp(2rem, 5vh, 3.5rem);
}

.section-label__idx {
  color: var(--accent);
}

.section-label__count {
  color: var(--text-3);
  margin-left: 0.5em;
}

.section-title {
  font-size: var(--fs-h2);
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin-bottom: clamp(2.5rem, 7vh, 4.5rem);
  max-width: 20ch;
}

.accent {
  color: var(--accent);
  font-style: normal;
}

.ink {
  color: var(--text-1);
}

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: normal;
}

/* metallic silver-white for display type */
.grad-silver {
  background: linear-gradient(180deg, #FFFFFF 25%, #A9BCDF 110%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* word-reveal masks (built by animations.js from [data-words]) */
.w-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.w {
  display: inline-block;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 2000;
  padding: 0.75rem 1.25rem;
  background: var(--text-1);
  color: var(--bg-0);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  border-radius: 999px;
  transform: translateY(-200%);
  transition: transform 0.25s ease;
}
.skip-link:focus-visible {
  transform: translateY(0);
}

/* film grain — background image data-URI injected at runtime */
.grain {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  background-repeat: repeat;
  background-size: 128px 128px;
  opacity: 0.05;
  mix-blend-mode: overlay;
}

/* ---------- reduced motion ---------- */

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