/* =============================================================================
   styles.css — celestial blue: soft sky, starlight, moonlit edges
   -----------------------------------------------------------------------------
   All colors come from the custom properties below. Change them in one place
   and the whole site follows.
   ========================================================================== */

:root {
  /* --- celestial blue palette ------------------------------------------- */
  --sky-50:   #f3f8ff;   /* lightest wash            */
  --sky-100:  #e2edff;   /* card tint / soft fills   */
  --sky-200:  #c3dcff;   /* borders, quiet lines     */
  --sky-300:  #9cc4ff;   /* hover fills              */
  --blue-400: #5b9dff;   /* primary light            */
  --blue-500: #3d7bf0;   /* primary                  */
  --blue-600: #2a5bd0;   /* primary deep             */
  --indigo:   #2b3a7a;   /* headings                 */
  --midnight: #1c2749;   /* darkest ink              */
  --cyan:     #9fe6f5;   /* accent glow              */
  --periwink: #cdd6ff;   /* accent soft              */
  --starlight:#fff6d9;   /* warm star accent         */

  --ink:      #24345e;
  --ink-soft: #5f719b;
  --white:    #ffffff;

  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;

  --shadow-soft: 0 10px 30px -12px rgba(43, 58, 122, 0.35);
  --shadow-lift: 0 18px 40px -16px rgba(43, 58, 122, 0.45);
  --glow:        0 0 0 6px rgba(61, 123, 240, 0.14);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-x: hidden;           /* never scroll sideways */
}

body {
  font-family: 'Nunito', ui-rounded, 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(165deg, #eef5ff 0%, #e6efff 40%, #f4f9ff 72%, #eaf6fb 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;           /* the escaping button anchors to the viewport */
}

/* ---------------------------------------------------------------- background */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.6;
  animation: drift 18s var(--ease) infinite alternate;
}
.blob-1 { width: 46vmax; height: 46vmax; left: -14vmax; top: -12vmax; background: var(--periwink); }
.blob-2 { width: 38vmax; height: 38vmax; right: -12vmax; top: 22vh;  background: var(--cyan); animation-delay: -6s; }
.blob-3 { width: 34vmax; height: 34vmax; left: 18vw; bottom: -14vmax; background: var(--sky-300); animation-delay: -11s; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(3vw, -4vh, 0) scale(1.12); }
}

/* A quiet field of stars over the gradient. */
.bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 22%, rgba(255,255,255,0.95) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 68% 14%, rgba(255,255,255,0.9)  50%, transparent 51%),
    radial-gradient(1.8px 1.8px at 32% 68%, rgba(255,255,255,0.85) 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 84% 56%, rgba(255,255,255,0.9)  50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 52% 88%, rgba(255,255,255,0.8)  50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 22% 46%, rgba(255,255,255,0.85) 50%, transparent 51%),
    radial-gradient(1.7px 1.7px at 92% 30%, rgba(255,255,255,0.9)  50%, transparent 51%);
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle {
  from { opacity: 0.45; }
  to   { opacity: 0.95; }
}

#celebration {
  position: fixed; inset: 0;
  z-index: 3;
  pointer-events: none;
  width: 100%; height: 100%;
}

.hearts { position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.floating-heart {
  position: absolute;
  bottom: -40px;
  font-size: 22px;
  animation: rise linear forwards;
  will-change: transform, opacity;
}
@keyframes rise {
  0%   { transform: translateY(0) rotate(0deg);       opacity: 0; }
  10%  { opacity: 0.9; }
  100% { transform: translateY(-108vh) rotate(30deg); opacity: 0; }
}

/* --------------------------------------------------------------------- shell */
.shell {
  position: relative;
  z-index: 4;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 28px 20px calc(36px + env(safe-area-inset-bottom));
  max-width: 680px;
  margin: 0 auto;
}

.stage { width: 100%; }

/* ------------------------------------------------------------------ progress */
.progress { width: 100%; max-width: 420px; }
.progress-track {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 0;
  padding: 0;
  position: relative;
}
.progress-track::before {
  content: '';
  position: absolute;
  left: 12%; right: 12%;
  top: 17px;
  height: 2px;
  background: var(--sky-200);
  border-radius: 2px;
}
.pstep {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
}
.pdot {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--sky-200);
  font-size: 15px;
  filter: grayscale(1);
  opacity: 0.55;
  transition: transform 0.35s var(--ease), filter 0.35s var(--ease),
              opacity 0.35s var(--ease), border-color 0.35s var(--ease),
              box-shadow 0.35s var(--ease);
}
.plabel {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  opacity: 0.6;
  transition: opacity 0.3s var(--ease);
}
.pstep.is-done .pdot { filter: none; opacity: 1; border-color: var(--blue-400); }
.pstep.is-done .plabel { opacity: 0.85; }
.pstep.is-current .pdot {
  filter: none; opacity: 1;
  border-color: var(--blue-500);
  transform: scale(1.18);
  box-shadow: var(--glow);
}
.pstep.is-current .plabel { opacity: 1; color: var(--blue-500); }

/* ------------------------------------------------------------------- screens */
.screen { display: none; text-align: center; }
.screen.is-active { display: block; animation: screen-in 0.5s var(--ease) both; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
.screen.is-leaving { animation: screen-out 0.22s var(--ease) both; }
@keyframes screen-out {
  to { opacity: 0; transform: translateY(-10px) scale(0.99); }
}

.eyebrow {
  font-size: 15px;
  font-weight: 700;
  color: var(--blue-500);
  letter-spacing: 0.04em;
  margin: 0 0 6px;
}

.headline {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: clamp(28px, 7.5vw, 46px);
  line-height: 1.12;
  margin: 0 0 10px;
  color: var(--indigo);
  text-wrap: balance;
}
.headline-big { font-size: clamp(32px, 9vw, 54px); }

.sub {
  margin: 0 0 22px;
  font-size: 15px;
  color: var(--ink-soft);
  text-wrap: balance;
}
.sub-tight { margin: 18px 0 12px; font-weight: 700; color: var(--ink); font-size: 17px; }
.sub-lg { font-size: 19px; font-weight: 700; color: var(--ink); }

/* ------------------------------------------------------------------- buttons */
.btn {
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  border: none;
  border-radius: 999px;
  padding: 16px 30px;
  min-height: 54px;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
              background 0.2s var(--ease), opacity 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 3px solid var(--blue-600); outline-offset: 3px; }

.btn-primary, .btn-yes {
  background: linear-gradient(135deg, var(--blue-400), var(--blue-600));
  color: var(--white);
  box-shadow: var(--shadow-lift);
}
.btn-primary:hover, .btn-yes:hover { transform: translateY(-2px); }
.btn-primary:disabled {
  background: var(--sky-100);
  color: #9bb0d4;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-yes { font-size: 20px; padding: 18px 44px; min-height: 60px; animation: pulse 2.6s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: var(--shadow-lift); }
  50%      { box-shadow: 0 18px 44px -12px rgba(61, 123, 240, 0.7); }
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.8);
  color: var(--blue-600);
  box-shadow: var(--shadow-soft);
  font-size: 15px;
  padding: 13px 22px;
  min-height: 48px;
}
.btn-confirm { font-size: 19px; padding: 17px 34px; }

.ask-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
  min-height: 64px;
}

.btn-no {
  background: var(--white);
  color: var(--ink-soft);
  box-shadow: var(--shadow-soft);
  transition: transform 0.32s var(--ease), box-shadow 0.3s var(--ease),
              background 0.3s var(--ease), left 0.32s var(--ease), top 0.32s var(--ease);
  will-change: transform, left, top;
}
/* Once it has run away it lives in viewport coordinates. */
.btn-no.is-loose {
  position: fixed;
  z-index: 20;
  margin: 0;
}
.btn-no.is-surrendered {
  position: static;
  background: linear-gradient(135deg, var(--sky-100), var(--periwink));
  color: var(--indigo);
  animation: none;
}

.taunt {
  min-height: 26px;
  margin: 16px 0 0;
  font-weight: 700;
  color: var(--blue-500);
  font-size: 16px;
}
.taunt.pop { animation: pop-in 0.4s var(--ease); }
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.8) translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------- cards */
.card {
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

/* ------------------------------------------------------------------ calendar */
.calendar {
  text-align: left;
  max-width: 420px;      /* keeps the cells square-ish instead of sprawling */
  margin: 0 auto;
}
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.cal-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 19px;
  color: var(--indigo);
}
.cal-nav {
  width: 40px; height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--sky-100);
  color: var(--blue-600);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.cal-nav:hover:not(:disabled) { background: var(--sky-200); transform: scale(1.06); }
.cal-nav:disabled { opacity: 0.3; cursor: not-allowed; }

.cal-weekdays, .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.cal-weekdays span {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-soft);
  opacity: 0.7;
  padding-bottom: 6px;
}
.cal-cell {
  aspect-ratio: 1 / 1;
  min-height: 40px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.cal-cell.is-empty { pointer-events: none; }
.cal-cell.is-open { background: var(--sky-50); }
.cal-cell.is-open:hover { background: var(--sky-200); transform: scale(1.06); }
.cal-cell:disabled { color: #b4c2de; background: transparent; cursor: not-allowed; }
.cal-cell.is-today { box-shadow: inset 0 0 0 2px var(--sky-200); }
.cal-cell.is-selected {
  background: linear-gradient(135deg, var(--blue-400), var(--blue-600));
  color: var(--white);
  transform: scale(1.04);
  box-shadow: var(--shadow-soft);
}

/* ---------------------------------------------------------------------- grid */
.grid { display: grid; gap: 12px; margin-bottom: 6px; }
/* The max-widths keep an odd number of cards from leaving one stranded on a
   row of its own. */
.grid-time     { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); max-width: 560px; margin-inline: auto; }
.grid-type     { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); max-width: 540px; margin-inline: auto; }
.grid-activity { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); max-width: 600px; margin-inline: auto; }

.pick {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 104px;
  padding: 16px 12px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-soft);
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease),
              border-color 0.22s var(--ease), background 0.22s var(--ease);
  -webkit-tap-highlight-color: transparent;
  animation: card-in 0.42s var(--ease) both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
.pick:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.pick:active { transform: translateY(-1px) scale(0.98); }
.pick:focus-visible { outline: 3px solid var(--blue-600); outline-offset: 3px; }

.pick-emoji { font-size: 30px; line-height: 1; transition: transform 0.25s var(--ease); }
.pick:hover .pick-emoji { transform: scale(1.18) rotate(-6deg); }
.pick-label { font-size: 16px; font-weight: 800; }
.pick-hint  { font-size: 12px; color: var(--ink-soft); }

.pick.is-selected {
  border-color: var(--blue-500);
  background: linear-gradient(135deg, #f2f7ff, #e6efff);
  box-shadow: 0 0 0 4px rgba(61, 123, 240, 0.12), var(--shadow-lift);
}
.pick.is-selected::after {
  content: '✦';
  position: absolute;
  top: 7px; right: 11px;
  font-size: 14px;
  color: var(--blue-500);
  animation: pop-in 0.3s var(--ease);
}

.pick-readout {
  margin: 16px 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
  min-height: 22px;
}
.pick-readout.has-pick { color: var(--blue-500); }

/* --------------------------------------------------------------- exact time */
.exact { margin-top: 16px; }
.exact-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.exact-input, .note {
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid var(--sky-200);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  min-height: 50px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.exact-input:focus, .note:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(61, 123, 240, 0.12);
}
.note { width: 100%; font-weight: 600; font-size: 15px; resize: vertical; }
.note-wrap { margin-top: 16px; text-align: left; }

/* ------------------------------------------------------------------- summary */
.summary { text-align: left; padding: 22px; }
.summary-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--indigo);
  text-align: center;
  margin: 0 0 16px;
}
.summary-list { margin: 0; display: grid; gap: 2px; }
.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 2px;
  border-bottom: 1px dashed var(--sky-200);
}
.summary-row:last-child { border-bottom: none; }
.summary-row dt { font-size: 14px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.summary-row dd {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--indigo);
  text-align: right;
}
.summary-final { margin-top: 18px; }

.nav-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-top: 18px;
  flex-wrap: wrap;
}
.nav-row .btn { flex: 0 1 auto; min-width: 150px; }

.error {
  margin-top: 14px;
  color: #b3264b;
  font-weight: 700;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.final-note {
  margin-top: 22px;
  font-size: 16px;
  font-weight: 700;
  color: var(--blue-600);
}

.is-sending { opacity: 0.7; pointer-events: none; }

/* ----------------------------------------------------------------- honeypot */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
  opacity: 0;
}

/* ------------------------------------------------------------------ phones */
@media (max-width: 420px) {
  .shell { padding: 20px 16px calc(28px + env(safe-area-inset-bottom)); }
  .grid-activity, .grid-time { grid-template-columns: repeat(2, 1fr); }
  .pick { min-height: 96px; padding: 14px 8px; }
  .pick-emoji { font-size: 26px; }
  .pick-label { font-size: 14px; }
  .plabel { font-size: 10px; }
  .nav-row .btn { flex: 1 1 auto; min-width: 0; }
  .btn-yes { padding: 18px 36px; }
  .summary-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .summary-row dd { text-align: left; }
}

/* --------------------------------------------------- reduced motion respect */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .blob, .bg::after { animation: none; }
  /* The No button still moves — it just teleports instead of gliding. */
  .btn-no { transition: none; }
}
