@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=DM+Sans:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700&family=Source+Sans+3:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root[data-site-font="editorial"] {
  --site-font-display: 'Fraunces', Georgia, serif;
  --site-font-body: 'DM Sans', sans-serif;
}
:root[data-site-font="geometric"] {
  --site-font-display: 'Space Grotesk', sans-serif;
  --site-font-body: 'Space Grotesk', sans-serif;
}
:root[data-site-font="humanist"] {
  --site-font-display: 'Manrope', sans-serif;
  --site-font-body: 'Source Sans 3', sans-serif;
}
:root[data-site-font="classic"] {
  --site-font-display: 'Cormorant Garamond', Georgia, serif;
  --site-font-body: 'IBM Plex Sans', sans-serif;
}
:root[data-site-font="technical"] {
  --site-font-display: 'IBM Plex Mono', monospace;
  --site-font-body: 'IBM Plex Mono', monospace;
}
:root[data-site-font] body {
  font-family: var(--site-font-body) !important;
}
:root[data-site-font] :is(h1, h2, h3, h4, .brand, .wordmark, .mark, .site-title, .reference-wordmark, .reference-hero-message) {
  font-family: var(--site-font-display) !important;
}
:root[data-site-font] :is(nav, button, input, textarea, select) {
  font-family: var(--site-font-body) !important;
}

:root[data-site-palette="rose"] {
  --palette-bg: #fff2ef;
  --palette-surface: #f1d8d6;
  --palette-primary: #bb4d63;
  --palette-deep: #402431;
  --palette-accent: #e4a23a;
  --palette-muted: #75515a;
  --palette-border: rgba(64, 36, 49, .24);
  --palette-on-deep: #fff8f3;
}
:root[data-site-palette="sage"] {
  --palette-bg: #f1f6ed;
  --palette-surface: #d5e3d3;
  --palette-primary: #4f785d;
  --palette-deep: #23372b;
  --palette-accent: #d18d44;
  --palette-muted: #526b58;
  --palette-border: rgba(35, 55, 43, .22);
  --palette-on-deep: #f5f8ef;
}
:root[data-site-palette="coast"] {
  --palette-bg: #eff7fa;
  --palette-surface: #c8e4ea;
  --palette-primary: #167b8a;
  --palette-deep: #163a4c;
  --palette-accent: #ef785d;
  --palette-muted: #426775;
  --palette-border: rgba(22, 58, 76, .22);
  --palette-on-deep: #f5fbfd;
}
:root[data-site-palette="clay"] {
  --palette-bg: #fbf1e7;
  --palette-surface: #e5c5a8;
  --palette-primary: #b85838;
  --palette-deep: #3a2924;
  --palette-accent: #526f8d;
  --palette-muted: #765849;
  --palette-border: rgba(58, 41, 36, .23);
  --palette-on-deep: #fff8f0;
}
:root[data-site-palette="festival"] {
  --palette-bg: #fff7d6;
  --palette-surface: #ffd052;
  --palette-primary: #e23968;
  --palette-deep: #3d1c68;
  --palette-accent: #218b76;
  --palette-muted: #68447c;
  --palette-border: rgba(61, 28, 104, .24);
  --palette-on-deep: #fff9e8;
}

:root[data-site-palette] {
  --ink: var(--palette-deep);
  --text: var(--palette-deep);
  --charcoal: var(--palette-deep);
  --night: var(--palette-deep);
  --pine: var(--palette-deep);
  --deep: var(--palette-deep);
  --paper: var(--palette-bg);
  --cream: var(--palette-surface);
  --white: var(--palette-surface);
  --paper-soft: var(--palette-surface);
  --sand: var(--palette-surface);
  --mist: var(--palette-surface);
  --muted: var(--palette-muted);
  --grey: var(--palette-muted);
  --line: var(--palette-border);
  --accent: var(--palette-primary);
  --primary: var(--palette-primary);
  --rose: var(--palette-primary);
  --rose-deep: var(--palette-primary);
  --rust: var(--palette-primary);
  --coral: var(--palette-primary);
  --red: var(--palette-primary);
  --blue: var(--palette-accent);
  --gold: var(--palette-accent);
  --acid: var(--palette-accent);
  --orange: var(--palette-accent);
  --lime: var(--palette-accent);
  --sage: var(--palette-primary);
  --green: var(--palette-primary);
  --fern: var(--palette-primary);
  --leaf: var(--palette-surface);
  --olive: var(--palette-primary);
  --moss: var(--palette-muted);
  --plum: var(--palette-deep);
  --clay: var(--palette-surface);
}

:root[data-site-palette] body {
  background-color: var(--palette-bg) !important;
  color: var(--palette-deep) !important;
}
:root[data-site-palette] :is(.site-header, .masthead, .rail, .page-top, .topline, .site-nav.open) {
  background-color: var(--palette-surface) !important;
  border-color: var(--palette-border) !important;
  color: var(--palette-deep) !important;
}
:root[data-site-palette] :is(.hero, .hero-section, .page-hero, .page-intro, .page-heading, .inner-intro, .intro-hero) {
  background-color: var(--palette-surface) !important;
  color: var(--palette-deep) !important;
}
:root[data-site-palette] :is(.cta, .manifesto, .contact-card, .feature, .band-moss, .band-rust, .chapter-strip) {
  background-color: var(--palette-deep) !important;
  color: var(--palette-on-deep) !important;
}
:root[data-site-palette] :is(.cta, .manifesto, .contact-card, .feature, .band-moss, .band-rust, .chapter-strip) :is(h1, h2, h3, p, a, span, small, strong, em) {
  color: var(--palette-on-deep) !important;
}
:root[data-site-palette] :is(.site-footer, .footer, .reference-footer) {
  background-color: var(--palette-deep) !important;
  border-color: var(--palette-border) !important;
  color: var(--palette-on-deep) !important;
}
:root[data-site-palette] :is(.brand-mark, .accent-square) {
  background-color: var(--palette-primary) !important;
  color: var(--palette-on-deep) !important;
}
:root[data-site-palette] :is(.eyebrow, .kicker, .section-label, .text-link, .arrow-link, .site-nav a:hover, .site-nav a.active, .nav a:hover, .nav a.active, h1 em, h2 em) {
  color: var(--palette-primary) !important;
}
:root[data-site-palette] :is(.button, .solid-button, .submit-button, .nav-submit, .cta-button, .primary-button, [type="submit"]) {
  background-color: var(--palette-primary) !important;
  border-color: var(--palette-primary) !important;
  color: var(--palette-on-deep) !important;
}
:root[data-site-palette] :is(input, textarea, select, .contact-form, .contact-map, .modulux-map) {
  border-color: var(--palette-border) !important;
}

.site-palette-trigger {
  position: fixed;
  z-index: 1000;
  right: 18px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid #362b31;
  border-radius: 2px;
  background: #fffaf6;
  color: #362b31;
  box-shadow: 0 3px 12px #211e1d26;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .04em;
  cursor: pointer;
}
.site-palette-trigger:hover, .site-palette-trigger:focus-visible {
  background: #362b31;
  color: #fffaf6;
}
.site-palette-trigger span { font-size: 17px; }
.site-palette-dialog {
  width: min(620px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 0;
  border: 1px solid #d8cec8;
  background: #fffaf6;
  color: #30292d;
  font: 14px/1.45 'DM Sans', 'Segoe UI', sans-serif;
  box-shadow: 0 24px 80px #211e1d40;
}
.site-palette-dialog::backdrop { background: #201820a8; }
.site-palette-form { padding: 26px; }
.site-palette-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.site-palette-heading span, .site-palette-dialog legend {
  color: #74646a;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.site-palette-heading h2 { margin: 5px 0 0; color: #30292d; font: 600 25px/1.15 'DM Sans', 'Segoe UI', sans-serif; }
.site-palette-close { border: 0; background: transparent; color: #30292d; font-size: 27px; line-height: 1; cursor: pointer; }
.site-palette-dialog fieldset { margin: 0 0 22px; padding: 0; border: 0; }
.site-palette-dialog legend { margin-bottom: 10px; }
.site-palette-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 9px; }
.site-palette-original-preview { display: grid; min-height: 34px; place-items: center; border: 1px dashed #a99ca0; color: #74646a; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.site-font-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 9px; }
.site-palette-option { position: relative; display: grid; gap: 8px; min-width: 0; padding: 9px; border: 1px solid #ded4ce; color: #30292d; font-size: 11px; cursor: pointer; }
.site-font-option { position: relative; display: grid; gap: 8px; min-width: 0; padding: 9px; border: 1px solid #ded4ce; color: #30292d; font-size: 11px; cursor: pointer; }
.site-palette-option:has(input:checked) { border-color: #624953; box-shadow: inset 0 0 0 1px #624953; }
.site-font-option:has(input:checked) { border-color: #624953; box-shadow: inset 0 0 0 1px #624953; }
.site-palette-option input { position: absolute; inset: 0; width: auto; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.site-font-option input { position: absolute; inset: 0; width: auto; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.site-palette-option input:focus-visible + .site-palette-swatches { outline: 2px solid #624953; outline-offset: 2px; }
.site-font-option input:focus-visible ~ .site-font-sample { outline: 2px solid #624953; outline-offset: 2px; }
.site-palette-swatches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 7px; }
.site-palette-swatch { display: flex; align-items: center; gap: 5px; min-width: 0; }
.site-palette-swatch i { width: 13px; height: 13px; flex: none; background: var(--swatch); }
.site-palette-swatch small { color: #50474a; font: 8px/1 'IBM Plex Mono', Consolas, monospace; white-space: nowrap; }
.site-font-sample { display: block; min-height: 34px; font-size: 25px; line-height: 1.25; }
.site-font-editorial { font-family: 'Fraunces', Georgia, serif; }
.site-font-geometric { font-family: 'Space Grotesk', sans-serif; }
.site-font-humanist { font-family: 'Manrope', sans-serif; }
.site-font-classic { font-family: 'Cormorant Garamond', Georgia, serif; }
.site-font-technical { font-family: 'IBM Plex Mono', monospace; }
.site-font-original { font-family: Georgia, serif; }
.site-palette-done { width: 100%; min-height: 43px; border: 0; background: #362b31; color: #fffaf6; font: 600 11px 'DM Sans', 'Segoe UI', sans-serif; cursor: pointer; }
.site-palette-done:hover { background: #624953; }
@media (max-width: 520px) {
  .site-palette-trigger { right: 12px; bottom: 76px; }
  .site-palette-form { padding: 20px 17px; }
  .site-palette-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-palette-swatch { gap: 4px; }
  .site-palette-swatch small { font-size: 7px; }
}

/* ── Studio Matrx legibility pass (appended on import) ─────────────────────── */
h1, h2, h3, h4,
.wordmark, .brand, .mark, .site-title, .reference-hero-message, .hero-message {
  letter-spacing: normal !important;
  line-height: 1.06 !important;
}
h1 { line-height: 1.0 !important; }
p, li, blockquote, .intro, .hero-intro, .large-copy { line-height: 1.5 !important; }
