/* Presto Planner — liquid glass UI on white (video-swappable background)
   ----------------------------------------------------------------------- */

:root {
  --ink: #1a1a1a;
  --ink-soft: #555;
  --ink-faint: #888;
  --accent: #C0625A;
  --accent-rgb: 192, 98, 90;
  --accent-2: #6991AD;
  --gold: #C9A847;
  --hairline: rgba(0, 0, 0, 0.08);

  /* Glass surface — translucent, with backdrop blur. Designed to refract
     beautifully once a video swaps in behind. On white it looks like soft
     frosted glass. */
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 12px 40px -8px rgba(0, 0, 0, 0.12),
    0 2px 8px -2px rgba(0, 0, 0, 0.06);
  --glass-blur: blur(24px) saturate(140%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}
body { min-height: 100vh; }

/* ── Background (swappable to video later) ─────────────────────────────── */

.background {
  position: fixed; inset: 0;
  z-index: -1;
  pointer-events: none;
}
.bg-solid {
  position: absolute; inset: 0;
  background: #ffffff;
}

/* ── Glass surface ──────────────────────────────────────────────────────── */

.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
          backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
}
/* subtle top-edge highlight for the liquid feel */
.glass::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.55) 0%, transparent 30%);
  border-radius: inherit;
}
.glass > * { position: relative; z-index: 1; }

/* ── Top nav ───────────────────────────────────────────────────────────── */

.topnav {
  position: fixed; top: 16px; left: 16px; right: 16px;
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: var(--glass-blur);
          backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  box-shadow: var(--glass-shadow);
  font-size: 14px;
}
.topnav .brand {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
}
.nav-links { display: flex; gap: 18px; }
.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 120ms;
}
.nav-links a:hover { color: var(--ink); }

.kofi-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(180deg, var(--accent), #a85149);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.4) inset,
    0 4px 12px -2px rgba(192, 98, 90, 0.5);
  transition: transform 100ms, box-shadow 200ms;
}
.kofi-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.4) inset,
    0 6px 16px -2px rgba(192, 98, 90, 0.55);
}
.kofi-emoji { font-size: 14px; }

/* ── Sections ──────────────────────────────────────────────────────────── */

.hero, .section {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 80px 24px;
}

/* ── Story flow: alternating white text cards + full-bleed scroll-driven
   JPG-sequence animations. The first hero introduces the planner; each step
   card introduces the zoom level shown in the following animation. */

.story-hero,
.story-step {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 80px 24px;
  background: #fff;          /* opaque so the .bg-solid never bleeds through */
  position: relative;
  z-index: 1;
}
/* Story steps pin for ~1 screen so readers pause on the copy before the
   next colored animation begins. Section is 200vh; .story-text sticks to
   the viewport for the first 100vh of scroll. */
.story-step {
  height: 200vh;
  min-height: 0;
  display: block;
  padding: 0;
}
.story-step .story-text {
  position: sticky; top: 0;
  height: 100vh;
  margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  padding: 80px 24px;
  box-sizing: border-box;
}
.story-text {
  max-width: 720px;
  text-align: center;
}
.story-hero h1 {
  font-size: clamp(40px, 7vw, 88px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 24px;
  font-weight: 700;
}
.story-hero .lede {
  font-size: clamp(20px, 2.4vw, 28px);
  color: var(--gold);
  margin: 0;
  line-height: 1.4;
}
.story-step h2 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  font-weight: 700;
}
.story-step p {
  font-size: clamp(18px, 2vw, 24px);
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.45;
}

/* Animation section. Total height is N × 100vh of scroll runway (set per
   section via inline --scroll-vh). Inside, a sticky 100vh viewport holds the
   current frame. Background color matches the rendered frame backgrounds so
   any letterbox bars on non-16:9 viewports disappear into the frame edge. */

.scroll-anim {
  position: relative;
  height: calc(var(--scroll-vh, 200) * 1vh);
  background: var(--anim-bg, #000);
  z-index: 1;
}
.anim-stage {
  position: sticky; top: 0;
  height: 100vh; width: 100%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.anim-frame {
  display: block;
  width: 100%; height: 100%;
  object-fit: contain;
  /* No transition — frame changes are scroll-driven and must be instant. */
}

/* Reduced motion: collapse each anim section to a single viewport showing
   the final frame as a still image. JS sets the src to the last frame. */
@media (prefers-reduced-motion: reduce) {
  .scroll-anim { height: 100vh; }
  .anim-stage { position: static; }
  .story-step { height: 100vh; min-height: 100vh; }
  .story-step .story-text { position: static; height: auto; padding: 80px 24px; }
}

@media (max-width: 720px) {
  .story-hero { padding: 60px 20px; }
  .story-step .story-text { padding: 60px 20px; }
}

.hero-card {
  max-width: 760px;
  padding: 48px 56px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}
.hero h2 {
  font-size: clamp(26px, 3.6vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}
.hero .lede {
  font-size: clamp(18px, 2vw, 22px);
  color: var(--ink-soft);
  margin: 0;
}
.hero p {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--ink-soft);
  margin: 0 auto;
  max-width: 56ch;
}

.section-card {
  width: 100%;
  max-width: 880px;
  padding: 40px 44px;
}
.section h2 {
  font-size: clamp(28px, 3.5vw, 34px);
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.section-lede {
  color: var(--ink-soft);
  margin: 0 0 28px;
}

/* ── Form bits ─────────────────────────────────────────────────────────── */

.qp-controls, .cp-controls {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.lang-label {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px;
  color: var(--ink-soft);
}
select {
  font: inherit;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,0.7);
  color: var(--ink);
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}
select:focus { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.primary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #2a2a2a, #111);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.15) inset,
    0 6px 18px -4px rgba(0,0,0,0.3);
  transition: transform 100ms, box-shadow 200ms;
}
.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.15) inset,
    0 8px 22px -4px rgba(0,0,0,0.35);
}
.primary-btn:disabled {
  opacity: 0.5; cursor: not-allowed; transform: none;
}

.ghost-btn {
  padding: 8px 14px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: rgba(255,255,255,0.5);
  font: inherit;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  transition: background 150ms, color 150ms;
}
.ghost-btn:hover { background: rgba(255,255,255,0.85); color: var(--ink); }

.hint {
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-faint);
}

/* ── Quick print: tile strip ──────────────────────────────────────────── */

.bundle-strip {
  display: flex;
  gap: 14px;
  margin: 0 0 24px;
  padding: 4px 4px 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  /* subtle fade on the right edge so users know it scrolls */
  mask-image: linear-gradient(to right, black 95%, transparent);
  -webkit-mask-image: linear-gradient(to right, black 95%, transparent);
}
.bundle-strip::-webkit-scrollbar { height: 8px; }
.bundle-strip::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }
.bundle-tile {
  flex: 0 0 auto;
  width: 132px;
  scroll-snap-align: start;
  text-align: center;
}
.tile-thumb {
  position: relative;
  display: block;
  width: 132px; height: 94px;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform 150ms, box-shadow 150ms;
}
.tile-thumb:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.14); }
.tile-thumb img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
}
.tile-thumb.thumb-missing { background: linear-gradient(135deg, #f5f5f5, #e8e8e8); }
.tile-badge {
  position: absolute; top: 6px; right: 6px;
  background: rgba(26,26,26,0.85);
  color: #fff;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
}
.tile-label {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.3;
}

/* ── Custom print: card grid ──────────────────────────────────────────── */

.pdf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 0 0 28px;
}
.pdf-grid-heading {
  grid-column: 1 / -1;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  margin: 14px 0 0;
}
.pdf-grid-heading:first-child { margin-top: 0; }

.pdf-card {
  display: flex; flex-direction: column;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  transition: transform 150ms, box-shadow 150ms, border-color 150ms;
}
.pdf-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
}
.pdf-card.disabled { opacity: 0.5; }
.pdf-card.selected {
  border-color: rgba(var(--accent-rgb), 0.6);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.18);
}
.card-thumb {
  position: relative;
  display: block;
  height: 140px;
  width: 100%;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  background: #fff;
  cursor: zoom-in;
  overflow: hidden;
}
.card-thumb img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
}
.card-thumb.thumb-missing { background: linear-gradient(135deg, #f5f5f5, #e8e8e8); }
.card-body {
  padding: 12px 14px 14px;
  display: flex; flex-direction: column;
  flex: 1;
  gap: 3px;
}
.card-title { font-weight: 600; font-size: 14px; line-height: 1.3; color: var(--ink); }
.card-sub { font-size: 12px; color: var(--ink-faint); line-height: 1.4; flex: 1; }
.card-stepper { margin-top: 10px; align-self: flex-start; }

/* ── Lightbox ──────────────────────────────────────────────────────────── */

.thumb-lightbox {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  z-index: 200;
  cursor: zoom-out;
  padding: 40px;
  animation: fadeIn 180ms ease-out;
}
.thumb-lightbox[hidden] { display: none; }
.thumb-lightbox img {
  max-width: 100%; max-height: 100%;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
  cursor: default;
}
.lightbox-close {
  position: absolute; top: 18px; right: 22px;
  width: 36px; height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.95);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.stepper {
  display: inline-flex; align-items: center;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
}
.stepper button {
  width: 36px; height: 36px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 18px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 100ms, color 100ms;
}
.stepper button:hover { background: rgba(0,0,0,0.06); color: var(--ink); }
.stepper button:disabled { color: var(--ink-faint); cursor: not-allowed; opacity: 0.4; }
.stepper input {
  width: 48px; height: 36px;
  border: 0;
  background: transparent;
  text-align: center;
  font: inherit;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; }

/* ── Footer ────────────────────────────────────────────────────────────── */

.site-footer {
  padding: 80px 24px 40px;
  display: flex; justify-content: center;
}
.footer-card {
  width: 100%; max-width: 1000px;
  padding: 40px 44px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 36px;
}
.footer-block h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  margin: 0 0 12px;
  font-weight: 600;
}
.footer-block p { font-size: 15px; color: var(--ink-soft); margin: 0 0 14px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin: 4px 0; }
.footer-links a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 1px;
  transition: border-color 150ms;
}
.footer-links a:hover { border-color: var(--accent); }
.footer-tiny {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  font-size: 12px;
  color: var(--ink-faint);
  text-align: center;
}

/* ── Welcome modal ─────────────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed; inset: 0;
  z-index: 100;
  background: rgba(20, 20, 28, 0.32);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade-in 280ms ease-out;
}
.modal-backdrop[hidden] { display: none; }

.modal {
  width: 100%; max-width: 440px;
  padding: 56px 40px 36px;
  text-align: center;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(192, 98, 90, 0.12) 0%, transparent 60%),
    var(--glass-bg-strong);
  border-radius: 28px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 30px 80px -16px rgba(0, 0, 0, 0.25),
    0 8px 24px -4px rgba(0, 0, 0, 0.10);
  animation: pop-in 380ms cubic-bezier(0.16, 1, 0.3, 1);
}
.modal::before { /* override inherited overlay so the radial gradient shows */
  display: none;
}

/* Override .glass > * to allow modal-close to be absolute-positioned */
.modal > .modal-close { position: absolute; }

.modal-avatar {
  width: 96px; height: 96px;
  margin: 0 auto 14px;
  border-radius: 50%;
  padding: 3px;
  background:
    conic-gradient(from 220deg, #C0625A, #D49254, #C9A847, #7DA079, #6991AD, #C58AA6, #9A7AA9, #C0625A);
  box-shadow:
    0 6px 24px -4px rgba(192, 98, 90, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
  position: relative;
}
.modal-avatar img {
  display: block;
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  border: 3px solid #fff;
}

.modal-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 4px;
}
.modal-tag {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 22px;
}
.modal-bio {
  margin: 0 auto 26px;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.55;
  max-width: 42ch;
  text-align: left;
}
.modal-bio p { margin: 0 0 10px; }
.modal-bio p:last-child { margin-bottom: 0; }
.modal-bio p:first-child { font-weight: 600; color: var(--ink); }

.modal-actions {
  display: flex; flex-direction: column; gap: 8px; align-items: stretch;
}
.modal-cta {
  background: linear-gradient(180deg, var(--accent), #a85149);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 8px 22px -4px rgba(192, 98, 90, 0.5);
}
.modal-cta:hover {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 10px 28px -4px rgba(192, 98, 90, 0.6);
}

.modal-close {
  top: 14px; right: 16px;
  width: 34px; height: 34px;
  background: rgba(0, 0, 0, 0.04);
  border: 0;
  font-size: 22px; line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 50%;
  transition: background 120ms, color 120ms, transform 120ms;
  z-index: 2;
}
.modal-close:hover {
  background: rgba(0, 0, 0, 0.10);
  color: var(--ink);
  transform: scale(1.06);
}

@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(20px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Loading overlay ───────────────────────────────────────────────────── */

.loading-overlay {
  position: fixed; inset: 0;
  z-index: 90;
  background: rgba(0,0,0,0.2);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
.loading-overlay[hidden] { display: none; }
.loading-card {
  padding: 28px 36px;
  display: flex; align-items: center; gap: 16px;
}
.loading-card p { margin: 0; font-size: 15px; color: var(--ink-soft); }
.spinner {
  width: 22px; height: 22px;
  border: 2.5px solid rgba(0,0,0,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  html, body { font-size: 16px; }
  .topnav { padding: 8px 14px; gap: 8px; }
  .topnav .nav-links { display: none; }
  .topnav .brand { font-size: 14px; }
  .kofi-btn { padding: 6px 12px; font-size: 12px; }
  .hero, .section { padding: 60px 16px; min-height: auto; }
  .hero-card, .section-card, .footer-card { padding: 28px 22px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .pdf-grid { grid-template-columns: 1fr; gap: 12px; }
  .card-thumb { height: 160px; }
  .thumb-lightbox { padding: 20px; }
  .lightbox-close { top: 12px; right: 12px; }
}
