/* ═══════════════════════════════════════════════════════════════════
   THE HISTORY VAULT — Design System v3.0
   Modern-Classic Blue | Montserrat + Cormorant Garamond
   ═══════════════════════════════════════════════════════════════════

   VALIDATION CHECKLIST
   ─────────────────────────────────────────────────────────────────
   Typography     Perfect Fourth scale (×1.333) from 16px base      ✓
   Typefaces      ≤2 global families (Montserrat + Cormorant)        ✓
   Color 60%      --bg-canvas #FDFBF7 — canvas, page backgrounds     ✓
   Color 30%      --bg-surface #F2EDE6 + --brand-main #1F2A33        ✓
   Color 10%      --brand-accent #C8B273 — CTAs and indicators ONLY  ✓
   Semantic color Red/Green/Yellow locked to feedback ONLY           ✓
   WCAG AA        text-primary on bg-canvas ≈ 18.2:1                 ✓
   Touch targets  btn min-height: 48px enforced globally             ✓
   Layout         No hardcoded pixel widths — clamp/min/max used     ✓
   Breathe        Section padding clamps to 100px+ on desktop        ✓
   ═══════════════════════════════════════════════════════════════════ */

/* ── GOOGLE FONTS ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=Montserrat:wght@500;700;900&display=swap');

/* ── DESIGN TOKENS ────────────────────────────────────────────────── */
:root {
  /* ── Color System (60 / 30 / 10 surface distribution) ──────────── */

  /* 60% Dominant Canvas — primary page backgrounds */
  --bg-canvas: #FDFBF7;

  /* 30% Structure — cards, alternate sections, navigation, footer */
  --bg-surface: #F2EDE6;
  --brand-main: #1F2A33;

  /* 10% Accent — EXCLUSIVELY: primary CTA buttons, active states,
     conversion indicators. Never decorative.                         */
  --brand-accent: #C8B273;

  /* Typography colors */
  --text-primary: #0B1623;
  --text-muted:   #6B7C8C;

  /* On-dark surface — for text sitting on --brand-main backgrounds  */
  --on-dark:       #FDFBF7;
  --on-dark-muted: rgba(253, 251, 247, 0.56);

  /* Semantic colors — LOCKED to feedback loops only.
     Do not use as decorative or background accent choices.           */
  --semantic-success: #2E7D32;
  --semantic-error:   #C62828;
  --semantic-warning: #E65100;

  /* ── Typographic Scale: Perfect Fourth (16 × 1.333) ─────────────
     Body(base):  16px  → optical override for Garamond: 18px
     H3:          16 × 1.333 ≈ 21px
     H2:          21 × 1.333 ≈ 28px
     H1:          28 × 1.333 ≈ 37px  (clamp to 50px at wide viewports)
     ──────────────────────────────────────────────────────────────── */
  --scale-h1:    clamp(37px, 4.5vw, 50px);
  --scale-h2:    28px;
  --scale-h3:    21px;
  --scale-body:  18px;   /* Garamond optical adjustment (+2px)       */
  --scale-ui:    14px;   /* Montserrat UI / nav text                 */
  --scale-label: 13px;   /* Button labels, eyebrow caps              */

  /* Font stacks */
  --font-display: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  --font-body:    'Cormorant Garamond', 'Garamond', Georgia, serif;

  /* ── Spacing ────────────────────────────────────────────────────
     Section padding clamps: mobile 64px → desktop 108px
     Minimum gap between sections at desktop: ≥100px per "Breathe" rule */
  --section-pad:    clamp(64px, 8vw, 108px);
  --card-pad:       32px;
  --card-pad-sm:    24px;
  --gutter:         max(20px, 5vw);
  --container-max:  1280px;

  /* ── Geometry ───────────────────────────────────────────────────
     Sharp, classic corners. Never pill-shaped. ≤4px radius.        */
  --radius-btn:  3px;
  --radius-card: 4px;

  /* ── Borders ────────────────────────────────────────────────────
     Thin print-quality lines. text-muted at 0.18 opacity.          */
  --border:      1px solid rgba(107, 124, 140, 0.18);
  --border-gold: 1px solid rgba(200, 178, 115, 0.25);

  /* ── Focus Ring ─────────────────────────────────────────────────
     Matches brand-accent to signal active state                     */
  --focus-ring: 0 0 0 3px rgba(200, 178, 115, 0.42);
}

/* ── CSS RESET ────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

body {
  font-family: var(--font-body);
  font-size: var(--scale-body);
  font-weight: 400;
  line-height: 1.65;
  color: var(--text-primary);
  background-color: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol { list-style: none; }

/* ── TYPOGRAPHY ───────────────────────────────────────────────────── */

/* All headings: Montserrat, geometric, architectural */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.15;
}

/* H1 — Hero headings. Geometric tight tracking per spec. */
h1 {
  font-size: var(--scale-h1);
  font-weight: 900;
  letter-spacing: -0.02em;    /* Tighten at large sizes */
}

/* H2 — Section titles */
h2 {
  font-size: var(--scale-h2);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* H3 — Card and subsection titles */
h3 {
  font-size: var(--scale-h3);
  font-weight: 700;
}

/* Body paragraphs: Cormorant Garamond, editorial quality
   Max-width enforced for line length ≤ 75ch (optimal readability) */
p {
  font-size: var(--scale-body);
  line-height: 1.65;
  color: var(--text-primary);
  max-width: 68ch;
}

/* Eyebrow — small Montserrat caps label above a heading */
.eyebrow {
  display: block;
  font-family: var(--font-display);
  font-size: var(--scale-label);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* On-dark surface: override all text colors */
.on-dark h1,
.on-dark h2,
.on-dark h3,
.on-dark h4 {
  color: var(--on-dark);
}

.on-dark p {
  color: var(--on-dark-muted);
  max-width: 64ch;
}

.on-dark .eyebrow {
  color: var(--brand-accent);
  opacity: 0.9;
}

/* Italic editorial style for Garamond */
em, cite { font-style: italic; }

/* ── LAYOUT PRIMITIVES ────────────────────────────────────────────── */

/* Fluid container — no hardcoded pixel widths */
.container {
  width: min(100%, calc(var(--container-max) + var(--gutter) * 2));
  padding-inline: var(--gutter);
  margin-inline: auto;
}

/* Section wrapper — enforces the "Breathe" constraint */
.section-wrap {
  padding-block: var(--section-pad);
}

/* Section header block — eyebrow + h2 + optional p */
.section-header {
  margin-bottom: clamp(40px, 5vw, 64px);
}

.section-header.centered {
  text-align: center;
}

.section-header.centered p {
  margin-inline: auto;
}

/* Thin print-quality horizontal dividers */
hr {
  border: none;
  border-top: var(--border);
}

/* ── NAVIGATION ───────────────────────────────────────────────────── */

/* Fixed header — brand-main (30% structural) */
.site-nav {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 200;
  height: 68px;
  background-color: var(--brand-main);
  border-bottom: var(--border);
  display: flex;
  align-items: center;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-inline: var(--gutter);
  gap: 24px;
}

/* Logo — clean Montserrat wordmark */
.nav-logo {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--on-dark);
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.nav-logo:hover { opacity: 0.75; }

/* Desktop nav link cluster */
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.5vw, 36px);
}

.nav-link {
  font-family: var(--font-display);
  font-size: var(--scale-label);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--on-dark-muted);
  padding-block: 10px;
  white-space: nowrap;
  transition: color 0.2s;
}

.nav-link:hover { color: var(--on-dark); }

/* ── HAMBURGER BUTTON (Mobile) ────────────────────────────────────── */
/* Meets Fitts's Law: 48×48px touch target */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  gap: 5px;
  padding: 0;
  background: none;
  border: none;
  border-radius: var(--radius-btn);
  flex-shrink: 0;
}

.hamburger-bar {
  display: block;
  width: 22px;
  height: 1.5px;
  background-color: var(--on-dark);
  transform-origin: center;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-hamburger[aria-expanded="true"] .hamburger-bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav-hamburger[aria-expanded="true"] .hamburger-bar:nth-child(2) {
  opacity: 0;
}
.nav-hamburger[aria-expanded="true"] .hamburger-bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile nav drawer — full-width overlay below the fixed header */
.nav-drawer {
  display: none;
  position: fixed;
  inset-block: 68px 0;
  inset-inline: 0;
  z-index: 199;
  background-color: var(--brand-main);
  overflow-y: auto;
  padding: 32px var(--gutter) 48px;
  flex-direction: column;
}

.nav-drawer.is-open {
  display: flex;
}

.nav-drawer .nav-link {
  font-size: 14px;
  letter-spacing: 0.08em;
  padding-block: 16px;
  border-bottom: var(--border);
  color: var(--on-dark-muted);
  display: block;
}

.nav-drawer .nav-link:last-of-type {
  border-bottom: none;
}

.nav-drawer .btn-primary {
  margin-top: 24px;
  width: 100%;
  justify-content: center;
}

/* ── BUTTON SYSTEM ────────────────────────────────────────────────── */

/* PRIMARY — Champagne Gold (#C8B273), 10% accent, exclusively for
   primary CTAs. Sharp corners. Montserrat 500 uppercase. 48px min.  */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding-inline: clamp(24px, 4vw, 36px);
  background-color: var(--brand-accent);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: var(--scale-label);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: none;
  border-radius: var(--radius-btn);
  white-space: nowrap;
  cursor: pointer;
  transition: filter 0.2s, transform 0.15s;
  text-decoration: none;
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* GHOST (on dark background) — low visual weight, secondary action  */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding-inline: clamp(24px, 4vw, 36px);
  background-color: transparent;
  color: var(--on-dark);
  font-family: var(--font-display);
  font-size: var(--scale-label);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid rgba(253, 251, 247, 0.28);
  border-radius: var(--radius-btn);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  text-decoration: none;
}

.btn-ghost:hover {
  border-color: rgba(253, 251, 247, 0.6);
  color: var(--on-dark);
}

/* OUTLINE (on light/canvas background) — secondary action on light  */
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding-inline: clamp(24px, 4vw, 36px);
  background-color: transparent;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: var(--scale-label);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid rgba(11, 22, 35, 0.28);
  border-radius: var(--radius-btn);
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
  text-decoration: none;
}

.btn-outline:hover {
  border-color: var(--text-primary);
  background-color: rgba(11, 22, 35, 0.04);
}

/* Flex row of buttons */
.btn-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

/* ── CARD COMPONENTS ──────────────────────────────────────────────── */

/* Light card — bg-canvas, thin border */
.card {
  background-color: var(--bg-canvas);
  border: var(--border);
  border-radius: var(--radius-card);
  padding: var(--card-pad);
}

/* Surface card — bg-surface (sand) */
.card-surface {
  background-color: var(--bg-surface);
  border: var(--border);
  border-radius: var(--radius-card);
  padding: var(--card-pad);
}

/* Dark card — brand-main, gold-tinted border */
.card-dark {
  background-color: var(--brand-main);
  border: var(--border-gold);
  border-radius: var(--radius-card);
  padding: var(--card-pad);
}

/* ── FORM ELEMENTS ────────────────────────────────────────────────── */

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
}

.form-label {
  font-family: var(--font-display);
  font-size: var(--scale-label);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

/* Input — 48px min-height for Fitts's Law compliance on mobile      */
.form-input {
  width: 100%;
  min-height: 48px;
  padding-inline: 16px;
  background-color: var(--bg-canvas);
  border: var(--border);
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-size: var(--scale-body);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.form-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.form-input:focus {
  border-color: var(--brand-accent);
  box-shadow: var(--focus-ring);
}

/* Semantic feedback styles — locked to validation only              */
.form-input.is-error { border-color: var(--semantic-error); }
.form-error-msg {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  color: var(--semantic-error);
  display: none;
}
.form-error-msg.visible { display: block; }

/* ── FOCUS STATES — Keyboard Navigation ──────────────────────────── */
/* Explicit, high-visibility focus rings for all interactive elements */
:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 3px;
  border-radius: var(--radius-btn);
}

/* Suppress outline for pointer users */
:focus:not(:focus-visible) {
  outline: none;
}

/* ── ACCESSIBILITY UTILITIES ──────────────────────────────────────── */

/* Screen-reader only — visually hidden but accessible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Skip-to-content link — visible on focus for keyboard navigation   */
.skip-link {
  position: fixed;
  top: -56px;
  left: var(--gutter);
  z-index: 9999;
  background-color: var(--brand-accent);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: var(--scale-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  padding: 12px 24px;
  border-radius: var(--radius-btn);
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus-visible {
  top: 12px;
  outline: 2px solid var(--text-primary);
  outline-offset: 3px;
}

/* ── SITE FOOTER ──────────────────────────────────────────────────── */

footer.site-footer {
  background-color: var(--brand-main);
  border-top: var(--border);
  padding-block: 48px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--on-dark);
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-link {
  font-family: var(--font-display);
  font-size: var(--scale-label);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--on-dark-muted);
  transition: color 0.2s;
  padding-block: 8px;
}

.footer-link:hover { color: var(--on-dark); }

.footer-copy {
  width: 100%;
  padding-top: 28px;
  margin-top: 20px;
  border-top: var(--border);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--on-dark-muted);
  opacity: 0.45;
  text-align: center;
}

/* ── RESPONSIVE BREAKPOINTS ───────────────────────────────────────── */

/* Tablet and below: collapse nav, stack buttons */
@media (max-width: 768px) {
  /* Show hamburger, hide desktop links */
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  /* Stack button groups vertically */
  .btn-group {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary,
  .btn-ghost,
  .btn-outline {
    width: 100%;
    justify-content: center;
  }

  /* Stack footer */
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Desktop: ensure drawer never shows */
@media (min-width: 769px) {
  .nav-drawer { display: none !important; }
}
