/* ============================================================ foundations */

:root {
  --sand-50:  #faf6ea;
  --sand-100: #f3dee2;
  --sand-200: #ecc9d1;
  --sand-300: #ddaab6;

  --clay:      #c93d85;
  --clay-deep: #9c2e68;
  --clay-soft: #e8a9c4;
  --rose:      #d9748f;
  --sage:      #a9c4d8;

  --ink:      #2a2d4e;
  --ink-soft: #5b5e7c;
  --ink-faint:#8d8fa6;

  --paper: #fdfbf6;
  --line: rgba(42, 45, 78, .18);
  --line-strong: rgba(42, 45, 78, .32);

  --shadow-sm: 0 1px 2px rgba(42, 45, 78, .05), 0 4px 14px rgba(42, 45, 78, .05);
  --shadow-md: 0 2px 4px rgba(42, 45, 78, .05), 0 14px 38px rgba(42, 45, 78, .09);
  --shadow-lg: 0 6px 12px rgba(42, 45, 78, .07), 0 34px 70px rgba(42, 45, 78, .16);

  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, system-ui, sans-serif;
  --font-heading: 'Source Serif Pro', 'Iowan Old Style', Palatino, Georgia, serif;
  --font-meta: 'Inconsolata', ui-monospace, 'SF Mono', 'Cascadia Code', monospace;

  --radius: 22px;
  --gutter: clamp(20px, 5vw, 64px);
}

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

[hidden] { display: none !important; }

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

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--sand-100);
  background-image:
    radial-gradient(120% 80% at 50% -10%, #fdfbf6 0%, rgba(253, 251, 246, 0) 60%),
    linear-gradient(178deg, var(--sand-50) 0%, var(--sand-100) 48%, var(--sand-200) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* ------------------------------------------------ ambient warmth & texture */

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ layout */

.page {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: clamp(40px, 7vh, 84px) var(--gutter) clamp(20px, 3vh, 32px);
}

.layout {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  gap: clamp(32px, 5vw, 72px);
}

/* --------------------------------------------------------------- masthead */

.masthead {
  flex: 0 0 clamp(260px, 30vw, 380px);
  text-align: left;
  position: sticky;
  top: clamp(40px, 7vh, 84px);
  transition: opacity .4s ease, transform .4s ease;
}

.question {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(1.9rem, 4.4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -.015em;
  text-wrap: balance;
  color: var(--ink);
}
.question em {
  font-style: normal;
  color: var(--clay-deep);
  position: relative;
  white-space: nowrap;
}
.question em::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: .06em;
  height: .5em;
  background: linear-gradient(180deg, rgba(232, 169, 196, 0) 0%, rgba(232, 169, 196, .5) 100%);
  border-radius: 0 0 .3em .3em;
  z-index: -1;
}

.cta-row {
  margin-top: clamp(24px, 4vh, 36px);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.last-updated {
  margin: 10px 0 0;
  font-family: var(--font-heading);
  font-size: 1.02rem;
  color: var(--ink-soft);
}
.last-updated-link {
  font: inherit;
  color: var(--clay-deep);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--clay-soft);
}
.last-updated-link:hover, .last-updated-link:focus-visible { color: var(--clay); }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-family: var(--font-meta);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: .01em;
  color: #fdfbf6;
  background: linear-gradient(170deg, var(--clay) 0%, var(--clay-deep) 100%);
  border: none;
  border-radius: 999px;
  padding: 16px 36px;
  cursor: pointer;
  box-shadow: 0 2px 3px rgba(74, 26, 54, .18), 0 10px 24px rgba(156, 46, 104, .26);
  transition: background .2s ease, transform .18s cubic-bezier(.2,.8,.3,1), box-shadow .18s ease;
}
.cta:hover {
  background: linear-gradient(170deg, var(--clay-deep) 0%, var(--clay) 100%);
  transform: translateY(-1px);
  box-shadow: 0 3px 5px rgba(74, 26, 54, .2), 0 16px 32px rgba(156, 46, 104, .3);
}
.cta:active { transform: translateY(1px) scale(.99); }
.cta:focus-visible { outline: 3px solid var(--clay-soft); outline-offset: 3px; }

.cta-secondary {
  font-family: var(--font-meta);
  font-weight: 600;
  font-size: .92rem;
  letter-spacing: .01em;
  color: var(--clay-deep);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 15px 26px;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}
.cta-secondary:hover { background: var(--sand-50); border-color: var(--clay-soft); }
.cta-secondary:active { transform: translateY(1px); }
.cta-secondary:focus-visible { outline: 3px solid var(--clay-soft); outline-offset: 3px; }

/* ------------------------------------------------------------------- card */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: clamp(22px, 3.4vw, 38px);
}

.fields {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(14px, 2vw, 20px);
}
.field-name    { grid-column: span 4; }
.field-age     { grid-column: span 2; }
.field-town    { grid-column: span 3; }
.field-country { grid-column: span 3; }
.field-email   { grid-column: span 6; }
.field-answer  { grid-column: span 6; position: relative; }

.field { margin: 0; display: flex; flex-direction: column; gap: 7px; text-align: left; }
input, textarea { text-align: left; }

label {
  font-family: var(--font-meta);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.optional {
  font-family: var(--sans);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-faint);
  font-size: .82em;
}

input, textarea {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--ink);
  background: #fdfbf6;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 15px;
  width: 100%;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
textarea {
  font-size: 1.1rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 8.5em;
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); opacity: .75; }

input:hover, textarea:hover { border-color: var(--line-strong); }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--clay-soft);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(232, 169, 196, .28);
}
.field.invalid input, .field.invalid textarea {
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(217, 116, 143, .18);
}

/* hide number spinners — kinder on a kiosk */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.counter {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-family: var(--font-meta);
  font-size: .72rem;
  color: var(--ink-faint);
  background: linear-gradient(90deg, rgba(253,251,246,0), #fdfbf6 30%);
  padding: 2px 4px 2px 14px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
}
.field-answer:focus-within .counter { opacity: 1; }

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  margin-top: clamp(18px, 2.6vw, 26px);
  flex-wrap: wrap;
}

.error {
  margin: 0;
  margin-right: auto;
  color: var(--clay-deep);
  font-size: .9rem;
  max-width: 42ch;
}

.submit {
  font: inherit;
  font-family: var(--font-meta);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: .01em;
  color: #fdfbf6;
  background: linear-gradient(170deg, var(--clay) 0%, var(--clay-deep) 100%);
  border: none;
  border-radius: 999px;
  padding: 15px 34px;
  cursor: pointer;
  box-shadow: 0 2px 3px rgba(74, 26, 54, .18), 0 10px 24px rgba(156, 46, 104, .26);
  transition: transform .18s cubic-bezier(.2,.8,.3,1), box-shadow .18s ease, filter .18s ease;
}
.submit:hover { transform: translateY(-1px); box-shadow: 0 3px 5px rgba(74, 26, 54, .2), 0 16px 32px rgba(156, 46, 104, .3); }
.submit:active { transform: translateY(1px) scale(.99); }
.submit:focus-visible { outline: 3px solid var(--clay-soft); outline-offset: 3px; }
.submit[disabled] { filter: saturate(.5) opacity(.7); cursor: progress; transform: none; }

.ghost {
  font: inherit;
  font-weight: 600;
  color: var(--clay-deep);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 12px 26px;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}
.ghost:hover { background: var(--sand-50); border-color: var(--clay-soft); }
.ghost:focus-visible { outline: 3px solid var(--clay-soft); outline-offset: 3px; }

/* ----------------------------------------------------------- thank-you card */

.thanks {
  text-align: center;
  animation: rise .6s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
.thanks-mark {
  font-size: 2.4rem;
  color: var(--rose);
  line-height: 1;
  animation: beat 2.6s ease-in-out infinite;
}
@keyframes beat {
  0%, 100% { transform: scale(1); }
  12%      { transform: scale(1.14); }
  24%      { transform: scale(1); }
  36%      { transform: scale(1.08); }
}
.thanks-title {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  margin: 14px 0 8px;
}
.thanks-copy {
  margin: 0 auto 26px;
  max-width: 44ch;
  color: var(--ink-soft);
  line-height: 1.65;
}

/* ------------------------------------------------------------------- wall */

.wall {
  flex: 1;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: opacity .2s ease;
}
.wall.is-switching { opacity: 0; }

.tally {
  margin: 0;
  font-family: var(--font-meta);
  font-weight: 600;
  font-size: 1rem;
  color: var(--clay-deep);
  letter-spacing: .02em;
  white-space: nowrap;
}

.empty {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--ink-faint);
  padding: 40px 0 50px;
  margin: 0;
}

.wall-viewport {
  --card-h: 236px;
  --grid-gap: clamp(12px, 1.8vw, 20px);
  position: relative;
  flex: 1;
  min-height: calc(2 * var(--card-h) + var(--grid-gap));
}
/* the 2-row floor above is sized for the card wall; the map has its own
   aspect-ratio box and doesn't need it -- without this, narrow viewports
   stretched .wall-viewport tall enough to push the corner buttons down
   into the sticky footer. */
body.is-map .wall-viewport { min-height: 0; }

.wall-columns {
  display: flex;
  gap: var(--grid-gap);
  height: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 8%, #000 92%, transparent);
}

.wall-col { flex: 1 1 0; min-width: 0; }

.col-track {
  display: flex;
  flex-direction: column;
  gap: var(--grid-gap);
  will-change: transform;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.col-track.dir-up   { animation-name: col-scroll-up; }
.col-track.dir-down { animation-name: col-scroll-down; }
@keyframes col-scroll-up   { from { transform: translate3d(0, 0, 0); }    to { transform: translate3d(0, -50%, 0); } }
@keyframes col-scroll-down { from { transform: translate3d(0, -50%, 0); } to { transform: translate3d(0, 0, 0); } }

.wall-viewport:hover .col-track,
.wall-viewport.paused .col-track { animation-play-state: paused; }

.expand-btn {
  position: absolute;
  bottom: 6px;
  width: 51px;
  height: 51px;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  z-index: 5;
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}
#expand-btn { right: 6px; }
#map-btn { right: 63px; }
.expand-btn:hover { background: var(--sand-50); color: var(--clay-deep); }
.expand-btn:focus-visible { outline: 3px solid var(--clay-soft); outline-offset: 3px; }
.expand-btn svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.expand-btn .icon-collapse, .expand-btn .icon-list { display: none; }
.expand-btn[aria-pressed="true"] .icon-expand,
.expand-btn[aria-pressed="true"] .icon-map { display: none; }
.expand-btn[aria-pressed="true"] .icon-collapse,
.expand-btn[aria-pressed="true"] .icon-list { display: block; }

/* ---------------------------------------------------------------- map view */

.wall-map {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}
.wall-map.is-panning { cursor: grabbing; }
.wall-map-inner {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 784.077 / 458.627; /* matches world-map.svg's viewBox */
  transform-origin: 0 0;
}
.wall-map-svg,
.wall-map-markers {
  position: absolute;
  inset: 0;
}
.wall-map-svg svg { width: 100%; height: 100%; display: block; }
.wall-map-svg svg path {
  fill: var(--sand-200);
  stroke: var(--line-strong);
  stroke-width: .6;
}

.map-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}
.map-marker::after {
  content: '';
  display: block;
  width: var(--dot-size, 14px);
  height: var(--dot-size, 14px);
  background: var(--clay-deep);
  border: 2px solid var(--paper);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease;
}
.map-marker:hover::after, .map-marker:focus-visible::after { transform: scale(1.2); }
.map-marker:focus-visible { outline: 3px solid var(--clay-soft); outline-offset: 2px; border-radius: 50%; }

.map-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-meta);
  font-size: .72rem;
  padding: 4px 9px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.map-marker:hover .map-tooltip, .map-marker:focus-visible .map-tooltip { opacity: 1; }

/* -------------------------------------------------------------- expanded */

body.is-expanded .masthead,
body.is-expanded .foot {
  opacity: 0;
  pointer-events: none;
}
body.is-expanded .masthead { transform: translateY(-18px); }
body.is-expanded .foot { transform: translateY(18px); }

body.is-expanded .wall {
  position: fixed;
  inset: 0;
  z-index: 45;
  padding: clamp(28px, 6vh, 56px) var(--gutter);
  background:
    radial-gradient(120% 80% at 50% -10%, #fdfbf6 0%, rgba(253, 251, 246, 0) 60%),
    linear-gradient(178deg, var(--sand-50) 0%, var(--sand-100) 48%, var(--sand-200) 100%);
}
/* ---------------------------------------------------------- voice cards */

.voice {
  height: var(--card-h);
  flex: 0 0 var(--card-h);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  background: var(--paper);
  border: 1px solid rgba(42, 45, 78, .24);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: transform .28s cubic-bezier(.2,.8,.3,1), box-shadow .28s ease, border-color .28s ease;
}
.voice:hover, .voice:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(232, 169, 196, .8);
  outline: none;
}
.voice:nth-child(4n+3) { background: #f7f2e4; }
.voice:nth-child(4n)   { background: #f7e8ec; }

.voice-text {
  margin: 0;
  min-height: 0;
  flex: 1;
  font-family: var(--font-heading);
  font-size: .98rem;
  line-height: 1.56;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 98%);
          mask-image: linear-gradient(180deg, #000 72%, transparent 98%);
}
.voice-text::before {
  content: '\201C';
  color: var(--clay-soft);
  font-size: 1.5em;
  line-height: 0;
  vertical-align: -.28em;
  margin-right: .06em;
}

.voice-meta {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--font-meta);
  font-size: .74rem;
  color: var(--ink-soft);
  letter-spacing: .01em;
}
.voice-meta strong { font-weight: 600; color: var(--ink); }
.voice-meta .dot { color: var(--ink-faint); margin: 0 .45em; }

.voice.fresh { animation: fresh 2.4s ease-out both; }
@keyframes fresh {
  0%   { box-shadow: 0 0 0 0 rgba(232, 169, 196, .9); border-color: var(--clay-soft); }
  100% { box-shadow: 0 0 0 16px rgba(232, 169, 196, 0); }
}


/* ---------------------------------------------------------- composer modal */

.composer-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: var(--gutter);
}
.composer-scrim {
  position: absolute;
  inset: 0;
  background: rgba(42, 45, 78, .42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade .3s ease both;
}

.composer-dialog {
  position: relative;
  max-width: 800px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  animation: rise .38s cubic-bezier(.2,.8,.3,1) both;
}

.composer-heading {
  margin: 0 0 clamp(18px, 2.6vw, 26px);
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
}

.composer-close {
  position: absolute;
  top: 14px; right: 16px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.composer-close:hover { background: var(--sand-100); color: var(--ink); }
.composer-close:focus-visible { outline: 3px solid var(--clay-soft); outline-offset: 3px; }

/* -------------------------------------------------------------- intention */

.intention-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: var(--gutter);
}
.intention-scrim {
  position: absolute;
  inset: 0;
  background: rgba(42, 45, 78, .42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade .3s ease both;
}

.intention-dialog {
  position: relative;
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  animation: rise .38s cubic-bezier(.2,.8,.3,1) both;
}

.intention-heading {
  margin: 0 0 clamp(14px, 2.2vw, 20px);
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
}

.intention-text {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.02rem, 1.6vw, 1.15rem);
  line-height: 1.72;
  color: var(--ink);
}

.intention-close {
  position: absolute;
  top: 14px; right: 16px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.intention-close:hover { background: var(--sand-100); color: var(--ink); }
.intention-close:focus-visible { outline: 3px solid var(--clay-soft); outline-offset: 3px; }

.intention-note {
  margin: clamp(18px, 3vh, 26px) 0 0;
  padding-top: clamp(16px, 2.6vh, 22px);
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: .92rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.intention-note + .intention-note {
  margin-top: clamp(12px, 2vh, 16px);
  padding-top: 0;
  border-top: none;
}

.intention-signoff {
  margin: clamp(14px, 2vh, 18px) 0 0;
  font-family: var(--font-heading);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------- lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: var(--gutter);
}
.lightbox-scrim {
  position: absolute;
  inset: 0;
  background: rgba(42, 45, 78, .42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade .3s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.lightbox-card {
  position: relative;
  margin: 0;
  max-width: 620px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: clamp(30px, 4.4vw, 46px);
  animation: rise .38s cubic-bezier(.2,.8,.3,1) both;
}
.lightbox-card blockquote {
  margin: 0 0 22px;
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 2.3vw, 1.4rem);
  line-height: 1.68;
  white-space: pre-wrap;
}
.lightbox-card figcaption {
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--font-meta);
  font-size: .8rem;
  color: var(--ink-soft);
}
.lightbox-card figcaption strong { color: var(--ink); }
.lightbox-card figcaption .dot { color: var(--ink-faint); margin: 0 .45em; }

.lightbox-close {
  position: absolute;
  top: 14px; right: 16px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.lightbox-close:hover { background: var(--sand-100); color: var(--ink); }

/* -------------------------------------------------------------- location */

.location-modal {
  position: fixed;
  inset: 0;
  z-index: 49;
  display: grid;
  place-items: center;
  padding: var(--gutter);
}
.location-scrim {
  position: absolute;
  inset: 0;
  background: rgba(42, 45, 78, .42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade .3s ease both;
}
.location-dialog {
  position: relative;
  margin: 0;
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  animation: rise .38s cubic-bezier(.2,.8,.3,1) both;
}
.location-heading {
  margin: 0 0 clamp(14px, 2.2vw, 20px);
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
}
.location-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.location-item {
  width: 100%;
  display: block;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--sand-50);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}
.location-item:hover, .location-item:focus-visible {
  background: var(--paper);
  border-color: var(--clay-soft);
  outline: none;
}
.location-excerpt {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: .96rem;
  line-height: 1.5;
  color: var(--ink);
}
.location-meta {
  margin: 0;
  font-family: var(--font-meta);
  font-size: .74rem;
  color: var(--ink-soft);
}
.location-meta strong { font-weight: 600; color: var(--ink); }
.location-meta .dot { color: var(--ink-faint); margin: 0 .45em; }

.location-close {
  position: absolute;
  top: 14px; right: 16px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.location-close:hover { background: var(--sand-100); color: var(--ink); }
.location-close:focus-visible { outline: 3px solid var(--clay-soft); outline-offset: 3px; }

/* ------------------------------------------------------------------- foot */

.foot-links {
  display: flex;
  justify-content: flex-start;
  gap: clamp(18px, 3vw, 32px);
  flex-wrap: wrap;
}
.foot-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  text-decoration: none;
  font-family: var(--font-meta);
  font-size: .78rem;
  letter-spacing: .03em;
  padding: 6px 4px;
  transition: color .2s ease;
}
.foot-links a:hover, .foot-links a:focus-visible { color: var(--clay-deep); }
.foot-links svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.foot {
  position: sticky;
  bottom: 0;
  z-index: 10;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 3vw, 24px);
  flex-wrap: wrap;
  text-align: left;
  padding: clamp(14px, 2.4vh, 20px) var(--gutter);
  border-top: 1px solid var(--line);
  background: var(--paper);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity .4s ease, transform .4s ease;
}

/* ------------------------------------------------------------ small screens */

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .masthead {
    flex: none;
    position: static;
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
  }
  .foot { position: static; text-align: center; justify-content: center; }
  .foot-links { justify-content: center; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .cta { justify-content: center; }
  .cta, .cta-secondary { width: 100%; }
}

@media (max-width: 640px) {
  .fields { grid-template-columns: repeat(4, 1fr); }
  .field-name    { grid-column: span 3; }
  .field-age     { grid-column: span 1; }
  .field-town    { grid-column: span 4; }
  .field-country { grid-column: span 4; }
  .field-email   { grid-column: span 4; }
  .field-answer  { grid-column: span 4; }
  .actions { justify-content: stretch; }
  .submit { width: 100%; }
  .wall-viewport {
    --card-h: 208px;
  }
  .wall-columns {
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 5%, #000 95%, transparent);
            mask-image: linear-gradient(180deg, transparent, #000 5%, #000 95%, transparent);
  }
  .voice { padding: 16px 18px; }
  .voice-text { font-size: .92rem; -webkit-line-clamp: 4; }
}

@media (max-width: 420px) {
  .wall-viewport { --card-h: 240px; }
}

/* --------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  .thanks-mark { animation: none; }
  .voice.fresh { animation: none; }
  .col-track { animation: none !important; transform: none !important; }
  .wall-columns {
    height: auto;
    max-height: 80vh;
    overflow-y: auto;
    -webkit-mask-image: none;
            mask-image: none;
  }
  .wall-col { overflow: visible; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
