/* =========================================================
   Pyng · Waitlist — opening animation, then the film as a
   full-screen backdrop: headline + two glass buttons, and
   the sign-up form in a popup
   ========================================================= */

:root {
  --mint: #E8F4E3;          /* the film's closing background */
  --ink: #1F2A24;
  --night: #0B110E;
  --danger: #FFB4A8;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --edge: clamp(16px, 2.4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }

/* no scrolling, ever: the fixed stage owns the viewport */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; background: var(--night); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  position: fixed;
  inset: 0;
  color: #fff;
  font-family: 'Heebo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video { display: block; }

/* ---------- Opening ---------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--mint);
  transition: opacity 1.1s var(--ease), transform 1.6s var(--ease), filter 1.1s var(--ease);
}
.intro video { width: 100%; height: 100%; object-fit: contain; }
.intro.is-leaving { opacity: 0; transform: scale(1.06); filter: blur(10px); pointer-events: none; }
body:not(.is-intro) .intro { display: none; }

/* ---------- Backdrop ---------- */
.stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--night);
}
.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(.6);
  transform: scale(1.04);
  transition: transform 2.4s var(--ease), filter .9s var(--ease);
}
body.is-intro .bg { transform: scale(1.1); }
body.is-modal .bg { filter: brightness(.4) blur(8px); transform: scale(1.08); }
/* the popup's glass would show the headline through it, so the hero steps away */
body.is-modal .hero,
body.is-modal .foot { opacity: 0; pointer-events: none; }
.grade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(55% 45% at 50% 52%, rgba(0, 0, 0, .42), transparent 72%),
    linear-gradient(to bottom, rgba(0, 0, 0, .3), transparent 25%, transparent 65%, rgba(0, 0, 0, .5));
  transition: opacity .9s var(--ease);
}

video.bg:fullscreen { object-fit: contain; filter: none; transform: none; }

/* Watching: the film comes forward with sound, everything else steps aside */
body.is-watching .bg { filter: none; transform: none; object-fit: contain; }
body.is-watching .grade,
body.is-watching .hero,
body.is-watching .brand,
body.is-watching .foot { opacity: 0; pointer-events: none; }

/* Everything on the film waits for the opening to finish */
body.is-intro .brand,
body.is-intro .hero,
body.is-intro .foot { opacity: 0; }

/* ---------- Chrome ---------- */
.brand {
  position: absolute;
  z-index: 3;
  top: max(var(--edge), env(safe-area-inset-top));
  left: 50%;
  translate: -50% 0;
  padding: 6px;
  filter: drop-shadow(0 2px 14px rgba(0, 0, 0, .45));
  transition: opacity .8s var(--ease);
}
.brand img { height: 40px; width: auto; }

.social {
  position: absolute;
  z-index: 3;
  top: max(var(--edge), env(safe-area-inset-top));
  inset-inline-end: var(--edge);
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  transition: transform .3s var(--ease), opacity .6s var(--ease);
}
.social:hover { transform: scale(1.08); }
.social:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.social svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 6px rgba(0, 0, 0, .35)); }
.social svg .dot { fill: currentColor; stroke: none; }
body.is-intro .social,
body.is-watching .social,
body.is-modal .social { opacity: 0; pointer-events: none; }

.foot {
  position: absolute;
  z-index: 2;
  inset-inline: var(--edge);
  bottom: max(var(--edge), env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  color: rgba(255, 255, 255, .5);
  transition: opacity .6s var(--ease);
}
.foot nav { display: flex; gap: 8px; }
.foot a { color: inherit; text-decoration: none; transition: color .2s; }
.foot a:hover { color: #fff; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  width: min(100% - 2 * var(--edge), 760px);
  text-align: center;
  transition: opacity .7s var(--ease);
}
.title {
  margin: 0;
  font-size: clamp(32px, 4.4vw, 60px);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -.02em;
  text-wrap: balance;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .55), 0 1px 3px rgba(0, 0, 0, .35);
  animation: words 1.2s var(--ease) both;
}
.actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: clamp(24px, 4dvh, 40px);
  animation: words 1.2s var(--ease) .2s both;
}
body.is-intro .title,
body.is-intro .actions { animation-play-state: paused; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  font: 500 16.5px/1 'Heebo', system-ui, sans-serif;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .3s var(--ease), opacity .6s var(--ease);
}
.btn:hover { transform: scale(1.05); }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 6px rgba(0, 0, 0, .4)); }
/* SF Symbols-style "*.circle.fill" icons: a solid light disc with the glyph cut in dark */
.btn svg.sf { width: 22px; height: 22px; fill: rgba(255, 255, 255, .95); stroke: none; filter: drop-shadow(0 1px 6px rgba(0, 0, 0, .35)); }
.sf .sf-glyph { fill: var(--ink); }
.sf .sf-line { fill: none; stroke: var(--ink); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { font-weight: 600; }

.watch-bar {
  position: absolute;
  z-index: 3;
  bottom: calc(max(var(--edge), env(safe-area-inset-bottom)) + 24px);
  left: 50%;
  translate: -50% 0;
  display: flex;
  gap: 12px;
  animation: rise .5s var(--ease) both;
}
.watch-bar[hidden] { display: none; }
#playBtn .i-resume,
#playBtn[aria-pressed="true"] .i-pause { display: none; }
#playBtn[aria-pressed="true"] .i-resume { display: block; }
body.is-watching .bg { cursor: pointer; }
@media (max-width: 760px) {
  .watch-bar { gap: 8px; width: calc(100% - 2 * var(--edge)); justify-content: center; }
  .watch-bar .btn { padding: 0 16px; height: 50px; font-size: 15px; gap: 8px; }
}

/* ---------- Liquid glass ---------- */
.lg {
  position: relative;
  isolation: isolate;
  background: transparent;
  color: #fff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .45);
}
.lg > :not(.lg-rim) { position: relative; z-index: 1; }
.social.lg { position: absolute; } /* the shared rule above would otherwise pull it into the flow */
/* a distorted, blurred view of whatever is behind the button... */
.lg::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(10px) saturate(1.7) brightness(1.15);
  backdrop-filter: blur(10px) saturate(1.7) brightness(1.15);
}
.liquid-svg .lg::after { backdrop-filter: url(#container-glass) saturate(1.5) brightness(1.15); }
/* the main action carries a little more light so it reads first */
.lg.btn-primary::after { background: rgba(255, 255, 255, .16); }
.modal-card.lg::after {
  background: rgba(12, 20, 16, .55);
  -webkit-backdrop-filter: blur(40px) saturate(1.5);
  backdrop-filter: blur(40px) saturate(1.5);
}
.liquid-svg .modal-card.lg::after { backdrop-filter: url(#container-glass) blur(34px) saturate(1.5); }
/* ...and the rim of light that gives the glass its edge */
:root {
  --rim:
    0 0 8px rgba(0, 0, 0, .03),
    0 2px 6px rgba(0, 0, 0, .08),
    inset 3px 3px .5px -3.5px rgba(255, 255, 255, .09),
    inset -3px -3px .5px -3.5px rgba(255, 255, 255, .85),
    inset 1px 1px 1px -.5px rgba(255, 255, 255, .6),
    inset -1px -1px 1px -.5px rgba(255, 255, 255, .6),
    inset 0 0 6px 6px rgba(255, 255, 255, .12),
    inset 0 0 2px 2px rgba(255, 255, 255, .06),
    0 0 12px rgba(0, 0, 0, .15);
}
.lg-rim {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  transition: box-shadow .25s var(--ease);
  box-shadow:
    0 0 8px rgba(0, 0, 0, .03),
    0 2px 6px rgba(0, 0, 0, .08),
    inset 3px 3px .5px -3.5px rgba(255, 255, 255, .09),
    inset -3px -3px .5px -3.5px rgba(255, 255, 255, .85),
    inset 1px 1px 1px -.5px rgba(255, 255, 255, .6),
    inset -1px -1px 1px -.5px rgba(255, 255, 255, .6),
    inset 0 0 6px 6px rgba(255, 255, 255, .12),
    inset 0 0 2px 2px rgba(255, 255, 255, .06),
    0 0 12px rgba(0, 0, 0, .15);
}
.lg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Popup ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: var(--edge);
}
.modal[hidden] { display: none; }
.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(5, 9, 7, .35);
  animation: fade .4s var(--ease) both;
}
.modal-card {
  position: relative;
  width: min(100%, 440px);
  padding: 34px 28px 24px;
  border-radius: 30px;
  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, .9);
  text-align: center;
  animation: pop .55s var(--ease) both;
}
.modal.is-closing .modal-scrim { animation: fade .3s var(--ease) reverse both; }
.modal.is-closing .modal-card { animation: pop .3s var(--ease) reverse both; }
.modal-x {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: transform .3s var(--ease);
}
.modal-x.lg { position: absolute; }
.modal-x:hover { transform: scale(1.08); }
.modal-x:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.modal-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

.view { transition: opacity .35s var(--ease), transform .35s var(--ease); }
.view[hidden] { display: none; }
.view.is-out { opacity: 0; transform: translateY(-8px); }
.view:focus { outline: none; }
.view.is-in { animation: rise .6s var(--ease) both; }
.modal-title { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 600; letter-spacing: -.015em; }
.modal-sub { margin: 8px 0 0; font-size: 14.5px; color: rgba(255, 255, 255, .7); }

/* ---------- Form ---------- */
.form { margin-top: 22px; }
.fields { display: grid; gap: 10px; }
.field { display: block; height: 52px; border-radius: 999px; transition: transform .3s var(--ease); }
.field:focus-within { transform: scale(1.015); }
.fields input {
  width: 100%;
  height: 100%;
  padding: 0 20px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: #fff;
  font: 400 16px/1 'Heebo', system-ui, sans-serif;
  text-align: right;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .35);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.fields input[type="tel"],
.fields input[type="email"] { direction: ltr; text-align: right; }
.fields input:placeholder-shown { direction: rtl; }
.fields input::placeholder { color: rgba(255, 255, 255, .6); }
.fields input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px rgba(40, 52, 46, 1) inset; -webkit-text-fill-color: #fff; }
.field:focus-within .lg-rim { box-shadow: var(--rim), 0 0 0 3px rgba(255, 255, 255, .14); }
.field:has(input[aria-invalid="true"]) .lg-rim { box-shadow: var(--rim), inset 0 0 0 1.5px var(--danger); }

.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.consent {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  text-align: start;
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .62);
  cursor: pointer;
}
.consent input { position: absolute; inset-inline-start: 0; top: 0; width: 18px; height: 18px; margin: 0; opacity: 0; cursor: pointer; }
.check {
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 6px;
  transition: background .2s, box-shadow .2s;
}
.check.lg { position: relative; }
.check .lg-rim { box-shadow: var(--rim), inset 0 0 0 1px rgba(255, 255, 255, .25); }
.check svg { width: 12px; height: 12px; fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset .3s var(--ease) .05s; }
.consent input:checked + .check::after { background: rgba(255, 255, 255, .92); }
.consent input:checked + .check svg { stroke-dashoffset: 0; }
.consent input:focus-visible + .check { box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.consent.is-invalid { color: var(--danger); }
.consent.is-invalid .check .lg-rim { box-shadow: var(--rim), inset 0 0 0 1.5px var(--danger); }

.form-status { margin: 12px 0 0; font-size: 13px; color: var(--danger); }
.form-status:empty { display: none; }

.submit { width: 100%; margin-top: 18px; }
.spin { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff; animation: spin .8s linear infinite; }
.submit.is-loading { cursor: progress; }
.submit.is-loading .spin { display: block; }
.privacy {
  display: inline-block;
  margin-top: 14px;
  font-size: 12px;
  color: rgba(255, 255, 255, .5);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, .25);
  text-underline-offset: 3px;
}
.privacy:hover { color: #fff; }

/* ---------- Joined ---------- */
.done .mascot { width: 92px; height: auto; margin: 0 auto 14px; animation: float 5s ease-in-out infinite; }
.done .btn { margin-top: 22px; }

/* ---------- Motion ---------- */
@keyframes words { from { opacity: 0; transform: translateY(16px); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  :root { --edge: 16px; }
  .brand img { height: 30px; }
  .title { font-size: clamp(28px, 8vw, 36px); line-height: 1.25; }
  .actions { flex-direction: column; align-items: stretch; gap: 12px; width: min(100%, 340px); margin-inline: auto; }
  .btn { height: 54px; font-size: 16px; }
  .foot { flex-direction: column; align-items: center; gap: 4px; font-size: 11px; text-align: center; }

  /* the popup floats in the middle on phones too */
  .modal { place-items: center; padding: 16px; }
  .modal-card { width: 100%; padding: 28px 18px 20px; border-radius: 26px; }
  .modal-title { font-size: 22px; }
  .field { height: 50px; }
}
@media (max-width: 760px) and (max-height: 700px) {
  .modal-card { padding-top: 22px; }
  .modal-sub { display: none; }
  .done .mascot { width: 64px; }
}

/* ---------- Popup: light theme ---------- */
/* White frosted glass with dark text, using the light variant of the liquid-glass rim. */
.modal {
  --rim-light:
    0 0 6px rgba(0, 0, 0, .03),
    0 2px 6px rgba(0, 0, 0, .08),
    inset 3px 3px .5px -3px rgba(0, 0, 0, .55),
    inset -3px -3px .5px -3px rgba(0, 0, 0, .5),
    inset 1px 1px 1px -.5px rgba(0, 0, 0, .3),
    inset -1px -1px 1px -.5px rgba(0, 0, 0, .3),
    inset 0 0 6px 6px rgba(0, 0, 0, .05),
    inset 0 0 2px 2px rgba(0, 0, 0, .03),
    0 0 12px rgba(255, 255, 255, .15);
  color: var(--ink);
}
body.is-modal .bg { filter: brightness(.75) blur(10px); }
.modal-scrim { background: rgba(240, 246, 238, .28); }

.modal .lg { color: var(--ink); text-shadow: none; }
.modal .lg-rim { box-shadow: var(--rim-light); }
.modal .lg::after { background: rgba(255, 255, 255, .55); }

.modal-card { box-shadow: 0 40px 100px -40px rgba(8, 16, 12, .55); }
.modal-card.lg::after {
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: blur(40px) saturate(1.6);
  backdrop-filter: blur(40px) saturate(1.6);
}
.liquid-svg .modal-card.lg::after { backdrop-filter: url(#container-glass) blur(34px) saturate(1.6); }
.modal-card > .lg-rim { box-shadow: var(--rim-light), inset 0 0 0 1px rgba(255, 255, 255, .7); }

.modal-title { color: var(--forest-900, #1E3A2D); }
.modal-sub { color: #5F6763; }

.modal-x.lg::after { background: rgba(31, 42, 36, .06); }
.modal-x:focus-visible { outline-color: var(--ink); }

.modal .field.lg::after { background: rgba(255, 255, 255, .7); }
.modal .fields input { color: var(--ink); text-shadow: none; }
.modal .fields input::placeholder { color: #7A817D; }
.modal .fields input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #fff inset; -webkit-text-fill-color: var(--ink); }
.modal .field:focus-within .lg-rim { box-shadow: var(--rim-light), 0 0 0 3px rgba(109, 191, 103, .28); }
.modal .field:has(input[aria-invalid="true"]) .lg-rim { box-shadow: var(--rim-light), inset 0 0 0 1.5px #C4483A; }

.modal .consent { color: #5F6763; }
.modal .check .lg-rim { box-shadow: var(--rim-light), inset 0 0 0 1px rgba(31, 42, 36, .25); }
.modal .check svg { stroke: #fff; }
.modal .consent input:checked + .check::after { background: #2F5242; }
.modal .consent input:focus-visible + .check { box-shadow: 0 0 0 3px rgba(109, 191, 103, .3); }
.modal .consent.is-invalid,
.modal .form-status { color: #C4483A; }
.modal .consent.is-invalid .check .lg-rim { box-shadow: var(--rim-light), inset 0 0 0 1.5px #C4483A; }

/* the main action: the same liquid glass, just tinted Pyng green (popup and home screen) */
.hero .btn-primary.lg,
.modal .btn-primary.lg { color: #fff; text-shadow: 0 1px 8px rgba(10, 40, 15, .35); font-weight: 600; }
/* on the film: a light green tint over the distorted backdrop */
.hero .btn-primary.lg::after {
  background: linear-gradient(180deg, rgba(126, 206, 114, .34), rgba(88, 170, 82, .28));
}
.liquid-svg .hero .btn-primary.lg::after { backdrop-filter: url(#container-glass) saturate(1.6) brightness(1.1); }
.hero .btn-primary .lg-rim { box-shadow: var(--rim), inset 0 0 0 1px rgba(170, 230, 160, .22); }
/* on the white card the tint needs more body, or white type disappears */
.modal .btn-primary.lg::after {
  background: linear-gradient(180deg, rgba(110, 190, 100, .78), rgba(80, 160, 76, .82));
  -webkit-backdrop-filter: blur(10px) saturate(1.5);
  backdrop-filter: blur(10px) saturate(1.5);
}
.liquid-svg .modal .btn-primary.lg::after { backdrop-filter: blur(10px) saturate(1.5); }
.modal .btn-primary .lg-rim { box-shadow: var(--rim), 0 10px 24px -14px rgba(62, 148, 64, .55); }
.modal .btn:focus-visible { outline-color: #2F5242; }

.modal .privacy { color: #7A817D; text-decoration-color: rgba(31, 42, 36, .25); }
.modal .privacy:hover { color: var(--ink); }

/* consent fine print under the button (replaces the checkbox) */
.fine { margin: 12px 4px 0; font-size: 11.5px; line-height: 1.55; color: #7A817D; text-align: center; }
.fine .privacy { display: inline; margin: 0; font-size: inherit; }
