/* ============================================================
   Attachment Style Assessment
   Brand alignment with francoisesterhuizen.com:
   - Teal-green primary (#297E7B deep, #3DBDB9 bright)
   - Sage neutral (#BABBA9), gold accent (#D3A71D)
   - Figtree typography throughout
   - Clean white paper, generous whitespace
   The 2D grid is the hero visual: Fear of losing closeness (vertical)
   against Need for distance (horizontal), with the four styles in the
   four quadrants.
   ============================================================ */

:root {
  /* Brand */
  --teal-50:   #ECF6F5;
  --teal-100:  #D6EAE9;
  --teal-200:  #A9D7D4;
  --teal-300:  #6FC0BC;
  --teal:      #3DBDB9;
  --teal-dark: #297E7B;
  --teal-deep: #1E5F5C;

  --sage:      #BABBA9;
  --sage-soft: #DEDED4;
  --sage-pale: #F1F0EA;

  --gold:      #D3A71D;
  --gold-soft: #E5D289;
  --gold-pale: #F6EFD1;

  --ink:       #1A1A1A;
  --ink-soft:  #363833;
  --muted:     #5F6360;
  --line:      #D8D8D8;
  --line-soft: #ECECEC;

  --paper:      #FFFFFF;
  --paper-warm: #FBFAF7;

  /* Accent for the "warm / reaching" side of things */
  --warm-deep: #C9543A;
  --warm-mid:  #E87B5A;
  --warm-pale: #FCE5D9;

  /* Typography */
  --font-body: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;

  /* Layout */
  --container:      720px;
  --container-wide: 920px;
  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-soft: 0 2px 12px rgba(45, 80, 75, 0.06);
  --shadow-card: 0 4px 24px rgba(45, 80, 75, 0.08);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 280ms;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; color: inherit; }
::selection { background: var(--teal-100); color: var(--ink); }

a {
  color: var(--teal-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--teal-deep); }

#app {
  max-width: var(--container);
  margin: 0 auto;
  padding: 40px 24px 96px;
  animation: fadeUp 360ms var(--ease) both;
}
.result-view { max-width: var(--container-wide); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.18;
  margin: 1.4em 0 0.5em;
}
h1 { font-size: clamp(30px, 5vw, 44px); margin-top: 0.4em; font-weight: 800; }
h2 { font-size: clamp(24px, 3.6vw, 32px); font-weight: 700; }
h3 { font-size: clamp(19px, 2.4vw, 22px); margin-top: 1.8em; font-weight: 700; }
h4 { font-size: 17px; font-weight: 700; }
h5 { font-size: 16px; font-weight: 700; }

p { margin: 0.7em 0; color: var(--ink-soft); }
em { font-style: italic; color: var(--ink); }
strong { color: var(--ink); font-weight: 700; }

ul { padding-left: 1.4em; }
ul li { margin: 0.5em 0; color: var(--ink-soft); }

.meta {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.step-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-dark);
  background: var(--teal-50);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}

hr.section-break {
  border: none;
  border-top: 1px solid var(--line-soft);
  margin: 56px 0 32px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  line-height: 1.2;
  transition: background var(--dur) var(--ease),
              color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              transform 120ms var(--ease),
              box-shadow var(--dur) var(--ease);
}
.btn.lg { padding: 14px 30px; font-size: 16px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:not(:disabled):active { transform: translateY(1px); }
.btn.primary {
  background: var(--teal-dark);
  color: #fff;
}
.btn.primary:not(:disabled):hover {
  background: var(--teal-deep);
  box-shadow: var(--shadow-soft);
}
.btn.ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
}
.btn.ghost:not(:disabled):hover {
  border-color: var(--teal-dark);
  color: var(--teal-dark);
  background: var(--teal-50);
}

/* ---------- Welcome ---------- */
.welcome { text-align: left; padding-top: 8px; }
.welcome .duo {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-bottom: 18px;
  animation: floatDuo 6s ease-in-out infinite;
}
@keyframes floatDuo {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.welcome h1 { text-align: center; margin-bottom: 6px; }
.welcome-subtitle {
  text-align: center;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 24px;
  font-weight: 500;
}
.welcome .lede { margin: 16px 0 22px; }
.welcome .meta { text-align: center; margin: 6px 0; }

.invite-banner {
  background: var(--teal-50);
  border: 1px solid var(--teal-200);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 22px 0;
  font-size: 15.5px;
  color: var(--ink-soft);
}

.resume-banner {
  background: var(--teal-50);
  border: 1px solid var(--teal-200);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  margin: 28px 0 8px;
  text-align: center;
}
.resume-banner p { margin: 0 0 16px; color: var(--ink-soft); font-size: 16px; }
.resume-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Inputs ---------- */
input[type="text"], input[type="email"], textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  margin: 4px 0;
  transition: border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
  line-height: 1.5;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px var(--teal-50);
}

/* ---------- Lead capture (on welcome) ---------- */
.lead-capture {
  background: var(--paper-warm);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  margin: 28px 0 18px;
}
.lead-capture .lead-title {
  font-size: clamp(22px, 3vw, 26px);
  margin: 0 0 8px;
  text-align: left;
}
.lead-capture .lead-body {
  color: var(--ink-soft);
  margin: 0 0 18px;
  font-size: 15.5px;
}
.lead-capture .form-row { margin: 14px 0; }
.lead-capture .form-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.client-question {
  border: none;
  margin: 20px 0 8px;
  padding: 0;
}
.client-question legend {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
  padding: 0;
  line-height: 1.4;
}
.form-error {
  color: #B23A2B;
  font-size: 14px;
  margin: 8px 0 0;
  min-height: 1em;
}
.lead-capture .btn {
  display: block;
  width: 100%;
  margin: 18px 0 0;
  min-width: 0;
}

/* ---------- Context questions ---------- */
.context-q {
  background: var(--paper-warm);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 18px 0;
}
.context-q > label {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
  line-height: 1.4;
}
.radio-group { display: flex; flex-direction: column; gap: 6px; }
.radio-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 160ms var(--ease);
  font-size: 15.5px;
  color: var(--ink-soft);
}
.radio-pill:hover {
  border-color: var(--teal-300);
  background: var(--teal-50);
}
.radio-pill input { margin: 0; cursor: pointer; accent-color: var(--teal-dark); }
.radio-pill.selected {
  background: var(--teal-50);
  border-color: var(--teal-dark);
  color: var(--ink);
  font-weight: 500;
}

/* ---------- Progress ---------- */
.progress {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  padding: 14px 0 12px;
  z-index: 10;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}
.progress-bar {
  height: 4px;
  background: var(--teal);
  border-radius: 999px;
  transition: width 360ms var(--ease);
  min-width: 4px;
}
.progress-text {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: 0.02em;
  font-weight: 500;
}

/* ---------- Chapter intro ---------- */
.chapter-card {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 32px 30px 26px;
  box-shadow: var(--shadow-soft);
  border-top: 4px solid var(--teal);
}
.chapter-card.chapter-closeness { border-top-color: var(--teal); }
.chapter-card.chapter-leaning   { border-top-color: var(--gold); }
.chapter-card.chapter-hard      { border-top-color: var(--warm-mid); }
.chapter-card.chapter-trust     { border-top-color: var(--sage); }
.chapter-subtitle {
  font-size: 16px;
  color: var(--muted);
  margin-top: -0.2em;
  margin-bottom: 18px;
  font-style: italic;
}
.chapter-intro {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 16px 0 22px;
}
.chapter-intro p { margin: 14px 0; }
.chapter-count { text-align: right; margin-bottom: 16px; }

/* ---------- Question card ---------- */
.question-card {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 28px 26px 22px;
  box-shadow: var(--shadow-soft);
  border-left: 4px solid var(--teal);
}
.question-card.chapter-closeness { border-left-color: var(--teal); }
.question-card.chapter-leaning   { border-left-color: var(--gold); }
.question-card.chapter-hard      { border-left-color: var(--warm-mid); }
.question-card.chapter-trust     { border-left-color: var(--sage); }

.question {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vw, 24px);
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 12px;
  color: var(--ink);
}

/* ---------- Tell me more ---------- */
.tell-more { margin: 6px 0 18px; font-size: 14.5px; }
.tell-more summary {
  cursor: pointer;
  color: var(--teal-dark);
  font-weight: 600;
  padding: 6px 0;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.tell-more summary::-webkit-details-marker { display: none; }
.tell-more summary::before {
  content: '+';
  font-weight: 700;
  font-size: 1.1em;
  width: 1em;
  display: inline-block;
  text-align: center;
}
.tell-more[open] summary::before { content: '−'; }
.tell-more summary:hover { color: var(--teal-deep); }
.tell-more-body {
  padding: 12px 16px;
  margin-top: 6px;
  background: var(--paper-warm);
  border-radius: var(--radius);
  font-style: italic;
  color: var(--ink-soft);
  border-left: 3px solid var(--gold);
  line-height: 1.6;
}

/* ---------- Likert ---------- */
.likert { display: flex; flex-direction: column; gap: 8px; margin: 18px 0 24px; }
.likert-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 16px;
  cursor: pointer;
  font-family: inherit;
  font-size: 15.5px;
  text-align: left;
  width: 100%;
  color: var(--ink-soft);
  transition: all 160ms var(--ease);
}
.likert-btn:hover {
  border-color: var(--teal-300);
  background: var(--teal-50);
}
.likert-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: #fff;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--muted);
  transition: all 160ms var(--ease);
}
.likert-btn.selected {
  background: var(--teal-50);
  border-color: var(--teal-dark);
  color: var(--ink);
  font-weight: 600;
}
.likert-btn.selected .likert-num {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
  color: #fff;
}

/* ---------- Nav ---------- */
.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}

/* ---------- Reflection ---------- */
.reflection-card {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  box-shadow: var(--shadow-soft);
  border-top: 4px solid var(--gold);
  margin: 18px 0;
}
.reflection-card h3 {
  margin-top: 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 18px;
}
.reflection-prompt {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  font-style: italic;
  margin: 14px 0;
}

/* ---------- Closing ---------- */
.closing-view h2 { margin-top: 0.3em; }

/* ---------- Result header ---------- */
.result-greeting {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 4px;
  font-style: italic;
}
.result-band {
  font-size: clamp(28px, 4.4vw, 40px);
  margin-top: 6px;
  margin-bottom: 4px;
  font-weight: 800;
}
.result-band.band-secure       { color: var(--teal-dark); }
.result-band.band-anxious      { color: var(--warm-deep); }
.result-band.band-avoidant     { color: var(--teal-deep); }
.result-band.band-disorganised { color: var(--gold); }
.result-tagline {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 8px;
  font-style: italic;
}

.emblem-art {
  display: flex;
  justify-content: center;
  margin: 18px 0 28px;
  animation: charFloat 4s ease-in-out infinite;
}
@keyframes charFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.emblem { display: block; }

/* ---------- The 2D grid ---------- */
.grid-wrap {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 18px 0 8px;
}
.grid-axis-y {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-dark);
  padding: 8px 0;
  white-space: nowrap;
}
.grid-main { flex: 1; min-width: 0; }
.grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.grid-quad {
  display: flex;
  padding: 12px 14px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.grid-quad span { opacity: 0.75; }
.q-anxious      { background: var(--warm-pale);  align-items: flex-start; justify-content: flex-start; color: var(--warm-deep); }
.q-disorganised { background: var(--gold-pale);  align-items: flex-start; justify-content: flex-end;   color: var(--gold); text-align: right; }
.q-secure       { background: var(--teal-50);    align-items: flex-end;   justify-content: flex-start; color: var(--teal-dark); }
.q-avoidant     { background: var(--sage-pale);  align-items: flex-end;   justify-content: flex-end;   color: var(--teal-deep); text-align: right; }

.grid-line-v {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 1px;
  background: rgba(45,80,75,0.18); transform: translateX(-50%);
}
.grid-line-h {
  position: absolute; top: 50%; left: 0; right: 0; height: 1px;
  background: rgba(45,80,75,0.18); transform: translateY(-50%);
}

.grid-dot {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--ink);
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.22);
  z-index: 3;
  transition: left 600ms var(--ease), top 600ms var(--ease);
}
.grid-dot.marker-a { border-color: var(--teal-dark); }
.grid-dot.marker-b { border-color: var(--warm-deep); }
.grid-dot-name {
  position: absolute;
  top: 130%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--ink);
  background: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.grid-dot.marker-b .grid-dot-name { top: auto; bottom: 130%; }

.grid-axis-x {
  text-align: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-dark);
  margin-top: 10px;
}

/* ---------- Score chips ---------- */
.score-readout {
  display: flex;
  gap: 12px;
  margin: 22px 0 8px;
  flex-wrap: wrap;
}
.score-chip {
  flex: 1;
  min-width: 160px;
  background: var(--paper-warm);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.score-chip-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.score-chip-val {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--teal-dark);
}
.score-chip-val small { font-size: 14px; font-weight: 600; color: var(--muted); }

/* ---------- Summary + boundary note ---------- */
.summary {
  font-size: 16.5px;
  line-height: 1.7;
  margin: 24px 0;
  padding: 22px 24px;
  background: var(--paper-warm);
  border-radius: var(--radius);
  border-left: 4px solid var(--gold);
  color: var(--ink-soft);
}
.boundary-note {
  font-size: 14.5px;
  color: var(--ink-soft);
  background: var(--teal-50);
  border: 1px solid var(--teal-200);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 4px 0 8px;
}

/* ---------- Practices ---------- */
.practices { margin: 16px 0 32px; }
.practice {
  background: #fff;
  border: 1px solid var(--line-soft);
  padding: 20px 22px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  margin: 14px 0;
  border-top: 3px solid var(--gold);
}
.practice h4 { margin: 0 0 6px; font-family: var(--font-display); font-size: 17px; }
.practice p { margin: 0; font-size: 15.5px; line-height: 1.6; }

/* ---------- Couple dynamic ---------- */
.dance-title { text-align: center; margin-top: 12px; }
.couple-styles {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  margin: 20px 0 8px;
}
.couple-style {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: var(--ink-soft);
}
.couple-style strong { color: var(--ink); }
.dance {
  background: linear-gradient(135deg, var(--teal-50), var(--gold-pale));
  padding: 30px 28px;
  border-radius: var(--radius-lg);
  margin: 28px 0;
  border: 1px solid var(--gold-soft);
  box-shadow: var(--shadow-soft);
}
.dance h3 {
  margin-top: 0;
  font-size: clamp(22px, 3vw, 26px);
  text-align: center;
}
.dance-body { font-size: 16.5px; line-height: 1.7; color: var(--ink-soft); }
.dance-body p { color: var(--ink-soft); }
.dance-body strong { color: var(--ink); }

/* ---------- Cross-reference ---------- */
.crossref {
  background: var(--sage-pale);
  border: 1px solid var(--sage-soft);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 28px 0 8px;
}
.crossref h4 { margin: 0 0 6px; font-family: var(--font-display); }
.crossref p { margin: 0; font-size: 15.5px; color: var(--ink-soft); }

/* ---------- Share / session box ---------- */
.share-box { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
#share-url {
  flex: 1;
  min-width: 200px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--ink-soft);
}
#share-status, #result-url-status {
  min-height: 1.2em;
  color: var(--teal-dark);
  font-weight: 500;
}

.session-box {
  background: var(--teal-50);
  border-radius: var(--radius-lg);
  padding: 26px 26px 20px;
  border-left: 4px solid var(--teal-dark);
  margin: 16px 0;
}
.session-box h3 { margin-top: 0; }
.session-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 6px;
}

/* ---------- SVG emblem animation ---------- */
.emblem-anxious, .emblem-disorganised { animation: emblemPulse 2.4s ease-in-out infinite; transform-origin: center; }
@keyframes emblemPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.8; }
}

/* ---------- Mobile ---------- */
@media (max-width: 520px) {
  body { font-size: 16px; }
  #app { padding: 28px 18px 80px; }
  .question-card, .chapter-card { padding: 22px 20px 18px; }
  .reflection-card { padding: 22px 20px; }
  .session-box { padding: 22px 20px 16px; }
  .grid-quad { font-size: 11.5px; padding: 9px 10px; }
  .grid-axis-y, .grid-axis-x { font-size: 11px; }
}

/* ---------- Site footer ---------- */
.site-footer {
  max-width: var(--container-wide);
  margin: 24px auto 0;
  padding: 28px 24px 48px;
  text-align: center;
  border-top: 1px solid var(--line-soft);
}
.site-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.site-footer-logo { display: inline-block; }
.site-footer-logo img { height: 40px; width: auto; opacity: 0.9; }
.site-footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 13px;
}
.site-footer-links a {
  color: var(--teal-dark);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.site-footer-links a:hover {
  color: var(--teal-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}
@media (max-width: 480px) {
  .site-footer { padding: 24px 18px 40px; }
}

/* ---------- Accessibility ---------- */
.btn:focus-visible,
.likert-btn:focus-visible,
.radio-pill:focus-within,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--teal-200);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Print ---------- */
/* ============================================================
   PRINT / SAVE AS PDF
   ------------------------------------------------------------
   The Save as PDF button calls window.print(), so everything the
   reader ends up with is decided here.

   This app is already ink on paper, so unlike its two dark-themed
   siblings it needs no palette inversion. What it does need is the
   four-quadrant map to survive: a browser drops every background
   colour when printing unless print-color-adjust says otherwise,
   and without the four tinted quadrants the map is an empty box
   with two dots in it.
   ============================================================ */
@media print {
  body { background: #fff; font-size: 11.5pt; color: var(--ink); }

  /* Everything that only makes sense on a screen. */
  .site-footer, .nav-row, .session-box, .share-box,
  #share-url, #share-status, #result-url-status,
  .progress, .tell-more { display: none !important; }

  #app { max-width: 100%; padding: 0; }

  .emblem-art { animation: none; page-break-inside: avoid; }
  .emblem-anxious, .emblem-disorganised { animation: none; }

  .dim-row, .practice, .summary, .dance, .crossref, .grid, .score-chip {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }

  /* The map is the result. Its four quadrants, the crosshair and the two
     dots all carry their meaning in a background colour, so each one has
     to be told to print. */
  .grid-wrap { page-break-inside: avoid; }
  .grid, .grid-quad, .q-anxious, .q-disorganised, .q-secure, .q-avoidant,
  .grid-line-v, .grid-line-h, .grid-dot, .grid-dot-name {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .grid-dot, .grid-dot-name { box-shadow: none; }
  .grid-quad span { opacity: 1; }

  /* The Disorganised quadrant is labelled in brand gold, which measures
     2.25 to 1 against white and all but disappears in print. One shade
     deeper puts it level with the other three labels. */
  .q-disorganised { color: #7F6210 !important; }

  .result-band { color: var(--ink) !important; }
  hr.section-break { page-break-before: always; border: none; margin: 0; }
  h2, h3 { page-break-after: avoid; }
  a { color: var(--ink); text-decoration: none; }

  /* A URL printed in full is unreadable and helps nobody holding paper. */
  a[href]::after { content: none !important; }
}
