/* ==========================================================================
   Web2Front — Tokens, reset & base typography
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --font-display: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;

  --container: 1320px;
  --pad: clamp(20px, 4vw, 48px);
  --header-h: 85px;

  --fs-display: clamp(3.15rem, 7.4vw, 7.1rem);
  --fs-h1: clamp(2.8rem, 6vw, 5.4rem);
  --fs-h2: clamp(2.15rem, 4.4vw, 3.9rem);
  --fs-h3: clamp(1.35rem, 1.9vw, 1.7rem);
  --fs-lead: clamp(1.05rem, 1.35vw, 1.25rem);
  --fs-body: 1rem;
  --fs-sm: 0.875rem;
  --fs-xs: 0.76rem;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;
}

/* Light — soft off-white + electric cobalt */
:root,
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f6f5f1;
  --bg-2: #efeee9;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --surface-3: #f1f0eb;

  --text: #0c0d10;
  --text-2: #4d515b;
  --muted: #6c707b;

  --line: rgba(12, 13, 16, 0.12);
  --line-strong: rgba(12, 13, 16, 0.24);
  --line-soft: rgba(12, 13, 16, 0.07);

  --accent: #1f3bf0;
  --accent-hover: #102cdb;
  --accent-text: #1730cf;
  --accent-soft: rgba(31, 59, 240, 0.08);
  --accent-soft-2: rgba(31, 59, 240, 0.14);
  --on-accent: #ffffff;

  --logo-word: #111111;

  --shadow-sm: 0 2px 8px rgba(16, 18, 26, 0.05);
  --shadow: 0 24px 64px rgba(16, 18, 26, 0.1);
  --shadow-soft: 0 14px 40px rgba(16, 18, 26, 0.07);
  --glow: rgba(31, 59, 240, 0.16);

  --selection: #1f3bf0;
}

/* Dark — midnight black + electric cobalt */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #060709;
  --bg-2: #0a0c10;
  --surface: #0d0f14;
  --surface-2: #11141a;
  --surface-3: #171a22;

  --text: #f2f4f8;
  --text-2: #a7adba;
  --muted: #7f8594;

  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --line-soft: rgba(255, 255, 255, 0.06);

  --accent: #2f4fff;
  --accent-hover: #4a66ff;
  --accent-text: #8699ff;
  --accent-soft: rgba(47, 79, 255, 0.14);
  --accent-soft-2: rgba(47, 79, 255, 0.24);
  --on-accent: #ffffff;

  --logo-word: #f2f4f8;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  --shadow-soft: 0 16px 44px rgba(0, 0, 0, 0.35);
  --glow: rgba(47, 79, 255, 0.28);

  --selection: #2f4fff;
}

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

* {
  margin: 0;
}

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

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  transition: background-color 0.4s ease, color 0.4s ease;
}

body.menu-open {
  overflow: hidden;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
}

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

ul,
ol {
  list-style: none;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

::selection {
  background: var(--selection);
  color: #fff;
}

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

/* Subtle film grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}

:root[data-theme="light"] body::after {
  opacity: 0.022;
}

/* ---------- Typography helpers ---------- */
.display {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 600;
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.h1 {
  font-size: var(--fs-h1);
  line-height: 0.97;
  letter-spacing: -0.05em;
}

.h2 {
  font-size: var(--fs-h2);
  line-height: 1.01;
  letter-spacing: -0.045em;
}

.h3 {
  font-size: var(--fs-h3);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--accent-text);
}

.serif-plain {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: normal;
  letter-spacing: -0.01em;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--text-2);
  letter-spacing: -0.01em;
  max-width: 58ch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  flex: none;
}

.eyebrow--plain::before {
  display: none;
}

.mono {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.text-muted {
  color: var(--muted);
}

.text-accent {
  color: var(--accent-text);
}

.italic {
  font-style: italic;
}

.underline-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--text);
  padding-bottom: 3px;
}

.underline-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform-origin: right;
  transition: transform 0.45s var(--ease);
}

.underline-link:hover::after {
  transform: scaleX(0);
}

.underline-link:hover {
  color: var(--accent-text);
}

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

.container--narrow {
  max-width: 1040px;
}

.container--wide {
  max-width: 1480px;
}

.section {
  padding-block: clamp(76px, 10vw, 136px);
}

.section--tight {
  padding-block: clamp(56px, 7vw, 92px);
}

.section--top {
  padding-top: clamp(52px, 7vw, 88px);
}

.stack {
  display: flex;
  flex-direction: column;
}

.grid {
  display: grid;
  gap: 24px;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10001;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  font-size: var(--fs-sm);
  transform: translateY(-160%);
  transition: transform 0.25s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.rule {
  height: 1px;
  border: 0;
  background: var(--line);
}

/* ---------- Scrollbar ---------- */
@supports (scrollbar-color: auto) {
  html {
    scrollbar-color: var(--line-strong) transparent;
    scrollbar-width: thin;
  }
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 10px;
  border: 3px solid var(--bg);
}
