/* ============================================================
   2 for you, 2 for me — ephemeral pink · white · gold
   ------------------------------------------------------------
   Forked from "I Found You". Same 6-color palette. No sound.
   ============================================================ */

:root {
  --cream:  #fff6ec;   /* warm white   */
  --blush:  #fbd9e3;   /* soft pink    */
  --pink:   #f0a6c0;   /* mid pink     */
  --rose:   #c56b88;   /* deep rose    */
  --gold:   #ecca80;   /* soft gold    */
  --gold-d: #c99a45;   /* deep gold    */

  --energy: 0;         /* slow breathing value, 0..1 (set by JS) */
  --vh: 1vh;           /* real viewport height (set by JS for mobile) */
}

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

html, body {
  min-height: 100%;
  width: 100%;
  background: var(--cream);
  color: var(--rose);
  font-family: "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: none;            /* Firefox — no scrollbar */
  -ms-overflow-style: none;         /* old Edge/IE */
}
html::-webkit-scrollbar,
body::-webkit-scrollbar { width: 0; height: 0; display: none; }  /* Chrome/Safari/Edge */
body {
  position: relative;
  min-height: calc(var(--vh, 1vh) * 100);
  overflow-x: hidden;            /* no horizontal scroll on phones */
}

/* ---------- ephemeral background (fixed layers) ---------- */
#bloom {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(112% 86% at 50% 40%, var(--cream) 0%, transparent 60%),
    radial-gradient(120% 120% at 80% 14%, var(--gold) 0%, transparent 50%),
    radial-gradient(120% 120% at 16% 90%, var(--blush) 0%, transparent 52%),
    linear-gradient(155deg, var(--blush) 0%, var(--cream) 50%, var(--gold) 100%);
}
/* a soft breathing glow behind the words */
#bloom::after {
  content: "";
  position: absolute;
  left: 50%; top: 42%;
  width: 75vmin; height: 75vmin;
  transform: translate(-50%, -50%) scale(calc(0.9 + var(--energy) * 0.22));
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 246, 236, calc(0.5 + var(--energy) * 0.32)) 0%,
    rgba(255, 246, 236, 0) 68%);
  mix-blend-mode: screen;
}

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
  pointer-events: none;
}

/* ---------- the stage: content flows above the background ---------- */
#stage {
  position: relative;
  z-index: 3;
  text-align: center;
}

/* ---------- the question (teleprompter — one line at a time) ---------- */
#intro {
  position: relative;
  height: calc(var(--vh, 1vh) * 100);   /* one full screen — the poem plays centered */
  font-family: "Cormorant Garamond", Georgia, serif;
  line-height: 1.18;
}
.poem-line {
  position: absolute;             /* every line shares the same center spot */
  left: 0; right: 0;
  top: 50%;                       /* centered within the full-height #intro */
  padding: 0 clamp(20px, 7vw, 48px);
  text-align: center;
  font-weight: 500;
  font-size: clamp(2.3rem, 10vw, 4.6rem);
  letter-spacing: 0.005em;
  background: linear-gradient(105deg, var(--rose) 0%, var(--pink) 38%, var(--gold-d) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  opacity: 0;
  transform: translateY(calc(-50% + 0.6em));   /* waits just below center */
  filter: blur(8px);
  transition: opacity .85s ease, transform 1s cubic-bezier(.2,.7,.2,1), filter .85s ease;
  will-change: opacity, transform, filter;
}
.poem-line.show {                 /* rises into center, in focus */
  opacity: 1;
  transform: translateY(-50%);
  filter: blur(0);
}
.poem-line.out {                  /* drifts up and away, making room for the next */
  opacity: 0;
  transform: translateY(calc(-50% - 0.6em));
  filter: blur(8px);
}

/* once the teleprompter has played, the first screen rests with the whole
   poem stacked and visible — so scrolling back up shows every line */
#intro.settled {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2px, 1vh, 12px);
}
#intro.settled .poem-line {
  position: static;
  opacity: 1;
  transform: none;
  filter: none;
  transition: none;
}

/* ---------- the places (the screen revealed by scrolling up) ---------- */
#places {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  min-height: calc(var(--vh, 1vh) * 100);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding:
    calc(env(safe-area-inset-top, 0px) + 8vh)
    clamp(20px, 7vw, 48px)
    calc(env(safe-area-inset-bottom, 0px) + 8vh);
  transition: opacity .5s ease;
}
#places[hidden] { display: none; }
#places.leaving { opacity: 0; pointer-events: none; }

/* the final poem line, now the heading above the cards — fades in with them */
.places-heading {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: clamp(2rem, 8.5vw, 3.8rem);
  line-height: 1.15;
  margin-bottom: clamp(18px, 5vh, 40px);
  background: linear-gradient(105deg, var(--rose) 0%, var(--pink) 38%, var(--gold-d) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  opacity: 0;
  animation: card-in .6s cubic-bezier(.2,.7,.2,1) both;
}

#card-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;          /* single column on phones */
  gap: 12px;
}
@media (min-width: 540px) {
  #card-grid { grid-template-columns: 1fr 1fr; }
}

.place-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 64px;
  padding: 16px 18px;
  text-align: left;
  background: rgba(255, 255, 255, 0.55);
  border: 1.5px solid rgba(197, 107, 136, 0.28);
  border-radius: 16px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 6px 22px rgba(197, 107, 136, 0.10);
  transition: border-color .25s ease, background .25s ease, transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  /* staggered entrance — uses `translate` so it never fights the hover `transform` */
  animation: card-in .55s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes card-in {
  from { opacity: 0; translate: 0 18px; }
  to   { opacity: 1; translate: 0 0; }
}
.place-card:hover { transform: translateY(-2px); border-color: rgba(197, 107, 136, 0.5); }
.place-card:active { transform: scale(0.98); }
.place-card:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
.place-card.selected {
  border-color: var(--rose);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 26px rgba(197, 107, 136, 0.22);
}
.place-card.selected::after {
  content: "♥";
  position: absolute;
  top: 12px; right: 14px;
  color: var(--rose);
  font-size: 0.95rem;
}

.place-name {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--rose);
  line-height: 1.1;
}
.place-area {
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--gold-d);
}
.place-peek {
  margin-top: 4px;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--rose);
  opacity: 0.62;
  text-decoration: none;
  border-bottom: 1px solid rgba(197, 107, 136, 0.3);
  padding: 2px 0;
}
.place-peek:hover { opacity: 1; }

/* the "suggest a place" card spans the full width */
.place-card.suggest {
  grid-column: 1 / -1;
  align-items: center;
  flex-direction: row;
  justify-content: center;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--rose);
  border-style: dashed;
}

/* the free-text input revealed by "suggest a place" */
#suggest-wrap { width: 100%; }
#suggest-wrap[hidden] { display: none; }
#suggest-input {
  width: 100%;
  font-family: "Cormorant Garamond", serif;
  font-size: 16px;                 /* >=16px stops iOS auto-zoom on focus */
  color: var(--rose);
  text-align: center;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1.5px solid rgba(197, 107, 136, 0.4);
  border-radius: 14px;
  outline: none;
  transition: border-color .25s ease;
}
#suggest-input::placeholder { color: rgba(197, 107, 136, 0.5); font-style: italic; }
#suggest-input:focus { border-color: var(--rose); }

/* the confirm button */
#confirm {
  -webkit-appearance: none;
  appearance: none;
  margin-top: 4px;
  min-height: 52px;
  padding: 14px 34px;
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--cream);
  background: linear-gradient(105deg, var(--rose) 0%, var(--pink) 100%);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(197, 107, 136, 0.35);
  transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease, opacity .3s ease;
}
#confirm[hidden] { display: none; }
#confirm:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(197, 107, 136, 0.42); }
#confirm:active { transform: scale(0.97); }
#confirm:disabled { opacity: 0.45; cursor: default; transform: none; box-shadow: none; }

/* ---------- after she picks ---------- */
#done {
  min-height: calc(var(--vh, 1vh) * 100);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9vh clamp(20px, 7vw, 48px);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 1.2s ease, transform 1.4s cubic-bezier(.2,.7,.2,1);
}
#done[hidden] { display: none; }
#done.show { opacity: 1; transform: translateY(0); }
.done-line {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: clamp(1.9rem, 7.5vw, 3.4rem);
  line-height: 1.15;
  max-width: 14ch;
  background: linear-gradient(105deg, var(--rose) 0%, var(--pink) 38%, var(--gold-d) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.done-sub {
  font-size: clamp(1.7rem, 8vw, 2.6rem);
  line-height: 1;
}

/* ---------- gentle on reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  /* keep the centering transform, drop the slide + blur → lines just crossfade */
  .poem-line { transition: opacity .35s ease; filter: none !important; }
  #done { transition: opacity .35s ease; transform: none; }
  .place-card, .places-heading { animation: none; opacity: 1; }
}
