/* ============================================================
   Tochene — base layer
   Design tokens, reset, typography, utilities.
   Everything else composes from these; no component defines
   a raw colour, size or duration of its own.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Brand palette — "coastal premium".
     Navy carries the authority of commercial real estate, brass does the
     expensive work on accents and rules, teal is the ocean reference. */
  --navy-950: #070f18;
  --navy-900: #0b1b2b;
  --navy-800: #102a40;
  --navy-700: #173b57;
  --navy-600: #1f4d6e;

  --teal-600: #1f6f78;
  --teal-400: #2e9aa3;

  --brass-600: #a8873f;
  --brass-500: #c2a25e;
  --brass-400: #d4b87c;
  --brass-300: #e3c98a;

  --sand-200: #e4d7c0;
  --sand-100: #f1e9da;
  --paper: #fbf9f5;
  --white: #ffffff;

  --slate-700: #2c3a46;
  --slate-600: #3b4a57;
  --slate-500: #5d6d7b;
  --slate-400: #8695a1;

  /* Semantic */
  --bg: var(--paper);
  --bg-alt: var(--sand-100);
  --bg-dark: var(--navy-950);
  --fg: var(--navy-900);
  --fg-muted: var(--slate-500);
  --fg-invert: #eef3f7;
  --fg-invert-muted: #9fb2c2;
  --accent: var(--brass-500);
  --accent-strong: var(--brass-600);
  --rule: rgba(11, 27, 43, 0.12);
  --rule-invert: rgba(255, 255, 255, 0.14);

  /* Type */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Fluid type scale — 360px → 1600px viewport */
  --step--1: clamp(0.82rem, 0.79rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
  --step-1: clamp(1.2rem, 1.12rem + 0.38vw, 1.42rem);
  --step-2: clamp(1.45rem, 1.31rem + 0.7vw, 1.9rem);
  --step-3: clamp(1.75rem, 1.5rem + 1.25vw, 2.6rem);
  --step-4: clamp(2.1rem, 1.65rem + 2.25vw, 3.6rem);
  --step-5: clamp(2.5rem, 1.7rem + 4vw, 5rem);
  --step-6: clamp(2.9rem, 1.6rem + 6.5vw, 7rem);

  /* Space */
  --space-2xs: 0.375rem;
  --space-xs: 0.625rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: clamp(4rem, 8vw, 7rem);
  --space-3xl: clamp(5rem, 11vw, 10rem);

  /* Shell */
  --shell: 1240px;
  --shell-wide: 1480px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --header-h: 88px;
  --header-h-scrolled: 68px;

  /* Radii — deliberately restrained; sharp corners read as more expensive */
  --radius-xs: 3px;
  --radius-sm: 5px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(7, 15, 24, 0.06), 0 2px 8px rgba(7, 15, 24, 0.05);
  --shadow-md: 0 4px 12px rgba(7, 15, 24, 0.07), 0 12px 32px rgba(7, 15, 24, 0.07);
  --shadow-lg: 0 12px 28px rgba(7, 15, 24, 0.1), 0 32px 64px rgba(7, 15, 24, 0.12);
  --shadow-brass: 0 10px 30px rgba(194, 162, 94, 0.28);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0.05, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  /* Even-paced curve for pointer-driven motion: it accelerates gently and
     settles without the dead tail that a strong ease-out leaves on a long
     duration, so an image zoom reads as one continuous glide. */
  --ease-smooth: cubic-bezier(0.32, 0.72, 0, 1);

  --dur-fast: 180ms;
  --dur-base: 320ms;
  --dur-slow: 620ms;
  --dur-reveal: 760ms;

  /* Hover motion. The lift and the image zoom are deliberately close in
     duration — when they diverge (a 320ms card over a 900ms image) the two
     halves of the same gesture visibly come apart. Leaving is quicker than
     arriving so the pointer feels answered rather than trailed. */
  --dur-hover-lift: 460ms;
  --dur-hover-zoom: 680ms;
  --dur-hover-zoom-out: 520ms;

  /* Layers */
  --z-base: 1;
  --z-sticky: 100;
  --z-header: 200;
  --z-overlay: 300;
  --z-progress: 400;
}

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Sticky header must never cover a jumped-to section heading */
  scroll-padding-top: calc(var(--header-h-scrolled) + 1.5rem);
}

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  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;
  /* No overflow-x band-aid: the layout is verified free of horizontal
     overflow at 375 / 834 / 1440 / 1920 by build/diag.mjs. */
}

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

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

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

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

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

table {
  border-collapse: collapse;
  width: 100%;
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.022em;
  text-wrap: balance;
  font-variation-settings: 'SOFT' 0, 'WONK' 0;
}

h1 {
  font-size: var(--step-5);
}
h2 {
  font-size: var(--step-4);
}
h3 {
  font-size: var(--step-2);
  line-height: 1.18;
  letter-spacing: -0.015em;
}
h4 {
  font-size: var(--step-1);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

p {
  text-wrap: pretty;
}

strong {
  font-weight: 600;
}

/* Optical sizing: big display type wants the tight end of the axis */
h1,
.display {
  font-variation-settings: 'opsz' 144, 'SOFT' 0, 'WONK' 0;
}

h2,
h3 {
  font-variation-settings: 'opsz' 72, 'SOFT' 0, 'WONK' 0;
}

/* ---------- Utilities ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.shell--wide {
  max-width: var(--shell-wide);
}

.shell--narrow {
  max-width: 820px;
}

.section {
  padding-block: var(--space-2xl);
  position: relative;
}

.section--tight {
  padding-block: var(--space-xl);
}

.section--loose {
  padding-block: var(--space-3xl);
}

.section--sand {
  background: var(--bg-alt);
}

.section--dark {
  background: var(--bg-dark);
  color: var(--fg-invert);
}

/* Eyebrow: brass micro-label with a leading hairline rule */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.section--dark .eyebrow {
  color: var(--brass-400);
}

.lede {
  font-size: var(--step-1);
  line-height: 1.6;
  color: var(--fg-muted);
  text-wrap: pretty;
}

.section--dark .lede {
  color: var(--fg-invert-muted);
}

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

.section--dark .hairline {
  background: var(--rule-invert);
}

.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: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -120%);
  z-index: calc(var(--z-header) + 10);
  background: var(--navy-900);
  color: var(--white);
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: transform var(--dur-fast) var(--ease-out);
}

.skip-link:focus-visible {
  transform: translate(-50%, 0);
}

/* Visible, on-brand focus ring for keyboard users only */
:focus-visible {
  outline: 2px solid var(--brass-500);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

::selection {
  background: var(--brass-300);
  color: var(--navy-950);
}

/* Subtle branded scrollbar on desktop */
@media (pointer: fine) {
  html {
    scrollbar-color: var(--slate-400) transparent;
    scrollbar-width: thin;
  }
}

/* ---------- Reduced motion ----------
   Motion is opt-in, not opt-out: with this set, every reveal starts in its
   final state and all ambient animation stops. */
@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;
  }
}
