/* ───────────────────────────────────────────────────────────────────────────
   Teaching Union Match — design tokens + base styles.
   Palette: warmer plum (brief Palette 2). Accent: coral.
   Type: editorial serif (Source Serif 4) + humanist sans (Public Sans).
   ─────────────────────────────────────────────────────────────────────────── */

:root {
  --c-primary:         #6E3B7E;
  --c-primary-dark:    #5D316C;
  --c-primary-deeper:  #3D2049;
  --c-secondary:       #B89AC9;
  --c-secondary-soft:  #E4D5EC;
  --c-background:      #FCF8FD;
  --c-background-2:    #F5EDF6;
  --c-surface:         #FFFFFF;
  --c-text:            #332733;
  --c-text-muted:      #6B6171;
  --c-text-subtle:     #8E8292;
  --c-accent:          #E07A5F;
  --c-accent-hover:    #C9654C;
  --c-accent-soft:     #FBE8E0;
  --c-border:          #E6D8EE;
  --c-border-strong:   #D9C8E2;
  --c-success:         #2F7D57;
  --c-warning:         #B7791F;

  --f-serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --f-sans:  "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 22px;

  --shadow-sm: 0 1px 2px rgba(61,32,73,.06), 0 1px 3px rgba(61,32,73,.05);
  --shadow-md: 0 4px 12px rgba(61,32,73,.08), 0 1px 3px rgba(61,32,73,.05);
  --shadow-lg: 0 18px 40px -12px rgba(61,32,73,.22), 0 2px 6px rgba(61,32,73,.08);

  --maxw: 1180px;
  --maxw-narrow: 780px;
}

/* Font theme swaps — set via html[data-font="..."] from Tweaks */
html[data-font="editorial"] {
  --f-serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --f-sans:  "Public Sans", system-ui, -apple-system, sans-serif;
}
html[data-font="modern"] {
  --f-serif: "Fraunces", "Source Serif 4", Georgia, serif;
  --f-sans:  "Inter", system-ui, -apple-system, sans-serif;
}
html[data-font="classic"] {
  --f-serif: "Lora", "Source Serif 4", Georgia, serif;
  --f-sans:  "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
}
html[data-font="contemporary"] {
  --f-serif: "Newsreader", "Source Serif 4", Georgia, serif;
  --f-sans:  "IBM Plex Sans", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { overflow-x: clip; }
body {
  font-family: var(--f-sans);
  color: var(--c-text);
  background: var(--c-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  line-height: 1.55;
  font-size: 16px;
  overflow-x: clip;
}

h1, h2, h3, h4 { font-family: var(--f-serif); font-weight: 500; color: var(--c-text); letter-spacing: -0.01em; margin: 0; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(40px, 5.2vw, 68px); font-weight: 400; line-height: 1.05; }
h2 { font-size: clamp(30px, 3.4vw, 44px); font-weight: 400; }
h3 { font-size: clamp(22px, 2vw, 28px); font-weight: 500; }
h4 { font-size: 18px; font-weight: 600; letter-spacing: 0; }
p  { margin: 0; color: var(--c-text); text-wrap: pretty; }

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout helpers ─────────────────────────────────────────── */
.wrap       { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
.wrap-narrow{ max-width: var(--maxw-narrow); margin: 0 auto; padding: 0 32px; }
.section    { padding: 96px 0; }
.section-sm { padding: 56px 0; }

.eyebrow {
  font-family: var(--f-sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 22px; height: 1px;
  background: var(--c-primary);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--f-sans);
  font-weight: 600;
  font-size: 15px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease, color .15s ease;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--c-accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(224,122,95,.3), 0 6px 14px -6px rgba(224,122,95,.55);
}
.btn-primary:hover { background: var(--c-accent-hover); color: #fff; }
/* Ensure primary buttons keep white text even inside nav/footer where `a` rules could win */
.nav a.btn-primary,
.site-footer a.btn-primary,
.hero-ctas a.btn-primary,
.cta-band-inner a.btn-primary,
.sticky-cta a.btn-primary { color: #fff; }
.nav a.btn-primary:hover,
.site-footer a.btn-primary:hover,
.hero-ctas a.btn-primary:hover,
.cta-band-inner a.btn-primary:hover,
.sticky-cta a.btn-primary:hover { color: #fff; }

.btn-secondary {
  background: var(--c-surface);
  color: var(--c-primary);
  border-color: var(--c-border-strong);
}
.btn-secondary:hover { border-color: var(--c-primary); background: var(--c-background-2); }

.btn-ghost {
  background: transparent;
  color: var(--c-text-muted);
  padding: 10px 14px;
}
.btn-ghost:hover { color: var(--c-primary); }

.btn-lg { padding: 18px 30px; font-size: 16px; }

/* ── Chips / tags / badges ─────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--c-background-2);
  color: var(--c-primary);
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--c-border);
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.tag {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--c-text-muted);
  text-transform: uppercase;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

/* ── Header / nav ───────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(252,248,253,.85);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--c-border);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 120px; position: relative; }
.brand {
  display: inline-flex; align-items: center;
  text-decoration: none;
  color: var(--c-text);
  line-height: 1;
}
.brand:hover { text-decoration: none; }
.brand img.wtu-logo { height: 100px; width: auto; display: block; }
.site-footer .brand img.wtu-logo { height: 110px; width: auto; filter: brightness(0) invert(1); opacity: .95; }

/* Modern lockup: three-shield mark + sans wordmark */
.brand-home { display: inline-flex; align-items: center; gap: 16px; }
.brand-home .wtu-mark { height: 60px; width: auto; display: block; flex-shrink: 0; }
.brand-home .wtu-wordmark-modern {
  font-family: var(--f-sans, "Public Sans", system-ui, sans-serif);
  font-size: 28px; line-height: 1;
  color: var(--c-primary);
  letter-spacing: -0.018em;
  font-weight: 500;
  white-space: nowrap;
}
.brand-home .wtu-wordmark-modern .wtu-which {
  font-weight: 800;
  letter-spacing: -0.025em;
}

/* Footer variant: white on purple bg */
.site-footer .wtu-mark-footer { height: 52px; filter: brightness(0) invert(1); opacity: .95; }
.site-footer .wtu-wordmark-footer { color: #fff; }

@media (max-width: 560px) {
  .brand img.wtu-logo { height: 72px; }
  .site-header .wrap { height: 78px; }
  .brand-home .wtu-mark { height: 44px; }
  .brand-home .wtu-wordmark-modern { font-size: 20px; }
  .brand-home { gap: 12px; }
}
.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  padding: 10px 14px; border-radius: 10px;
  color: var(--c-text-muted); font-size: 14.5px; font-weight: 500;
}
.nav a:hover { background: var(--c-background-2); color: var(--c-primary); text-decoration: none; }
.nav a.active { color: var(--c-primary); }
.nav a.active::after {
  content: ""; display: block; height: 2px; width: 22px;
  background: var(--c-accent); border-radius: 2px; margin: 4px auto -2px;
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: #2A1A33;
  color: #E4D5EC;
  margin-top: 80px;
  padding: 64px 0 32px;
  font-size: 14px;
}
.site-footer a { color: #F0E4F6; }
.site-footer .footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 48px;
  margin-bottom: 40px;
}
.site-footer h4 { color: #fff; font-family: var(--f-sans); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.site-footer .tagline { color: #B89AC9; max-width: 320px; line-height: 1.6; }
.site-footer .legal { border-top: 1px solid rgba(255,255,255,.08); padding-top: 24px; color: #9888A0; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; font-size: 12.5px; }

/* ── Sticky quiz bar (homepage extra) ───────────────────────── */
.sticky-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--c-primary);
  color: #fff;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: center; gap: 18px;
  box-shadow: 0 -8px 24px -8px rgba(61,32,73,.4);
  transform: translateY(120%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  font-size: 14.5px;
}
.sticky-bar.show { transform: translateY(0); }
.sticky-bar .btn-primary { box-shadow: none; }
.sticky-bar .close {
  background: transparent; border: none; color: rgba(255,255,255,.55);
  cursor: pointer; font-size: 20px; padding: 4px 10px; margin-left: 8px;
}
.sticky-bar .close:hover { color: #fff; }

/* ── Utility ───────────────────────────────────────────────── */
.muted { color: var(--c-text-muted); }
.subtle { color: var(--c-text-subtle); }
.mono { font-family: var(--f-mono); }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }

/* ── Abstract decorative shapes (imagery direction: abstract only) ── */
.shape-ring {
  position: absolute; border-radius: 50%;
  border: 1px solid var(--c-border);
  pointer-events: none;
}
.shape-disc {
  position: absolute; border-radius: 50%;
  background: var(--c-secondary-soft);
  pointer-events: none;
}
.shape-wash {
  position: absolute; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(184,154,201,.35), rgba(184,154,201,0));
  pointer-events: none;
}

/* ── Mobile nav (hamburger + drawer) ─────────────────────── */
.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border-radius: 10px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.nav-toggle:hover { background: var(--c-background-2); border-color: var(--c-border-strong); }
.nav-toggle svg { display: block; }

.nav-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(42, 26, 51, 0.45);
  z-index: 25;
  opacity: 0;
  transition: opacity .25s ease;
}
.nav-backdrop.open { display: block; opacity: 1; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 880px) {
  .section { padding: 56px 0; }
  .section-sm { padding: 40px 0; }
  .wrap, .wrap-narrow { padding: 0 20px; }
  .site-header .wrap { height: 64px; }

  /* backdrop-filter on the header establishes a containing block that would
     trap the position:fixed drawer + backdrop inside the header box. Disable
     it on mobile so the drawer and backdrop fill the whole viewport. */
  .site-header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: var(--c-surface);
  }

  /* Hamburger replaces full nav */
  .nav-toggle { display: inline-flex; }

  /* Slide-in drawer */
  .nav {
    display: flex !important;
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(320px, 84vw);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 80px 20px 28px;
    background: var(--c-surface);
    box-shadow: -16px 0 40px -12px rgba(61,32,73,.25);
    z-index: 30;
    transform: translateX(110%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
    visibility: hidden;
    pointer-events: none;
  }
  .nav.open { transform: translateX(0); visibility: visible; pointer-events: auto; }
  .nav a {
    padding: 14px 16px;
    font-size: 16px;
    border-radius: 10px;
    color: var(--c-text);
  }
  .nav a.active {
    color: var(--c-primary);
    background: var(--c-background-2);
  }
  .nav a.active::after { display: none; }
  .nav a.btn-primary {
    margin: 14px 0 0 !important;
    padding: 14px 18px !important;
    font-size: 15px !important;
    justify-content: center;
  }

  .site-footer .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 560px) {
  h1 { font-size: clamp(30px, 8.5vw, 42px); }
  h2 { font-size: clamp(26px, 7vw, 34px); }
  .section { padding: 48px 0; }
  .wrap, .wrap-narrow { padding: 0 16px; }

  .site-footer { padding: 48px 0 28px; margin-top: 56px; }
  .site-footer .footer-grid { grid-template-columns: 1fr; gap: 28px; margin-bottom: 28px; }
  .site-footer .legal { flex-direction: column; gap: 8px; }
  .site-footer .brand img.wtu-logo { height: 80px; }

  .sticky-bar { flex-direction: column; gap: 10px; padding: 12px 16px; }

  /* Buttons fit comfortably and don't get squashed */
  .btn { padding: 12px 18px; font-size: 14.5px; }
  .btn-lg { padding: 14px 22px; font-size: 15px; }

  /* Brand lockup safer at very narrow widths */
  .brand-home .wtu-mark { height: 38px; }
  .brand-home .wtu-wordmark-modern { font-size: 17px; }
  .brand-home { gap: 10px; }
  .site-footer .brand-home .wtu-wordmark-modern { font-size: 18px; }
}
@media (max-width: 360px) {
  .brand-home .wtu-wordmark-modern { font-size: 15px; }
  .brand-home .wtu-mark { height: 34px; }
}

/* ── Print-friendly helpers ────────────────────────────────── */
@media print {
  .site-header, .site-footer, .sticky-bar, .consent-banner { display: none; }
}

/* ── Photos ────────────────────────────────────────────────
   Two treatments, toggled by body[data-photo-treatment]:
     "natural"  — photos as-is
     "duotone"  — purple/coral duotone tint for a branded feel
*/
.photo {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transition: filter .3s ease;
}
body[data-photo-treatment="duotone"] .photo-wrap {
  position: relative;
  isolation: isolate;
}
body[data-photo-treatment="duotone"] .photo-wrap::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-accent) 100%);
  mix-blend-mode: color;
  opacity: .78;
  z-index: 1;
}
body[data-photo-treatment="duotone"] .photo-wrap .photo {
  filter: grayscale(100%) contrast(1.05) brightness(1.02);
}
/* Floating label/chip above any photo treatment */
.photo-wrap { position: relative; overflow: hidden; border-radius: 18px; background: var(--c-background-2); }
.photo-wrap > .photo-overlay-chip {
  position: absolute; z-index: 2;
}

/* ── Consent banner ────────────────────────────────────────── */
.consent-banner {
  position: fixed; left: 24px; right: 24px; bottom: 24px; z-index: 50;
  max-width: 720px; margin: 0 auto;
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  transform: translateY(140%);
  opacity: 0;
  transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .35s ease;
}
.consent-banner.show { transform: translateY(0); opacity: 1; }
.consent-banner .consent-inner {
  display: grid; grid-template-columns: 1fr auto;
  gap: 20px; align-items: center;
  padding: 18px 20px;
}
.consent-banner .consent-text { font-size: 14px; color: var(--c-text); line-height: 1.55; }
.consent-banner .consent-text strong { font-family: var(--f-serif); font-weight: 500; font-size: 15px; }
.consent-banner .consent-actions { display: flex; gap: 8px; }
.consent-banner .btn { padding: 10px 16px; font-size: 14px; }
@media (max-width: 640px) {
  .consent-banner { left: 12px; right: 12px; bottom: 12px; }
  .consent-banner .consent-inner { grid-template-columns: 1fr; }
  .consent-banner .consent-actions { justify-content: flex-end; }
}

/* ── Nation flag tiles (quiz question 1) ─────────────────── */
.flag-tile-img {
  width: 48px; height: 48px;
  border-radius: 8px;  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

/* ── Homepage nation quick-pick ───────────────────────────── */
.nation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nation-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: 12px;
  font-weight: 500; font-size: 15px;
  color: var(--c-text);
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.nation-btn:hover { border-color: var(--c-primary); background: var(--c-background-2); text-decoration: none; transform: translateY(-1px); }
.nation-flag {
  width: 32px; height: 22px; border-radius: 4px; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08); flex-shrink: 0;
}
