/*
  THE ZEN DRAGONFLY QUIZ: STYLES
  Layout idea: full-width bands that alternate dark and light, each with one of Angela's textured backgrounds.
  Questions and answers always sit on solid cream cards, so text stays readable on any background.
  Headings use Svetze. Everything else uses Lato. No italics anywhere.
*/

@font-face {
  font-family: "Svetze";
  src: url("../assets/fonts/Svetze.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lato";
  src: url("../assets/fonts/Lato-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand palette */
  --plum: #341422;
  --cream: #EECEB0;
  --espresso: #441F12;
  --terracotta: #B84924;
  --blush: #DE9583;
  --teal: #054E43;
  --magenta: #A6184E;
  --mustard: #D7891B;

  /* Supporting tones */
  --paper: #FBF1E4;        /* answer and result cards */
  --paper-deep: #F3DCC4;   /* selected card, switch track */
  --ink-light: #F7E4D0;    /* text on dark backgrounds */
  --ink-dark: #341422;     /* text on light backgrounds */
  --ink-mid: #2A0F1B;      /* text on terracotta and copper */
  --muted: #6B3A2A;        /* secondary text on paper */

  --font-head: "Svetze", Georgia, "Times New Roman", serif;
  --font-body: "Lato", "Helvetica Neue", Arial, sans-serif;

  --radius-card: 18px;
  --radius-btn: 10px;
  --gutter-left: max(16px, env(safe-area-inset-left, 0px));
  --gutter-right: max(16px, env(safe-area-inset-right, 0px));

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--plum);
  color: var(--ink-dark);
  font-family: var(--font-body);
  font-weight: 400;
  font-style: normal;
  font-synthesis: none;
  font-size: 17px;
  line-height: 1.6;
}

/* No italics, no faux bold, anywhere. */
em, i, cite, dfn, address, var { font-style: normal; }
b, strong, h1, h2, h3, h4, th { font-weight: 400; }

img { max-width: 100%; height: auto; }
a { color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Bands ---------- */

.screen {
  position: relative;
  padding-block: clamp(40px, 7vw, 88px);
  background-color: var(--bg-fallback, var(--plum));
  background-image: var(--bg-img);
  background-size: cover;
  background-position: var(--bg-pos, center);
  background-repeat: no-repeat;
  color: var(--ink);
  animation: zd-fade 0.35s ease-out both;
}

.wrap {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  padding-left: var(--gutter-left);
  padding-right: var(--gutter-right);
}
.wrap.wide { max-width: 1120px; }
.wrap.hero { max-width: 880px; }

/* Themes: background, text color, and button colors for each band */
[data-theme="plum"]       { --bg-img: url("../assets/backgrounds/plum-vine.webp");        --bg-fallback: #491A24; }
[data-theme="peach"]      { --bg-img: url("../assets/backgrounds/peach-vine.webp");       --bg-fallback: #EFC29D; }
[data-theme="terracotta"] { --bg-img: url("../assets/backgrounds/terracotta-arch.webp");  --bg-fallback: #D7744A; }
[data-theme="teal"]       { --bg-img: url("../assets/backgrounds/teal-cane.webp");        --bg-fallback: #DFC8A2; }
[data-theme="wood"]       { --bg-img: url("../assets/backgrounds/dark-wood.webp");        --bg-fallback: #35170F; }
[data-theme="blush"]      { --bg-img: url("../assets/backgrounds/blush-peony.webp");      --bg-fallback: #F8D9C3; }
[data-theme="emerald"]    { --bg-img: url("../assets/backgrounds/emerald-floral.webp");   --bg-fallback: #18372F; }
[data-theme="copper"]     { --bg-img: url("../assets/backgrounds/copper-stripe.webp");    --bg-fallback: #DB9764; }
[data-theme="burgundy"]   { --bg-img: url("../assets/backgrounds/burgundy-floral.webp");  --bg-fallback: #773430; }
[data-theme="statue"]     { --bg-img: url("../assets/backgrounds/plum-statue.webp");      --bg-fallback: #582727; --bg-pos: 28% center; }

/* dark bands */
[data-theme="plum"], [data-theme="wood"], [data-theme="emerald"], [data-theme="burgundy"], [data-theme="statue"] {
  --ink: var(--ink-light);
  --track: rgba(247, 228, 208, 0.32);
  --fill: var(--mustard);
  --btn-bg: var(--mustard);
  --btn-ink: var(--plum);
  --btn-hover: #E79B2C;
  --focus: #FFD58A;
}
/* light bands */
[data-theme="peach"], [data-theme="teal"], [data-theme="blush"] {
  --ink: var(--ink-dark);
  --track: rgba(52, 20, 34, 0.25);
  --fill: var(--magenta);
  --btn-bg: var(--magenta);
  --btn-ink: #FFF6EC;
  --btn-hover: #8F1342;
  --focus: var(--plum);
}
/* mid-tone bands */
[data-theme="terracotta"], [data-theme="copper"] {
  --ink: var(--ink-mid);
  --track: rgba(42, 15, 27, 0.28);
  --fill: var(--plum);
  --btn-bg: var(--plum);
  --btn-ink: var(--ink-light);
  --btn-hover: #4A1E33;
  --focus: var(--plum);
}

@media (min-width: 760px) {
  [data-theme="statue"] { --bg-pos: center; }
}

/* ---------- Type ---------- */

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.12;
  text-align: center;
  text-wrap: balance;
  margin: 0;
  letter-spacing: 0.01em;
}

.display {
  font-size: clamp(2rem, 1.2rem + 3.6vw, 3.75rem);   /* 32px mobile, 60px desktop */
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.08;
}

.q-heading {
  font-size: clamp(1.4375rem, 1.1rem + 1.6vw, 2.125rem);  /* 23px mobile, 34px desktop */
  line-height: 1.22;
}

.section-heading {
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem);
  line-height: 1.15;
}

.lede {
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  max-width: 40em;
  margin: 22px auto 0;
  text-align: center;
  text-wrap: pretty;
}

.fine { font-size: 15px; text-align: center; margin: 18px 0 0; opacity: 0.95; }

p { margin: 0; text-wrap: pretty; text-align: left; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 16px 30px;
  border: 2px solid transparent;
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  background: var(--btn-bg);
  color: var(--btn-ink);
  transition: background-color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}
.btn:hover { background: var(--btn-hover); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: currentColor;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.14); }

.btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn[aria-disabled="true"]:hover { background: var(--btn-bg); }
.btn[aria-disabled="true"]:active { transform: none; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 34px;
}

/* ---------- Progress ---------- */

.progress { margin-bottom: 30px; }
.progress .count { display: block; text-align: center; font-size: 15px; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 12px; }
.segments { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.seg { height: 6px; border-radius: 3px; background: var(--track); transition: background-color 0.3s ease; }
.seg.done { background: var(--fill); }

/* ---------- Answers ---------- */

.answers { display: grid; gap: 12px; margin-top: 30px; }

.answer {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 24px;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 14px 18px;
  background: var(--paper);
  color: var(--espresso);
  border: 2px solid rgba(68, 31, 18, 0.2);
  border-radius: 14px;
  cursor: pointer;
  font-size: clamp(1rem, 0.94rem + 0.25vw, 1.125rem);   /* 16px mobile, 18px desktop */
  line-height: 1.45;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.answer:hover { border-color: var(--magenta); }
.answer input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.answer .ring { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; }
.answer input:focus-visible ~ .ring { outline: 3px solid var(--focus); outline-offset: 3px; }
.answer .letter {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--plum);
  color: var(--ink-light);
  font-size: 16px;
  transition: background-color 0.15s ease;
}
.answer .tick { width: 24px; height: 24px; color: var(--magenta); opacity: 0; transition: opacity 0.15s ease; }
.answer.is-selected { border-color: var(--magenta); background: var(--paper-deep); box-shadow: inset 0 0 0 1px var(--magenta); }
.answer.is-selected .letter { background: var(--magenta); }
.answer.is-selected .tick { opacity: 1; }

.nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 34px; }
.nav .btn { min-width: 160px; }

/* ---------- Cards (results) ---------- */

.card {
  background: var(--paper);
  color: var(--espresso);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 20px 44px rgba(26, 8, 16, 0.28);
}
.card-img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--paper-deep); }
.card-body { display: flex; flex-direction: column; gap: 16px; padding: clamp(22px, 3.2vw, 36px); }
.card-title { font-size: clamp(1.5rem, 1.15rem + 1.5vw, 2.25rem); text-transform: uppercase; letter-spacing: 0.04em; color: var(--plum); }
.card-copy { font-size: 17px; line-height: 1.65; }
.card .meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin: 0; padding: 0; list-style: none; font-size: 15px; color: var(--muted); }
.card .cta-row { margin-top: 6px; }
.card .btn { --btn-bg: var(--magenta); --btn-ink: #FFF6EC; --btn-hover: #8F1342; --focus: var(--plum); }

.primary-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); }
.primary-card .card-body { justify-content: center; }
.complements { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 36px; align-items: stretch; }
.complements .card { display: flex; flex-direction: column; }
.complements .card-body { flex: 1; }
.complements .card-copy { flex: 1; }
.complements .card-title { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.85rem); }

.stack { display: grid; gap: 28px; }

/* Format switch (in person / virtual) */
.switch { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; margin-inline: auto; background: var(--paper-deep); border-radius: 12px; width: 100%; max-width: 360px; }
.switch label { position: relative; display: grid; place-items: center; text-align: center; padding: 10px 12px; border-radius: 9px; font-size: 15px; line-height: 1.25; cursor: pointer; color: var(--espresso); transition: background-color 0.15s ease, color 0.15s ease; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch label.is-on { background: var(--plum); color: var(--ink-light); }
.switch label:has(input:focus-visible) { outline: 3px solid var(--magenta); outline-offset: 2px; }

/* Preference toggle */
.pref { display: flex; justify-content: center; margin: 26px auto 0; max-width: 640px; }
.toggle {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start;
  padding: 16px 18px; border-radius: 14px; cursor: pointer;
  background: rgba(247, 228, 208, 0.14); border: 1px solid rgba(247, 228, 208, 0.45);
}
.toggle input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--mustard); cursor: pointer; }
.toggle input:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.toggle .hint { display: block; font-size: 15px; opacity: 0.92; }

.result-note { max-width: 640px; margin: 28px auto 0; font-size: 15px; text-align: left; }

/* ---------- Email panel ---------- */

.email-card { max-width: 640px; margin-inline: auto; padding: clamp(24px, 4vw, 40px); }
.email-card .section-heading { color: var(--plum); font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem); }
.field { display: grid; gap: 8px; margin-top: 18px; }
.field label { font-size: 16px; }
.field input[type="text"], .field input[type="email"] {
  width: 100%; min-height: 52px; padding: 12px 14px;
  font: 400 17px/1.3 var(--font-body); color: var(--espresso);
  background: #FFFBF6; border: 2px solid rgba(68, 31, 18, 0.45); border-radius: 10px;
}
.field input:focus-visible { outline: 3px solid var(--magenta); outline-offset: 2px; border-color: var(--magenta); }
.consent { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; margin-top: 20px; font-size: 16px; }
.consent input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--magenta); cursor: pointer; }
.consent input:focus-visible { outline: 3px solid var(--magenta); outline-offset: 3px; }
.consent a { color: var(--magenta); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.status { min-height: 1.6em; margin-top: 14px; font-size: 16px; }
.status.is-error { color: #8A1030; }
.status.is-ok { color: #0B5A3A; }
.email-card .cta-row { margin-top: 20px; }

.actions { margin-top: 40px; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--cream);
  color: var(--espresso);
  padding-block: 48px 40px;
}
.site-footer .wrap { display: grid; justify-items: center; gap: 20px; text-align: center; }
.site-footer .logo { display: block; width: clamp(150px, 22vw, 190px); height: auto; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 26px; margin: 0; padding: 0; list-style: none; font-size: 16px; }
.footer-links a { color: var(--espresso); text-underline-offset: 4px; }
.footer-links a:focus-visible, .site-footer a:focus-visible { outline: 3px solid var(--plum); outline-offset: 3px; border-radius: 2px; }
.footer-small { font-size: 15px; max-width: 640px; text-align: center; margin: 0; }

/* ---------- Privacy page ---------- */

.doc { background: var(--paper); color: var(--espresso); }
.doc-wrap { max-width: 760px; margin-inline: auto; padding: clamp(36px, 6vw, 72px) var(--gutter-right) clamp(36px, 6vw, 72px) var(--gutter-left); }
.doc h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem); color: var(--plum); text-transform: uppercase; letter-spacing: 0.03em; }
.doc h2 { text-align: left; font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); color: var(--plum); margin-top: 40px; }
.doc p, .doc li { font-size: 17px; line-height: 1.7; }
.doc p { margin-top: 14px; }
.doc ul { margin: 14px 0 0; padding-left: 1.3em; }
.doc li { margin-top: 8px; }
.doc .updated { text-align: center; margin-top: 16px; color: var(--muted); font-size: 15px; }
.doc a { color: var(--magenta); text-underline-offset: 3px; }
.doc .back { display: flex; justify-content: center; margin-top: 44px; }
.doc .back .btn { --btn-bg: var(--magenta); --btn-ink: #FFF6EC; --btn-hover: #8F1342; --focus: var(--plum); color: var(--btn-ink); }

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
  .primary-card { grid-template-columns: minmax(0, 1fr); }
  .complements { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .nav .btn, .cta-row .btn { width: 100%; }
  .answer { gap: 12px; padding: 12px 14px; }
  .answer .letter { width: 32px; height: 32px; }
  .btn { padding-inline: 20px; }
}

/* ---------- Motion ---------- */

@keyframes zd-fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Result card extras ---------- */
.card .fit { display: grid; gap: 10px; }
.card-fit { font-size: 16px; line-height: 1.6; margin: 0; }
.card-fit .lead-in { font-family: var(--font-head); color: var(--plum); font-size: 1.05em; }
.card .btn[aria-disabled="true"], .email-card .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.stack .email-card { width: 100%; }
