/* ===== Myfab — Built different. ===== */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

:root {
  /* Brand colors — from official guidelines */
  --cobalt: #0046BF;
  --sapphire: #122C67;
  --dodger: #2F80ED;
  --blue: #1F458F;
  --midnight: #0E1933;

  --rice: #EEEADA;
  --hillary: #ACA178;
  --martinique: #3F3E40;

  --black: #000;
  --white: #fff;

  /* Theme tokens — flipped by palette-mode */
  --bg: var(--white);
  --fg: var(--midnight);
  --muted: rgba(14, 25, 51, 0.58);
  --line: rgba(14, 25, 51, 0.12);
  --accent: var(--cobalt);
  --accent-fg: var(--white);
  --surface: var(--rice);
  --surface-fg: var(--midnight);

  --grid-gutter: clamp(16px, 2vw, 32px);
  --page-pad: clamp(20px, 4vw, 64px);
  --section-pad: clamp(72px, 10vw, 160px);

  /* Type scale */
  --t-display: clamp(64px, 11vw, 200px);
  --t-h1: clamp(48px, 7vw, 112px);
  --t-h2: clamp(36px, 4.5vw, 72px);
  --t-h3: clamp(24px, 2.4vw, 40px);
  --t-h4: clamp(18px, 1.4vw, 22px);
  --t-body: 17px;
  --t-small: 13px;
  --t-eyebrow: 12px;
}

[data-palette="midnight"] {
  --bg: var(--midnight);
  --fg: var(--rice);
  --muted: rgba(238, 234, 218, 0.6);
  --line: rgba(238, 234, 218, 0.14);
  --accent: var(--dodger);
  --accent-fg: var(--midnight);
  --surface: #142243;
  --surface-fg: var(--rice);
}

[data-palette="cream"] {
  --bg: var(--rice);
  --fg: var(--midnight);
  --muted: rgba(14, 25, 51, 0.6);
  --line: rgba(14, 25, 51, 0.16);
  --accent: var(--cobalt);
  --accent-fg: var(--white);
  --surface: var(--white);
  --surface-fg: var(--midnight);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Geist', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  font-feature-settings: 'ss01', 'cv11';
  background: var(--bg);
  color: var(--fg);
  font-size: var(--t-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.4s ease, color 0.4s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }

/* Type */
.display, h1.display { font-weight: 600; font-size: var(--t-display); line-height: 0.92; letter-spacing: -0.055em; margin: 0; text-wrap: balance; }
h1 { font-weight: 600; font-size: var(--t-h1); line-height: 0.96; letter-spacing: -0.045em; margin: 0; text-wrap: balance; }
h2 { font-weight: 500; font-size: var(--t-h2); line-height: 1; letter-spacing: -0.035em; margin: 0; text-wrap: balance; }
h3 { font-weight: 500; font-size: var(--t-h3); line-height: 1.08; letter-spacing: -0.025em; margin: 0; }
h4 { font-weight: 500; font-size: var(--t-h4); line-height: 1.2; letter-spacing: -0.015em; margin: 0; }
p { margin: 0; }
.eyebrow {
  font-size: var(--t-eyebrow);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 500;
  color: var(--muted);
  font-family: 'Geist Mono', ui-monospace, monospace;
}
.mono { font-family: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0; }

/* Layout */
.page { min-height: 100vh; }
.container { max-width: 1640px; margin: 0 auto; padding: 0 var(--page-pad); }
.section { padding: var(--section-pad) 0; position: relative; }
.section-tight { padding: clamp(48px, 6vw, 96px) 0; }
.grid-12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--grid-gutter); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 24px;
  font-size: 15px; font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 0;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--midnight); color: var(--white); }
.btn-ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-light { background: var(--white); color: var(--midnight); box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.btn-light:hover { background: var(--rice); }
/* Footer-specific ghost variant: outline button on midnight bg */
.footer .btn-ghost { background: transparent; color: var(--rice); border: 1px solid rgba(238,234,218,0.4); }
.footer .btn-ghost:hover { background: var(--rice); color: var(--midnight); border-color: var(--rice); }
.btn-arrow { font-size: 18px; line-height: 1; }

/* Link arrow */
.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  transition: gap 0.2s ease;
}
.link-arrow:hover { gap: 14px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(20px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--page-pad);
  gap: 32px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 22px; letter-spacing: -0.035em; }
.nav-logo .logo-mark { width: 28px; height: 28px; }
.nav-links { display: flex; align-items: center; gap: 36px; }
.nav-link {
  font-size: 15px; font-weight: 500;
  padding: 8px 0;
  position: relative;
  color: var(--muted);
  transition: color 0.2s ease;
}
.nav-link.active, .nav-link:hover { color: var(--fg); }
.nav-link.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -19px;
  height: 2px; background: var(--accent);
}
.nav-cta { display: flex; gap: 12px; align-items: center; }

/* Pill / chip */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* Cards */
.card {
  background: var(--surface);
  color: var(--surface-fg);
  padding: 32px;
  position: relative;
  overflow: hidden;
}
.card-bordered { background: transparent; border: 1px solid var(--line); padding: 32px; }

/* Placeholder (image slot) */
.ph {
  position: relative;
  background:
    repeating-linear-gradient(135deg,
      color-mix(in srgb, var(--fg) 6%, var(--bg)) 0 1px,
      transparent 1px 14px),
    color-mix(in srgb, var(--fg) 4%, var(--bg));
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  color: var(--muted);
}
.ph-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--fg);
}
.ph-cobalt {
  background:
    repeating-linear-gradient(135deg,
      rgba(255,255,255,0.06) 0 1px,
      transparent 1px 14px),
    var(--cobalt);
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.2);
}
.ph-cobalt .ph-label { background: var(--cobalt); color: rgba(255,255,255,0.95); border-color: rgba(255,255,255,0.3); }

/* Footer */
.footer {
  background: var(--midnight);
  color: var(--rice);
  padding: clamp(64px, 8vw, 120px) 0 32px;
}
.footer .footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 48px; }
.footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.15em; color: rgba(238,234,218,0.5); font-weight: 500; margin-bottom: 16px; }
.footer a { color: rgba(238, 234, 218, 0.85); display: block; padding: 6px 0; font-size: 15px; }
.footer a:hover { color: var(--dodger); }
.footer-bottom {
  margin-top: 80px; padding-top: 24px; border-top: 1px solid rgba(238,234,218,0.15);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  font-size: 12px; color: rgba(238,234,218,0.5); letter-spacing: 0.05em; text-transform: uppercase;
}
@media (max-width: 900px) {
  .footer .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(.2,.7,.2,1), transform 0.8s cubic-bezier(.2,.7,.2,1);
}
.reveal.in { opacity: 1; transform: none; }

/* House symbol marquee */
.symbol-row { display: flex; align-items: center; gap: 16px; }

/* Stat */
.stat-num {
  font-weight: 500;
  font-size: clamp(48px, 6.5vw, 112px);
  line-height: 0.95;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Tables */
.spec-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.spec-table th, .spec-table td { padding: 18px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec-table th { font-weight: 500; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; }
.spec-table tr:last-child td { border-bottom: 0; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 500; }
.field input, .field textarea, .field select {
  padding: 14px 16px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  outline: 0;
  transition: border-color 0.2s ease;
}
.field input:focus, .field textarea:focus, .field select:focus { border-bottom-color: var(--accent); }
.field textarea { resize: vertical; min-height: 120px; }

/* Mobile menu burger + drawer */
.nav-burger { display: none; width: 44px; height: 44px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 0; }
.nav-burger span { display: block; width: 22px; height: 2px; background: var(--fg); transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-mobile-menu { display: none; }

@media (max-width: 900px) {
  .nav-burger { display: flex; }
  .nav-quote { display: none !important; }
  .nav-mobile-menu {
    display: block;
    position: fixed;
    top: 65px;
    left: 0; right: 0;
    background: var(--bg);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    transform: translateY(-110%);
    transition: transform 0.3s cubic-bezier(.2,.7,.2,1);
    z-index: 49;
  }
  .nav-mobile-menu.open { transform: translateY(0); }
  .nav-mobile-link {
    display: flex; align-items: center;
    font-size: 22px; font-weight: 500; letter-spacing: -0.02em;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    color: var(--fg);
  }
  .nav-mobile-link:last-of-type { border-bottom: 0; }
  .nav-mobile-link.active { color: var(--accent); }
}

/* Sustainability stats — explicit 2x2 grid */
.sustain-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 32px;
  row-gap: 0;
}

/* Stack About-hero intro & Mission/Vision rows earlier so paragraphs never get squeezed */
@media (max-width: 1100px) {
  .ceo-feature { grid-template-columns: 1fr !important; row-gap: 32px !important; }
  .ceo-feature > * { grid-column: 1 / -1 !important; }
  .ceo-img > div { max-width: 480px; }

  .about-intro { grid-template-columns: 1fr !important; row-gap: 24px !important; }
  .about-intro > * { grid-column: 1 / -1 !important; }

  .mv-grid { grid-template-columns: 1fr !important; row-gap: 32px !important; }
  .mv-grid > * { grid-column: 1 / -1 !important; }
  .mv-l h2 { max-width: none !important; }

  .sustain-grid { grid-template-columns: 1fr !important; row-gap: 40px !important; }
  .sustain-grid > * { grid-column: 1 / -1 !important; }

  .prod-hero { grid-template-columns: 1fr !important; row-gap: 24px !important; }
  .prod-hero > * { grid-column: 1 / -1 !important; }

  .joint-grid { grid-template-columns: 1fr !important; row-gap: 40px !important; }
  .joint-grid > * { grid-column: 1 / -1 !important; }
}

/* Team grid — auto-fit so any number of members lays out cleanly */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--grid-gutter);
}

/* Footer top row (the "Built different. Build with myfab." block) */
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 32px;
  margin-bottom: 96px;
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 180px;
  gap: var(--grid-gutter);
}

/* Mobile */
@media (max-width: 900px) {
  .grid-12 { grid-template-columns: repeat(6, 1fr); }
  .nav-links { display: none; }
}

/* ========== RESPONSIVE LAYOUT ========== */

/* Tablet ≤1024 */
@media (max-width: 1024px) {
  :root {
    --section-pad: clamp(56px, 8vw, 112px);
    --t-display: clamp(56px, 11vw, 140px);
    --t-h1: clamp(40px, 7vw, 88px);
    --t-h2: clamp(32px, 5vw, 56px);
  }
  .footer .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .nav-cta .btn { padding: 12px 18px; font-size: 14px; }
}

/* Mobile ≤768 */
@media (max-width: 768px) {
  :root {
    --page-pad: clamp(16px, 4vw, 24px);
    --section-pad: 56px;
    --grid-gutter: 16px;
    --t-display: clamp(44px, 12vw, 80px);
    --t-h1: clamp(36px, 9vw, 64px);
    --t-h2: clamp(28px, 7vw, 44px);
    --t-h3: clamp(20px, 5vw, 28px);
    --t-body: 16px;
  }

  /* Generic grid stack: ALL `span N` columns become full-width on mobile */
  .grid-12 { grid-template-columns: 1fr !important; gap: 24px; }
  .grid-12 > * { grid-column: 1 / -1 !important; grid-column-start: auto !important; }

  /* Nav */
  .nav-inner { padding: 14px var(--page-pad); gap: 12px; }
  .nav-cta .btn { padding: 10px 14px; font-size: 13px; }
  .nav-cta .btn-arrow { display: none; }

  /* Hero */
  .hero-grid { row-gap: 40px !important; min-height: auto !important; }
  .hero-triplet { row-gap: 16px !important; }
  .hero-textcol { padding: 0 !important; gap: 24px !important; }
  .hero-imgcol { min-height: 280px; }
  .hero-chiprow { gap: 8px !important; }
  .hero-chiprow .chip { font-size: 11px; }
  .hero-chiprow .eyebrow { display: none; }

  /* Section head: title + description stack */
  .sec-head { row-gap: 24px !important; }

  /* Stats: 4 → 2 columns on mobile */
  .stat-grid { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 32px 24px !important; }
  .stat-grid > * { grid-column: auto !important; }
  .stat-num { font-size: clamp(48px, 11vw, 64px) !important; }

  /* Pillars: 4 → 2 columns */
  .pillar-grid { grid-template-columns: 1fr 1fr !important; gap: 16px !important; }
  .pillar-grid > * { grid-column: auto !important; }
  .pillar-grid .card-bordered { min-height: 220px !important; padding: 20px !important; }

  /* Comparison table — already scrolls horizontally */
  .spec-table th, .spec-table td { padding: 14px 12px !important; font-size: 14px !important; }

  /* Process: 3-col → 1-col */
  .process-grid { gap: 0 !important; }

  /* Gallery: collapse complex masonry into a clean stack */
  .gallery-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-auto-rows: 140px !important;
    gap: 12px !important;
  }
  .gallery-cell { grid-column: auto !important; grid-row: auto !important; }
  .gallery-cell:first-child { grid-column: span 2 !important; grid-row: span 2 !important; }
  .gallery-cell:last-child { grid-column: span 2 !important; }

  /* Manifesto */
  .manifesto-cols { row-gap: 24px !important; }
  .manifesto-col { padding: 24px 0; border-top: 1px solid rgba(255,255,255,0.18); }
  .manifesto-col:first-child { border-top: 0; padding-top: 0; }

  /* Products page */
  .prod-tabs { flex-direction: column !important; }
  .prod-tab { border-right: 0 !important; border-bottom: 1px solid var(--line); }
  .prod-tab:last-child { border-bottom: 0; }
  .panel-detail { row-gap: 32px !important; }

  /* Mixture selector — list stacks above detail card */
  .mixture-grid { row-gap: 16px !important; }
  .mixture-detail { min-height: 280px; }

  /* Applications */
  .app-grid { gap: 32px !important; }

  /* Customization */
  .cust-grid { gap: 0 !important; }
  .cust-cell:not(:first-child) > div { border-top: 0 !important; padding-top: 16px !important; }

  /* About */
  .about-intro { row-gap: 24px !important; }
  .mv-grid { row-gap: 32px !important; }
  .mv-l h2 { max-width: 100% !important; }
  .values-grid { gap: 0 !important; }
  .values-row { gap: 16px !important; padding: 24px 0 !important; }
  .timeline-row { display: grid !important; grid-template-columns: 1fr !important; gap: 8px !important; padding: 24px 0 !important; }
  .team-grid { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 24px !important; }
  .team-grid > * { grid-column: auto !important; }
  .sustain-stats { grid-template-columns: 1fr 1fr !important; gap: 0 16px !important; }
  .sustain-stat { padding: 20px 0 !important; }
  .testim-grid { gap: 32px !important; }

  /* Contact */
  .contact-layout { row-gap: 48px !important; }
  .contact-info-col { position: static !important; }
  .field input, .field textarea, .field select { padding: 12px 0 !important; }
  .contact-form-col > form > div > div[style*="grid-template-columns: repeat(3"] { grid-template-columns: 1fr !important; }
  .contact-form-col > form > div > div[style*="grid-template-columns: repeat(2"] { grid-template-columns: 1fr !important; }

  /* Footer */
  .footer { padding: 64px 0 24px; }
  .footer-top { flex-direction: column !important; align-items: flex-start !important; gap: 24px !important; margin-bottom: 48px !important; }
  .footer .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 32px 20px !important; }

  /* Buttons */
  .btn { padding: 14px 20px !important; font-size: 14px !important; }
}

/* Small mobile ≤480 */
@media (max-width: 480px) {
  :root {
    --t-display: clamp(40px, 13vw, 64px);
    --t-h1: clamp(32px, 10vw, 48px);
    --t-h2: clamp(24px, 8vw, 36px);
  }
  .pillar-grid { grid-template-columns: 1fr !important; }
  .stat-grid { grid-template-columns: 1fr 1fr !important; }
  .team-grid { grid-template-columns: 1fr !important; }
  .sustain-stats { grid-template-columns: 1fr !important; }
  .gallery-grid { grid-template-columns: 1fr !important; }
  .gallery-cell { grid-column: 1 / -1 !important; grid-row: auto !important; }
  .gallery-cell:first-child { grid-column: 1 / -1 !important; grid-row: span 2 !important; }
  .footer .footer-grid { grid-template-columns: 1fr !important; }
  .nav-logo img { height: 24px !important; }
}

/* Prevent horizontal overflow anywhere */
html, body { overflow-x: hidden; max-width: 100%; }

/* House symbol overlay variants (controlled by tweak) */
.house-overlay--off .house-deco { display: none; }
.house-overlay--soft .house-deco { opacity: 0.5; }
.house-overlay--strong .house-deco { opacity: 1; }

/* Marquee */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee { display: flex; gap: 64px; animation: marquee 40s linear infinite; width: max-content; }
.marquee-wrap { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }

/* Animated underline reveal for letters */
.split-letter { display: inline-block; }

/* Hide scrollbar on horizontal scroll */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

/* Page transition */
.page-fade {
  animation: pageFade 0.5s cubic-bezier(.2,.7,.2,1);
}
@keyframes pageFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
