/* Your First Website: design foundation. Tokens, type and shared components. Mobile first. */

/* 1. TOKENS ------------------------------------------------------------ */
:root {
  /* Neutrals: the brand navy stretched into a full scale */
  --ink-950: #090e1a;
  --ink-900: #0f172a;
  --ink-800: #17213a;
  --ink-700: #26324e;
  --ink-500: #64708f;
  --ink-300: #a9b3cb;
  --ink-100: #e4e8f1;
  --paper: #f8f5ee;

  /* One warm accent, taken from the orange in the logo */
  --accent: #ffa02e;
  --accent-hover: #ffb457;
  --accent-soft: rgba(255, 160, 46, 0.12);
  --on-accent: #1c1002;

  /* Roles: components use these, not the raw scale */
  --bg: var(--ink-950);
  --surface: var(--ink-900);
  --surface-raised: var(--ink-800);
  --line: rgba(228, 232, 241, 0.1);
  --line-strong: rgba(228, 232, 241, 0.28);
  --text: var(--paper);
  --text-muted: var(--ink-300);

  /* Type */
  --font-display: 'Bricolage Grotesque', 'DM Sans', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --text-xs: clamp(0.75rem, 0.73rem + 0.1vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.85rem + 0.12vw, 0.9375rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.35vw, 1.375rem);
  --text-xl: clamp(1.375rem, 1.2rem + 0.8vw, 2rem);
  --text-2xl: clamp(2rem, 1.45rem + 2.4vw, 3.75rem);
  --text-display: clamp(2.75rem, 1.6rem + 5.2vw, 6.25rem);

  /* Spacing, 4px grid */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --section-y: clamp(4rem, 2rem + 8vw, 8rem);
  --container: 80rem;

  /* Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.375rem;
  --radius-pill: 999px;

  /* Shadows */
  --lift-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --lift-md: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
  --lift-lg: 0 30px 70px -24px rgba(0, 0, 0, 0.7);
  --highlight: inset 0 1px 0 rgba(255, 255, 255, 0.06);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast: 150ms;
  --dur: 250ms;
  --dur-reveal: 700ms;
  --rise: 24px;
  --stagger: 90ms;
}

/* 2. BASE: applies inside .ds only, so it can sit beside the older styles */
.ds, .ds *, .ds *::before, .ds *::after { box-sizing: border-box; }
.ds { color: var(--text); font-family: var(--font-body); font-size: var(--text-base); line-height: 1.6; -webkit-font-smoothing: antialiased; }
body.ds { margin: 0; background: var(--bg); }
.ds h1, .ds h2, .ds h3 { margin: 0; font-family: var(--font-display); font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; }
.ds h1 { font-size: var(--text-display); }
.ds h2 { font-size: var(--text-2xl); }
.ds h3 { font-size: var(--text-xl); line-height: 1.15; }
.ds p { margin: 0; text-wrap: pretty; }
.ds a { color: inherit; }
.ds :focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

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

/* Large faint number that drifts behind a section */
.section--marked { position: relative; overflow: hidden; }
.section--marked > .container { position: relative; }
.watermark { position: absolute; top: var(--space-6); right: var(--gutter); font-family: var(--font-display); font-weight: 700; font-size: clamp(9rem, 30vw, 26rem); line-height: 1; letter-spacing: -0.05em; color: transparent; -webkit-text-stroke: 1px var(--line-strong); opacity: 0.45; pointer-events: none; user-select: none; }

/* 3. BUTTONS ----------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 3rem;
  padding: var(--space-3) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.button:active { transform: scale(0.98); }
.ds .button--primary, .button--primary { background: var(--accent); color: var(--on-accent); }
.button--primary:hover { background: var(--accent-hover); }
.ds .button--ghost, .button--ghost { border-color: var(--line-strong); color: var(--text); }
.button--ghost:hover { border-color: var(--accent); background: var(--accent-soft); }
.button-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
@media (max-width: 30rem) { .button-row .button { flex: 1 1 100%; } }

/* 4. SECTION HEADER ---------------------------------------------------- */
.section-header { display: grid; gap: var(--space-4); margin-bottom: var(--space-7); max-width: 46rem; }
.eyebrow { display: flex; align-items: center; gap: var(--space-3); color: var(--accent); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 2rem; height: 2px; background: currentColor; }
.section-header p { color: var(--text-muted); font-size: var(--text-lg); max-width: 36rem; }

/* 5. CARDS ------------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: var(--space-4); }
.card {
  display: grid;
  align-content: start;
  gap: var(--space-3);
  padding: var(--space-5);
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--highlight), var(--lift-md);
}
.card p { color: var(--text-muted); }
.card .card-number { font-family: var(--font-display); font-size: var(--text-sm); color: var(--accent); font-variant-numeric: tabular-nums; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); margin-top: var(--space-7); border-top: 1px solid var(--line); }
.stat { padding: var(--space-5) 0; border-bottom: 1px solid var(--line); }
.stat strong { display: block; font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--text-muted); font-size: var(--text-sm); }

/* 6. STICKY HEADER ----------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), backdrop-filter var(--dur) var(--ease);
}
.site-header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding-block: var(--space-5); transition: padding var(--dur) var(--ease); }
.site-header.is-scrolled { background: rgba(9, 14, 26, 0.72); border-color: var(--line); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); }
.site-header.is-scrolled .site-header-inner { padding-block: var(--space-3); }
.logo { display: flex; align-items: center; gap: var(--space-3); min-height: 3rem; font-family: var(--font-display); font-weight: 700; font-size: var(--text-base); text-decoration: none; }
.logo-mark { display: block; width: 3rem; height: 1.75rem; }
.logo-mark svg { display: block; width: 100%; height: 100%; }

.topstrip-nav { display: flex; align-items: center; gap: var(--space-5); }
.topstrip-nav a:not(.button) { color: var(--text-muted); font-size: var(--text-sm); font-weight: 500; text-decoration: none; }
.topstrip-nav a:not(.button):hover { color: var(--text); }

/* Phone menu, built by nav.js */
.menu-toggle { display: none; }
@media (max-width: 900px) {
  .menu-toggle { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 3rem; height: 3rem; padding: 0; background: transparent; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; }
  .menu-toggle span { width: 20px; height: 2px; background: var(--text); }
  .topstrip-nav.site-menu { display: none; flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .topstrip-nav.site-menu.is-open { display: flex; }
  .topstrip-nav.site-menu a:not(.button) { display: flex; align-items: center; min-height: 3rem; border-top: 1px solid var(--line); font-size: var(--text-base); color: var(--text); }
  .topstrip-nav.site-menu .button { margin-top: var(--space-3); }
  .site-header:has(.site-menu.is-open) { background: var(--bg); }
}

/* 7. MOTION: only hidden once motion.js has switched motion on --------- */
.motion [data-animate],
.motion [data-stagger] > * {
  opacity: 0;
  transform: translate3d(0, var(--rise), 0);
  transition: opacity var(--dur-reveal) var(--ease), transform var(--dur-reveal) var(--ease);
  transition-delay: calc(var(--i, 0) * var(--stagger));
}
.motion [data-animate].is-visible,
.motion [data-stagger] > .is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* On phones the number sits above the text, not behind it */
@media (max-width: 40rem) { .watermark { top: -0.75rem; font-size: 6.5rem; opacity: 0.35; } }
