:root {
  --theme-page: #f7f3ee;
  --theme-surface: #fffdfa;
  --theme-text: #1c191b;
  --theme-muted: #6f655f;
  --theme-line: rgba(28,25,27,.12);
}

/* Hero title stays on one line; JS reduces the size only when required. */
.hero-content {
  width: min(1240px, calc(100% - 36px));
}
.hero h1 {
  max-width: none !important;
  width: 100%;
  white-space: nowrap;
  overflow: visible;
  font-size: clamp(1.65rem, 4.15vw, 3.65rem);
  line-height: 1.08;
  letter-spacing: -.03em;
}
.hero-copy {
  max-width: 820px;
  font-size: clamp(.96rem, 1.25vw, 1.08rem);
}

/* Shared logo treatment for dark header variants: no white box, only a restrained warm glow. */
html[data-theme="hybrid"] .topbar,
html[data-theme="dark"] .topbar {
  position: sticky;
  isolation: isolate;
  overflow: hidden;
}
html[data-theme="hybrid"] .topbar::before,
html[data-theme="dark"] .topbar::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;
  width: min(430px, 48vw);
  height: 120px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: radial-gradient(ellipse at center,
    rgba(142,103,75,.34) 0%,
    rgba(104,75,57,.20) 36%,
    rgba(58,45,40,.08) 58%,
    transparent 76%);
}
html[data-theme="hybrid"] .topbar > *,
html[data-theme="dark"] .topbar > * { position: relative; z-index: 1; }
html[data-theme="hybrid"] .site-logo,
html[data-theme="dark"] .site-logo {
  filter: drop-shadow(0 1px 1px rgba(255,255,255,.16)) drop-shadow(0 0 10px rgba(155,105,67,.10)) !important;
}

/*
  LIGHT choice.
  Stored internally as "mixed" for backward compatibility: this is the former mixed theme
  that was preferred over the old all-light version.
*/
html[data-theme="mixed"] body {
  background: #f7f3ee;
  color: #1c191b;
}
html[data-theme="mixed"] .topbar {
  background: rgba(255,253,250,.97);
  color: #1c191b;
  border-bottom-color: rgba(123,74,36,.14);
}
html[data-theme="mixed"] .language-switch {
  background: #fffdfa;
  color: #1c191b;
  border-color: rgba(28,25,27,.22);
}
html[data-theme="mixed"] .hero {
  color: #fffaf5;
  background: linear-gradient(135deg, #1b1718, #35261d);
  border-bottom-color: rgba(123,74,36,.12);
}
html[data-theme="mixed"] .hero h1 { color: #fffaf5; }
html[data-theme="mixed"] .hero-copy { color: rgba(255,250,245,.82); }
html[data-theme="mixed"] .links-section {
  color: #1c191b;
  padding-top: 44px;
}
html[data-theme="mixed"] .section-heading h2 { color: #1c191b; }
html[data-theme="mixed"] .footer {
  background: #1c191b;
  color: rgba(255,255,255,.72);
  border-top-color: rgba(255,255,255,.07);
}
html[data-theme="mixed"] .footer-brand strong,
html[data-theme="mixed"] .footer p { color: #fffdfa; }
html[data-theme="mixed"] .footer-brand span { color: rgba(255,255,255,.56); }

/*
  NEW MIXED choice: darker than the light choice but not an all-dark site.
  Dark header/hero + compact dark section accent + warm light content area.
*/
html[data-theme="hybrid"] body {
  background: #eee7e0;
  color: #1c191b;
}
html[data-theme="hybrid"] .topbar {
  background: linear-gradient(90deg, #171416 0%, #211b19 34%, #2a211d 50%, #211b19 66%, #171416 100%);
  color: #fffaf5;
  border-bottom-color: rgba(255,255,255,.08);
  box-shadow: 0 8px 28px rgba(0,0,0,.14);
}
html[data-theme="hybrid"] .language-switch {
  background: rgba(255,255,255,.025);
  color: #fffaf5;
  border-color: rgba(255,255,255,.24);
}
html[data-theme="hybrid"] .language-switch:hover {
  border-color: #c79d79;
  color: #e4c2a4;
}
html[data-theme="hybrid"] .hero {
  color: #fffaf5;
  background: linear-gradient(135deg, #171315, #30231d);
  border-bottom-color: rgba(255,255,255,.07);
}
html[data-theme="hybrid"] .hero h1 { color: #fffaf5; }
html[data-theme="hybrid"] .hero-copy { color: rgba(255,250,245,.80); }
html[data-theme="hybrid"] .links-section {
  width: 100%;
  margin: 0;
  padding: 38px max(20px, calc((100vw - var(--max)) / 2)) 78px;
  color: #fffaf5;
  background: linear-gradient(180deg, #211c1d 0 112px, #eee7e0 112px 100%);
}
html[data-theme="hybrid"] .section-heading { margin-bottom: 22px; }
html[data-theme="hybrid"] .section-heading h2 { color: #fffaf5; }
html[data-theme="hybrid"] .section-heading .eyebrow { color: #d4a47d; }
html[data-theme="hybrid"] .card-grid {
  width: min(var(--max), 100%);
  margin-inline: auto;
}
html[data-theme="hybrid"] .link-card {
  box-shadow: 0 12px 32px rgba(31,24,21,.10);
}
html[data-theme="hybrid"] .link-card--dark {
  background: linear-gradient(145deg, #242022, #191617);
  color: #fffaf5;
}
html[data-theme="hybrid"] .link-card--bronze {
  background: linear-gradient(145deg, #d9c0ad, #c9aa91);
  color: #211b19;
}
html[data-theme="hybrid"] .link-card--sand {
  background: linear-gradient(145deg, #fffdfa, #eee5dd);
  color: #211b19;
}
html[data-theme="hybrid"] .footer {
  background: #151214;
  color: rgba(255,255,255,.70);
  border-top-color: rgba(255,255,255,.07);
}
html[data-theme="hybrid"] .footer-brand strong,
html[data-theme="hybrid"] .footer p { color: #fffaf5; }
html[data-theme="hybrid"] .footer-brand span { color: rgba(255,255,255,.54); }

/* DARK */
html[data-theme="dark"] body {
  background: #151214;
  color: #f7f2ed;
}
html[data-theme="dark"] .topbar {
  background: linear-gradient(90deg, #100e0f 0%, #171315 34%, #211a17 50%, #171315 66%, #100e0f 100%);
  color: #f7f2ed;
  border-bottom-color: rgba(255,255,255,.08);
  box-shadow: 0 8px 28px rgba(0,0,0,.22);
}
html[data-theme="dark"] .language-switch {
  background: rgba(255,255,255,.02);
  color: #f7f2ed;
  border-color: rgba(255,255,255,.25);
}
html[data-theme="dark"] .language-switch:hover {
  border-color: #c79d79;
  color: #e4c2a4;
}
html[data-theme="dark"] .hero {
  color: #fffaf5;
  background: linear-gradient(135deg, #171315, #2b211b);
  border-bottom-color: rgba(255,255,255,.08);
}
html[data-theme="dark"] .hero h1 { color: #fffaf5; }
html[data-theme="dark"] .hero-copy { color: rgba(255,250,245,.78); }
html[data-theme="dark"] .links-section {
  color: #fffaf5;
  padding-top: 44px;
  background: linear-gradient(180deg, #151214, #181416);
}
html[data-theme="dark"] .section-heading h2 { color: #fffaf5; }
html[data-theme="dark"] .link-card,
html[data-theme="dark"] .link-card--dark,
html[data-theme="dark"] .link-card--bronze,
html[data-theme="dark"] .link-card--sand {
  background: linear-gradient(145deg, #221d1f, #191617);
  color: #fffaf5;
  border-color: rgba(255,255,255,.10);
  box-shadow: 0 12px 34px rgba(0,0,0,.20);
}
html[data-theme="dark"] .link-card--bronze {
  background: linear-gradient(145deg, #4a3324, #2d241f);
}
html[data-theme="dark"] .link-card--sand {
  background: linear-gradient(145deg, #342d2a, #211d1e);
}
html[data-theme="dark"] .link-card .card-copy p { color: rgba(255,250,245,.68); }
html[data-theme="dark"] .link-card .card-footer { color: #d7aa83; }
html[data-theme="dark"] .link-card .card-icon {
  color: #d7aa83;
  background: rgba(255,255,255,.06);
  border-color: rgba(215,170,131,.46);
}
html[data-theme="dark"] .modal {
  background: #211d1f;
  color: #fffaf5;
  border-color: rgba(255,255,255,.10);
}
html[data-theme="dark"] .option-item {
  background: #2a2426;
  color: #fffaf5;
  border-color: rgba(255,255,255,.09);
}
html[data-theme="dark"] .option-item:hover { background: #352c2e; }
html[data-theme="dark"] .option-text span { color: rgba(255,250,245,.64); }
html[data-theme="dark"] .icon-button {
  background: #2a2426;
  color: #fffaf5;
  border-color: rgba(255,255,255,.12);
}
html[data-theme="dark"] .footer {
  background: #100e0f;
  color: rgba(255,255,255,.70);
  border-top-color: rgba(255,255,255,.07);
}

@media (max-width: 620px) {
  .hero-content { width: calc(100% - 22px); padding-inline: 0; }
  .hero h1 { font-size: 1.8rem; }
  .hero-copy { max-width: 94%; line-height: 1.65; }
  html[data-theme="hybrid"] .links-section {
    padding: 32px 13px 58px;
    background: linear-gradient(180deg, #211c1d 0 102px, #eee7e0 102px 100%);
  }
  html[data-theme="hybrid"] .topbar::before,
  html[data-theme="dark"] .topbar::before {
    width: min(300px, 70vw);
    height: 100px;
  }
}
