@import "../tokens.css";

/* ============================================================
   Yehu — minimalist single-page landing
   ============================================================ */

* { box-sizing: border-box; }

/* Visually hidden but accessible */
.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
  border: 0; padding: 0; margin: -1px;
}

:where(button, [href], input, select, textarea):focus-visible {
  outline: 2px solid var(--color-clay);
  outline-offset: 2px;
}

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--color-bg-warm);
  color: var(--color-ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* Shared waitlist pill (header + section CTAs) */
.btn-waitlist {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-clay);
  color: #fff;
  font-family: var(--font-sans);
  font-size: clamp(13px, 1.4vw, 15px);
  font-weight: 400;
  text-decoration: none;
  line-height: 1;
  padding: 11px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 0 0 rgba(0, 0, 0, 0.14);
  transition: background-color 160ms ease, transform 160ms ease;
}
@media (min-width: 821px) {
  .btn-waitlist {
    font-size: clamp(15px, 1.2vw, 19px);
    padding: 15px 30px;
  }
}
.btn-waitlist:hover { background: var(--color-clay-pressed); }
.btn-waitlist:active { transform: translateY(1px); }
.btn-waitlist:focus-visible {
  outline: 2px solid var(--color-clay);
  outline-offset: 3px;
}

/* ------------------------------------------------------------
   1. Hero — 3D product + wordmark
   ------------------------------------------------------------ */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 72px);
  position: relative;
}

.hero__cta {
  position: absolute;
  top: clamp(18px, 3vw, 36px);
  right: clamp(18px, 3vw, 36px);
}

.hero__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(32px, 10vw, 160px);
}

.hero__viewer {
  width: clamp(280px, 38vw, 520px);
  height: clamp(280px, 52vh, 560px);
  --poster-color: transparent;
  background: transparent;
}

.hero__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.6vw, 18px);
}

.hero__mark {
  width: clamp(120px, 18vw, 230px);
  aspect-ratio: 1821 / 2048;
  background-color: var(--color-ink);
  -webkit-mask: url(/assets/yehu-logo.svg?v=5) center / contain no-repeat;
  mask: url(/assets/yehu-logo.svg?v=5) center / contain no-repeat;
}

.hero__wordmark {
  margin: 0;
  font-weight: 400;
  font-size: clamp(48px, 9vw, 120px);
  letter-spacing: 0.06em;
  line-height: 0.9;
  color: var(--color-ink);
}

/* Poster / fallback shown while the GLB loads or if WebGL is unavailable */
.hero__fallback {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Lifestyle carousel styles removed — restore from git tag
   `homepage-lifestyle-carousel` */

/* ------------------------------------------------------------
   2. CGM + App
   ------------------------------------------------------------ */
.product {
  background: var(--color-bg-cream);
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(56px, 9vw, 120px) clamp(24px, 5vw, 72px);
}

.product__cta {
  position: absolute;
  top: clamp(18px, 3vw, 36px);
  right: clamp(18px, 3vw, 36px);
}

.product__grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(32px, 6vw, 88px);
}

.product__copy {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 4vw, 44px);
  text-align: center;
}

.product__statement {
  margin: 0;
  font-weight: 400;
  font-size: clamp(22px, 2.8vw, 34px);
  line-height: 1.25;
  color: var(--color-ink);
}

.product__plus {
  font-size: clamp(28px, 4vw, 44px);
  color: var(--color-clay);
  line-height: 1;
}

.product__media {
  display: grid;
  gap: clamp(16px, 3vw, 32px);
  align-items: center;
}

.product__device {
  width: 100%;
  max-width: 440px;
  justify-self: center;
  /* the source .webp has a lot of baked-in whitespace (esp. below the
     products); crop to the product band without editing the asset */
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center 46%;
}

.product__phones {
  width: clamp(150px, 30vw, 240px);
  justify-self: center;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.18));
}

/* ------------------------------------------------------------
   3. Feature explorer — accordion + synced screenshot
   ------------------------------------------------------------ */
.features {
  background: var(--color-bg-warm);
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(64px, 10vw, 130px) clamp(24px, 5vw, 72px);
}

.features__cta {
  position: absolute;
  top: clamp(18px, 3vw, 36px);
  right: clamp(18px, 3vw, 36px);
}

.features__grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(32px, 6vw, 88px);
}

.features__heading {
  margin: 0 0 clamp(20px, 3vw, 36px);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.1;
  color: var(--color-ink);
}

.features__list {
  display: flex;
  align-items: flex-start;
  gap: clamp(8px, 1.4vw, 16px);
}

/* up / down step controls */
.features__nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 6px;
}

.features__chev {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(27, 13, 13, 0.06);
  color: var(--color-ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background-color 160ms ease, transform 160ms ease;
}
.features__chev:hover { background: rgba(27, 13, 13, 0.12); }
.features__chev:active { transform: translateY(1px); }
.features__chev svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.accordion {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.accordion__item {
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: background-color 200ms ease;
}
.accordion__item:has(.accordion__trigger[aria-expanded="true"]) {
  background: rgba(255, 255, 255, 0.85);
}

.accordion__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: clamp(14px, 1.8vw, 18px) clamp(16px, 2vw, 22px);
  font-family: var(--font-sans);
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 600;
  color: var(--color-ink);
  line-height: 1.2;
}

/* circular +/− icon */
.accordion__icon {
  position: relative;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  opacity: 0.85;
}
.accordion__icon::before,
.accordion__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 11px;
  height: 1.5px;
  background: currentColor;
  transform: translate(-50%, -50%);
  transition: transform 200ms ease, opacity 200ms ease;
}
.accordion__icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.accordion__trigger[aria-expanded="true"] .accordion__icon::after {
  transform: translate(-50%, -50%) rotate(0deg);
  opacity: 0;
}

.accordion__panel {
  padding: 0 clamp(16px, 2vw, 22px) 0 calc(clamp(16px, 2vw, 22px) + 26px + 14px);
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 240ms ease;
}
.accordion__item:has(.accordion__trigger[aria-expanded="true"]) .accordion__panel {
  grid-template-rows: 1fr;
  padding-bottom: clamp(16px, 2vw, 20px);
}
.accordion__panel > p {
  margin: 0;
  overflow: hidden;
  font-size: clamp(15px, 1.6vw, 18px);
  font-weight: 400;
  line-height: 1.45;
  color: rgba(27, 13, 13, 0.72);
}

.features__media {
  /* the static feature shots and the bezel video clip are all cropped
     tight to the phone, so one shared size keeps swaps aligned */
  --phone-size: min(clamp(158px, 29vw, 253px), 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.features__shot {
  width: var(--phone-size);
  height: auto;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.18));
  transition: opacity 220ms ease;
}
.features__shot.is-swapping { opacity: 0; }

/* Demo video: the raw screen recording sits behind a transparent iPhone
   bezel PNG (937×1935, screen cutout at x 40–899, y 33–1904, corner
   radius 123px). The video is inset to that cutout with a ~3px overlap
   so its edges tuck under the opaque frame. */
.features__clip {
  position: relative;
  width: var(--phone-size);
  aspect-ratio: 937 / 1935;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.18));
  transition: opacity 220ms ease;
}
.features__clip.is-swapping { opacity: 0; }

.features__video {
  position: absolute;
  display: block;
  left: 3.95%;
  top: 1.55%;
  width: 92.32%;
  height: 97%;
  object-fit: cover;
  border-radius: 14.6% / 6.7%;
}

.features__bezel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ------------------------------------------------------------
   4. Founding-member offer — closing pitch → /reserve
   ------------------------------------------------------------ */
.offer {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(56px, 9vw, 110px) clamp(20px, 5vw, 48px) clamp(48px, 8vw, 96px);
}

.offer__card {
  width: 100%;
  max-width: 720px;
  background: var(--color-bg-cream);
  border-radius: var(--radius-xl);
  padding: clamp(28px, 5vw, 56px);
  box-shadow: 0 10px 40px rgba(27, 13, 13, 0.06);
  text-align: center;
}
/* Widen on desktop so the single-line heading has room to breathe */
@media (min-width: 821px) {
  .offer__card { max-width: 880px; }
}

.offer__heading {
  margin: 0;
  font-size: clamp(30px, 5.2vw, 48px);
  font-weight: 700;
  line-height: 1.05;
  white-space: nowrap;      /* keep "Master your metabolism" on one line */
}
/* On narrow phones let it wrap rather than overflow the card. */
@media (max-width: 520px) {
  .offer__heading { white-space: normal; }
}

.offer__lede {
  margin: 18px auto 0;
  max-width: 48ch;
  font-size: clamp(16px, 2.2vw, 19px);
  line-height: 1.55;
  opacity: 0.8;
}

/* Email capture — pill input with an inline Join button (Suna-style) */
.offer__form { margin: 32px 0 0; }
.offer__field {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 440px;
  margin: 0 auto;
}
.offer__field input {
  flex: 1 1 auto;
  min-width: 0;
  appearance: none;
  border: none;
  background: var(--color-input-bg);
  color: var(--color-input-text);
  font-family: var(--font-sans);
  font-size: clamp(16px, 2vw, 18px);
  padding: 15px 20px;
  border-radius: 999px;
}
.offer__field input:focus {
  outline: 2px solid var(--color-clay);
  outline-offset: 2px;
}
.offer__field ::placeholder { color: var(--color-input-text); opacity: 0.7; }

.offer__join {
  flex: 0 0 auto;
  border: none;
  cursor: pointer;
  background: var(--color-clay);
  color: #fff;
  font-family: var(--font-sans);
  font-size: clamp(16px, 2vw, 18px);
  font-weight: 600;
  padding: 15px 30px;
  border-radius: 999px;
  box-shadow: 0 4px 0 0 rgba(0, 0, 0, 0.14);
  transition: background-color 160ms ease, transform 120ms ease;
}
.offer__join:hover { background: var(--color-clay-pressed); }
.offer__join:active { transform: translateY(1px); }
.offer__join:disabled { opacity: 0.6; cursor: not-allowed; }

/* On phones, stack the Join button under the email field. */
@media (max-width: 520px) {
  .offer__field { flex-direction: column; align-items: stretch; gap: 12px; }
  .offer__field input { text-align: center; }
  .offer__join { width: 100%; }
}

.offer__feedback {
  min-height: 1.2em;
  margin: 10px 0 0;
  font-size: 15px;
  color: var(--color-brown);
}
.offer__feedback.error { color: var(--color-danger); }

.offer__hp {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* Already reserved? View your ticket */
.offer__ticket {
  display: inline-block;
  margin: 18px 0 0;
  font-size: 15px;
  color: var(--color-ink);
  opacity: 0.6;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.offer__ticket:hover { opacity: 0.9; }

/* Shipping pill with live countdown to August 2026 */
.offer__ship {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  width: fit-content;
  margin: 20px auto 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(178, 94, 94, 0.12);
  color: var(--color-clay);
  font-size: 14px;
  font-weight: 600;
}
.offer__ship-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-clay);
}
.offer__ship-label { letter-spacing: 0.01em; }
.offer__ship-count {
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}
.offer__ship-count::before {
  content: "·";
  margin-right: 8px;
  opacity: 0.6;
}
.offer__ship-count:empty { display: none; }

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.site-footer {
  padding: clamp(28px, 5vw, 48px) 20px clamp(36px, 6vw, 56px);
  border-top: 1px solid rgba(27, 13, 13, 0.14);
  text-align: center;
}
.site-footer__copy {
  margin: 0 0 12px;
  font-size: 15px;
  color: rgba(27, 13, 13, 0.55);
  line-height: 1.5;
}
.site-footer__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: center;
  align-items: center;
}
.site-footer__nav a {
  color: var(--color-clay);
  font-weight: 400;
  font-size: 15px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
}
.site-footer__nav a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-footer__nav a:focus-visible {
  outline: 2px solid var(--color-clay);
  outline-offset: 2px;
}

/* ------------------------------------------------------------
   Responsive — stack on mobile (matches iPhone frames)
   ------------------------------------------------------------ */
@media (max-width: 820px) {
  .hero {
    text-align: center;
    padding-block: clamp(40px, 8vh, 80px);
  }
  .hero__cta,
  .product__cta,
  .features__cta {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
  .hero__cta:active,
  .product__cta:active,
  .features__cta:active { transform: translateX(-50%) translateY(1px); }
  .hero__inner {
    flex-direction: column;
    gap: clamp(48px, 12vh, 120px);
  }
  .hero__viewer {
    width: clamp(240px, 70vw, 420px);
    height: clamp(240px, 40vh, 420px);
  }

  .product__grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* clear the absolutely-positioned CTA so the first title isn't
       crowded against the button */
    margin-top: clamp(32px, 9vw, 88px);
    /* tight base gap keeps each title close to its image; the plus
       adds its own margin to separate the two groups */
    gap: clamp(10px, 2vw, 16px);
  }
  /* flatten the copy/media wrappers so each title can sit directly
     above its matching product image, with the plus sign between */
  .product__copy,
  .product__media { display: contents; }
  .product__copy .product__statement:first-child { order: 1; }
  .product__device { order: 2; }
  .product__copy .product__statement:last-child { order: 4; }
  .product__phones { order: 5; }

  /* both product images share the same width so they read as a pair */
  .product__device,
  .product__phones {
    width: clamp(220px, 66vw, 340px);
    max-width: 340px;
  }
  .product__plus {
    order: 3;
    font-size: clamp(48px, 10vw, 72px);
    margin-block: clamp(20px, 5vw, 40px);
  }

  .features__grid { grid-template-columns: 1fr; }
  .features__media {
    order: -1;
    /* clear the absolutely-positioned CTA by the same distance as the
       grid gap between the phone and the heading below it */
    margin-top: clamp(32px, 6vw, 88px);
  }
  .features__heading { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-waitlist { transition: none; }
  .accordion__panel,
  .accordion__icon::before,
  .accordion__icon::after,
  .features__shot,
  .features__clip { transition: none; }
}
