/* ========================================================================
   KHAO HEALTHY — launch page (launch.html)
   Standalone: none of style.css, which is the hero's. Built from the
   "KhaoHealthy — Coming Soon" design: a 390 × 844 mobile board, a 1440 × 900
   desktop board and an on-the-list board — the oddly exact values below are
   those boards'.
   ======================================================================== */

:root {
  --ink: #251A10;
  --cream: #F9EED4;
  --paper: #FAF3E7;
  --sand: #F2E7DB;
  --brown: #8C4E1C;
  --amber: #D98E0B;
  --ink-soft: #6E5E4E;
  --hint: #9A8B7B;
  --line: rgba(37, 26, 16, 0.18);
  --err: #9B2C10;
  --on-brown: #FFF9EF;

  --font-display: 'Bricolage Grotesque', 'Arial Black', sans-serif;
  --font-body: 'Outfit', system-ui, sans-serif;
  --font-hand: 'Kalam', 'Comic Sans MS', cursive;

  --gutter: 20px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; }
i { display: block; font-style: normal; }
a { color: var(--brown); }
a:hover { color: var(--ink); }
button, input { font: inherit; color: inherit; }
::selection { background: var(--ink); color: var(--paper); }

.page { display: flex; flex-direction: column; min-height: 100svh; background: var(--cream); overflow-x: clip; }
.main { flex: 1; display: flex; flex-direction: column; }

/* ---------- header ---------- */
.top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px var(--gutter) 0; }
.top__logo img { width: 70px; height: 67px; object-fit: contain; }
.top__nav { display: flex; align-items: center; gap: 24px; }
.top__link { display: none; color: var(--ink); font-size: 15px; font-weight: 500; text-decoration: none; }
.top__link:hover { color: var(--brown); }
.top__shop {
  padding: 10px 18px; border: 1.5px solid var(--ink); border-radius: 999px; color: var(--ink); text-decoration: none;
  font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap;
  transition: background .2s, color .2s;
}
.top__shop:hover { background: var(--ink); color: var(--paper); }
.top__shop span { display: inline-block; animation: shop-nudge 1.6s ease-in-out infinite; }
.top__shop:focus-visible { outline: 3px solid var(--brown); outline-offset: 3px; }

/* ---------- the words ---------- */
.hero { display: flex; flex-direction: column; flex: 1; padding-bottom: 14px; }
.title {
  position: relative; margin-top: 18px; padding: 0 var(--gutter);
  font: 800 clamp(46px, 14.9vw, 58px)/0.92 var(--font-display); letter-spacing: -2.4px;
}
.title span { color: var(--brown); }
/* phones always read: something / new is / cooking. */
@media (min-width: 600px) { .title__br { display: none; } }
.tag { position: relative; margin-top: 10px; padding: 0 var(--gutter); font: 700 min(21px, 5.2vw)/1.25 var(--font-hand); color: var(--ink); }
.tag span { color: var(--brown); text-decoration: underline wavy var(--amber) 1.5px; text-underline-offset: 5px; }

/* ---------- the secret bowl: everything here is sized from the stage, which
   takes whatever height the page has left ---------- */
.stage { position: relative; flex: none; height: 204px; margin: 4px 0; container-type: size; }
.stage > * { --bowl: min(310px, 98cqh, 72cqw); --side: min(170px, 66cqh); --belt-gap: 24px; }
.belt {
  position: absolute; left: 50%; top: 50%; width: 100vw; height: var(--side);
  margin-top: calc(var(--side) / -2); translate: -50% 0; overflow: hidden;
}
.belt__track { display: flex; align-items: center; width: max-content; opacity: 0.7; animation: belt 28s linear infinite; }
.belt__track img { flex: none; width: var(--side); height: auto; margin-right: var(--belt-gap); }

.secret {
  --card: clamp(96px, calc(var(--bowl) * 0.67), 190px);
  position: absolute; left: 50%; top: calc(50% - var(--bowl) / 2); width: var(--bowl);
  margin-left: calc(var(--bowl) / -2);
}
.secret__bowl { width: 100%; height: auto; }
.secret__card {
  position: absolute; left: 50%; top: 50%; width: var(--card); height: calc(var(--card) * 0.48);
  margin: calc(var(--card) * -0.24) 0 0 calc(var(--card) * -0.5); padding: calc(var(--card) * 0.05);
  background: #F4E6C4; border-radius: calc(var(--card) * 0.03); transform: rotate(-6deg);
  box-shadow: 0 10px 24px rgba(37, 26, 16, 0.3);
}
.secret__stamp {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--card) * 0.012);
  width: 100%; height: 100%; color: #B5121B; filter: url(#stamp-ink);
  border: calc(var(--card) * 0.018) solid currentColor; outline: calc(var(--card) * 0.006) solid currentColor;
  outline-offset: calc(var(--card) * -0.03);
}
.secret__conf { font: 700 calc(var(--card) * 0.052)/1 var(--font-body); letter-spacing: 0.22em; text-transform: uppercase; }
.secret__top { font: 700 calc(var(--card) * 0.126)/1 'Stardos Stencil', 'Arial Black', sans-serif; letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap; }

/* ---------- the form ---------- */
.panel { position: relative; padding: 0 var(--gutter); }
.join { display: flex; flex-direction: column; gap: 10px; }
.join__fields { display: flex; flex-wrap: wrap; gap: 10px; }

.field {
  flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px;
  padding: 10px 16px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--paper);
  transition: border-color .2s, box-shadow .2s;
}
.field.is-bad { border-color: var(--err); }
.field:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(140, 78, 28, 0.18); }
.field__label { font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }
.field__input {
  width: 100%; min-width: 0; height: 26px; border: 0; outline: 0; background: transparent;
  color: var(--ink); font-size: 18px; font-weight: 500;
}
.field__input::placeholder { color: var(--hint); }
.field__row { display: flex; align-items: center; gap: 8px; }
.field__row .field__input { flex: 1; letter-spacing: 0.02em; }
.field__cc { flex: none; padding: 2px 7px; border-radius: 8px; background: var(--sand); font-size: 15px; font-weight: 600; }

.join__trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.join__err { margin: -2px 0 0 4px; font-size: 13px; color: var(--err); }
.join__err:empty { display: none; }

.cta {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 56px; margin-top: 4px; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-size: 17px; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: background .2s, opacity .2s;
}
.cta:hover { background: #3A2A1B; color: var(--paper); }
.cta:focus-visible { outline: 3px solid var(--brown); outline-offset: 3px; }
.cta:disabled { opacity: 0.6; cursor: default; }
.cta__star { color: var(--amber); }

/* the main button asks for the tap: a streak as wide as the button's own 100%,
   parked off the left edge between passes */
.dibs { position: relative; overflow: hidden; }
.dibs::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(250, 243, 231, 0), rgba(250, 243, 231, 0.32), rgba(250, 243, 231, 0)) center / 72px 100% no-repeat;
  transform: translateX(-100%) skewX(-20deg);
  animation: dibs-shine 2.8s ease-in-out infinite;
}
.dibs .cta__star { display: inline-block; animation: dibs-star 2.8s ease-in-out infinite; }
.join__note { text-align: center; font-size: 12px; line-height: 1.4; color: var(--ink-soft); }
.tease { margin-top: 8px; text-align: center; font: 700 16px/1.2 var(--font-hand); color: var(--brown); }

.fx {
  display: block; position: fixed; inset: 0; z-index: 40; width: 100%; height: 100%;
  margin: 0; padding: 0; border: 0; background: transparent; pointer-events: none;
}

/* ---------- the bottom sheet. --kb is the height of the on-screen keyboard,
   set by launch.js, so the button is never left underneath it ---------- */
.sheet {
  position: fixed; inset: auto 0 var(--kb, 0px); width: 100%; max-width: 520px; max-height: calc(100dvh - var(--kb, 0px));
  margin: 0 auto; padding: 0; border: 0; border-radius: 24px 24px 0 0; overflow: auto;
  background: var(--cream); color: var(--ink); box-shadow: 0 -12px 40px rgba(37, 26, 16, 0.25);
}
.sheet[open] { animation: sheet-up .32s cubic-bezier(.2, .8, .2, 1); }
.sheet.is-closing { animation: sheet-down .22s ease-in forwards; }
.sheet::backdrop { background: rgba(37, 26, 16, 0.5); animation: sheet-dim .32s ease-out; }
.sheet__in { position: relative; padding: 0 var(--gutter) 20px; }
.sheet__grab { display: flex; justify-content: center; padding: 10px 0 12px; touch-action: none; cursor: grab; }
.sheet__grab i { width: 44px; height: 5px; border-radius: 999px; background: var(--line); }
.sheet__close {
  position: absolute; right: 12px; top: 12px; display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--sand); color: var(--ink); cursor: pointer;
}
.sheet__close:focus-visible { outline: 3px solid var(--brown); outline-offset: 2px; }
.sheet__title { font: 800 30px/1 var(--font-display); letter-spacing: -1px; }
.sheet__sub { margin: 4px 0 14px; font: 700 17px/1.2 var(--font-hand); color: var(--brown); }

/* ---------- on the list ---------- */
.done { flex: 1; display: flex; flex-direction: column; }
.done__body { padding: 34px var(--gutter) 22px; }
.done__head { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.done__title { margin-top: 6px; font: 800 clamp(46px, 14.4vw, 56px)/0.92 var(--font-display); letter-spacing: -2.2px; outline: 0; }
.done__title span { color: var(--brown); }
.done__line { font: 400 19px/1.3 var(--font-hand); color: var(--ink-soft); }

.perk {
  display: flex; flex-direction: column; gap: 6px; margin-top: 22px; padding: 18px 20px;
  border-radius: 22px; background: var(--ink); color: var(--paper); transform: rotate(-1deg);
  animation: perk-pop .5s cubic-bezier(.3, 1.4, .5, 1) .15s both;
}
.perk__label { font-size: 10px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: #E9B25A; }
.perk__offer { font: 800 38px/1 var(--font-display); letter-spacing: -1px; }
.perk__note { font-size: 13px; line-height: 1.4; color: #E7DCCB; }
.perk__phone { white-space: nowrap; }

.done__links { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.pill {
  display: flex; align-items: center; justify-content: center; gap: 10px; height: 54px;
  border: 1.5px solid var(--ink); border-radius: 999px; color: var(--ink);
  font-size: 16px; font-weight: 600; text-decoration: none; transition: background .2s, color .2s;
}
.pill:hover { background: var(--ink); color: var(--paper); }
.pill--share { border-color: var(--brown); background: var(--brown); color: var(--on-brown); }
.pill--share:hover { border-color: var(--ink); }

.wait { margin-top: auto; background: var(--sand); border-top: 1px solid rgba(37, 26, 16, 0.12); }
.wait__in { display: flex; flex-direction: column; gap: 8px; padding: 16px var(--gutter) 22px; }
.wait__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.wait__title { font: 700 17px/1.2 var(--font-hand); }
.wait__shop { font-size: 13px; font-weight: 600; white-space: nowrap; }
.wait__bowls { display: flex; justify-content: space-between; align-items: flex-end; gap: 4px; }
.wait__bowl { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; font-size: 12px; font-weight: 600; }
.wait__bowl img { width: 100%; max-width: 78px; height: auto; }

/* ---------- the strip along the bottom ---------- */
.strip {
  flex: none; display: flex; align-items: center; justify-content: center; height: 40px; padding: 0 12px;
  background: var(--ink); color: var(--paper); white-space: pre;
  font-size: min(13px, 3.3vw); font-weight: 600; letter-spacing: 0.04em;
}
.strip b { color: var(--amber); font-weight: 600; }
.strip__more { display: none; }
.is-done .strip { display: none; }

@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes sheet-dim { from { opacity: 0; } }
@keyframes perk-pop { from { transform: scale(.82) rotate(-4deg); opacity: 0; } }
@keyframes dibs-shine {
  0%, 45% { transform: translateX(-100%) skewX(-20deg); }
  85%, 100% { transform: translateX(100%) skewX(-20deg); }
}
@keyframes dibs-star {
  0%, 45%, 100% { transform: scale(1) rotate(0); }
  65% { transform: scale(1.45) rotate(90deg); }
}
@keyframes shop-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}
/* four bowls and their gaps is one full loop */
@keyframes belt { to { transform: translateX(calc((var(--side) + var(--belt-gap)) * -4)); } }

/* ---------- shorter phones (Instagram's in-app browser): the bowl takes up
   what is left, and the on-the-list screen tightens ---------- */
@media (max-width: 959px) and (max-height: 860px) {
  .done__body { padding-top: 18px; padding-bottom: 14px; }
}
@media (max-width: 959px) and (max-height: 800px) {
  .done__title { margin-top: 0; font-size: clamp(38px, 12.4vw, 46px); }
  .done__line { font-size: 17px; }
  .perk { margin-top: 14px; padding: 14px 16px; }
  .done__links { gap: 8px; margin-top: 12px; }
  .pill { height: 48px; font-size: 15px; }
  .wait__in { padding: 10px var(--gutter) 12px; gap: 4px; }
  .wait__bowl img { max-width: 62px; }
}
@media (max-width: 959px) and (max-height: 720px) {
  .top { padding-top: 10px; }
  .top__logo img { width: 58px; height: 55px; }
  .top__shop { padding: 8px 15px; font-size: 12px; }
  .title { margin-top: 12px; }
  .tag { margin-top: 6px; font-size: min(18px, 4.7vw); }
  .join { gap: 8px; }
  .join__fields { gap: 8px; }
  .field { padding: 6px 14px; }
  .field__input { height: 24px; }
  .cta { height: 48px; margin-top: 2px; }
  .join__note { font-size: 11px; }
  .hero { padding-bottom: 10px; }
  .strip { height: 32px; }
  .done__body { padding-top: 12px; }
  .perk__note { font-size: 12px; }
}
@media (max-width: 959px) and (max-height: 600px) {
  .wait__bowls { display: none; }
}

/* ---------- tablet: the phone column, a little larger ---------- */
@media (min-width: 600px) and (max-width: 959px) {
  .top__link { display: block; }
  .strip { font-size: 13px; }
  .strip__more { display: inline; }
  .hero, .done__body { width: 100%; max-width: 600px; margin-inline: auto; }
  .hero { justify-content: center; }
  .title { font-size: min(72px, 9.4svh); letter-spacing: -3px; }
  .stage { height: 290px; margin: 10px 0 14px; }
  .stage > * { --bowl: min(420px, 94cqh, 66cqw); --side: min(190px, 58cqh); --belt-gap: 32px; }
  .wait__in { max-width: 600px; margin-inline: auto; }
  .wait__bowl img { max-width: 110px; }
}

/* ---------- desktop: words and form left, bowl right ---------- */
@media (min-width: 960px) {
  .top { flex: none; width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px 5vw 0; }
  .top__logo img { width: 88px; height: 84px; }
  .top__link { display: block; }
  .top__shop { padding: 12px 22px; font-size: 14px; }

  .hero {
    width: 100%; max-width: 1240px; margin: 0 auto; padding: 32px 5vw;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 48px;
    align-content: center; align-items: center;
  }
  .title, .tag, .panel { grid-column: 1; padding: 0; }
  .title { margin-top: 0; font-size: clamp(56px, 7.4vw, 104px); line-height: 0.9; letter-spacing: -0.04em; }
  .tag { margin-top: 18px; font-size: 27px; }
  .panel { margin-top: 28px; max-width: 520px; }

  .stage { grid-column: 2; grid-row: 1 / span 3; align-self: stretch; height: 520px; min-height: min(520px, 62svh); margin: 0; }
  .stage > * { --bowl: min(390px, 41svh, 27vw); --side: min(170px, 18svh, 12vw); --belt-gap: 36px; }
  .belt {
    width: 112%;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  }
  .secret { --card: max(96px, calc(var(--bowl) * 0.565)); }
  .secret__card { box-shadow: 0 16px 34px rgba(37, 26, 16, 0.3); }

  .join { gap: 12px; }
  .join__fields { gap: 12px; }
  .field { padding: 11px 16px; }
  .cta { height: 58px; margin-top: 0; }

  .done__body {
    width: 100%; max-width: 1240px; margin: 0 auto; padding: 40px 5vw;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 72px; align-items: center;
  }
  .done__title { font-size: clamp(56px, 6.6vw, 92px); line-height: 0.9; letter-spacing: -0.04em; }
  .done__line { font-size: 24px; }
  .perk { margin-top: 0; padding: 24px 26px; }
  .perk__offer { font-size: 48px; }
  .perk__note { font-size: 14px; }
  .wait__in { max-width: 1240px; margin: 0 auto; padding: 22px 5vw 28px; gap: 12px; }
  .wait__title { font-size: 20px; }
  .wait__shop { font-size: 15px; }
  .wait__bowls { justify-content: flex-start; gap: 56px; }
  .wait__bowl { font-size: 14px; }
  .wait__bowl img { max-width: 120px; }

  .strip { height: 48px; font-size: 15px; }
  .strip__more { display: inline; }
}

/* ---------- laptops: the headline and gaps give way to the screen's height ---------- */
@media (min-width: 960px) and (max-height: 820px) {
  .top { padding-top: 12px; }
  .top__logo img { width: 72px; height: 69px; }
  .hero { padding-block: 10px; }
  .title { font-size: min(clamp(56px, 7.4vw, 104px), 11svh); }
  .tag { margin-top: 10px; font-size: 22px; }
  .panel { margin-top: 16px; }
  .done__body { padding-block: 16px; }
  .done__title { font-size: min(clamp(56px, 6.6vw, 92px), 11svh); }
  .done__line { font-size: 20px; }
  .wait__in { padding-block: 12px 14px; gap: 6px; }
  .wait__bowl img { max-width: 84px; }
}
@media (min-width: 960px) and (max-height: 680px) {
  .wait__bowl img { max-width: 64px; }
}

/* ---------- one screen, no scrolling. launch.js adds .scrolls when a screen is
   too small for that (a phone on its side, an in-app keyboard shrinking the
   page), so the form can always be reached ---------- */
html:not(.scrolls), html:not(.scrolls) body { height: 100%; overflow: hidden; }
html:not(.scrolls) body { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
html:not(.scrolls) .page { flex: 1; min-height: 0; overflow: hidden; }
html:not(.scrolls) .main, html:not(.scrolls) .hero, html:not(.scrolls) .done { min-height: 0; }
html:not(.scrolls) .stage { flex: 1 1 0; height: auto; min-height: 0; }
@media (max-width: 959px) {
  html.scrolls .stage { height: 150px; }
}
@media (min-width: 960px) {
  html:not(.scrolls) .stage { min-height: min(520px, 62svh); }
}

/* the larger logo and Shop button are for the first screen; the on-the-list
   screen keeps the quieter header */
.is-done .top__logo img { width: 56px; height: 54px; }
.is-done .top__shop { padding: 8px 14px; font-size: 11px; }
@media (max-width: 959px) and (max-height: 720px) {
  .is-done .top__logo img { width: 44px; height: 42px; }
  .is-done .top__shop { padding: 6px 12px; font-size: 10px; }
}
@media (min-width: 960px) {
  .is-done .top__logo img { width: 72px; height: 69px; }
  .is-done .top__shop { padding: 9px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .belt__track, .sheet, .sheet::backdrop, .perk, .top__shop span, .dibs::after, .dibs .cta__star { animation: none !important; }
}
