/* ==========================================================================
   Visually Rendered Production — base.css
   Design tokens, reset, typography, utilities.
   Loaded first. Contains nothing component-specific.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts — self-hosted for privacy, speed and a strict CSP.
   Drop the .woff2 files into assets/fonts/ (see DEPLOYMENT.md).
   If they are missing the stack falls back to system UI fonts and the site
   still renders correctly — nothing breaks.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/space-grotesk-variable.woff2') format('woff2-variations');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2122, U+2212;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2122, U+2212;
}

/* --------------------------------------------------------------------------
   2. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Surfaces */
  --bg: #090909;
  --bg-elevated: #0e0e0e;
  --surface: #141414;
  --surface-hover: #1a1a1a;
  --border: #232323;
  --border-strong: #2e2e2e;

  /* Ink
     Contrast against the #090909 canvas, measured:
       --text      19.8:1
       --muted      8.6:1
       --muted-dim  5.8:1
     --muted-dim is deliberately not darker than this. It is used on small
     text (footer labels, stat captions, the brand sub-label) where WCAG AA
     demands 4.5:1 — #6f6f6f, which looks right in a mockup, measures 3.96:1
     and fails. */
  --text: #f5f5f5;
  --muted: #aaaaaa;
  --muted-dim: #8a8a8a;

  /* Accents — warm white and soft gold, used sparingly */
  --warm: #ede4d6;
  --gold: #c9a961;
  --gold-dim: rgba(201, 169, 97, 0.16);
  --gold-line: rgba(201, 169, 97, 0.32);

  /* Very subtle gradients only */
  --grad-veil: linear-gradient(180deg, rgba(9, 9, 9, 0) 0%, rgba(9, 9, 9, 0.72) 62%, var(--bg) 100%);
  --grad-card: linear-gradient(158deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0) 46%);
  --grad-rule: linear-gradient(90deg, transparent, var(--border-strong) 18%, var(--border-strong) 82%, transparent);

  /* Type families */
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Fluid type scale — 320px to 1600px viewport */
  --step--1: clamp(0.79rem, 0.77rem + 0.09vw, 0.84rem);
  --step-0: clamp(0.94rem, 0.90rem + 0.18vw, 1.05rem);
  --step-1: clamp(1.13rem, 1.06rem + 0.33vw, 1.32rem);
  --step-2: clamp(1.35rem, 1.24rem + 0.55vw, 1.65rem);
  --step-3: clamp(1.62rem, 1.44rem + 0.88vw, 2.06rem);
  --step-4: clamp(1.94rem, 1.67rem + 1.36vw, 2.58rem);
  --step-5: clamp(2.33rem, 1.92rem + 2.05vw, 3.22rem);
  --step-6: clamp(2.80rem, 2.20rem + 3.00vw, 4.03rem);
  --step-7: clamp(3.36rem, 2.50rem + 4.30vw, 5.03rem);

  /* Spacing scale */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2.25rem;
  --space-xl: 3.5rem;
  --space-2xl: 5rem;
  --space-3xl: clamp(5rem, 3.5rem + 7vw, 9rem);

  /* Layout */
  --container: 78rem;
  --container-wide: 96rem;
  --gutter: clamp(1.25rem, 0.85rem + 2vw, 3rem);

  /* Radii */
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;
  --radius-full: 999px;

  /* Motion — one shared easing language so everything feels related */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --dur-fast: 220ms;
  --dur: 460ms;
  --dur-slow: 900ms;

  /* Elevation */
  --shadow-card: 0 18px 48px -24px rgba(0, 0, 0, 0.9);
  --shadow-lift: 0 32px 70px -30px rgba(0, 0, 0, 0.95);

  /* Chrome */
  --header-h: 6.25rem;
  --z-header: 60;
  --z-cursor: 90;
  --z-overlay: 80;
  --z-loader: 100;

  color-scheme: dark;
  accent-color: var(--gold);
}

/* --------------------------------------------------------------------------
   3. Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchor targets clear the fixed header */
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  /* Prevents horizontal jitter from parallax/marquee transforms */
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ul[role='list'],
ol[role='list'] {
  list-style: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

:target {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

/* --------------------------------------------------------------------------
   4. Typography
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-7);
}

h2 {
  font-size: var(--step-5);
}

h3 {
  font-size: var(--step-2);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h4 {
  font-size: var(--step-1);
  line-height: 1.3;
  letter-spacing: -0.015em;
}

p {
  text-wrap: pretty;
}

strong {
  font-weight: 600;
  color: var(--text);
}

/* Small uppercase label used above section headings */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
}

.eyebrow::before {
  content: '';
  inline-size: 1.75rem;
  block-size: 1px;
  background: var(--gold-line);
  flex: none;
}

.lede {
  font-size: var(--step-1);
  line-height: 1.6;
  color: var(--muted);
  max-inline-size: 46ch;
}

.muted {
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   5. Layout utilities
   -------------------------------------------------------------------------- */
.container {
  inline-size: 100%;
  max-inline-size: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--wide {
  max-inline-size: var(--container-wide);
}

.section {
  padding-block: var(--space-3xl);
  position: relative;
}

.section--tight {
  padding-block: var(--space-2xl);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  max-inline-size: 62ch;
  margin-block-end: var(--space-xl);
}

.rule {
  border: 0;
  block-size: 1px;
  background: var(--grad-rule);
  margin: 0;
}

.stack > * + * {
  margin-block-start: var(--flow, var(--space-s));
}

/* Screen-reader-only, but focusable variant for skip links */
.visually-hidden {
  position: absolute !important;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 50%;
  transform: translate(-50%, -120%);
  z-index: calc(var(--z-loader) + 1);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--gold-line);
  border-radius: 0 0 var(--radius-s) var(--radius-s);
  padding: 0.75rem 1.25rem;
  transition: transform var(--dur-fast) var(--ease-out);
}

.skip-link:focus-visible {
  transform: translate(-50%, 0);
}

/* --------------------------------------------------------------------------
   6. Focus — always visible, never removed
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--radius-s);
}

/* Only suppress the ring for pointer users who did not tab here */
:focus:not(:focus-visible) {
  outline: none;
}

/* --------------------------------------------------------------------------
   7. Selection & scrollbar
   -------------------------------------------------------------------------- */
::selection {
  background: var(--gold);
  color: #0b0b0b;
}

@supports selector(::-webkit-scrollbar) {
  ::-webkit-scrollbar {
    inline-size: 10px;
    block-size: 10px;
  }

  ::-webkit-scrollbar-track {
    background: var(--bg);
  }

  ::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg);
  }

  ::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
  }
}

html {
  scrollbar-color: var(--border-strong) var(--bg);
}

/* --------------------------------------------------------------------------
   8. Reduced motion — honoured globally, then again per component.
   Nothing is hidden when motion is off: reveal states resolve to visible.
   -------------------------------------------------------------------------- */
@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;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   9. Print — a portfolio does get printed by prospective clients
   -------------------------------------------------------------------------- */
@media print {
  :root {
    --bg: #fff;
    --text: #000;
    --muted: #444;
  }

  body {
    background: #fff;
    color: #000;
  }

  .site-header,
  .site-footer,
  .wa-fab,
  .cursor,
  .loader,
  .marquee,
  video {
    display: none !important;
  }
}
