/* ==========================================================================
   Vamora Ventures — base.css
   Tokens, fonts, reset, typography, layout primitives.
   ========================================================================== */

/* ---------- Fonts (self-hosted, latin subset, variable) ---------- */
@font-face {
  font-family: "Montserrat";
  src: url("../assets/fonts/montserrat-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* Metric-matched fallbacks keep layout stable while fonts load (CLS). */
@font-face {
  font-family: "Montserrat Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 113.4%;
  ascent-override: 85.5%;
  descent-override: 22.2%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 107.1%;
  ascent-override: 90.4%;
  descent-override: 22.5%;
  line-gap-override: 0%;
}

/* ---------- Tokens ---------- */
:root {
  /* Brand palette */
  --charcoal: #0F0F10;
  --ivory: #F8F6F2;
  --taupe: #B7AFA3;
  --navy: #1E2A44;
  --sage: #3E5B4E;

  /* Derived neutrals (for text contrast & surfaces) */
  --ivory-2: #F0ECE5;           /* alternate light surface */
  --ink: var(--charcoal);
  --ink-2: #4B4843;             /* secondary text on ivory — 8.6:1 */
  --ink-3: #6B665F;             /* tertiary text on ivory — 5.4:1 */
  --paper-2: rgba(248, 246, 242, 0.72); /* secondary text on charcoal */
  --paper-3: rgba(248, 246, 242, 0.56);
  --line: rgba(15, 15, 16, 0.14);
  --line-strong: rgba(15, 15, 16, 0.32);
  --line-dark: rgba(248, 246, 242, 0.14);
  --line-dark-strong: rgba(248, 246, 242, 0.32);

  /* Type */
  --font-display: "Montserrat", "Montserrat Fallback", system-ui, sans-serif;
  --font-body: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;

  --fs-display: clamp(2.35rem, 1rem + 5.9vw, 7rem);
  --fs-h1: clamp(2.35rem, 1.1rem + 4.6vw, 5.75rem);
  --fs-h2: clamp(2rem, 1.15rem + 3.1vw, 4.25rem);
  --fs-h3: clamp(1.3rem, 1.1rem + 0.8vw, 1.75rem);
  --fs-lead: clamp(1.0625rem, 0.98rem + 0.38vw, 1.3125rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-micro: 0.75rem;

  /* Space */
  --gutter: clamp(1rem, 0.4rem + 3.2vw, 3.5rem);
  --section: clamp(4.5rem, 2.75rem + 6.5vw, 8.5rem);
  --maxw: 1440px;
  --header-h: 72px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.9s;

  /* Subtle film grain (SVG noise, ~0.4 KB) */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
picture { display: block; }
.frame picture, .hero__media picture, .philosophy__media picture { height: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
::selection { background: var(--charcoal); color: var(--ivory); }
.on-dark ::selection { background: var(--ivory); color: var(--charcoal); }

/* ---------- Page transitions (cross-document View Transitions, progressive) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 0.28s var(--ease) both; }
::view-transition-new(root) { animation: vt-in 0.45s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
.site-header { view-transition-name: site-header; }

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 200;
  padding: 0.75rem 1.1rem;
  background: var(--charcoal);
  color: var(--ivory);
  font-size: var(--fs-small);
  font-weight: 500;
}
.skip-link:focus { top: 12px; }
.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;
}
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--charcoal);
  outline-offset: 4px;
}
.on-dark :focus-visible { outline-color: var(--ivory); }

/* ---------- Typography ---------- */
.display, .h1, .h2, .h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.display { font-size: var(--fs-display); line-height: 1.02; letter-spacing: -0.035em; }
.h1 { font-size: var(--fs-h1); line-height: 1.04; letter-spacing: -0.032em; }
.h2 { font-size: var(--fs-h2); line-height: 1.06; }
.h3 { font-size: var(--fs-h3); line-height: 1.2; letter-spacing: -0.015em; }
.lead { font-size: var(--fs-lead); line-height: 1.6; color: var(--ink-2); max-width: 36em; text-wrap: pretty; }
.on-dark .lead { color: var(--paper-2); }
.body-copy { color: var(--ink-2); max-width: 38em; text-wrap: pretty; }
.body-copy + .body-copy { margin-top: 1.1em; }
.on-dark .body-copy { color: var(--paper-2); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}
.on-dark .eyebrow { color: var(--paper-2); }
.eyebrow--plain::before { display: none; }

.tracked {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.muted { color: var(--ink-3); }
.on-dark .muted { color: var(--paper-3); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section); position: relative; }
.section--tight { padding-block: calc(var(--section) * 0.62); }

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(1rem, 0.5rem + 1.6vw, 2rem);
}
.col-full { grid-column: 1 / -1; }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.on-dark .rule { background: var(--line-dark); }

/* Surfaces */
.surface-dark { background: var(--charcoal); color: var(--ivory); }
.surface-navy { background: var(--navy); color: var(--ivory); }
.surface-alt { background: var(--ivory-2); }
.grain { position: relative; isolation: isolate; }
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: var(--grain);
  opacity: 0.07;
  mix-blend-mode: overlay;
}
