/* ============================================================
   APRIL — foundations
   Design language: a measuring instrument, built the way Cupertino
   would build one. Warm paper, ink type, editorial serif headlines,
   monospace metadata, one deep blue. Hairlines over shadows.
   ============================================================ */

:root {
  /* ---- type ---- */
  --font-text: 'Helvetica Neue', HelveticaNeue, 'Switzer', Helvetica, Arial, sans-serif;
  --font-serif: 'Helvetica Neue', HelveticaNeue, 'Switzer', Helvetica, Arial, sans-serif;
  --font-num: 'Helvetica Neue', HelveticaNeue, 'Switzer', Helvetica, Arial, sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-label: 0.875rem;
  --text-base: 1.0625rem;
  --text-lg: clamp(1.125rem, 1rem + 0.5vw, 1.3125rem);
  --text-lede: clamp(1.1875rem, 1.05rem + 0.7vw, 1.5rem);
  --text-h3: clamp(1.1875rem, 1.1rem + 0.4vw, 1.375rem);
  --text-h2: clamp(1.875rem, 1.2rem + 2.4vw, 3rem);
  --text-h1: clamp(2.5rem, 1.4rem + 4.4vw, 4.5rem);
  --text-display: clamp(1.5rem, 1rem + 2vw, 2.25rem);

  --track-tight: -0.014em;
  --track-tighter: -0.022em;
  --track-mono: 0.1em;

  /* ---- space ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --section-y: clamp(4.5rem, 8vw, 8rem);

  /* ---- radii: the signature ---- */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 22px;
  --r-2xl: 26px;
  --r-pill: 980px;

  --measure: 40rem;
  --shell: 69rem;

  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Light: the default. Paper-white instrument. ---- */
:root,
[data-theme='light'] {
  --bg: #f4f2ee;
  --bg-deep: #efece6;
  --surface: #fcfbf9;
  --surface-2: #eceae4;
  --surface-3: #e3e0d8;
  --border: rgba(28, 26, 22, 0.11);
  --border-strong: rgba(28, 26, 22, 0.24);
  --text: #16181c;
  --text-muted: #5d5f66;
  --text-faint: #8b8b8b;

  --accent: #14367e;
  --accent-hover: #0f2a68;
  --accent-ink: #0d2354;
  --accent-soft: rgba(20, 54, 126, 0.06);
  --accent-line: rgba(20, 54, 126, 0.2);
  --on-accent: #fcfbf9;

  --wa: #146b45;
  --wa-hover: #10583a;

  --glow: radial-gradient(
    70% 60% at 50% 0%,
    rgba(20, 54, 126, 0.07) 0%,
    rgba(20, 54, 126, 0.02) 46%,
    rgba(20, 54, 126, 0) 74%
  );

  --rule: rgba(28, 26, 22, 0.13);
  --shadow-sm: 0 1px 1px rgba(24, 22, 18, 0.03);
  --shadow-md: 0 1px 2px rgba(24, 22, 18, 0.04), 0 10px 26px -16px rgba(24, 22, 18, 0.16);
  --shadow-lg: 0 1px 2px rgba(24, 22, 18, 0.04), 0 24px 50px -26px rgba(24, 22, 18, 0.22);
  --shadow-accent: 0 8px 20px -12px rgba(20, 54, 126, 0.5);

  --header-bg: rgba(244, 242, 238, 0.78);
  --scrim: rgba(252, 251, 249, 0.6);
  color-scheme: light;
}

/* ---- Dark: same instrument, lights off. ---- */
[data-theme='dark'] {
  --bg: #0d0f13;
  --bg-deep: #090a0d;
  --surface: #14171d;
  --surface-2: #101318;
  --surface-3: #1c2028;
  --border: rgba(232, 235, 240, 0.1);
  --border-strong: rgba(232, 235, 240, 0.2);
  --text: #eceef2;
  --text-muted: #9ba1ab;
  --text-faint: #767c86;
  --rule: rgba(232, 235, 240, 0.11);

  --accent: #8fabff;
  --accent-hover: #a6bcff;
  --accent-ink: #c3d2ff;
  --accent-soft: rgba(143, 171, 255, 0.1);
  --accent-line: rgba(143, 171, 255, 0.26);
  --on-accent: #06121f;

  --wa: #1f9d5c;
  --wa-hover: #24b268;

  --glow: radial-gradient(
    70% 60% at 50% 0%,
    rgba(143, 171, 255, 0.13) 0%,
    rgba(143, 171, 255, 0.04) 46%,
    rgba(143, 171, 255, 0) 76%
  );

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 10px 28px -16px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 24px 56px -28px rgba(0, 0, 0, 0.95);
  --shadow-accent: 0 8px 22px -14px rgba(143, 171, 255, 0.45);

  --header-bg: rgba(13, 15, 19, 0.76);
  --scrim: rgba(9, 10, 13, 0.5);
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.53;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.45s var(--ease), color 0.45s var(--ease);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: var(--track-tight);
  line-height: 1.1;
  text-wrap: balance;
}

/* Display sizes wear the serif. UI-scale headings stay in the grotesk. */
h1,
h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.012em;
}

h1 {
  font-size: var(--text-h1);
  line-height: 1.04;
}

h2 {
  font-size: var(--text-h2);
  line-height: 1.06;
}

h3 {
  font-size: var(--text-h3);
  line-height: 1.2;
}

p {
  margin: 0 0 1em;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s var(--ease), opacity 0.2s var(--ease);
}

a:hover {
  color: var(--accent-hover);
}

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

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

strong,
b {
  font-weight: 600;
}

small {
  font-size: var(--text-sm);
}

s {
  text-decoration-thickness: 1px;
  text-decoration-color: var(--text-faint);
}

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

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

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

.hidden,
[hidden] {
  display: none !important;
}

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

/* ============================================================
   motion
   ============================================================ */
@keyframes exhale {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.03);
  }
}

@keyframes float-soft {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

.exhale {
  animation: exhale 7.5s ease-in-out infinite;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

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

/* ---- compatibility aliases for inline styles in markup ---- */
:root {
  --font-display: var(--font-serif);
  --font-mono: var(--font-num);
  --font-body: var(--font-text);
  --text-2xl: var(--text-h2);
  --text-3xl: var(--text-h1);
  --text-xl: var(--text-h3);
  --radius-sm: var(--r-xs);
  --radius-md: var(--r-sm);
  --radius-lg: var(--r-md);
}
