/* ==========================================================================
   The Story Room — Heartstrings Studio
   Palette: amber on the main site's dark walnut shell. Mobile-first.
   ========================================================================== */

/* The main site's dark shell (style.css :root on heartstringsstudio): walnut
   ground, cream ink, amber accent. Token names are the old rose-era ones so the
   rules below still read the same; only the values moved. --rose* is now the
   amber accent, --cream the page ground, --card the raised panel. */
:root {
  --rose: #f0b86f;          /* amber accent (main site --accent) */
  --rose-deep: #f2c98e;     /* pale amber, accent text and links */
  --blush: #8a6446;         /* answered-question dot */
  --gold: #af8050;          /* bronze edge */
  --gold-soft: #1a120d;     /* hard offset shadow under cards */
  --cream: #271c16;         /* page ground (main site --bg) */
  --cream-warm: #31241b;    /* recessed note */
  --card: #382920;          /* card / input surface (main site --panel) */
  --ink: #fff1dc;
  --ink-soft: #d6bfa6;      /* main site --muted */
  --line: #e3b78640;
  --charcoal: #1b120f;      /* deepest walnut, header shade */

  --amber: #edb268;
  --amber-shadow: #956536;
  --amber-ink: #291c14;

  --serif: "Libre Caslon Display", Georgia, serif;
  --serif-alt: Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --grad: linear-gradient(120deg, #956536 0%, #c98f4f 55%, #f0b86f 100%);
  --radius: 3px;
  --ease: cubic-bezier(0.25, 0.6, 0.3, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% -10%, rgba(240,184,111,0.08), transparent 34rem),
    var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* --- Header ------------------------------------------------------------- */

.site-header {
  text-align: center;
  padding: 1.6rem 1rem 0.25rem;
  background: linear-gradient(#1b120fd9, transparent);
}

/* The main site's header lockup: mark beside a tracked caps name. logo.png
   frames the mark at ~54% of its canvas, so 64px here draws it at the same
   visual size as the main site's 46px header slot once the padding is counted. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

.brand img {
  width: 64px;
  height: 64px;
  margin: -8px -4px;
  object-fit: contain;
}

.brand small {
  display: block;
  margin-top: 4px;
  font-size: 0.65rem;
  letter-spacing: 0.13em;
  color: #e2c7a8;
}

.site-header::after {
  content: "";
  display: block;
  width: 3.75rem;
  height: 1px;
  margin: 0.9rem auto 0;
  background: var(--grad);
}

.room-name {
  margin: 1.1rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--rose);   /* the main site's amber eyebrow */
}

/* --- Layout ------------------------------------------------------------- */

.app {
  flex: 1;
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2.5rem;
}

.screen {
  animation: screen-in 420ms var(--ease) both;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

h1, h2 {
  font-family: var(--serif);
  font-weight: 400;   /* the only weight the face ships */
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.75rem;
}

h1 { font-size: 2.15rem; }

/* The main site's accent word: amber Georgia italic inside a Caslon headline. */
h1 em, h2 em {
  color: var(--rose);
  font-family: var(--serif-alt);
  font-weight: 400;
  letter-spacing: -0.055em;
}
h2 { font-size: 1.75rem; }

p { margin: 0 0 1rem; }

a { color: var(--rose-deep); }

.soft { color: var(--ink-soft); }

.sub-prompt {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: -0.35rem 0 1.15rem;
}

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

/* The main site's amber slab: a hard offset instead of a blur, lifting on hover. */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  color: var(--amber-ink);
  background: var(--amber);
  border: none;
  border-radius: 3px;
  padding: 0.85rem 2.1rem;
  cursor: pointer;
  min-height: 48px;
  box-shadow: 0 6px 0 var(--amber-shadow), 0 16px 25px #0004;
  transition: transform 250ms var(--ease), box-shadow 250ms var(--ease);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 9px 0 var(--amber-shadow), 0 20px 28px #0006;
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 3px 0 var(--amber-shadow);
}

.btn-quiet {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.85rem 1.6rem;
  cursor: pointer;
  min-height: 48px;
  transition: border-color 200ms var(--ease), color 200ms var(--ease);
}

.btn-quiet:hover { border-color: var(--ink-soft); color: var(--ink); }

.link-btn {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink-soft);
  background: none;
  border: none;
  padding: 0.5rem 0.25rem;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.link-btn:hover { color: var(--rose-deep); }

/* Amber, as on the main site — it reads clearly against the walnut ground.
   Offset stays tight so the ring doesn't collide with the next stacked field. */
:focus-visible {
  outline: 3px solid var(--rose);
  outline-offset: 2px;
  border-radius: 3px;
}

.btn:focus-visible, .btn-quiet:focus-visible { border-radius: 3px; }

/* app.js moves screen-reader focus to each new screen's heading via
   tabindex="-1". Those headings aren't in the tab order, so the ring is noise
   rather than way-finding — and a box drawn round the question on every screen
   change reads as an error state on a page that has to stay calm. */
h1[tabindex="-1"]:focus-visible,
h2[tabindex="-1"]:focus-visible { outline: none; }

.nav-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1.4rem;
  flex-wrap: wrap;
}

.nav-row .spacer { flex: 1; }

/* --- Welcome ------------------------------------------------------------ */

.welcome {
  text-align: center;
  padding-top: 2.5rem;
}

.welcome h1 { font-size: 2.4rem; }

.welcome p {
  max-width: 28rem;
  margin: 0 auto 1.75rem;
  color: var(--ink-soft);
}

.welcome .offer-note {
  display: block;
  width: fit-content;
  margin: -0.55rem auto 1.6rem;
  padding: 0.55rem 0.85rem;
  border-top: 1px solid var(--gold-soft);
  border-bottom: 1px solid var(--gold-soft);
  color: var(--rose-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --- Occasion cards ------------------------------------------------------ */

.cards {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: 1fr; /* every card the same height, sized by the tallest */
  gap: 0.8rem;
  margin-top: 1.25rem;
  padding: 0;
  list-style: none;
}

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

.cards li {
  display: grid; /* stretch each card button to fill its equal-height cell */
}

.card {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 4px 5px 0 var(--gold-soft);
  padding: 1.05rem 1.1rem;
  cursor: pointer;
  transition: transform 250ms var(--ease), border-color 250ms var(--ease),
              box-shadow 250ms var(--ease);
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: 6px 8px 0 var(--gold-soft);
}

.card svg {
  flex: none;
  width: 30px;
  height: 30px;
  margin-top: 0.15rem;
  stroke: var(--rose);
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card strong {
  display: block;
  font: 1.3rem/1.3 var(--serif-alt);   /* Georgia at h3 scale, as the main site does */
  font-weight: 400;
}

.card span {
  display: block;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

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

.dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0.45rem;
}

.progress-copy {
  margin: 0 0 1.75rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
  transition: background 300ms var(--ease), transform 300ms var(--ease);
}

.dot.done { background: var(--blush); }

.dot.current {
  background: var(--grad);
  transform: scale(1.35);
}

/* --- Question screens ----------------------------------------------------- */

.favorite-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 0.5rem;
}

.favorite-flag svg {
  width: 14px;
  height: 14px;
  fill: var(--rose);
}

textarea, input[type="text"], input[type="email"] {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}

textarea {
  min-height: 10.5rem;
  resize: vertical;
  line-height: 1.6;
}

textarea:focus, input:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(240, 184, 111, 0.22);
}

.privacy-brief {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-left: 2px solid var(--gold);
  background: var(--cream-warm);
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.55;
}

label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  margin: 1.1rem 0 0.35rem;
}

label .optional {
  font-weight: 400;
  color: var(--ink-soft);
}

.field-note {
  color: var(--rose-deep);
  font-size: 0.92rem;
  margin: 0.5rem 0 0;
}

/* --- Review --------------------------------------------------------------- */

.review-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.8rem;
}

.review-section h3 {
  font: 1.25rem/1.3 var(--serif-alt);
  font-weight: 400;
  margin: 0 0 0.3rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.review-section p {
  margin: 0;
  white-space: pre-wrap;
  color: var(--ink-soft);
}

.review-section .link-btn { flex: none; padding: 0 0.1rem; }

.presend {
  margin: 1.5rem 0 0.35rem;
  font-style: italic;
  color: var(--ink-soft);
}

.next-step {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}

.error-box {
  background: #4b3525;
  border: 1px solid #af80504d;
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 1.25rem 0;
}

.error-box p { margin: 0 0 0.75rem; }

/* --- Confirmation ---------------------------------------------------------- */

.done-screen {
  text-align: center;
  padding-top: 2.5rem;
}

.done-mark {
  display: block;
  width: 120px;
  height: 120px;
  margin: -1rem auto 0.25rem;
}

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

.site-footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 1.5rem 1.25rem 2rem;
  border-top: 1px solid var(--line);
}

.footer-sep { margin: 0 0.4rem; }

@media (max-width: 559px) {
  .site-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
  }

  .footer-sep,
  .footer-punctuation {
    display: none;
  }
}

/* --- Reduced motion ----------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
