/* Good Plans homepage draft: Partiful's group-chat hero + Miso's short page and pinned button. Draft only (index-chat.html). */

/* ---------- hero: centred head, then the chat over a night card ---------- */
.ch-hero { padding: 120px 0 72px; text-align: center; }
.ch-hero h1 { max-width: 11em; margin-inline: auto; }
.ch-hero .sub { margin: 18px auto 0; max-width: 26em; color: var(--color-paper-2); }
.ch-hero .hero-cta { justify-content: center; margin-top: 26px; }
.ch-hero .small { margin-top: 16px; }

.ch-stage { position: relative; width: min(100% - 40px, 440px); margin: 44px auto 0; }
.ch-card { position: relative; aspect-ratio: 3 / 4; border-radius: 28px; overflow: hidden;
  background:
    linear-gradient(to bottom, oklch(0.12 0.01 285 / 0.1), oklch(0.12 0.01 285 / 0.45)),
    url("/assets/hero-bar-couple.webp") center 20% / cover no-repeat,
    linear-gradient(160deg, oklch(0.24 0.04 300), oklch(0.12 0.02 270) 60%, oklch(0.16 0.04 30));
  box-shadow: 0 32px 64px -32px oklch(0 0 0 / 0.6); }
.ch-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 40%, oklch(0.1 0.01 280 / 0.55)); }
.ch-card .tag-ex { position: absolute; left: 14px; top: 14px; z-index: 2; }

/* the conversation: newest at the bottom, older lines slide up and out */
.ch-feed { position: absolute; left: -24px; right: -24px; top: 44px; bottom: 20px; z-index: 3; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%); mask-image: linear-gradient(to bottom, transparent, #000 18%); }
.msg { display: flex; align-items: flex-end; gap: 10px; animation: msg-in 0.3s var(--ease) both; }
.msg.me { flex-direction: row-reverse; }
.msg .av { width: 36px; height: 36px; flex: none; border-radius: 50%; object-fit: cover; border: 2px solid var(--color-night); background: var(--color-night-3); }
.msg .av { display: grid; place-items: center; font-weight: 800; font-size: 0.875rem; color: var(--color-white); background: var(--color-accent-deep); }
.av-me { font-size: 0.6875rem !important; background: oklch(0.5 0.19 258) !important; }
.av-1 { background: oklch(0.62 0.2 350) !important; }
.av-2 { background: oklch(0.55 0.15 160) !important; }
.av-3 { background: oklch(0.68 0.17 60) !important; color: var(--color-ink) !important; }
.av-4 { background: oklch(0.55 0.2 290) !important; }
.msg p { max-width: 72%; padding: 12px 16px; border-radius: 22px 22px 22px 6px; background: oklch(0.93 0.003 100); color: var(--color-ink); font-size: 1.0625rem; font-weight: 550; line-height: 1.3; text-align: left; }
.msg.me p { border-radius: 22px 22px 6px 22px; background: oklch(0.5 0.19 258); color: var(--color-white); }
.msg.typing p { display: inline-flex; gap: 4px; padding: 16px; }
.msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--color-muted); animation: dot 1.1s infinite; }
.msg.typing i:nth-child(2) { animation-delay: 0.15s; }
.msg.typing i:nth-child(3) { animation-delay: 0.3s; }

/* the Good Plans card dropped into the chat (Partiful's invite card) */
.gp-card { width: min(64%, 240px); border-radius: 18px; overflow: hidden; background: var(--color-white); color: var(--color-ink); text-align: left; box-shadow: 0 18px 40px -18px oklch(0 0 0 / 0.7); }
.gp-card-top { padding: 8px 12px; background: var(--color-accent); color: var(--color-ink); }
.gp-card-top small { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 650; background: oklch(1 0 0 / 0.55); padding: 2px 8px; border-radius: 999px; }
.gp-card-top b { display: block; margin-top: 8px; font-family: var(--font-display); font-weight: 900; font-stretch: 75%; font-size: 1.25rem; line-height: 1; text-transform: uppercase; }
.gp-card ul { list-style: none; margin: 0; padding: 2px 12px; }
.gp-card li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; font-size: 0.8125rem; font-weight: 600; border-bottom: 1px solid var(--color-paper-line); }
.gp-card li:last-child { border-bottom: 0; }
.gp-card .cnt { flex: none; font-size: 0.8125rem; padding: 2px 8px; min-height: 0; }
.gp-card-foot { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--color-paper-2); font-size: 0.8125rem; font-weight: 650; }
.gp-card-foot span { background: oklch(0.5 0.19 258); color: var(--color-white); padding: 4px 12px; border-radius: 999px; }

.ch-replay { display: inline-flex; align-items: center; margin-top: 16px; background: none; border: 0; color: var(--color-muted-night); font-size: var(--text-xs); text-decoration: underline; cursor: pointer; min-height: 44px; }

@keyframes msg-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes dot { 0%, 60%, 100% { opacity: 0.35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

/* ---------- Miso-style short list ---------- */
.ch-list { list-style: none; margin: 0 auto; padding: 0; max-width: 760px; }
.ch-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px 40px; padding: 28px 0; border-top: 1px solid var(--color-paper-line); }
.ch-list li:last-child { border-bottom: 1px solid var(--color-paper-line); }
.ch-list h3 { font-size: var(--text-lg); font-weight: 750; }
.ch-list p { color: var(--color-muted); }
.ch-lead { max-width: 760px; margin: 0 auto 36px; font-size: clamp(1.5rem, 1rem + 1.6vw, 2.25rem); font-weight: 650; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }

/* ---------- Miso's pinned button ---------- */
.ch-pin { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 40; transform: translateX(-50%); box-shadow: 0 12px 30px -10px oklch(0 0 0 / 0.5); transition: opacity 0.25s, transform 0.25s var(--ease); }
.ch-pin.is-hidden { opacity: 0; pointer-events: none; transform: translate(-50%, 16px); }

@media (max-width: 640px) {
  .ch-hero { padding: 100px 0 56px; }
  .ch-card { aspect-ratio: 2 / 3; }
  .ch-stage { margin-top: 36px; }
  .ch-feed { left: -12px; right: -12px; }
  .msg p { font-size: 1rem; }
  .ch-list li { grid-template-columns: minmax(0, 1fr); padding: 22px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .msg, .msg.typing i { animation: none; }
}

.ch-soon { font-size: 0.875rem; font-weight: 650; vertical-align: middle; padding: 4px 12px; border-radius: 999px; background: var(--color-paper-2); color: var(--color-muted); }

/* Robert's page rules (Dec 3): every title centered and full width, tight gaps between sections */
body:is([data-page="home"], [data-page="questions"]) .sec { padding: 80px 0; }
.ch-hero { padding-bottom: 64px; }
.ch-lead { max-width: none; text-align: center; font-size: clamp(1.75rem, 1.1rem + 2.4vw, 3.6rem); font-weight: 800; line-height: 1.04; letter-spacing: -0.02em; margin-bottom: 32px; }
.ch-list { max-width: 820px; }
.ch-list li { grid-template-columns: minmax(0, 1fr); text-align: center; gap: 4px; padding: 20px 0; }
.ch-list p { max-width: 34rem; margin-inline: auto; }
.ch-hero h1 { max-width: none; }
body:is([data-page="home"], [data-page="questions"]) .sec-head { margin-bottom: 24px; }
@media (max-width: 640px) {
  body:is([data-page="home"], [data-page="questions"]) .sec { padding: 56px 0; }
  .ch-hero { padding: 96px 0 48px; }
  .ch-list li { padding: 16px 0; }
}
body:is([data-page="home"], [data-page="questions"]) .close { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; gap: 24px; }
body:is([data-page="home"], [data-page="questions"]) .close .shout { max-width: none; }
body:is([data-page="home"], [data-page="questions"]) .close-cta { justify-content: center; }

/* Robert (Dec 3): no dead space on the sides at desktop; content uses the container width */
@media (min-width: 900px) {
  .ch-list { max-width: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
  .ch-list li, .ch-list li:last-child { border: 0; border-left: 1px solid var(--color-paper-line); padding: 8px 24px; align-content: start; }
  .ch-list li:first-child { border-left: 0; }
  .ch-list p { max-width: none; }
  .ch-stage { width: min(100%, 520px); }
  .ch-feed { left: -160px; right: -160px; }
  .msg p { max-width: 60%; }
  body:is([data-page="home"], [data-page="questions"]) .cities { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 48px; }
}

.ch-hero .sub { max-width: none; }
.ch-hero .sub .ln { display: block; }
/* keep the couple's faces clear: the chat lives in the lower half of the photo */
.ch-feed { top: 46%; }
.ch-card { background-position: center 30%; }
.ch-feed { top: 50%; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 6%); mask-image: linear-gradient(to bottom, transparent, #000 6%); }
@media (max-width: 640px) { .ch-feed { top: 40%; } .gp-card li { padding: 4px 0; } }

/* The count climbing (Good Plans' own animation): check-in dots fly into the top row and its count ticks up band by band */
.gp-card li { position: relative; }
.gp-card .cnt { transition: background-color 0.25s, color 0.25s; }
.gp-card .cnt.tick { animation: cnt-tick 0.42s var(--ease); }
.gp-card .ci { position: absolute; right: 1.7em; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--color-accent); pointer-events: none; animation: ci-in 0.36s cubic-bezier(0.4, 0, 0.6, 1) both; }
@keyframes ci-in { from { opacity: 0; transform: translate(var(--x), var(--y)) scale(0.6); } 25% { opacity: 1; } to { opacity: 0; transform: translate(0, 0) scale(1); } }
@keyframes cnt-tick { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .gp-card .cnt.tick, .gp-card .ci { animation: none; } .gp-card .ci { display: none; } }
.gp-card li:first-child .cnt { min-width: 3.2em; justify-content: center; }

/* Footer wordmark fits its rounded block at every width (it was 17.6vw and ran past the edges) */
body:is([data-page="home"], [data-page="questions"]) .wordmark { font-size: min(17rem, calc((100vw - 72px) / 5.4)); }

/* Our own ending instead of Partiful's giant wordmark: a count pill climbs once, then becomes the name */
.ch-end { display: grid; justify-items: center; gap: 16px; padding: 48px 16px 56px; text-align: center; }
.ch-end-stage { position: relative; }
.foot .ch-end-pill { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: min(12rem, calc((100vw - 72px) / 6.4)); line-height: 1; letter-spacing: -0.045em; text-transform: lowercase; padding: 0.06em 0.4em 0.12em; gap: 0; transition: background-color 0.3s, color 0.3s; }
.foot .ch-end-pill.tick { animation: cnt-tick 0.42s var(--ease); }
.ch-end .ci { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--color-accent); pointer-events: none; animation: ci-in 0.36s cubic-bezier(0.4, 0, 0.6, 1) both; }
.ch-end-note { margin: 0; color: var(--color-muted-night); font-size: var(--text-sm); }
@media (prefers-reduced-motion: reduce) { .foot .ch-end-pill.tick, .ch-end .ci { animation: none; } .ch-end .ci { display: none; } }

/* /questions: the FAQ moved off the short homepage onto its own page */
body[data-page="questions"] .q-page.sec { padding-top: 136px; }
.q-page h1 { text-align: center; }
@media (max-width: 640px) { body[data-page="questions"] .q-page.sec { padding-top: 112px; } }

/* Dec 3 (Robert): the chat was too slow and jumpy. Bubbles now pop in from their own side,
   friends type first, and older bubbles glide up and fade out past the top of the photo. */
.msg { animation: none; }
.msg > * { animation: msg-in 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; transform-origin: bottom left; }
.msg.me > * { transform-origin: bottom right; }
.msg .av { animation-duration: 0.18s; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px) scale(0.86); } to { opacity: 1; transform: none; } }
.ch-feed { top: 36%; transition: opacity 0.3s; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%); mask-image: linear-gradient(to bottom, transparent, #000 22%); }
.ch-feed.is-out { opacity: 0; }
@media (max-width: 640px) { .ch-feed { top: 28%; } }
.gp-card .ci, .ch-end .ci { animation-duration: 0.22s; }
.gp-card .cnt.tick, .foot .ch-end-pill.tick { animation-duration: 0.3s; }
@media (prefers-reduced-motion: reduce) { .msg > * { animation: none; } }

/* Dec 3 (Robert): hero sits higher, both buttons on one line */
.ch-hero { padding-top: 108px; }
.ch-hero .hero-cta { flex-wrap: nowrap; margin-top: 22px; }
.ch-hero .small { margin-top: 12px; }
.ch-stage { margin-top: 28px; }
@media (max-width: 640px) {
  .ch-hero { padding-top: 96px; }
  .ch-stage { margin-top: 24px; }
  .ch-hero .hero-cta { gap: 8px; }
  .ch-hero .hero-cta .b-lg { min-height: 52px; padding: 0 14px; font-size: 0.875rem; }
}
@media (max-width: 370px) { .ch-hero .hero-cta .b-lg { padding: 0 10px; font-size: 0.8125rem; } }

/* Dec 3 (Robert): "move that hero up". Desktop: text and the chat side by side so the chat is on the
   first screen (text stays centered in its column). Phones: a square photo that ends on the first screen. */
@media (min-width: 1024px) {
  .ch-hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 64px; align-items: center; }
  .ch-hero .ch-copy { text-align: center; }
  .ch-hero .ch-stage { margin: 0; width: min(520px, calc((100vh - 172px) * 0.75)); }
  .ch-hero .ch-feed { left: -48px; right: -24px; }
  .ch-hero { padding-bottom: 64px; }
}
@media (max-width: 640px) {
  .ch-card { aspect-ratio: 1 / 1; background-position: center 28%; }
  .ch-feed { top: 42%; }
}
@media (max-width: 640px) {
  .ch-feed { top: 26%; gap: 8px; }
  .gp-card-foot { display: none; }
  .gp-card-top { padding: 6px 10px; }
  .gp-card-top b { margin-top: 4px; font-size: 1.0625rem; }
  .gp-card li { padding: 3px 0; }
}

/* Dec 3 (Robert): the chat stopped halfway up the photo. It now runs the full height and fades only at the very top. */
.ch-feed, .ch-hero .ch-feed { top: 14px; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 9%); mask-image: linear-gradient(to bottom, transparent, #000 9%); }
@media (max-width: 640px) { .ch-feed { top: 10px; } }

/* Dec 3 (Robert): chat avatars are the cartoon people */
.msg .av.av-pic { background-color: #e9e6df; background-size: cover; background-position: center; font-size: 0; width: 40px; height: 40px; }
@media (min-width: 1024px) { .msg .av.av-pic { width: 44px; height: 44px; } }
