/* ---------- tokens ---------- */
:root {
  --linen:        #F4EFE3;
  --linen-deep:   #EAE1CB;
  --linen-panel:  #FBF8F1;
  --ink:          #2B2A22;
  --ink-soft:     #5B5847;
  --forest:       #3C5240;
  --forest-deep:  #2A3B2E;
  --sage:         #7C9473;
  --moss:         #B7C4A0;
  --clay:         #B08355;
  --clay-soft:    #D9C6A8;

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --sans:  "Karla", -apple-system, "Segoe UI", sans-serif;

  --radius-lg: 22px;
  --radius-md: 14px;
  --shadow-soft: 0 14px 40px -18px rgba(43, 42, 34, 0.35);
  --shadow-lift: 0 24px 60px -20px rgba(43, 42, 34, 0.45);

  /* ---- micro-interaction tokens: glow, glass, easing ---- */
  --ease-smooth: cubic-bezier(.22, .8, .32, 1);
  --glow-sage: rgba(124, 148, 115, 0.45);
  --glow-sage-soft: rgba(124, 148, 115, 0.22);
  --glow-emerald: rgba(42, 59, 46, 0.35);
  --glass-bg: rgba(251, 248, 241, 0.68);
  --glass-bg-strong: rgba(251, 248, 241, 0.88);
  --glass-bg-tint: rgba(124, 148, 115, 0.12);
  --glass-border: rgba(255, 255, 255, 0.55);
  --shadow-glow-sage: 0 0 28px 2px var(--glow-sage-soft);
  --shadow-glow-sage-strong: 0 0 32px 4px var(--glow-sage);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto !important; }
}

html {
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }

   [hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--linen);
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
}

/* ---------- ambient breathing background ---------- */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(60px);
  will-change: transform, opacity;
}

body::before {
  width: min(60vw, 640px);
  height: min(60vw, 640px);
  top: -14%;
  left: -12%;
  background: radial-gradient(circle, rgba(124,148,115,0.24), transparent 70%);
  animation: ambientDriftA 22s var(--ease-smooth) infinite alternate;
}

body::after {
  width: min(55vw, 560px);
  height: min(55vw, 560px);
  bottom: -16%;
  right: -10%;
  background: radial-gradient(circle, rgba(176,131,85,0.16), transparent 70%);
  animation: ambientDriftB 27s var(--ease-smooth) infinite alternate;
}

@keyframes ambientDriftA {
  0%   { transform: translate(0, 0) scale(1); opacity: 0.85; }
  100% { transform: translate(4%, 6%) scale(1.08); opacity: 1; }
}
@keyframes ambientDriftB {
  0%   { transform: translate(0, 0) scale(1); opacity: 0.8; }
  100% { transform: translate(-5%, -4%) scale(1.1); opacity: 1; }
}

/* subtle paper grain */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0.17  0 0 0 0 0.16  0 0 0 0 0.13  0 0 0 0.045 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

a, button { font-family: inherit; }

/* ---------- header / footer ---------- */
.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px clamp(20px, 5vw, 56px) 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-logo {
  width: 32px;
  height: 32px;
  display: block;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-smooth);
}
.brand-link:hover .brand-logo {
  transform: translateY(-1px) scale(1.04);
}

.mark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--forest-deep);
  transition: color 0.3s var(--ease-smooth);
}
.brand-link:hover .mark {
  color: var(--forest);
}

.link-btn {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.03em;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 100px;
  transition: background 0.25s var(--ease-smooth), color 0.25s var(--ease-smooth), transform 0.25s var(--ease-smooth);
}
.link-btn:hover { background: rgba(60,82,64,0.08); color: var(--forest-deep); transform: translateY(-1px); }
.link-btn:active { transform: translateY(0) scale(0.95); transition-duration: 0.12s; }

.site-footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 30px 20px 46px;
  color: var(--ink-soft);
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

/* ---------- layout / views ---------- */
#app {
  position: relative;
  z-index: 2;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.view { display: none; width: 100%; }
.view[data-active="true"] { display: block; animation: viewIn 0.5s ease both; }

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

.home-inner, .narrow-inner, .draw-inner {
  max-width: 620px;
  margin: 0 auto;
  padding: 28px 4px 60px;
}

/* The home view carries the long-form editorial below it now, so its own
   hero block needs less top/bottom air than a standalone view. */
#view-home .home-inner {
  padding: 22px 4px 6px;
}

.eyebrow {
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 600;
  margin: 0 0 14px;
}

h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 5.2vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  color: var(--forest-deep);
}

h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(24px, 4.5vw, 32px);
  line-height: 1.15;
  margin: 0 0 14px;
  color: var(--forest-deep);
}

.lede {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 24px;
}
.lede.small { font-size: 15px; margin-bottom: 26px; }

/* ---------- mode cards ---------- */
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

@media (max-width: 560px) {
  .mode-grid { grid-template-columns: 1fr; }
}

.mode-card {
  text-align: left;
  background: var(--glass-bg);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 19px 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.32s var(--ease-smooth), box-shadow 0.32s var(--ease-smooth), border-color 0.32s var(--ease-smooth);
}

.mode-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift), var(--shadow-glow-sage);
  border-color: rgba(124,148,115,0.55);
}

.mode-card:active {
  transform: translateY(-2px) scale(0.98);
  transition-duration: 0.14s;
}

.mode-icon {
  width: 32px; height: 32px;
  color: var(--forest);
}
.mode-icon svg { width: 100%; height: 100%; }

.mode-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--forest-deep);
}

.mode-desc {
  font-size: 13.8px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.deck-note {
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  margin-bottom: 18px;
}
.deck-note strong { color: var(--forest-deep); font-weight: 600; }

/* ---------- therapy request card ---------- */
.therapy-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(135deg, var(--glass-bg-tint), var(--glass-bg));
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 17px 22px;
  transition: transform 0.32s var(--ease-smooth), box-shadow 0.32s var(--ease-smooth);
}

.therapy-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft), var(--shadow-glow-sage);
}

@media (max-width: 560px) {
  .therapy-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

.therapy-card-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--forest-deep);
  margin: 0 0 6px;
}

.therapy-card-desc {
  font-size: 13.8px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 44ch;
  margin: 0;
}

.therapy-card-btn {
  flex-shrink: 0;
  text-decoration: none;
  white-space: nowrap;
}

/* ---------- "draw a card" call to action ----------
   The app's main interaction goal — drawing a card — otherwise sits below
   a long essay and a full FAQ/deck-gallery section on the homepage, or
   below an entire reflection history on My Journey, so a logged-in
   (returning) visitor doesn't necessarily see an obvious way to just
   draw right away. This banner puts that action first, above everything
   else, wherever it's placed. Its button (#home-top-draw-btn /
   #journey-top-draw-btn) simply re-triggers the existing "Card of the
   Day" flow (see script.js), so it needs no navigation logic of its own. */
.draw-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(155deg, var(--forest) 0%, var(--forest-deep) 100%);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: var(--shadow-lift);
  max-width: 980px;
  margin: 18px auto 0;
  transition: transform 0.32s var(--ease-smooth), box-shadow 0.32s var(--ease-smooth);
}

.draw-cta:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift), var(--shadow-glow-sage-strong);
}

.draw-cta-text {
  min-width: 0;
}

.draw-cta-eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay-soft);
  font-weight: 600;
  margin: 0 0 6px;
}

.draw-cta-heading {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
  color: var(--linen-panel);
  margin: 0 0 6px;
}

.draw-cta-desc {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(251,248,241,0.78);
  max-width: 42ch;
  margin: 0;
}

.draw-cta-btn {
  flex-shrink: 0;
  background: var(--linen-panel);
  color: var(--forest-deep);
  white-space: nowrap;
}
.draw-cta-btn:hover {
  background: var(--linen-panel);
  box-shadow: 0 12px 26px -10px rgba(0,0,0,0.35);
}

/* homepage top row: the draw banner and the booking banner sit side by
   side, each stacked vertically so both fit at half width */
.top-cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  max-width: 980px;
  margin: 18px auto 0;
}

.draw-cta--half {
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  max-width: none;
  padding: 20px 22px 22px;
}

.draw-cta--half .draw-cta-heading {
  font-size: 19px;
}

.draw-cta--half .draw-cta-desc {
  max-width: none;
  font-size: 13.5px;
}

.draw-cta--booking {
  background: linear-gradient(155deg, var(--forest-deep) 0%, #1F2C22 100%);
}

@media (max-width: 720px) {
  .top-cta-row {
    grid-template-columns: 1fr;
  }
}

/* the My Journey placement is a smaller, single-line nudge rather than
   the homepage's full pitch — no eyebrow/description, just a heading */
.draw-cta--compact {
  padding: 16px 20px;
  margin: 0 0 22px;
  max-width: none;
}
.draw-cta--compact .draw-cta-heading {
  font-size: 16.5px;
  margin: 0;
}

@media (max-width: 560px) {
  .draw-cta {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 20px 22px;
  }
  .draw-cta-btn { width: 100%; text-align: center; }
  .draw-cta--compact {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- back / buttons ---------- */
.back-btn {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 13.5px;
  cursor: pointer;
  padding: 4px 0 22px;
  display: inline-block;
  transition: color 0.2s ease, transform 0.2s var(--ease-smooth);
}
.back-btn:hover { color: var(--forest-deep); transform: translateX(-2px); }
.back-btn:active { transform: translateX(-2px) scale(0.96); }

.primary-btn {
  background: var(--forest);
  color: var(--linen-panel);
  border: none;
  border-radius: 100px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 24px -10px rgba(42,59,46,0.55);
  transition: transform 0.3s var(--ease-smooth), box-shadow 0.3s var(--ease-smooth), background 0.3s var(--ease-smooth);
  display: inline-block;
  text-decoration: none;
}
.primary-btn:hover {
  transform: translateY(-4px);
  background: var(--forest-deep);
  box-shadow: 0 18px 34px -14px rgba(42,59,46,0.6), var(--shadow-glow-sage);
}
.primary-btn:active {
  transform: translateY(-1px) scale(0.96);
  box-shadow: 0 8px 18px -10px rgba(42,59,46,0.5);
  transition-duration: 0.12s;
}
.primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
  box-shadow: 0 10px 24px -10px rgba(42,59,46,0.4);
}

.secondary-btn {
  background: transparent;
  color: var(--forest-deep);
  border: 1.4px solid var(--forest);
  border-radius: 100px;
  padding: 12px 26px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s var(--ease-smooth), transform 0.3s var(--ease-smooth), box-shadow 0.3s var(--ease-smooth), border-color 0.3s var(--ease-smooth);
}
.secondary-btn:hover {
  background: rgba(124,148,115,0.14);
  transform: translateY(-4px);
  border-color: var(--sage);
  box-shadow: var(--shadow-glow-sage);
}
.secondary-btn:active {
  transform: translateY(-1px) scale(0.96);
  transition-duration: 0.12s;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 84px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(60,82,64,0.22);
  background: var(--linen-panel);
  padding: 16px 18px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 22px;
  line-height: 1.5;
  transition: box-shadow 0.28s var(--ease-smooth), border-color 0.28s var(--ease-smooth);
}
textarea:focus {
  outline: none;
  border-color: rgba(124,148,115,0.6);
  box-shadow: 0 0 0 4px var(--glow-sage-soft);
}
textarea::placeholder { color: #9c9884; }

/* ---------- draw stage ---------- */
.draw-inner { text-align: center; }

.theme-chip {
  display: inline-block;
  background: var(--linen-deep);
  color: var(--ink-soft);
  border-radius: 100px;
  padding: 8px 18px;
  font-size: 13px;
  font-style: italic;
  margin-bottom: 26px;
  max-width: 90%;
}

.card-stage {
  position: relative;
  width: min(300px, 78vw);
  aspect-ratio: 3 / 4.35;
  margin: 0 auto 34px;
  perspective: 1400px;
  transition: width 0.35s cubic-bezier(.2,.8,.2,1), aspect-ratio 0.35s cubic-bezier(.2,.8,.2,1);
}

.card-back {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-lift);
  background: linear-gradient(155deg, var(--forest) 0%, var(--forest-deep) 100%);
  transition: transform 0.5s cubic-bezier(.2,.8,.2,1), opacity 0.5s ease, box-shadow 0.4s var(--ease-smooth);
}

.card-back-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.10) 0, transparent 40%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0 2px, transparent 2px 14px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.04) 0 2px, transparent 2px 14px);
}

.card-back-label {
  position: absolute;
  bottom: 26px;
  left: 0; right: 0;
  color: var(--clay-soft);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

.card-back:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-lift), var(--shadow-glow-sage-strong);
}
.card-back:active {
  transform: translateY(-1px) scale(0.98);
  transition-duration: 0.14s;
}

.card-back.is-drawing {
  animation: drawPulse 0.6s ease forwards;
}
@keyframes drawPulse {
  0%   { transform: scale(1) rotate(0deg); }
  40%  { transform: scale(1.04) rotate(-1.5deg); }
  100% { transform: scale(0.94) rotate(3deg); opacity: 0; }
}

.card-face {
  position: absolute;
  inset: 0;
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lift);
  background: var(--linen-panel);
  opacity: 0;
  transform: scale(0.92) rotate(-2deg);
}

.card-face.is-revealed {
  animation: cardReveal 0.7s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes cardReveal {
  0%   { opacity: 0; transform: scale(0.9) rotate(4deg); }
  60%  { opacity: 1; transform: scale(1.03) rotate(-1deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.card-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), object-fit 0s;
}

/* ---------- card rotate controls ---------- */
/* Metaphoric cards aren't always meant to be read one way up — turning
   one over, or on its side, can surface a different reading. These
   controls apply to whatever card is currently shown, in any deck. */
.card-stage.is-sideways {
  width: min(320px, 82vw);
  aspect-ratio: 1 / 1;
}

.card-face.rot-90 img,
.card-face.rot-270 img {
  object-fit: contain;
  background: var(--linen-panel);
}
.card-face.rot-90 img { transform: rotate(90deg); }
.card-face.rot-180 img { transform: rotate(180deg); }
.card-face.rot-270 img { transform: rotate(270deg); }

.card-rotate-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.42), rgba(0,0,0,0));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease 0.25s, transform 0.4s ease 0.25s;
}
.card-face.is-revealed .card-rotate-controls {
  opacity: 1;
  transform: translateY(0);
}

.card-rotate-hint {
  color: rgba(255,255,255,0.88);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.card-rotate-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.16);
  color: #fff;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.card-rotate-btn:hover {
  background: rgba(255,255,255,0.3);
}
.card-rotate-btn:active {
  transform: scale(0.9);
}

/* ---------- card stage group (holds 1 or 2 card stages) ----------
   Blind Draw and single-card Open Selection use just #card-stage, exactly
   as before. Two-card Open Selection also shows #card-stage-2 beside it —
   both shrink slightly so the pair sits together without feeling like a
   pair of thumbnails. */
.card-stage-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 22px;
  margin: 0 auto 34px;
}
.card-stage-group .card-stage {
  margin: 0;
}
.card-stage-group.is-dual .card-stage {
  width: min(210px, 40vw);
}
.card-stage-secondary .card-face {
  /* the second card is only ever shown already-revealed — no flip/back */
  opacity: 0;
  transform: scale(0.92) rotate(-2deg);
}
.card-stage-secondary .card-face.is-revealed {
  animation: cardReveal 0.7s cubic-bezier(.2,.8,.2,1) forwards;
}

/* ---------- reflection ---------- */
.reflection {
  max-width: 480px;
  margin: 0 auto;
  opacity: 0;
}
.reflection.is-shown {
  animation: fadeUp 0.6s ease 0.15s forwards;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reflection-hint {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 14.5px;
  margin-bottom: 18px;
}

.questions {
  list-style: none;
  margin: 0 0 30px;
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.questions li {
  position: relative;
  padding-left: 26px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  opacity: 0;
  transform: translateY(12px);
  cursor: pointer;
}

.questions li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--clay);
}

/* each question breathes in on its own beat, right after the card settles */
.reflection.is-shown .questions li {
  animation: questionIn 0.7s var(--ease-smooth) forwards;
}
.reflection.is-shown .questions li::before {
  animation: questionDotGlow 0.9s var(--ease-smooth) forwards;
}

.reflection.is-shown .questions li:nth-child(1) { animation-delay: 0.30s; }
.reflection.is-shown .questions li:nth-child(2) { animation-delay: 0.48s; }
.reflection.is-shown .questions li:nth-child(3) { animation-delay: 0.66s; }
.reflection.is-shown .questions li:nth-child(4) { animation-delay: 0.84s; }
.reflection.is-shown .questions li:nth-child(5) { animation-delay: 1.02s; }

.reflection.is-shown .questions li:nth-child(1)::before { animation-delay: 0.30s; }
.reflection.is-shown .questions li:nth-child(2)::before { animation-delay: 0.48s; }
.reflection.is-shown .questions li:nth-child(3)::before { animation-delay: 0.66s; }
.reflection.is-shown .questions li:nth-child(4)::before { animation-delay: 0.84s; }
.reflection.is-shown .questions li:nth-child(5)::before { animation-delay: 1.02s; }

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

@keyframes questionDotGlow {
  0%   { box-shadow: 0 0 0 0 rgba(176,131,85,0.55); transform: scale(0.5); }
  55%  { box-shadow: 0 0 0 7px rgba(176,131,85,0); transform: scale(1.25); }
  100% { box-shadow: 0 0 0 0 rgba(176,131,85,0); transform: scale(1); }
}

/* a little tremor when you rest the cursor on a question — as if it
   was touched. Lives on the inner span so it never fights the
   question's own entrance animation. */
.question-text {
  display: inline-block;
  transition: color 0.25s ease;
}

.questions li:hover .question-text {
  animation: questionShiver 0.42s ease-in-out;
  color: var(--forest-deep);
}

.questions li:hover::before {
  background: var(--forest);
}

/* touch devices have no :hover state, so a tap toggles this class
   instead (see script.js) to get the same tremor on a phone/tablet */
.questions li.is-tap-shiver .question-text {
  animation: questionShiver 0.42s ease-in-out;
  color: var(--forest-deep);
}

.questions li.is-tap-shiver::before {
  background: var(--forest);
}

@keyframes questionShiver {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  15%      { transform: translate(-1.5px, 0.5px) rotate(-0.6deg); }
  30%      { transform: translate(1.5px, -0.5px) rotate(0.6deg); }
  45%      { transform: translate(-1.2px, 0.4px) rotate(-0.4deg); }
  60%      { transform: translate(1.2px, -0.4px) rotate(0.4deg); }
  75%      { transform: translate(-0.7px, 0.2px) rotate(-0.2deg); }
  90%      { transform: translate(0.7px, -0.2px) rotate(0.2deg); }
}

@media (prefers-reduced-motion: reduce) {
  .questions li:hover .question-text,
  .questions li.is-tap-shiver .question-text { animation: none; }
  .faq-square-trigger.is-tap-wiggle,
  .faq-square.is-open .faq-square-trigger.is-tap-wiggle { animation: none; }
}

.draw-actions-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.secondary-btn.action-btn {
  width: 100%;
  max-width: 260px;
  text-align: center;
}

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(43,42,34,0.5);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 36px clamp(24px, 5vw, 40px);
  box-shadow: var(--shadow-lift), 0 0 44px 4px var(--glow-sage-soft);
  max-height: 86vh;
  overflow-y: auto;
  animation: modalIn 0.4s cubic-bezier(.2,.8,.2,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0 0 16px;
}
.modal em { color: var(--forest-deep); font-style: italic; }
.modal .primary-btn { margin-top: 6px; }

:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 4px var(--glow-sage-soft);
  border-radius: 4px;
}

/* ---------- header actions / auth / reflections ---------- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

@media (max-width: 480px) {
  .site-header {
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .header-actions {
    flex-wrap: wrap;
    row-gap: 6px;
  }
}

.reflection-save {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(60,82,64,0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.reflection-save textarea {
  width: 100%;
  margin-bottom: 18px;
}

.reflection-status {
  display: block;
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 10px;
  min-height: 1em;
}

/* ---------- loading indicator: a small "breathing dots" cluster ----------
   Used wherever the app is genuinely waiting on the network (My Journey
   fetching its entries, a reflection/profile saving, a booking request
   sending) instead of a bare "Loading…"/"Saving…" string sitting still. */
.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 30px 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-style: italic;
  font-size: 14.5px;
}

.loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.loading-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
  animation: loadingBreathe 1.1s ease-in-out infinite;
}
.loading-dot:nth-child(2) { animation-delay: 0.15s; }
.loading-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes loadingBreathe {
  0%, 80%, 100% { transform: scale(0.55); opacity: 0.35; }
  40%           { transform: scale(1); opacity: 1; }
}

.modal-divider {
  height: 1px;
  margin: 22px 0 18px;
  background: linear-gradient(90deg, transparent, rgba(60,82,64,0.22), transparent);
}

.field-label {
  display: block;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 600;
  margin: 0 0 6px;
}

.field-input {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid rgba(60,82,64,0.22);
  background: var(--linen-panel);
  padding: 12px 16px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 16px;
  transition: box-shadow 0.28s var(--ease-smooth), border-color 0.28s var(--ease-smooth);
}
.field-input:focus {
  outline: none;
  border-color: rgba(124,148,115,0.6);
  box-shadow: 0 0 0 4px var(--glow-sage-soft);
}

#auth-form .primary-btn { width: 100%; margin-bottom: 10px; }

.reflections-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reflection-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 14px 18px;
  transition: transform 0.28s var(--ease-smooth), box-shadow 0.28s var(--ease-smooth);
}
.reflection-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.reflection-item-thumbs {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.reflection-item-thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--linen-deep);
  object-fit: cover;
}

.reflection-item-body {
  min-width: 0;
  flex: 1;
}

.reflection-item-date {
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 600;
  margin: 0 0 6px;
}

.reflection-item-theme {
  font-size: 13.5px;
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

.reflection-item-text {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0;
}

/* a soft, quiet note explaining the two-week journey rhythm — meant to
   read as a gentle aside, not an announcement */
.journey-note {
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: linear-gradient(155deg, var(--glass-bg-tint), var(--glass-bg));
  padding: 14px 18px;
  margin: 0 0 18px;
}
.journey-note p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  font-style: italic;
}

.journey-current-range {
  font-size: 12.5px;
  letter-spacing: 0.03em;
  font-weight: 600;
  color: var(--sage);
  margin: 0 0 18px;
}

/* ---------- journey history: filters + PDF export ---------- */
.journey-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 14px;
}

.journey-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 7px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.25s var(--ease-smooth), color 0.25s var(--ease-smooth), border-color 0.25s var(--ease-smooth), transform 0.2s var(--ease-smooth);
}
.filter-chip:hover { transform: translateY(-1px); border-color: var(--sage); }
.filter-chip.is-active {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--linen-panel);
}

.journey-custom-range {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin: 0 0 18px;
}
.journey-custom-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}
.journey-custom-field input[type="date"] {
  font-family: var(--sans);
  font-size: 14px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--linen-panel);
  color: var(--ink);
}

.journey-filter-summary {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: -6px 0 18px;
}

@media (max-width: 560px) {
  .journey-toolbar { flex-direction: column; align-items: stretch; }
  .journey-toolbar #journey-pdf-btn { width: 100%; text-align: center; }
  .journey-custom-range { flex-direction: column; align-items: stretch; }
}

.journey-section-label {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 34px 0 12px;
}

.past-journeys {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.past-journey {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  overflow: hidden;
}

.past-journey-trigger {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 13px 18px;
  cursor: pointer;
  font-family: var(--sans);
}

.past-journey-range {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--forest-deep);
}

.past-journey-count {
  font-size: 12px;
  color: var(--ink-soft);
  flex-shrink: 0;
}

/* reveal via a grid-template-rows transition (not an animation-forwards
   keyframe) — the same robust, non-hover-dependent mechanism used by the
   FAQ answer panels, so it behaves identically on touch and mouse */
.past-journey-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--ease-smooth);
}
.past-journey.is-open .past-journey-body {
  grid-template-rows: 1fr;
}
.past-journey-body-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 18px;
}
.past-journey.is-open .past-journey-body-inner {
  padding: 2px 18px 16px;
}

.small-btn {
  padding: 8px 18px;
  font-size: 13px;
  box-shadow: none;
}
.small-btn:hover { box-shadow: var(--shadow-glow-sage); }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
}

.user-chip-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: var(--forest);
  background-size: cover;
  background-position: center;
  color: var(--linen-panel);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-chip-name {
  font-size: 13px;
  color: var(--ink-soft);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- profile modal ---------- */
.avatar-upload {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--linen-panel);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-initial {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload-btn {
  display: inline-block;
  cursor: pointer;
}

.required-mark {
  color: var(--sage);
}

/* ---------- booking (Google Calendar) ----------
   Three entry points share one modal: the full-width .booking-section
   at the bottom of the homepage, the glass .booking-card on the deck
   picker (reuses .therapy-card's look), and a quieter .booking-card--draw
   under the reflection box after a draw. The modal is wider than the
   text modals so Google's booking page has room to breathe. */

.booking-section {
  max-width: 980px;
  margin: 8px auto 46px;
  padding: 0 4px;
}

.booking-section-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(155deg, var(--forest) 0%, var(--forest-deep) 100%);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  box-shadow: var(--shadow-lift);
  transition: transform 0.32s var(--ease-smooth), box-shadow 0.32s var(--ease-smooth);
}

.booking-section-inner:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift), 0 0 44px 4px var(--glow-sage-soft);
}

.booking-section .draw-cta-heading {
  font-size: clamp(22px, 2.6vw, 28px);
}

.booking-section .draw-cta-desc {
  max-width: 54ch;
}

@media (max-width: 640px) {
  .booking-section-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 22px;
  }
  .booking-section .draw-cta-btn {
    width: 100%;
  }
}

.booking-card--draw {
  margin-top: 22px;
  padding: 15px 20px;
}

.booking-card--draw .therapy-card-title {
  font-size: 16px;
}

.modal--booking {
  max-width: 820px;
  position: relative;
  padding-top: 30px;
}

.booking-close-x {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s var(--ease-smooth), color 0.2s var(--ease-smooth);
}

.booking-close-x:hover,
.booking-close-x:focus-visible {
  background: rgba(60, 82, 64, 0.1);
  color: var(--forest-deep);
  outline: none;
}

.booking-frame-wrap {
  position: relative;
  margin-top: 18px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--linen-panel);
  border: 1px solid rgba(60, 82, 64, 0.14);
  min-height: 420px;
}

/* soft shimmer while Google's page is loading */
.booking-frame-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, var(--linen-panel) 30%, var(--linen-deep) 50%, var(--linen-panel) 70%);
  background-size: 220% 100%;
  animation: bookingShimmer 1.6s ease-in-out infinite;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.booking-frame-wrap.is-loaded::before {
  opacity: 0;
}

@keyframes bookingShimmer {
  from { background-position: 120% 0; }
  to   { background-position: -120% 0; }
}

.booking-frame {
  display: block;
  width: 100%;
  height: min(600px, 56vh);
  border: 0;
  position: relative;
  z-index: 1;
}

.booking-fallback {
  margin: 12px 0 0;
  text-align: center;
}

.booking-fallback-link {
  color: var(--forest);
  font-weight: 600;
  margin-left: 6px;
}

@media (max-width: 560px) {
  .modal--booking {
    padding: 28px 16px 20px;
    max-height: 92vh;
  }
  .booking-frame {
    height: 62vh;
  }
}

/* ==========================================================================
   Home editorial — the long-form piece and its gallery, living inside
   #view-home below the interactive hero.
   ========================================================================== */

.section-divider {
  width: min(180px, 40%);
  height: 1px;
  margin: 8px auto 40px;
  background: linear-gradient(90deg, transparent, rgba(60,82,64,0.28), transparent);
}

.home-editorial {
  max-width: 600px;
  min-width: 0;
  margin: 0;
  padding: 0 4px 46px;
}

.home-editorial h1,
.home-editorial .editorial-h1 {
  font-size: clamp(23px, 4vw, 29px);
  margin: 0 0 18px;
}

.home-editorial h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(17.5px, 3vw, 19.5px);
  line-height: 1.25;
  color: var(--forest-deep);
  margin: 34px 0 12px;
}

.home-editorial p {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  max-width: 60ch;
  margin: 0 0 12px;
}

.home-editorial strong {
  color: var(--forest-deep);
  font-weight: 700;
}

.home-editorial em {
  font-style: italic;
}

/* Short, quoted inner-monologue lines — set apart with a touch of colour
   and indent, quieter than a heading but distinct from ordinary prose. */
.home-editorial .whisper {
  font-style: italic;
  color: var(--forest);
  padding-left: 14px;
  border-left: 2px solid var(--moss);
  margin: -2px 0 12px;
}

/* Pull-quote treatment for the handful of load-bearing conceptual lines. */
.home-editorial .callout {
  font-family: var(--serif);
  font-size: clamp(17px, 2.6vw, 19px);
  line-height: 1.35;
  color: var(--forest-deep);
  max-width: 24ch;
  margin: 20px 0 20px;
}
.home-editorial .callout strong { font-weight: 500; }

.magritte-link {
  color: var(--forest-deep);
  text-decoration-color: var(--sage);
  text-underline-offset: 3px;
  transition: color 0.25s var(--ease-smooth), text-decoration-color 0.25s var(--ease-smooth);
}
.magritte-link:hover {
  color: var(--forest);
  text-decoration-color: var(--forest);
}

/* ---------- artwork gallery shelf ---------- */
.gallery-shelf {
  /* Stays within the essay's own column width — the old viewport-relative
     breakout assumed the article was centered on the full page, which no
     longer holds now that it shares the top row with the FAQ sidebar. */
  width: 100%;
  max-width: 100%;
  margin: 8px 0 36px;
  padding: 0;
}

.gallery-track {
  display: flex;
  align-items: flex-end;
  gap: clamp(14px, 2.5vw, 26px);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  border-radius: 10px;
}
.gallery-track:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 4px var(--glow-sage-soft);
}

.gallery-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(62vw, 260px);
}

.gallery-img {
  /* A fixed frame (not each image's natural aspect ratio) so all three
     artworks — very different source shapes: tall illustration, near-square
     painting, wide painting — render at exactly the same size, on any
     viewport. object-fit crops to fill the frame instead of stretching. */
  display: block;
  width: min(62vw, 260px);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--glass-border);
  background: var(--linen-panel);
}

.gallery-caption {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gallery-caption em { font-style: italic; }

.gallery-credit {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: #9c9884;
}

@media (max-width: 720px) {
  .home-editorial p,
  .home-editorial .callout {
    max-width: none;
  }
  .gallery-track {
    gap: 14px;
  }
}

/* ==========================================================================
   Home top grid: FAQ sidebar (left) + editorial essay (right)
   ========================================================================== */

.home-top-grid {
  display: grid;
  grid-template-columns: minmax(180px, 32%) 1fr;
  gap: 30px;
  align-items: start;
  max-width: 980px;
  margin: 0 auto;
  padding: 22px 4px 6px;
}

@media (max-width: 780px) {
  .home-top-grid {
    grid-template-columns: 1fr;
    gap: 0;
    max-width: 620px;
    padding: 22px 4px 0;
  }
}

.home-sidebar {
  min-width: 0;
}

/* ==========================================================================
   Home FAQ corner (playful squares)
   ========================================================================== */

.faq-corner {
  margin: 0;
  min-width: 0;
}

@media (max-width: 780px) {
  .faq-corner {
    margin: 0 0 30px;
  }
}

.faq-corner .eyebrow {
  margin: 0 0 6px;
}

.faq-corner h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(20px, 3.6vw, 25px);
  color: var(--forest-deep);
  margin: 0 0 8px;
  max-width: 26ch;
}

.faq-corner-intro {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 13.5px;
  margin: 0 0 20px;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
  max-width: 260px;
}

@media (max-width: 780px) {
  .faq-grid {
    /* The 260px cap above matches the desktop layout, where the FAQ
       shares a narrow sidebar column with the deck gallery. Below 780px
       that sidebar collapses into a single full-width column (see
       .home-top-grid), so the grid should fill it instead of staying
       pinned to its old desktop width and leaving space unused. */
    max-width: none;
  }
}

.faq-square { position: relative; }

.faq-square-trigger {
  all: unset;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  border-radius: 14px;
  background: linear-gradient(155deg, var(--linen-panel), var(--glass-bg-tint));
  border: 1px solid rgba(60, 82, 64, 0.16);
  color: var(--forest-deep);
  transition: border-color 0.3s var(--ease-smooth), box-shadow 0.3s var(--ease-smooth), padding 0.3s var(--ease-smooth);
}

.faq-square-trigger:hover,
.faq-square-trigger:focus-visible {
  border-color: var(--sage);
  box-shadow: var(--shadow-glow-sage);
  animation: faqWiggle 0.5s var(--ease-smooth);
}

/* touch devices have no :hover state, so a tap toggles this class
   instead (see script.js) to get the same wiggle on a phone/tablet.
   A tap both opens the square (adding .is-open on its parent, which
   sets animation: none below) and adds this class in the same instant,
   so the second selector below needs to out-specificity that rule or
   the wiggle gets silently cancelled before it ever plays. */
.faq-square-trigger.is-tap-wiggle,
.faq-square.is-open .faq-square-trigger.is-tap-wiggle {
  border-color: var(--sage);
  box-shadow: var(--shadow-glow-sage);
  animation: faqWiggle 0.5s var(--ease-smooth);
}

.faq-square-trigger:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
}

@keyframes faqWiggle {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(-3deg); }
  60%      { transform: rotate(2.5deg); }
  85%      { transform: rotate(-1deg); }
}

.faq-square-icon {
  width: 22px;
  height: 22px;
  color: var(--forest);
  flex: none;
}
.faq-square-icon svg { width: 100%; height: 100%; display: block; }

.faq-square-teaser {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12px;
  line-height: 1.25;
}

.faq-square-cta {
  font-family: var(--serif);
  font-style: italic;
  font-size: 10.5px;
  color: var(--sage);
  opacity: 0.85;
  transition: opacity 0.25s var(--ease-smooth);
}

/* Open state: the square unfolds into a full-width strip so the answer
   actually has room to breathe, instead of a tragic 90px-wide sliver. */
.faq-square.is-open {
  grid-column: 1 / -1;
}

.faq-square.is-open .faq-square-trigger {
  aspect-ratio: auto;
  flex-direction: row;
  justify-content: flex-start;
  text-align: left;
  padding: 12px 16px;
  border-color: var(--forest);
  box-shadow: var(--shadow-soft);
  animation: none;
}

.faq-square.is-open .faq-square-cta {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.faq-square-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--ease-smooth);
}

.faq-square.is-open .faq-square-panel {
  grid-template-rows: 1fr;
}

.faq-square-panel-inner {
  overflow: hidden;
  min-height: 0;
  padding: 0 18px;
}

.faq-square.is-open .faq-square-panel-inner {
  padding: 4px 18px 18px;
}

.faq-square-found {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  color: var(--sage);
}

.faq-square-question {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 15.5px;
  color: var(--forest-deep);
  margin: 0 0 10px;
  line-height: 1.35;
}

.faq-square-panel-inner p:not(.faq-square-found):not(.faq-square-question) {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 10px;
  max-width: 58ch;
}

@media (max-width: 480px) {
  .faq-square.is-open .faq-square-trigger {
    padding: 12px;
  }
  .faq-square-panel-inner,
  .faq-square.is-open .faq-square-panel-inner {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* ==========================================================================
   Deck gallery (preview cards, one per deck, directly under the FAQ)
   ========================================================================== */

.deck-gallery {
  margin: 26px 0 0;
  min-width: 0;
}

@media (max-width: 780px) {
  .deck-gallery {
    margin: 30px 0 0;
  }
}

.deck-gallery .eyebrow {
  margin: 0 0 6px;
}

.deck-gallery h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(18px, 3.2vw, 22px);
  color: var(--forest-deep);
  margin: 0 0 14px;
  max-width: 26ch;
}

.deck-gallery-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 260px;
}

@media (max-width: 780px) {
  .deck-gallery-grid {
    /* Same reasoning as .faq-grid above: this cap matches the desktop
       sidebar column width, which no longer exists once the layout
       collapses to one full-width column below 780px. */
    max-width: none;
  }
}

.deck-preview-card {
  border-radius: 14px;
  padding: 14px 16px 16px;
  background: linear-gradient(155deg, var(--linen-panel), var(--glass-bg-tint));
  border: 1px solid rgba(60, 82, 64, 0.16);
}

.deck-preview-name {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 14px;
  color: var(--forest-deep);
  margin: 0 0 4px;
}

.deck-preview-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 0 0 12px;
  line-height: 1.4;
}

.deck-preview-thumbs {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}

.deck-preview-thumb-btn {
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  flex: 1 1 0;
  min-width: 0;
  border-radius: 8px;
  transition: transform 0.28s var(--ease-smooth);
}
.deck-preview-thumb-btn:hover { transform: translateY(-3px) scale(1.05); }
.deck-preview-thumb-btn:active { transform: translateY(-1px) scale(0.98); transition-duration: 0.12s; }

.deck-preview-thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 52 / 68;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(60, 82, 64, 0.16);
  box-shadow: var(--shadow-soft);
  transition: opacity 0.42s ease, box-shadow 0.28s var(--ease-smooth);
}
.deck-preview-thumb-btn:hover .deck-preview-thumb {
  box-shadow: var(--shadow-lift), var(--shadow-glow-sage);
}
.deck-preview-thumb.is-fading {
  opacity: 0;
}

.deck-preview-zoom-btn {
  padding: 0;
  border: none;
  background: none;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--forest);
  cursor: pointer;
  transition: color 0.25s ease, transform 0.25s var(--ease-smooth);
}
.deck-preview-zoom-btn:hover { color: var(--forest-deep); transform: translateX(2px); }

/* ==========================================================================
   Deck picker (choose a deck after "Card of the Day" / "Reflect on a Theme")
   ========================================================================== */

.deck-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin: 4px 0 20px;
}

.deck-picker-card {
  text-align: left;
  background: linear-gradient(155deg, var(--linen-panel), var(--glass-bg-tint));
  border: 1px solid rgba(60, 82, 64, 0.16);
  border-radius: 14px;
  padding: 14px 16px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.32s var(--ease-smooth), box-shadow 0.32s var(--ease-smooth), border-color 0.32s var(--ease-smooth);
}

.deck-picker-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift), var(--shadow-glow-sage);
  border-color: rgba(124,148,115,0.55);
}

.deck-picker-card:active {
  transform: translateY(-2px) scale(0.98);
  transition-duration: 0.14s;
}

.deck-picker-card.is-selected {
  border-color: var(--forest);
  box-shadow: var(--shadow-lift), var(--shadow-glow-sage);
}

.deck-picker-name {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--forest-deep);
}

.deck-picker-count {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.deck-picker-thumbs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.deck-picker-thumb {
  width: 52px;
  height: 68px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(60, 82, 64, 0.16);
  box-shadow: var(--shadow-soft);
  flex: none;
}

/* ==========================================================================
   Selection mode picker (Blind Draw vs Open Selection)
   ========================================================================== */
.mode-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 4px 0 20px;
}
@media (max-width: 560px) {
  .mode-picker-grid { grid-template-columns: 1fr; }
}

.mode-picker-card {
  all: unset;
  box-sizing: border-box;
  text-align: left;
  background: linear-gradient(155deg, var(--linen-panel), var(--glass-bg-tint));
  border: 1px solid rgba(60, 82, 64, 0.16);
  border-radius: var(--radius-lg);
  padding: 20px 20px 22px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.32s var(--ease-smooth), box-shadow 0.32s var(--ease-smooth), border-color 0.32s var(--ease-smooth);
}
.mode-picker-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift), var(--shadow-glow-sage);
  border-color: rgba(124,148,115,0.55);
}
.mode-picker-card:active {
  transform: translateY(-2px) scale(0.98);
  transition-duration: 0.14s;
}
.mode-picker-card:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
}

.mode-picker-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  color: var(--forest-deep);
}

.mode-picker-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ==========================================================================
   Open Selection: browsing the temporary random pool
   ========================================================================== */
.selection-pool-inner {
  max-width: 760px;
}

.selection-pool-status-bar {
  position: sticky;
  top: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 16px;
  margin: 4px 0 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-strong);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
}

.selection-pool-status {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-soft);
  flex: 1;
  min-width: 180px;
}
.selection-pool-status.is-limit {
  color: var(--clay);
  font-weight: 600;
}

.selection-pool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
  margin: 0 0 22px;
}
@media (max-width: 480px) {
  .selection-pool-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

.selection-pool-card {
  all: unset;
  box-sizing: border-box;
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4.35;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: var(--shadow-soft);
  transition: transform 0.28s var(--ease-smooth), box-shadow 0.28s var(--ease-smooth), border-color 0.28s var(--ease-smooth);
}
.selection-pool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}
.selection-pool-card:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
}
.selection-pool-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.selection-pool-card.is-selected {
  border-color: var(--forest);
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift), var(--shadow-glow-sage-strong);
}

.selection-pool-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--linen-panel);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.22s var(--ease-smooth), transform 0.22s var(--ease-smooth);
}
.selection-pool-card.is-selected .selection-pool-check {
  opacity: 1;
  transform: scale(1);
}

.selection-pool-card.is-rejected {
  animation: selectionRejectShake 0.4s ease;
}
@keyframes selectionRejectShake {
  0%, 100% { transform: translateX(0); }
  22%      { transform: translateX(-6px); }
  44%      { transform: translateX(5px); }
  66%      { transform: translateX(-3px); }
  88%      { transform: translateX(2px); }
}

.selection-pool-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0 0 20px;
}

.selection-pool-page-label {
  font-size: 12.5px;
  color: var(--ink-soft);
  min-width: 84px;
  text-align: center;
}

.selection-pool-prev:disabled,
.selection-pool-next:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* ==========================================================================
   Deck lightbox (a closer look at a deck's cards, from the gallery)
   ========================================================================== */

.deck-lightbox-overlay {
  padding: 20px;
}

.deck-lightbox {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 420px;
  width: 100%;
  animation: modalIn 0.35s cubic-bezier(.2,.8,.2,1);
}

.deck-lightbox-close {
  position: absolute;
  top: -16px;
  right: -12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--linen-panel);
  color: var(--forest-deep);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s var(--ease-smooth), box-shadow 0.25s var(--ease-smooth);
  z-index: 1;
}
.deck-lightbox-close:hover { transform: scale(1.08); box-shadow: var(--shadow-lift); }
.deck-lightbox-close:active { transform: scale(0.96); }

.deck-lightbox-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.deck-lightbox-img {
  max-width: min(72vw, 300px);
  max-height: 64vh;
  border-radius: 16px;
  box-shadow: var(--shadow-lift), var(--shadow-glow-sage);
  background: var(--linen-panel);
  transition: opacity 0.22s ease;
}
.deck-lightbox-img.is-loading { opacity: 0; }

.deck-lightbox-nav {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  color: var(--forest-deep);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s var(--ease-smooth), box-shadow 0.25s var(--ease-smooth), background 0.25s var(--ease-smooth);
}
.deck-lightbox-nav:hover { transform: scale(1.08); box-shadow: var(--shadow-soft); background: var(--linen-panel); }
.deck-lightbox-nav:active { transform: scale(0.96); transition-duration: 0.12s; }

@media (max-width: 480px) {
  .deck-lightbox-nav { width: 36px; height: 36px; font-size: 19px; }
}

.deck-lightbox-caption {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--linen-panel);
  font-size: 14px;
  text-align: center;
  margin: 0;
}
.deck-lightbox-caption strong {
  font-family: var(--serif);
  font-weight: 600;
}
.deck-lightbox-count {
  opacity: 0.75;
  font-size: 12.5px;
}

/* ==========================================================================
   Blog (/blog/ and /blog/<slug>/) — statically pre-rendered pages, built
   from Sanity content by scripts/build.mjs. Script-free: they reuse this
   same stylesheet and the site's shared header/footer markup, but never
   load script.js, so they stay simple and fast regardless of what the
   Supabase-backed app is doing.
   ========================================================================== */

.blog-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 36px 20px 80px;
}

/* EN/RU switch link in the blog header — a small badge rather than a full
   nav item, since it's just a two-letter language code. */
.blog-lang-switch {
  border: 1px solid rgba(60,82,64,0.25);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 9px;
}

.blog-hero {
  max-width: 640px;
  margin: 0 auto 40px;
  text-align: center;
}
.blog-hero h1 { margin-bottom: 10px; line-height: 1.1; }
.blog-hero-sub {
  display: block;
  font-size: 0.5em;
  font-style: italic;
  font-weight: 400;
  color: var(--ink-soft);
  margin-top: 6px;
}
.blog-hero .lede { margin: 0 auto; }

.blog-empty {
  text-align: center;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-style: italic;
  padding: 40px 0;
}

/* ---- listing grid ---- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--linen-panel);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-soft);
  transition: transform 0.32s var(--ease-smooth), box-shadow 0.32s var(--ease-smooth);
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}

.blog-card-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  background: var(--linen-deep);
}
.blog-card-img--placeholder {
  background: linear-gradient(155deg, var(--moss) 0%, var(--sage) 100%);
}

.blog-card-body {
  padding: 18px 20px 22px;
}
.blog-card-date {
  display: block;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 600;
  margin-bottom: 6px;
}
.blog-card-title {
  font-size: 19px;
  margin: 0 0 8px;
}
.blog-card-excerpt {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
}

/* ---- single post ---- */
.blog-article {
  max-width: 680px;
  margin: 0 auto;
}
.blog-article-back {
  margin: 0 0 20px;
}
.blog-article-back--bottom {
  margin: 40px 0 0;
}
.blog-article-back a {
  color: var(--ink-soft);
  font-size: 13.5px;
  text-decoration: none;
}
.blog-article-back a:hover { color: var(--forest-deep); }

.blog-article-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-soft);
}
.blog-article-date {
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 600;
  margin: 0 0 8px;
}
.blog-article h1 { margin-bottom: 24px; }

.blog-article-body {
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
}
.blog-article-body p { margin: 0 0 20px; }
.blog-article-body h2 {
  font-size: clamp(22px, 4vw, 27px);
  margin: 36px 0 14px;
}
.blog-article-body h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 20px;
  color: var(--forest-deep);
  margin: 28px 0 12px;
}
.blog-article-body a { color: var(--forest); text-decoration-color: var(--moss); }
.blog-article-body a:hover { color: var(--forest-deep); }
.blog-article-body ul,
.blog-article-body ol {
  margin: 0 0 20px;
  padding-left: 1.3em;
}
.blog-article-body li { margin-bottom: 8px; }
.blog-article-body blockquote {
  margin: 0 0 20px;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--moss);
  color: var(--ink-soft);
  font-style: italic;
}
.blog-article-img {
  width: 100%;
  border-radius: var(--radius-md);
  margin: 8px 0 24px;
  display: block;
}

/* header/footer links used only on the script-free blog pages need a couple
   of resets .link-btn / .primary-btn never needed on a <button> */
a.link-btn,
a.primary-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 560px) {
  .blog-main { padding: 26px 16px 60px; }
  .blog-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Emotion map (#view-emotion-map + the homepage entry card)
   ========================================================================== */

/* entry card: same grid cell as the other two modes, but visibly its own
   thing — warm clay tint instead of glass, and a small eyebrow */
.mode-card--emap {
  background: linear-gradient(150deg, rgba(217,198,168,0.55) 0%, rgba(251,248,241,0.85) 100%);
  border-color: rgba(176,131,85,0.35);
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
}
.mode-card--emap .mode-eyebrow {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay);
  font-weight: 600;
}
.mode-card--emap { position: relative; }
.mode-card--emap .mode-icon { color: var(--clay); width: 40px; height: 40px; flex-shrink: 0; }
.mode-card--emap .mode-card-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding-right: 120px; }
@media (max-width: 560px) { .mode-card--emap .mode-card-text { padding-right: 0; } }
.mode-card--emap:hover {
  border-color: rgba(176,131,85,0.6);
  box-shadow: var(--shadow-lift), 0 0 40px 2px rgba(176,131,85,0.22);
}
@media (max-width: 560px) {
  .mode-card--emap { flex-direction: column; align-items: flex-start; padding-top: 34px; }
}

/* view */
.emap { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

.emap-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 14px;
}
.emap-seg {
  display: inline-flex;
  background: var(--linen-panel);
  border: 1px solid rgba(60,82,64,0.18);
  border-radius: 100px;
  padding: 3px;
}
.emap-seg button {
  border: 0;
  background: none;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 100px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.2s var(--ease-smooth), color 0.2s var(--ease-smooth);
}
.emap-seg button[aria-pressed="true"] { background: var(--forest); color: var(--linen-panel); }

.emap-stage {
  position: relative;
  width: fit-content;
  margin: 0 auto;
}
#emap-canvas {
  display: block;
  height: min(72dvh, 820px);
  max-width: 100%;
  aspect-ratio: 1 / 2;
  touch-action: none;
  border-radius: var(--radius-lg);
  background: var(--linen-panel);
  border: 1px solid rgba(60,82,64,0.18);
  box-shadow: var(--shadow-soft);
  cursor: crosshair;
}
.emap-zoom {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.emap-zoom button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(60,82,64,0.22);
  background: rgba(251,248,241,0.92);
  color: var(--forest-deep);
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: var(--shadow-soft);
}
.emap-zoom .emap-zoom-label { font-size: 11.5px; }
.emap-hint {
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 10px 0 14px;
}

.emap-tray {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: grid;
  gap: 12px;
}
.emap-colours {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(3, 32px);
  grid-auto-columns: 32px;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 6px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.emap-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(43,42,34,0.14);
  outline: 2px solid transparent;
  outline-offset: 2px;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  position: relative;
  overflow: hidden;
}
.emap-swatch[aria-pressed="true"] { outline-color: var(--forest-deep); }
.emap-swatch--custom { background: conic-gradient(#d7263d, #f2c14e, #3e9e5a, #1b998b, #2e5eaa, #6a4c93, #d7263d); }
.emap-swatch--custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

.emap-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.emap-tool {
  min-height: 40px;
  padding: 0 14px;
  border: 1.2px solid rgba(60,82,64,0.3);
  border-radius: 100px;
  background: var(--linen-panel);
  color: var(--forest-deep);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.2s var(--ease-smooth), color 0.2s var(--ease-smooth), border-color 0.2s var(--ease-smooth);
}
.emap-tool[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: var(--linen-panel); }
.emap-tool--danger { border-color: rgba(176,131,85,0.7); color: var(--clay); }
.emap-clear-confirm { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-soft); }
@media (hover: none) and (pointer: coarse) { .emap-tool--desktop { display: none; } }

.emap-size-label { font-size: 13.5px; color: var(--ink-soft); font-weight: 600; }
#emap-size { flex: 1 1 120px; min-width: 100px; accent-color: var(--forest); height: 44px; margin: 0; }

.emap-check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-soft); min-height: 44px; cursor: pointer; }
.emap-check input { width: 20px; height: 20px; accent-color: var(--forest); cursor: pointer; }

.emap-h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--forest-deep);
  margin: 26px 0 10px;
}
.emap-legend { display: grid; gap: 8px; }
.emap-legend-empty { font-size: 14px; color: var(--ink-soft); font-style: italic; margin: 0; }
.emap-legend-row { display: flex; align-items: center; gap: 12px; }
.emap-legend-dot { width: 24px; height: 24px; border-radius: 50%; flex: 0 0 24px; border: 1px solid rgba(43,42,34,0.14); }
.emap-legend-input { flex: 1; margin: 0; }
.emap-legend-remove {
  width: 40px; height: 40px; flex: 0 0 40px;
  border: 0; border-radius: 50%; background: transparent;
  color: var(--ink-soft); font-size: 22px; line-height: 1; cursor: pointer; touch-action: manipulation;
}
.emap-legend-remove:hover, .emap-legend-remove:focus-visible { background: rgba(60,82,64,0.1); color: var(--forest-deep); }
.emap-note { resize: vertical; margin-bottom: 18px; }

.emap-download { width: 100%; }
.emap-privacy { font-size: 13px; color: var(--ink-soft); text-align: center; margin: 10px 0 0; }
.emap-care {
  margin: 30px 0 0;
  padding: 14px 16px;
  border-left: 3px solid var(--moss);
  background: rgba(183,196,160,0.14);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.emap-care a { color: var(--forest); font-weight: 600; }

.emap button:focus-visible, .emap input:focus-visible, .emap textarea:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .emap-seg button, .emap-tool { transition: none; }
}

/* ==========================================================================
   Pentagram (#view-pentagram + the homepage entry card)
   ========================================================================== */

.mode-card--penta {
  background: linear-gradient(150deg, rgba(183,196,160,0.45) 0%, rgba(251,248,241,0.85) 100%);
  border-color: rgba(124,148,115,0.4);
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  position: relative;
}
.mode-card--penta .mode-eyebrow {
  position: absolute; top: 12px; right: 16px;
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--sage); font-weight: 600;
}
.mode-card--penta .mode-icon { color: var(--forest); width: 40px; height: 40px; flex-shrink: 0; }
.mode-card--penta .mode-card-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding-right: 130px; }
.mode-card--penta:hover { border-color: rgba(124,148,115,0.7); }
@media (max-width: 560px) {
  .mode-card--penta { flex-direction: column; align-items: flex-start; padding-top: 34px; }
  .mode-card--penta .mode-card-text { padding-right: 0; }
}

.penta-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(12px, 3vw, 28px) calc(28px + env(safe-area-inset-bottom));
}
.penta-header {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 14px 24px; margin-bottom: 16px;
}
.penta-header-text .lede { margin-bottom: 0; }
.penta-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.penta-tool {
  min-height: 40px; padding: 0 16px;
  border: 1.2px solid rgba(60,82,64,0.3); border-radius: 100px;
  background: var(--linen-panel); color: var(--forest-deep);
  font-family: var(--sans); font-size: 13.5px; font-weight: 600;
  cursor: pointer; touch-action: manipulation;
  transition: background 0.2s var(--ease-smooth), color 0.2s var(--ease-smooth), border-color 0.2s var(--ease-smooth);
}
.penta-tool:hover:not(:disabled) { border-color: var(--forest); }
.penta-tool.is-active { background: var(--forest); border-color: var(--forest); color: var(--linen-panel); }
.penta-tool:disabled { opacity: 0.45; cursor: not-allowed; }
.penta-tool--danger { border-color: rgba(176,131,85,0.7); color: var(--clay); }

.penta-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}
@media (max-width: 900px) { .penta-main { grid-template-columns: 1fr; } }

.penta-stage {
  background: var(--linen-panel);
  border: 1px solid rgba(60,82,64,0.16);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 6px;
}
#penta-svg { width: 100%; height: auto; display: block; }
.penta-label { font-family: var(--serif); font-size: 21px; font-weight: 500; }
.penta-chip-text { font-family: var(--sans); font-size: 13px; }
[data-layer="glow"], [data-layer="guide"], [data-layer="living"], [data-layer="outline"], [data-layer="figure"] { pointer-events: none; }
[data-layer="links"] path { pointer-events: stroke; }
.penta-point, .penta-chip { cursor: pointer; outline: none; }
.penta-point:focus-visible circle:last-of-type, .penta-chip:focus-visible rect { stroke: var(--forest); stroke-width: 3; }
.penta-living { transition: d 0.5s var(--ease-smooth); }
@media (prefers-reduced-motion: reduce) { .penta-living { transition: none; } }

.penta-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.penta-h3 { font-family: var(--serif); font-size: 22px; font-weight: 500; color: var(--forest-deep); margin: 0 0 8px; display: flex; align-items: center; gap: 10px; }
.penta-h4 { font-family: var(--serif); font-size: 16.5px; font-weight: 500; color: var(--forest-deep); margin: 22px 0 8px; }
.penta-p { font-size: 14px; line-height: 1.55; color: var(--ink-soft); margin: 0 0 10px; }
.penta-desc { margin-bottom: 4px; }
.penta-hintbox {
  margin: 14px 0 0; padding: 12px 14px;
  border-left: 3px solid var(--moss); background: rgba(183,196,160,0.14);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 13.5px; line-height: 1.55; color: var(--ink-soft);
}
.penta-hint { font-size: 12.5px; color: var(--ink-soft); margin: -2px 0 8px; }
.penta-dot { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 14px; display: inline-block; }
.penta-dot--faded { opacity: 0.55; }

.penta-questions { display: grid; gap: 6px; margin-bottom: 14px; }
.penta-q {
  text-align: left; font-family: var(--serif); font-style: italic; font-size: 14.5px; line-height: 1.4;
  color: var(--ink-soft); background: transparent; border: 0; border-left: 2px solid rgba(60,82,64,0.25);
  padding: 8px 12px; cursor: pointer; border-radius: 0 var(--radius-md) var(--radius-md) 0; touch-action: manipulation;
}
.penta-q.is-active { background: var(--forest-deep); color: var(--linen-panel); font-size: 15.5px; border-left-width: 3px; }

.penta-slider-row { margin: 12px 0 0; }
.penta-slider-line { display: flex; align-items: center; gap: 10px; }
#penta-slider { flex: 1; accent-color: var(--forest); height: 44px; margin: 0; }
.penta-slider-val { min-width: 22px; text-align: center; font-weight: 600; color: var(--forest-deep); }
.penta-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.penta-sug {
  border: 1.2px solid var(--area); color: var(--area); background: transparent;
  border-radius: 100px; padding: 6px 11px; font-family: var(--sans); font-size: 13px; cursor: pointer; touch-action: manipulation; min-height: 34px;
}
.penta-sug.is-on { background: var(--area); color: #fff; font-weight: 600; }

.penta-words { display: grid; gap: 6px; margin-top: 14px; }
.penta-word { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); }
.penta-word-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.penta-word-v { color: var(--ink-soft); font-size: 12.5px; }
.penta-empty { font-size: 14px; color: var(--ink-soft); font-style: italic; margin: 0; }
.penta-x {
  width: 36px; height: 36px; flex: 0 0 36px; border: 0; border-radius: 50%; background: transparent;
  color: var(--ink-soft); font-size: 20px; line-height: 1; cursor: pointer; touch-action: manipulation;
}
.penta-x:hover, .penta-x:focus-visible { background: rgba(60,82,64,0.1); color: var(--forest-deep); }
.penta-links, .penta-snaps { display: grid; gap: 6px; }
.penta-link-row, .penta-snap-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.penta-link-row span, .penta-snap-date { flex: 1; }
.penta-notice { margin-bottom: 16px; padding: 12px 14px; background: rgba(176,131,85,0.12); border-radius: var(--radius-md); font-size: 14px; color: var(--ink); }
.penta-notice p { margin: 0 0 10px; }
.penta-back { padding: 10px 18px; font-size: 13.5px; }
.penta-clear-wrap { margin-top: 20px; }
.penta-clear-confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-soft); }
.penta-inner .emap-privacy { margin-top: 16px; }
.penta-inner button:focus-visible, .penta-inner input:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }

/* ==========================================================================
   Hero — the first thing a new visitor sees
   ========================================================================== */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(20px, 4vw, 48px);
  max-width: 980px;
  margin: 8px auto 26px;
  padding: clamp(8px, 2vw, 18px) 4px 0;
}
.hero-text .eyebrow { margin-bottom: 10px; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--forest-deep);
  margin: 0 0 16px;
  max-width: 14ch;
}
.hero-lede {
  font-size: clamp(15.5px, 1.4vw, 17.5px);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 22px;
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.hero-btn { padding: 14px 30px; font-size: 15.5px; }
.hero-link { font-size: 14px; }

.hero-cards {
  position: relative;
  height: clamp(250px, 28vw, 340px);
  min-width: 0;
}
/* A hand of four cards: each one is shifted sideways (--dx) and tilted
   (--rot) around a pivot well below the cards, so they spread like a fan
   held in a hand — all four visible, edges overlapping a little. */
.hero-card {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: clamp(110px, 12.5vw, 150px);
  height: auto;
  aspect-ratio: 768 / 1100;
  object-fit: cover;
  border-radius: 14px;
  border: 4px solid var(--linen-panel);
  box-shadow: var(--shadow-lift);
  transform-origin: 50% 160%;
  transform: translateX(calc(-50% + var(--dx))) rotate(var(--rot));
  transition: transform 0.6s var(--ease-smooth);
}
.hero-card-1 { --dx: -48%;  --rot: -14deg; z-index: 1; }
.hero-card-2 { --dx: -16%;  --rot: -5deg;  z-index: 2; }
.hero-card-3 { --dx: 16%;   --rot: 5deg;   z-index: 3; }
.hero-card-4 { --dx: 48%;   --rot: 14deg;  z-index: 4; }
.hero-cards:hover .hero-card-1 { --dx: -56%; --rot: -17deg; }
.hero-cards:hover .hero-card-2 { --dx: -19%; --rot: -6deg; }
.hero-cards:hover .hero-card-3 { --dx: 19%;  --rot: 6deg; }
.hero-cards:hover .hero-card-4 { --dx: 56%;  --rot: 17deg; }

@media (prefers-reduced-motion: no-preference) {
  .hero-card { animation: heroFan 1s var(--ease-smooth) both; }
  .hero-card-2 { animation-delay: 0.06s; }
  .hero-card-3 { animation-delay: 0.12s; }
  .hero-card-4 { animation-delay: 0.18s; }
  @keyframes heroFan {
    from { opacity: 0; transform: translateX(-50%) rotate(0deg) translateY(14px); }
    to   { opacity: 1; transform: translateX(calc(-50% + var(--dx))) rotate(var(--rot)); }
  }
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 10px; margin-bottom: 18px; }
  .hero h1 { max-width: none; }
  .hero-cards { height: 200px; order: -1; margin-bottom: 6px; }
  .hero-card { width: 96px; bottom: 18px; }
  .hero-card-1 { --dx: -54%; }
  .hero-card-4 { --dx: 54%; }
}

/* ==========================================================================
   FAQ page (#view-faq) — accordion; the homepage keeps its squares
   ========================================================================== */
.faq-list { display: grid; gap: 10px; margin: 8px 0 30px; }
.faq-item {
  background: var(--glass-bg);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.3s var(--ease-smooth), box-shadow 0.3s var(--ease-smooth), transform 0.3s var(--ease-smooth);
}
.faq-item:hover { border-color: rgba(124,148,115,0.55); box-shadow: var(--shadow-soft); }
.faq-item.is-open { border-color: rgba(124,148,115,0.7); box-shadow: var(--shadow-soft), var(--shadow-glow-sage); }
.faq-item-trigger {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "num q chev" "num teaser chev";
  column-gap: 14px; row-gap: 2px; align-items: center;
  padding: 16px 18px; color: var(--forest-deep); touch-action: manipulation;
}
.faq-item-num { grid-area: num; font-family: var(--serif); font-size: 15px; color: var(--sage); font-variant-numeric: tabular-nums; }
.faq-item-q { grid-area: q; font-family: var(--serif); font-size: 17.5px; font-weight: 500; line-height: 1.3; }
.faq-item-teaser { grid-area: teaser; font-size: 12.5px; font-style: italic; color: var(--ink-soft); }
.faq-item-chevron {
  grid-area: chev; width: 12px; height: 12px;
  border-right: 1.8px solid var(--forest); border-bottom: 1.8px solid var(--forest);
  transform: rotate(45deg); transition: transform 0.35s var(--ease-smooth); margin-top: -4px;
}
.faq-item.is-open .faq-item-chevron { transform: rotate(-135deg); margin-top: 4px; }
.faq-item-panel {
  max-height: 0; overflow: hidden;
  transition: max-height 0.45s var(--ease-smooth);
}
.faq-item-panel p {
  margin: 0 18px 14px 50px; font-size: 14.5px; line-height: 1.6; color: var(--ink);
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.35s var(--ease-smooth) 0.1s, transform 0.35s var(--ease-smooth) 0.1s;
}
.faq-item.is-open .faq-item-panel p { opacity: 1; transform: none; }
.faq-item-panel p:first-child { padding-top: 2px; }
.faq-page-cta { margin-top: 10px; }

/* fresh entrance: items rise in one after another when the page opens */
@media (prefers-reduced-motion: no-preference) {
  #view-faq[data-active="true"] .faq-item {
    animation: faqRise 0.55s var(--ease-smooth) both;
    animation-delay: calc(var(--i) * 60ms);
  }
  @keyframes faqRise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
  }
}
@media (max-width: 560px) {
  .faq-item-trigger { padding: 14px 14px; column-gap: 10px; }
  .faq-item-q { font-size: 16px; }
  .faq-item-panel p { margin-left: 14px; }
}

/* ---------- Privacy page ---------- */
.privacy-body { margin: 6px 0 40px; max-width: 62ch; }
.privacy-body h3 {
  font-family: var(--font-display, inherit);
  font-size: 1.15rem;
  font-weight: 500;
  margin: 28px 0 8px;
  color: var(--forest-deep, inherit);
}
.privacy-body p { line-height: 1.65; color: var(--ink-soft); margin: 0; }
.privacy-body a { color: var(--forest-deep, inherit); text-decoration: underline; text-underline-offset: 3px; }
.privacy-body strong { color: var(--ink, inherit); font-weight: 600; }
.footer-links { margin-top: 10px; }
.footer-links .link-btn { font-size: 12.5px; padding: 4px 8px; }
