/* MECC — shared styles */

:root {
  --navy: #0A1628;
  --navy-2: #0E1B30;
  --navy-3: #152238;
  --ink: #0A1628;
  --ink-2: #1a2538;
  --paper: #FFFFFF;
  --paper-2: #F7F5F2;
  --paper-3: #EFEBE4;
  --rule: #2a3650;
  --rule-light: #E4DFD6;
  --muted: #8E8E93;
  --muted-2: #6b6e75;
  --muted-on-dark: #9aa3b2;
  --accent: #0D4F4F;
  --accent-2: #0f6363;
  --gold: #C9A96E;
  --gold-soft: #b8955c;

  --serif: 'Instrument Serif', 'Times New Roman', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --max: 1360px;
  --gutter: 48px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; padding: 0; color: inherit; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Type */
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.mono { font-family: var(--mono); font-size: 0.78em; letter-spacing: 0.04em; text-transform: uppercase; }

h1, h2, h3, h4 { margin: 0; font-weight: 400; }
.display-xl { font-family: var(--serif); font-size: clamp(56px, 9vw, 148px); line-height: 0.95; letter-spacing: -0.025em; }
.display-l { font-family: var(--serif); font-size: clamp(44px, 6.2vw, 96px); line-height: 1.0; letter-spacing: -0.02em; }
.display-m { font-family: var(--serif); font-size: clamp(36px, 4.6vw, 68px); line-height: 1.05; letter-spacing: -0.015em; }
.display-s { font-family: var(--serif); font-size: clamp(28px, 3.2vw, 44px); line-height: 1.1; letter-spacing: -0.01em; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 500;
}
.eyebrow.on-dark { color: var(--gold); }

.lede {
  font-size: 22px;
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
  max-width: 62ch;
}
.body-large { font-size: 19px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; max-width: 62ch; }

/* Section backgrounds */
.bg-paper { background: var(--paper); }
.bg-paper2 { background: var(--paper-2); }

/* Dark section */
.dark {
  background: var(--navy);
  color: #EFE9DE;
}
.dark .lede { color: #cfd5e1; }
.dark .body-large { color: #cfd5e1; }
.dark .eyebrow { color: var(--gold); }
.dark hr { border-color: var(--rule); }

/* Top nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 12px var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  transition: background 240ms ease, border-color 240ms ease, padding 240ms ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(10, 22, 40, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom-color: rgba(255,255,255,0.08);
  padding-top: 10px; padding-bottom: 10px;
}
.nav.on-light.scrolled {
  background: rgba(255,255,255,0.92);
  border-bottom-color: var(--rule-light);
}
.nav-brand { display: flex; align-items: center; }
.nav-logo { height: 32px; width: auto; display: block; }
.nav-logo-light { display: none; }
.nav.on-light .nav-logo-dark { display: none; }
.nav.on-light .nav-logo-light { display: block; }
.nav-links { display: flex; gap: 28px; font-size: 14px; color: rgba(255,255,255,0.8); }
.nav.on-light .nav-links { color: var(--ink-2); }
.nav-links a { position: relative; padding: 6px 0; }
.nav-links a:hover { color: #fff; }
.nav.on-light .nav-links a:hover { color: var(--ink); }
.nav-links a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--gold);
}
.nav-cta {
  font-size: 13px; letter-spacing: 0.04em;
  padding: 8px 20px;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  transition: background 160ms, border-color 160ms;
}
.nav.on-light .nav-cta { background: var(--accent); border-color: var(--accent); color: #fff; }
.nav-cta:hover { background: var(--accent-2); border-color: var(--accent-2); }
.nav.on-light .nav-cta:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }

/* Hamburger toggle */
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 28px; height: 20px; position: relative; padding: 0; z-index: 60;
}
.nav-toggle span {
  display: block; width: 100%; height: 2px; background: #fff;
  position: absolute; left: 0; transition: transform 260ms ease, opacity 200ms ease;
}
.nav.on-light .nav-toggle span { background: var(--ink); }
.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 9px; }
.nav-toggle span:nth-child(3) { top: 18px; }
.nav.menu-open .nav-toggle span:nth-child(1) { top: 9px; transform: rotate(45deg); }
.nav.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav.menu-open .nav-toggle span:nth-child(3) { top: 9px; transform: rotate(-45deg); }
.nav.menu-open .nav-toggle span { background: #fff; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 18px 26px;
  font-size: 15px; font-weight: 500; letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: all 180ms ease;
  cursor: pointer;
}
.btn .arrow { width: 18px; height: 1px; background: currentColor; position: relative; transition: width 180ms; }
.btn .arrow::after { content: ''; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); }
.btn:hover .arrow { width: 28px; }

.btn-primary { background: var(--gold); color: var(--navy); }
.btn-primary:hover { background: #d4b87a; }
.btn-ghost { border-color: rgba(255,255,255,0.25); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.45); }
.btn-ink { border-color: var(--ink); color: var(--ink); }
.btn-ink:hover { background: var(--ink); color: #fff; }

/* Sections */
section { padding: 120px 0; position: relative; }
section.tight { padding: 80px 0; }
section.loose { padding: 160px 0; }

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

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }

/* Fade-in on scroll */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 600ms ease, transform 600ms ease; }
.reveal.in { opacity: 1; transform: none; }

/* Footer */
.footer {
  background: var(--navy);
  color: #cfd5e1;
  padding: 96px 0 48px;
  font-size: 14px;
}
.footer .row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; align-items: start; }
.footer h4, .footer-heading { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin-bottom: 18px; margin-top: 0; font-weight: 500; }
.footer a { color: #cfd5e1; display: block; padding: 4px 0; }
.footer a:hover { color: #fff; }
.footer-brand { font-family: var(--serif); font-size: 32px; color: #fff; letter-spacing: -0.01em; }
.footer-logo { height: 40px; width: auto; display: block; }
.footer-tag { margin-top: 6px; color: var(--gold); font-family: var(--serif); font-size: 20px; font-style: italic; }
.footer-legal {
  margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted-on-dark);
}
.wcag-badge { display: inline-flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--rule); color: #cfd5e1; }
.wcag-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }

/* Rules with labels */
.label-row {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--rule-light);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2);
}
.dark .label-row { border-top-color: var(--rule); color: var(--muted-on-dark); }

/* Image card */
.img-frame {
  position: relative;
  overflow: hidden;
  background: var(--navy-3);
}
.img-frame img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.78) contrast(1.05) brightness(0.92);
  transition: transform 900ms ease;
}
.img-frame:hover img { transform: scale(1.02); }
.img-caption {
  position: absolute; left: 16px; bottom: 14px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  background: rgba(10,22,40,0.55); backdrop-filter: blur(6px);
  padding: 6px 10px;
}

/* Page header block (non-home hero) */
.page-hero {
  background: var(--navy);
  color: #EFE9DE;
  padding: 220px 0 120px;
  position: relative;
  overflow: hidden;
}
.page-hero .eyebrow { color: var(--gold); }
.page-hero h1 { margin-top: 28px; max-width: 22ch; text-wrap: balance; }
.page-hero p.lede { margin-top: 28px; color: #cfd5e1; max-width: 60ch; }

/* Stat */
.stat-num {
  font-family: var(--serif);
  font-size: clamp(72px, 9vw, 140px);
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--gold);
}
.stat-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted-on-dark);
  margin-top: 16px;
}
.stat-body {
  margin-top: 14px; color: #cfd5e1; font-size: 16px; line-height: 1.55;
  max-width: 34ch;
}

/* "Chip" */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; border: 1px solid var(--rule-light);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted-2);
}
.dark .chip { border-color: var(--rule); color: var(--muted-on-dark); }

/* Responsive */
@media (max-width: 980px) {
  :root { --gutter: 24px; }
  .grid-2 { grid-template-columns: 1fr; gap: 48px; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  section { padding: 80px 0; }
  .page-hero { padding: 160px 0 80px; }
  .footer .row { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-toggle { display: block; }
  .nav.menu-open {
    bottom: 0;
    background: rgba(10, 22, 40, 0.97) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding-top: 18px; padding-bottom: 18px;
    border-bottom-color: transparent !important;
  }
  .nav.menu-open .nav-brand {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
  }
  .nav.menu-open .nav-toggle {
    position: absolute;
    top: 18px;
    right: var(--gutter);
  }
  .nav.menu-open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    font-size: 20px;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    margin: 0;
  }
  .nav.menu-open .nav-links a { color: rgba(255,255,255,0.85); }
  .nav.menu-open .nav-links a:hover { color: #fff; }
  .nav.menu-open .nav-cta {
    display: inline-block;
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    border-color: rgba(255,255,255,0.3);
    color: #fff;
  }
}
@media (max-width: 768px) {
  .card-grid { grid-template-columns: 1fr; }
}
@media (min-width: 769px) and (max-width: 980px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
}

/* Gold rule motif */
.gold-rule {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gold);
  margin-bottom: 16px;
}
.gold-rule-wide { display: block; height: 1px; background: var(--gold); opacity: 0.3; }

/* Section label (replaces numbered eyebrows) */
.section-label {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted-2);
  letter-spacing: 0.02em;
}
.dark .section-label { color: var(--muted-on-dark); }

/* Card component */
.card {
  background: #fff;
  border: 1px solid var(--rule-light);
  border-top: 2px solid var(--gold);
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(10,22,40,.06);
  padding: 40px;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 12px 32px rgba(10,22,40,.10);
}
.card h3 { margin-bottom: 16px; }
.card p { font-size: 16px; line-height: 1.55; color: var(--ink-2); }

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

/* Light-mode stat overrides */
.stat-light .stat-num { color: var(--accent); }
.stat-light .stat-label { color: var(--muted-2); }
.stat-light .stat-body { color: var(--ink-2); }

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.btn:focus-visible { outline-offset: 3px; }
.nav-cta:focus-visible { outline-offset: 3px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .img-frame img { transition: none; }
  .card { transition: none; }
  .card:hover { transform: none; }
}

/* Dark body */
body.bg-dark { background: var(--navy); }

/* Large button */
.btn-lg { padding: 22px 32px; font-size: 16px; }
