/* ============ Reset & base ============ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Montserrat', system-ui, sans-serif;
  background: #ffffff;
  color: #2b354f;
  -webkit-font-smoothing: antialiased;
}
input, textarea, button { font-family: inherit; }
input:focus, textarea:focus { outline: none; }
img { display: block; max-width: 100%; }
a { -webkit-tap-highlight-color: transparent; }

@keyframes fstp-pop { 0% { transform: scale(.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes fstp-ring { 0% { transform: scale(.4); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes fstp-check { 0% { stroke-dashoffset: 48; } 100% { stroke-dashoffset: 0; } }

.modal-scroll::-webkit-scrollbar { width: 8px; }
.modal-scroll::-webkit-scrollbar-thumb { background: rgba(43,53,79,.18); border-radius: 8px; }

p {
  font-size: clamp(16px, 2.9vw, 21px);
  line-height: 1.6;
}

/* ============ Hero ============ */
.hero {
  position: relative;
  min-height: 100svh;
  background: #2b354f;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hero-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 40px) clamp(20px, 5vw, 54px) 8px;
}
.hero-logo { height: 26px; width: auto; filter: brightness(0) invert(1); }

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(30px, 5vw, 48px) clamp(20px, 5vw, 54px) 12px;
  gap: clamp(18px, 4vw, 14px);
}
.hero-title {
  margin: 0;
  color: #fff;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.18;
  font-size: clamp(35px, 9vw, 64px);
  text-transform: uppercase;
  text-wrap: balance;
}
.hero-subtitle {
  color: #fff;
  font-size: clamp(25px, 7vw, 50px);
}
/* Sits below the fanned gallery, closing out the hero. */
.hero-sub {
  position: relative;
  z-index: 2;
  /* Negative top pulls the copy up into the empty space the fanned gallery
     leaves below its cards, so it sits closer to the fan instead of far down. */
  margin: clamp(-140px, -18vw, -80px) auto 0;
  padding: 0 clamp(20px, 5vw, 54px) 46px;
  max-width: 720px;
  text-align: center;
  color: rgba(255,255,255,.78);
  font-size: clamp(16px, 2.9vw, 21px);
  line-height: 1.6;
}
.hero-hashtag {
  display: flex;
  justify-content: center;
  font-weight: 800;
  letter-spacing: -.01em;
  font-size: clamp(17px, 4.2vw, 28px);
}
.hg-1 { color: #6f86ab; }
.hg-2 { color: #9aabc4; }
.hg-3 { color: #c9d4e2; }
.hg-4 { color: #ffffff; }

.btn-learn-more {
  margin: 4px 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #ff5200;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: clamp(12px, 3vw, 15px);
  padding: 11px 22px;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(255,82,0,.34);
  transition: transform .18s ease, box-shadow .18s ease;
}
.btn-learn-more:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(255,82,0,.42);
}

/* ============ Gallery (fanned, in-hero) ============ */
.gallery-wrap {
  position: relative;
  z-index: 2;
  padding: clamp(16px, 3vw, 40px) 0 0;
  text-align: center;
}
.stage {
  position: relative;
  width: 100%;
  height: clamp(360px, 66vh, 820px);
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
}
.stage.dragging { cursor: grabbing; }
.card {
  position: absolute;
  left: 50%;
  top: 0;
  width: clamp(240px, 80vw, 440px);
  aspect-ratio: 4/5;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  will-change: transform, opacity;
  transform-origin: 50% 0%;
  cursor: pointer;
  background: #e9e4da;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
/* Front card gets a real drop shadow via a static class toggle (see
   Gallery.apply in app.js) instead of an animated filter, so it never forces
   a per-frame repaint like filter: drop-shadow would. */
.card.is-front {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 14px 30px rgba(10,14,26,.45);
}
.card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}
/* Darkens receding cards via opacity instead of an animated
   filter: brightness — alpha-blending opaque black at (1 - bright) is
   mathematically identical to brightness(bright), but opacity/transform
   stay compositor-only every frame where filter would force a repaint. */
.card-tint {
  position: absolute;
  inset: 0;
  background: #0a0e1a;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}
.card-texture {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.06) 0 13px, transparent 13px 26px);
}

/* ============ Choice page (send now vs schedule) ============ */
.choice-page {
  position: relative;
  min-height: 100svh;
  background: #f6f3ee;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(48px, 10vw, 96px) clamp(20px, 5vw, 54px);
}
.choice-inner { max-width: 720px; text-align: center; }
.choice-inner h2 {
  margin: 0 0 10px;
  font-weight: 700;
  font-size: clamp(28px, 6vw, 46px);
  line-height: 1.08;
  letter-spacing: -.01em;
  color: #2b354f;
}
.choice-inner > p {
  margin: 0 0 clamp(32px, 6vw, 48px);
  color: rgba(43,53,79,.62);
}
.choice-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 640px) {
  .choice-options { grid-template-columns: 1fr; }
}
.choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  background: #fff;
  border: 2px solid #ece6db;
  border-radius: 22px;
  padding: clamp(28px, 5vw, 40px) 22px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.choice-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(15,20,35,.14);
  border-color: #ff5200;
}
.choice-card-icon {
  width: 34px; height: 34px; display: block; margin: 0 auto;
}

/* ============ Decorative background wheels ============ */
/* Large outline wheels peeking in from the section edges — pure decoration:
   behind all content, non-interactive, static (each just sits at its own
   fixed --angle). Static rather than animated on purpose: a spinning wheel
   costs an always-on compositor layer per instance (9 of them), which is
   real overhead on lower-end mobile GPUs for a purely decorative flourish. */
.deco-wheel {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  transform: rotate(var(--angle, 0deg));
}
/* Keep real content painting above the wheels. */
.choice-inner, .collection-intro, .grid { position: relative; z-index: 1; }
.choice-page, .collection { overflow: hidden; }
/* Hero (navy): faint, one big half-wheel off the left, a smaller one top-right. */
.deco-hero-1 { width: clamp(300px, 46vw, 620px); left: -14%; bottom: -6%; opacity: .28; --angle: 24deg; }
.deco-hero-2 { width: clamp(160px, 24vw, 320px); right: -8%; top: 4%; opacity: .22; --angle: -40deg; }
/* Choice (cream): half-wheels off opposite corners. */
.deco-choice-1 { width: clamp(260px, 40vw, 520px); right: -12%; top: -10%; opacity: .5; --angle: 65deg; }
.deco-choice-2 { width: clamp(320px, 48vw, 640px); left: -16%; bottom: -18%; opacity: .45; --angle: -15deg; }
/* Collection grid (white): spread down the full height of the long grid,
   alternating sides, so the section doesn't feel empty between the cards. */
.deco-collection-1 { width: clamp(240px, 36vw, 480px); left: -10%; top: 1%; opacity: .35; --angle: 50deg; }
.deco-collection-2 { width: clamp(280px, 42vw, 540px); right: -13%; top: 18%; opacity: .3; --angle: -70deg; }
.deco-collection-3 { width: clamp(300px, 46vw, 600px); left: -15%; top: 40%; opacity: .32; --angle: 105deg; }
.deco-collection-4 { width: clamp(250px, 38vw, 500px); right: -11%; top: 62%; opacity: .3; --angle: 12deg; }
.deco-collection-5 { width: clamp(320px, 48vw, 620px); left: -14%; bottom: -6%; opacity: .33; --angle: -30deg; }

.choice-card-title { font-weight: 800; font-size: clamp(19px, 4vw, 23px); color: #2b354f; }
.choice-card-desc { font-size: 13.5px; line-height: 1.5; color: rgba(43,53,79,.62); }

/* ============ Full collection grid ============ */
.collection {
  position: relative;
  background: #ffffff;
  padding: clamp(48px, 9vw, 96px) clamp(16px, 5vw, 54px) clamp(56px, 10vw, 110px);
}
.collection-intro {
  max-width: 640px;
  margin: 0 auto clamp(28px, 5vw, 48px);
  text-align: center;
}
.mode-change {
  display: inline-block;
  margin-top: 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 12.5px;
  color: #ff5200;
}
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #ff5200;
  margin-bottom: 12px;
}
.collection-intro h2 {
  margin: 0 0 10px;
  font-weight: 700;
  font-size: clamp(26px, 6vw, 44px);
  line-height: 1.05;
  letter-spacing: -.01em;
  color: #2b354f;
}
.collection-intro p {
  margin: 0;
  font-size: clamp(14px, 3.8vw, 17px);
  line-height: 1.55;
  color: rgba(43,53,79,.62);
}
.grid {
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.grid-card {
  overflow: hidden;
  aspect-ratio: 4/5;
  position: relative;
  cursor: pointer;
  background: #e9e4da;
  box-shadow: 0 6px 18px rgba(15,20,35,.12);
  transition: box-shadow .2s ease, transform .1s ease;
}
.grid-card:hover { box-shadow: 0 16px 34px rgba(15,20,35,.24); }
.grid-card-badge {
  position: absolute;
  top: 10px; right: 10px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  color: #2b354f;
  font-weight: 800;
  font-size: 13px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(15,20,35,.2);
}
.grid-card.selected { box-shadow: 0 0 0 3px #ff5200, 0 10px 24px rgba(15,20,35,.2); }
.grid-card.selected .grid-card-badge { display: flex; background: #ff5200; color: #fff; }

/* ============ Schedule selection bar ============ */
.schedule-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px clamp(16px, 5vw, 40px) calc(14px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  box-shadow: 0 -8px 24px rgba(15,20,35,.12);
}
.schedule-bar[hidden] { display: none; }
#schedule-bar-count { font-weight: 700; font-size: 14px; color: #2b354f; }
.schedule-bar-btn {
  border: none;
  border-radius: 999px;
  padding: 13px 26px;
  font-weight: 800;
  font-size: 14px;
  background: #ff5200;
  color: #fff;
  cursor: pointer;
  transition: transform .16s ease, opacity .16s ease;
}
.schedule-bar-btn:hover:not(:disabled) { transform: translateY(-2px); }
.schedule-bar-btn:disabled { opacity: .4; cursor: not-allowed; }
body.has-schedule-bar { padding-bottom: 74px; }

/* ============ Footer ============ */
.site-footer {
  background: #2b354f;
  color: rgba(255,255,255,.6);
  text-align: center;
  padding: 34px 24px;
  font-size: 13px;
}
.footer-hashtag {
  font-weight: 800;
  color: #fff;
  font-size: 15px;
  letter-spacing: .02em;
  margin-bottom: 6px;
}

/* ============ Modal ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(24,29,45,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  /* Fade the tint and the blur amount in, full-screen from the first frame.
     (Scaling this element instead would shrink the blurred region into a
     visible square that pops outward — backdrop-filter only affects the
     element's own box.) */
  animation: fstp-backdrop .3s ease;
}
@keyframes fstp-backdrop {
  0% {
    background: rgba(24,29,45,0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
  }
  100% {
    background: rgba(24,29,45,.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}
.modal-overlay[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; }
.modal-card {
  position: relative;
  width: min(540px, 100%);
  max-height: 92svh;
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(15,20,35,.4);
  animation: fstp-pop .26s cubic-bezier(.2,.9,.3,1.2);
}

/* -- Success screen -- */
.sent-panel {
  padding: 44px 30px 38px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.sent-ring {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: #eaf3ec;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  animation: fstp-ring .5s ease;
}
.sent-check-path { stroke-dasharray: 48; stroke-dashoffset: 48; animation: fstp-check .5s .2s ease forwards; }
.sent-title { margin: 0; font-weight: 800; font-size: 24px; letter-spacing: -.01em; }
.sent-sub { margin: 6px 0 22px; font-size: 15px; line-height: 1.55; color: rgba(43,53,79,.66); max-width: 320px; }
/* Both sent-screen buttons share the exact same footprint — the campaign
   link simply comes first in orange, the reset action below it in navy. */
.sent-panel .btn-learn-more {
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 15px 30px;
  font-size: 16px;
  box-shadow: none;
}
.btn-primary-pill {
  background: #2b354f;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  padding: 15px 30px;
  border-radius: 999px;
  width: 100%;
  transition: transform .16s ease;
}
.btn-primary-pill:hover { transform: translateY(-2px); }
.btn-close-text {
  margin-top: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(43,53,79,.5);
  font-weight: 600;
  font-size: 13px;
}

/* -- Form panel -- */
.form-panel { padding: 20px 22px 26px; position: relative; }
.btn-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 3;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: #f0ede8;
  color: #2b354f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* -- Customize editor -- */
.editor-wrap { margin-top: 26px; }
.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  color: #2b354f;
  font-weight: 700;
  font-size: 14px;
}
.editor-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #ff5200;
}
.btn-done {
  background: #2b354f;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 999px;
}
.edit-card {
  max-width: 300px;
  margin: 0 auto 10px;
  aspect-ratio: 4/5;
  position: relative;
  overflow: visible;
  box-shadow: 0 18px 42px rgba(15,20,35,.32);
  touch-action: none;
  user-select: none;
}
.edit-box {
  position: absolute;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  border: 1.5px dashed rgba(255,255,255,.7);
  padding: 10px;
  cursor: move;
  display: flex;
  align-items: center;
  justify-content: center;
}
.edit-box textarea {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  resize: none;
  outline: none;
  overflow: hidden;
  text-align: center;
  font-weight: 700;
  line-height: 1.25;
  font-family: 'Montserrat', sans-serif;
  cursor: text;
}
.edit-corner {
  position: absolute;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 7px rgba(0,0,0,.35);
  touch-action: none;
  transform: translate(-50%, -50%);
}
.edit-corner.corner-tl { left: 0; top: 0; cursor: nwse-resize; }
.edit-corner.corner-tr { left: 100%; top: 0; cursor: nesw-resize; }
.edit-corner.corner-bl { left: 0; top: 100%; cursor: nesw-resize; }
.edit-corner.corner-br { left: 100%; top: 100%; cursor: nwse-resize; }
.edit-edge {
  position: absolute;
  top: 50%;
  width: 9px; height: 32px;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(0,0,0,.35);
  touch-action: none;
  cursor: ew-resize;
  transform: translate(-50%, -50%);
}
.edit-edge.edge-left { left: 0; }
.edit-edge.edge-right { left: 100%; }
.editor-hint {
  text-align: center;
  font-size: 12px;
  color: rgba(43,53,79,.55);
  margin: 0 0 16px;
}

/* -- Detail + send -- */
.detail-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 26px;
  margin-bottom: 20px;
}
.detail-preview {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 4/5;
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(15,20,35,.28);
}
.detail-preview-scale {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
}
.detail-preview-box {
  position: absolute;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* Same geometry as the editor's box (10px padding + 1.5px border). The
     text itself is pre-wrapped lines captured from the editor, so no wrap
     decision is ever re-made here. */
  padding: 10px;
  border: 1.5px solid transparent;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
}
.detail-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.detail-note {
  font-size: 12.5px;
  color: rgba(43,53,79,.55);
}

/* -- Modal kicker/heading -- */
.modal-kicker {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #ff5200;
  margin: 24px 0 4px;
}
.modal-heading {
  margin: 2px 0 18px;
  text-align: center;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -.01em;
}

/* -- Schedule panel -- */
.schedule-intro { margin: 0 0 6px; font-size: 13.5px; line-height: 1.5; color: rgba(43,53,79,.62); }
.schedule-range { font-size: 12px; font-weight: 600; color: #ff5200; margin-bottom: 14px; }
.day-list { display: flex; flex-direction: column; gap: 9px; margin-bottom: 18px; }
.day-item {
  position: relative;
  border: 1.5px solid #ece6db;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow .15s ease;
}
.day-item.dragging-row {
  z-index: 5;
  box-shadow: 0 12px 26px rgba(15,20,35,.24);
  border-color: #ff5200;
}
.day-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: none;
  border: none;
  cursor: default;
  text-align: left;
}
.day-drag {
  flex: none;
  width: 22px; height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(43,53,79,.35);
  cursor: grab;
  touch-action: none;
}
.day-drag:active { cursor: grabbing; }
.day-thumb {
  width: 34px;
  aspect-ratio: 4/5;
  flex: none;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  background: #e9e4da;
}
.day-info { flex: 1; min-width: 0; }
.day-title { font-weight: 700; font-size: 13.5px; }
.day-status { font-size: 11.5px; font-weight: 600; color: rgba(43,53,79,.55); }

/* -- Recipients -- */
.recipients { border-top: 1px solid #efe9df; padding-top: 18px; }
.recipients-fields { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(43,53,79,.5);
  margin-bottom: 6px;
}
.field-optional {
  text-transform: none;
  font-weight: 500;
  letter-spacing: 0;
  opacity: .75;
}
.field-required {
  color: #ff5200;
}
.field-input {
  width: 100%;
  border: 1.5px solid #e3ddd2;
  border-radius: 11px;
  padding: 13px;
  font-size: 15px;
  color: #2b354f;
  background: #fff;
}
.field-input:focus { border-color: #ff5200; }
.field-textarea {
  resize: vertical;
  min-height: 68px;
  line-height: 1.45;
}
.btn-send {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 16px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .01em;
  transition: transform .16s ease, opacity .16s ease;
  background: #ff5200;
  color: #fff;
  box-shadow: 0 12px 28px rgba(255,82,0,.3);
}
.btn-send:hover:not(:disabled) { transform: translateY(-2px); }
.btn-send:disabled { opacity: .5; cursor: not-allowed; }
.send-error {
  margin: 0 0 14px;
  padding: 11px 14px;
  border-radius: 10px;
  background: rgba(214,69,49,.08);
  color: #d64531;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}
