/* ==========================================================================
   ModMax — Shared Stylesheet
   Brand palette from ModMax_Brand Guide Sheet_vF
   Type: Instrument Serif (display) + Geist (UI/body) as Söhne stand-in
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital,wght@0,400;1,400&family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

:root {
  /* Brand colors — exact from guide */
  --larch-brown: #B26646;       /* Primary */
  --redwood: #CB4037;           /* Secondary */
  --yellow-pine: #C6A34B;       /* Secondary */
  --pine-green: #215C4D;        /* Secondary */
  --snow-white: #FFFFFF;        /* Neutral */
  --platinum-gray: #E6E5E2;     /* Neutral */
  --charred-fir: #291D21;       /* Dark neutral */

  /* Derived tones */
  --cream: #F4EFE7;             /* warm off-white for hero/section bg */
  --bone: #ECE6DA;
  --charred-fir-90: #3a2c30;
  --charred-fir-80: #4a3c40;
  --muted: #8a7a78;
  --line: rgba(41, 29, 33, 0.12);
  --line-light: rgba(255, 255, 255, 0.14);

  /* Type stack */
  --font-display: 'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Geist', 'Söhne', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', 'IBM Plex Mono', ui-monospace, monospace;

  /* Layout */
  --max: 1440px;
  --pad-x: clamp(20px, 4vw, 56px);
  --radius: 4px;
  --header-h: 92px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--charred-fir);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  font-size: 16px;
}

img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

/* ============== Type ============== */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--larch-brown);
}
.eyebrow.on-dark { color: var(--yellow-pine); }
.eyebrow.muted { color: var(--muted); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.display {
  font-family: var(--font-display);
  font-size: clamp(56px, 9vw, 148px);
  line-height: 0.95;
  letter-spacing: -0.025em;
}
.display em { font-style: italic; color: var(--larch-brown); }

.h1 { font-family: var(--font-display); font-size: clamp(44px, 6.5vw, 96px); line-height: 0.98; letter-spacing: -0.02em; }
.h2 { font-family: var(--font-display); font-size: clamp(36px, 4.5vw, 64px); line-height: 1.04; letter-spacing: -0.015em; }
.h3 { font-family: var(--font-display); font-size: clamp(26px, 2.4vw, 36px); line-height: 1.1; }
.h4 { font-family: var(--font-sans); font-size: 18px; line-height: 1.3; font-weight: 500; letter-spacing: -0.005em; }

.lede {
  font-size: clamp(17px, 1.3vw, 20px);
  line-height: 1.5;
  color: var(--charred-fir-90);
  max-width: 62ch;
}
.body { font-size: 15.5px; line-height: 1.65; color: var(--charred-fir-90); max-width: 62ch; }
.small { font-size: 13px; line-height: 1.55; color: var(--muted); }

/* ============== Header / Nav ============== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 300;
  background: rgba(244, 239, 231, 0.85);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header.on-dark { background: rgba(41, 29, 33, 0.6); border-bottom-color: var(--line-light); }
.nav-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(16px, 2.5vw, 40px);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.brand svg { height: 36px; width: auto; }
.brand .logo-color { fill: var(--charred-fir); }
.on-dark .brand .logo-color { fill: var(--snow-white); }

.nav-links {
  display: flex; align-items: center; gap: 2px;
  list-style: none;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.nav-links li { position: relative; }
.nav-links li.has-dropdown > a { display: inline-flex; align-items: center; gap: 6px; }
.nav-links .caret { opacity: 0.6; transition: transform 0.2s; }
.nav-links li.has-dropdown:hover .caret { transform: rotate(180deg); }
.nav-links .dropdown {
  position: absolute;
  top: 100%; left: 0;
  min-width: 200px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(41,29,33,0.14);
  padding: 8px;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
  z-index: 60;
}
.on-dark .nav-links .dropdown {
  background: var(--charred-fir-90);
  border-color: rgba(255,255,255,0.1);
}
.nav-links li.has-dropdown:hover .dropdown,
.nav-links li.has-dropdown:focus-within .dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-links .dropdown a {
  display: block;
  padding: 10px 14px;
  font-size: 13.5px;
  border-radius: 6px;
  color: var(--charred-fir-90);
}
.on-dark .nav-links .dropdown { background: var(--charred-fir); }
.on-dark .nav-links .dropdown a { color: var(--cream); }
.on-dark .nav-links .dropdown a:hover { background: rgba(244,239,231,0.12); color: var(--snow-white); }
.nav-links .dropdown a:hover {
  background: rgba(178,102,70,0.1);
  color: var(--larch-brown);
}
.on-dark .nav-links .dropdown a:hover {
  background: rgba(255,255,255,0.08);
  color: var(--yellow-pine);
}
.nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--charred-fir-90);
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.on-dark .nav-links a { color: rgba(255,255,255,0.78); }
.nav-links a:hover { background: rgba(41, 29, 33, 0.06); color: var(--charred-fir); }
.on-dark .nav-links a:hover { background: rgba(255,255,255,0.08); color: white; }
.nav-links a.is-active {
  color: var(--charred-fir);
  background: rgba(41, 29, 33, 0.06);
}
.on-dark .nav-links a.is-active { color: white; background: rgba(255,255,255,0.1); }

.nav-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px;
  background: var(--charred-fir);
  color: var(--snow-white);
  border-radius: 999px;
  font-size: 13.5px; font-weight: 500;
  transition: background 0.2s, transform 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.on-dark .nav-cta { background: var(--snow-white); color: var(--charred-fir); }
.nav-cta:hover { background: var(--larch-brown); }
.on-dark .nav-cta:hover { background: var(--yellow-pine); }

.nav-portal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 999px;
  background: transparent;
  color: var(--charred-fir);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
  margin-left: 6px;
  position: relative;
}
.nav-portal::after {
  content: '';
  position: absolute;
  top: 8px; right: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--yellow-pine);
  box-shadow: 0 0 0 2px var(--cream);
}
.on-dark .nav-portal { color: var(--snow-white); border-color: var(--line-light); }
.on-dark .nav-portal::after { box-shadow: 0 0 0 2px var(--charred-fir); }
.nav-portal:hover {
  background: var(--charred-fir);
  color: var(--snow-white);
  border-color: var(--charred-fir);
  transform: translateY(-1px);
}
.on-dark .nav-portal:hover {
  background: var(--snow-white);
  color: var(--charred-fir);
  border-color: var(--snow-white);
}

.menu-toggle { display: none; }

/* Header right cluster */
.nav-right {
  display: flex; align-items: center; gap: 14px;
}
.nav-phone {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--charred-fir);
  padding: 8px 12px;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}
.nav-phone:hover { color: var(--larch-brown); background: rgba(41,29,33,0.04); }
.on-dark .nav-phone { color: rgba(255,255,255,0.85); }
.on-dark .nav-phone:hover { color: var(--yellow-pine); background: rgba(255,255,255,0.06); }

.nav-social {
  display: flex; align-items: center; gap: 2px;
  list-style: none;
  padding: 0 4px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  margin: 0 2px;
}
.on-dark .nav-social { border-color: var(--line-light); }
.nav-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  color: var(--charred-fir-90);
  transition: background 0.2s, color 0.2s;
}
.nav-social a:hover { background: var(--larch-brown); color: var(--snow-white); }
.on-dark .nav-social a { color: rgba(255,255,255,0.78); }
.on-dark .nav-social a:hover { background: var(--yellow-pine); color: var(--charred-fir); }

@media (max-width: 1280px) { .nav-social { display: none; } }
@media (max-width: 1180px) { .nav-phone { display: none; } }
@media (max-width: 1040px) { .nav-social { display: none; } }

/* Footer phone + social */
.footer-contact { margin-top: 22px; }
.footer-phone {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.01em;
  color: var(--snow-white);
  transition: color 0.2s;
}
.footer-phone:hover { color: var(--yellow-pine); }
.footer-phone svg { color: var(--yellow-pine); }

.footer-social {
  display: flex; gap: 8px;
  list-style: none;
  margin-top: 22px;
}
.footer-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.footer-social a:hover {
  background: var(--larch-brown);
  color: var(--snow-white);
  transform: translateY(-2px);
}

/* ============== Buttons ============== */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: all 0.25s ease;
  cursor: pointer;
}
.btn-primary { background: var(--charred-fir); color: var(--snow-white); }
.btn-primary:hover { background: var(--larch-brown); transform: translateY(-1px); }
.btn-light { background: var(--snow-white); color: var(--charred-fir); }
.btn-light:hover { background: var(--platinum-gray); }
.btn-ghost { background: transparent; color: var(--charred-fir); border: 1px solid var(--line); }
.btn-ghost:hover { background: rgba(41,29,33,0.04); border-color: var(--charred-fir); }
.btn-ghost.on-dark { color: var(--snow-white); border-color: var(--line-light); }
.btn-ghost.on-dark:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.4); }

.btn-arrow { transition: transform 0.2s; }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ============== Sections ============== */
section {
  padding: clamp(60px, 9vw, 120px) var(--pad-x);
}
.section-inner { max-width: var(--max); margin: 0 auto; }

.section-light { background: var(--cream); color: var(--charred-fir); }
.section-bone { background: var(--bone); color: var(--charred-fir); }
.section-dark { background: var(--charred-fir); color: var(--snow-white); }
.section-dark .body { color: rgba(255,255,255,0.78); }
.section-dark .lede { color: rgba(255,255,255,0.85); }
.section-dark .small { color: rgba(255,255,255,0.55); }
.section-dark .eyebrow { color: var(--yellow-pine); }

.section-pine { background: var(--pine-green); color: var(--snow-white); }
.section-pine .body, .section-pine .lede { color: rgba(255,255,255,0.86); }
.section-pine .eyebrow { color: var(--yellow-pine); }

/* Section header pattern */
.section-head {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(32px, 5vw, 96px);
  align-items: end;
  margin-bottom: clamp(40px, 5vw, 72px);
}
@media (max-width: 760px) { .section-head { grid-template-columns: 1fr; align-items: start; } }
.section-head .eyebrow { margin-bottom: 16px; display: block; }

/* ============== Footer ============== */
.site-footer {
  background: var(--charred-fir);
  color: rgba(255,255,255,0.75);
  padding: 80px var(--pad-x) 32px;
}
.site-footer .footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
@media (max-width: 880px) { .site-footer .footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .site-footer .footer-inner { grid-template-columns: 1fr; } }
.site-footer .brand svg { height: 28px; }
.site-footer .brand .logo-color { fill: var(--snow-white); }
.footer-tag { margin-top: 18px; max-width: 38ch; color: rgba(255,255,255,0.6); font-size: 14px; line-height: 1.55; }
.footer-col h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--yellow-pine);
  margin-bottom: 18px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: rgba(255,255,255,0.75); font-size: 14px; transition: color 0.2s; }
.footer-col a:hover { color: var(--snow-white); }
.footer-bottom {
  max-width: var(--max);
  margin: 0 auto;
  padding-top: 28px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.45);
  flex-wrap: wrap;
  gap: 16px;
}

/* ============== Decorative tokens ============== */
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: rgba(178, 102, 70, 0.12);
  color: var(--larch-brown);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.tag.dark { background: rgba(255,255,255,0.1); color: var(--yellow-pine); }
.tag.green { background: rgba(33, 92, 77, 0.12); color: var(--pine-green); }
.tag.red { background: rgba(203, 64, 55, 0.12); color: var(--redwood); }

.divider-rule {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}
.divider-rule::before,
.divider-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.section-dark .divider-rule { color: rgba(255,255,255,0.5); }
.section-dark .divider-rule::before,
.section-dark .divider-rule::after { background: rgba(255,255,255,0.15); }

/* Marquee */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  background: var(--bone);
}
.marquee-track {
  display: flex; gap: 56px;
  white-space: nowrap;
  animation: marquee 50s linear infinite;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--charred-fir-90);
}
.marquee-track span { display: inline-flex; align-items: center; gap: 56px; }
.marquee-track span::after {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--larch-brown);
  opacity: 0.7;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============== Mobile nav ============== */
@media (max-width: 1100px) {
  .nav-links, .nav-cta, .nav-right { display: none; }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--charred-fir);
    color: var(--snow-white);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
  }
  .on-dark .menu-toggle { background: var(--snow-white); color: var(--charred-fir); }
}

/* ============== Utilities ============== */
.row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grow { flex: 1; }
.center { text-align: center; }

/* Subtle reveal */
.fade-up { opacity: 0; transform: translateY(20px); transition: opacity 0.7s ease, transform 0.7s ease; }
.fade-up.in { opacity: 1; transform: translateY(0); }

/* Link with hover underline */
.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500;
  color: var(--charred-fir);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.2s, gap 0.2s;
}
.link-arrow:hover { border-color: var(--larch-brown); gap: 12px; color: var(--larch-brown); }
.section-dark .link-arrow { color: var(--snow-white); }
.section-dark .link-arrow:hover { color: var(--yellow-pine); border-color: var(--yellow-pine); }

/* Image placeholder pattern */
.img-placeholder {
  background-color: var(--bone);
  background-image: repeating-linear-gradient(
    45deg,
    rgba(41,29,33,0.04) 0,
    rgba(41,29,33,0.04) 8px,
    transparent 8px,
    transparent 16px
  );
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  border-radius: var(--radius);
}
.img-placeholder.dark {
  background-color: var(--charred-fir-90);
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.04) 0,
    rgba(255,255,255,0.04) 8px,
    transparent 8px,
    transparent 16px
  );
  color: rgba(255,255,255,0.4);
}

/* image-slot custom styling */
image-slot {
  --is-bg: var(--bone);
  --is-color: var(--muted);
  --is-border: 1px dashed rgba(41,29,33,0.2);
}
.section-dark image-slot {
  --is-bg: rgba(255,255,255,0.04);
  --is-color: rgba(255,255,255,0.5);
  --is-border: 1px dashed rgba(255,255,255,0.18);
}
/* Let a touch that starts on a filled photo still scroll the page vertically
   (the component sets touch-action:none on the image for its reframe drag,
   which otherwise "hangs" scrolling on mobile). */
image-slot::part(image) { touch-action: pan-y; }
