/* ==========================================================================
   Build Edge — base.css
   Fonts, design tokens, reset, typography, utilities
   ========================================================================== */

/* ---------- Fonts (self-hosted, latin subset) ---------- */
@font-face {
  font-family: "Jost";
  src: url("../fonts/jost-latin.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-garamond-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  /* Colour */
  --c-ink: #0d0d0d;            /* darkest background */
  --c-ink-2: #131313;          /* dark section */
  --c-ink-3: #1b1b1b;          /* card on dark */
  --c-line-dark: rgba(255, 255, 255, 0.12);
  --c-paper: #f6f3ee;          /* warm light background */
  --c-white: #ffffff;
  --c-line: #e3ddd4;
  --c-text: #1b1a18;
  --c-text-2: #5c5750;
  --c-on-dark: #f2ede6;
  --c-on-dark-2: #a8a198;
  --c-accent: #c09062;         /* bronze — text/lines on dark */
  --c-accent-deep: #8a5c2f;    /* bronze — text on light */
  --c-accent-fill: #9c6a38;    /* bronze — button fill (white text AA) */
  --c-success: #2f7d4f;
  --c-error: #b3261e;

  /* Type */
  --ff-sans: "Jost", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ff-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --fs-h3: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  --fs-h2: clamp(2.1rem, 1.5rem + 2.4vw, 3.4rem);
  --fs-hero: clamp(3.1rem, 1.6rem + 6.4vw, 7rem);

  /* Space & layout */
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --container: 1240px;
  --section-y: clamp(4.5rem, 3rem + 6vw, 8rem);
  --header-h: 84px;
  --radius: 2px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.45s;
}

@media (max-width: 1024px) {
  :root { --header-h: 68px; }
}

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

* { margin: 0; }

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  min-height: 100vh;
  font-variant-numeric: lining-nums;
  font-family: var(--ff-sans);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.7;
  color: var(--c-text-2);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

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

img { height: auto; }

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

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

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

ul[role="list"],
ol[role="list"] { list-style: none; padding: 0; }

h1, h2, h3, h4 {
  font-variant-numeric: lining-nums;
  color: var(--c-text);
  line-height: 1.12;
  font-weight: 500;
  text-wrap: balance;
}

p { text-wrap: pretty; }

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

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

/* ---------- Typography helpers ---------- */
.eyebrow {
  display: inline-block;
  font-family: var(--ff-sans);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--c-accent-deep);
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--ff-serif);
  font-size: var(--fs-h2);
  font-weight: 500;
  letter-spacing: -0.005em;
}

.lead {
  font-size: var(--fs-md);
  line-height: 1.75;
}

.divider {
  width: 56px;
  height: 2px;
  background: var(--c-accent);
  border: 0;
  margin: 1.75rem 0;
}

/* Dark context — flips colours for any child */
.is-dark {
  background: var(--c-ink);
  color: var(--c-on-dark-2);
}
.is-dark h1,
.is-dark h2,
.is-dark h3,
.is-dark h4 { color: var(--c-on-dark); }
.is-dark .eyebrow { color: var(--c-accent); }

.is-deep { background: var(--c-ink-2); }

.is-paper { background: var(--c-paper); }

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

.section { padding-block: var(--section-y); position: relative; }

.section-head {
  max-width: 720px;
  margin: 0 auto clamp(2.5rem, 2rem + 2vw, 4rem);
  text-align: center;
}

.section-head .lead { margin-top: 1.25rem; }

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

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

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1000;
  padding: 0.75rem 1.25rem;
  background: var(--c-accent-fill);
  color: var(--c-white);
  font-weight: 500;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: none; }

.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Animation pre-states (only when GSAP will run) ---------- */
.js-anim [data-reveal],
.js-anim [data-reveal-stagger] > * { opacity: 0; }

.js-anim [data-reveal-img] { clip-path: inset(0 0 100% 0); }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
