/* Final website polish.
 * Keep the public site inside the native NutriFlux design language: rounded,
 * soft-filled chips, strict brand-derived colours, and a deliberate editorial
 * rhythm across wide, tablet and mobile viewports.
 */

/* Match the app's Chip component while retaining enough presence for the
 * marketing page. No hard outlines; colour variation stays inside the brand
 * palette/tints rather than introducing arbitrary colours. */
.food-rail {
  flex-wrap: wrap;
  overflow: visible;
  gap: 10px;
  padding-top: 34px;
}

.food-rail span,
.food-rail span:nth-child(3n + 2),
.food-rail span:nth-child(3n + 3) {
  flex: 0 0 auto;
  font-family: var(--body);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--brand-dark);
  box-shadow: none;
}

.food-rail span:nth-child(3n + 1) {
  background: var(--brand-soft);
}

.food-rail span:nth-child(3n + 2) {
  background: color-mix(in srgb, var(--green) 20%, var(--cream));
}

.food-rail span:nth-child(3n + 3) {
  background: color-mix(in srgb, var(--lime) 24%, var(--cream));
}

.rail-note {
  margin-top: 12px;
}

/* Components such as .button, .nav-cta and .early-access set their own display,
 * which beats the user-agent [hidden] rule. site.js hides waitlist entry points
 * with the hidden attribute when the API reports early access as disabled, so
 * the attribute has to win for that guard to work. */
[hidden] {
  display: none !important;
}

/* Client visibility switch. The waitlist implementation stays in place; this
 * single authored flag controls whether any public waitlist entry point exists
 * in the rendered page. */
body[data-public-waitlist="off"] #early-access,
body[data-public-waitlist="off"] a[href="#early-access"] {
  display: none !important;
}

/* Client hierarchy: "What to eat sorted" leads and is visibly a step larger;
 * "Every. Single. Day." follows it as the supporting line. The h1 stays the
 * h1 so the document outline and CMS headline binding are unchanged. */
.hero .eyebrow {
  margin-bottom: 10px;
  color: var(--brand);
  font-size: clamp(34px, 3.3vw, 48px);
  line-height: 1.02;
  letter-spacing: .02em;
}

.hero h1 {
  max-width: 620px;
  font-size: clamp(30px, 2.95vw, 42px);
  line-height: 1.05;
}

/* App showcase: deliberately follows the three-device composition supplied by
 * the client, but uses native NutriFlux screens/content and brand geometry. */
.app-showcase {
  position: relative;
  isolation: isolate;
  width: var(--page);
  margin: 12px auto 116px;
  padding: clamp(34px, 4vw, 52px);
  overflow: hidden;
  background: var(--brand-dark);
  color: var(--white);
  border-radius: 30px 30px 96px 30px;
}

.app-showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: .12;
  background-image:
    linear-gradient(rgba(255,255,255,.32) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.32) 1px, transparent 1px);
  background-size: 92px 92px;
}

.app-showcase::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 520px;
  height: 520px;
  right: 2%;
  top: -170px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--green) 42%, transparent);
  filter: blur(70px);
  opacity: .55;
}

.app-showcase-stage {
  position: relative;
  width: min(100%, 980px);
  min-height: 600px;
  margin: 0 auto;
}

.app-phone {
  position: absolute;
  aspect-ratio: 1179 / 2556;
  overflow: hidden;
  background: #090f09;
  border: 7px solid #090f09;
  border-radius: 40px;
  box-shadow: 0 28px 62px rgba(0, 0, 0, .34);
  transform-origin: 50% 100%;
}

.app-phone-home {
  z-index: 3;
  left: 36%;
  bottom: 8px;
  width: clamp(230px, 24vw, 280px);
  transform: translateX(-12%) rotate(-1deg);
}

.app-phone-cookbook {
  z-index: 2;
  left: 3%;
  bottom: 2px;
  width: clamp(210px, 22vw, 260px);
  transform: rotate(-7deg);
}

.app-phone-plan {
  z-index: 2;
  right: 2%;
  bottom: 4px;
  width: clamp(218px, 23vw, 270px);
  transform: rotate(7deg);
}

.app-preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.app-showcase-copy {
  position: relative;
  z-index: 5;
  width: min(100%, 880px);
  margin: 28px auto 8px;
  border-top: 1px solid rgba(255,255,255,.18);
  padding-top: 32px;
}

.app-showcase-label {
  margin: 0 0 18px;
  color: rgba(255,255,255,.65);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.app-showcase h2 {
  max-width: 760px;
  color: var(--white);
  font-size: clamp(44px, 5vw, 70px);
}

.app-showcase-copy > p:last-child {
  max-width: 720px;
  margin: 22px 0 0;
  color: rgba(255,255,255,.72);
  font-size: clamp(17px, 1.7vw, 21px);
}

/* Recovery story on one column: the photo sits between the headline and the
 * explanation, so the question is read first and the picture answers it. */
@media (max-width: 980px) {
  .recovery-story { gap: 0; }
  .recovery-copy { display: contents; }
  .recovery-copy .section-index { order: 1; }
  .recovery-copy h2 { order: 2; }
  .recovery-photo { order: 3; margin-top: 34px; }
  .recovery-copy > p:not(.section-index) { order: 4; }
  .recovery-copy ul { order: 5; }
}

/* Desktop composition.
 * The hero is the only full viewport stage. The green statement remains a
 * strong visual break, but deliberately stops short of becoming a second
 * full-screen slide. */
@media (min-width: 981px) {
  .hero {
    min-height: calc(100svh - 88px);
  }

  .statement {
    min-height: clamp(500px, 62svh, 650px);
    grid-template-columns: minmax(190px, .30fr) minmax(0, 1fr);
    gap: clamp(44px, 5.5vw, 82px);
    padding-top: clamp(72px, 6vw, 92px);
    padding-bottom: clamp(72px, 6vw, 92px);
    align-items: center;
  }

  .statement .section-index {
    padding-top: 8px;
    align-self: start;
  }

  .statement > div {
    width: min(100%, 900px);
  }

  .statement h2 {
    max-width: 900px;
    font-size: clamp(50px, 5.25vw, 76px);
  }

  .statement p:not(.section-index) {
    max-width: 690px;
    margin-top: 24px;
    font-size: 18px;
  }

  .food-intro {
    grid-template-columns: minmax(190px, .30fr) minmax(0, 1fr);
    column-gap: clamp(44px, 5.5vw, 82px);
  }

  .food-intro .section-index {
    padding-top: 8px;
  }

  .food-intro h2 {
    max-width: 860px;
    font-size: clamp(46px, 4.8vw, 70px);
  }

  .food-intro > p:last-child {
    max-width: 700px;
  }

  /* Align the familiar-food rail with the main food-copy column and let the
   * chips breathe across the same visual width as the headline instead of
   * bunching up at one edge. */
  .food-rail {
    width: min(860px, calc(100% - 272px));
    margin-left: min(272px, 22vw);
    justify-content: space-between;
    column-gap: 14px;
    row-gap: 12px;
  }

  .rail-note {
    width: min(860px, calc(100% - 272px));
    margin-left: min(272px, 22vw);
  }

  /* Remove the oversized dead band between the familiar-food rail and Recovery
   * Mode while preserving clear section separation. */
  .food-language {
    padding-top: 84px;
    padding-bottom: 54px;
  }

  .recovery-story {
    padding-top: 60px;
    padding-bottom: 94px;
  }

  /* Footer: brand/slogan and all legal links occupy one clean baseline on
   * desktop. The disclaimer gets its own full-width line below and can use the
   * available width instead of wrapping into a narrow column. */
  footer {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: clamp(32px, 4vw, 64px);
    row-gap: 16px;
    padding-top: 28px;
    padding-bottom: 36px;
  }

  .footer-brand {
    white-space: nowrap;
  }

  .footer-legal {
    justify-content: flex-end;
    align-items: center;
    gap: 10px clamp(14px, 1.5vw, 24px);
  }

  .legal-note {
    grid-column: 1 / -1;
    max-width: none;
    line-height: 1.55;
  }
}

@media (max-width: 980px) {
  .hero .eyebrow {
    font-size: clamp(32px, 5vw, 44px);
  }

  .hero h1 {
    font-size: clamp(28px, 4.3vw, 38px);
  }

  .statement h2 {
    max-width: 760px;
  }

  .app-showcase {
    margin-bottom: 92px;
  }

  .app-showcase-stage {
    min-height: 535px;
  }

  .app-phone-home { left: 35%; width: min(30vw, 250px); }
  .app-phone-cookbook { left: 1%; width: min(28vw, 230px); }
  .app-phone-plan { right: 0; width: min(29vw, 240px); }

  .food-language {
    padding-top: 88px;
    padding-bottom: 68px;
  }

  .recovery-story {
    padding-top: 68px;
  }
}

@media (max-width: 640px) {
  .hero .eyebrow {
    margin-bottom: 8px;
    font-size: clamp(26px, 7.6vw, 32px);
    letter-spacing: .01em;
  }

  .hero h1 {
    font-size: clamp(23px, 6.6vw, 28px);
    line-height: 1.05;
  }

  .app-showcase {
    width: calc(100vw - 20px);
    margin-top: 0;
    margin-bottom: 76px;
    padding: 24px 18px 30px;
    border-radius: 24px 24px 58px 24px;
  }

  .app-showcase::before {
    background-size: 58px 58px;
  }

  .app-showcase-stage {
    min-height: 0;
    aspect-ratio: 1 / 1.04;
    margin-inline: -8px;
  }

  .app-phone {
    border-width: 5px;
    border-radius: 28px;
  }

  .app-phone-home {
    left: 34%;
    width: 45%;
    transform: translateX(-12%) rotate(-1deg);
  }

  .app-phone-cookbook {
    left: -8%;
    width: 42%;
    transform: rotate(-7deg);
  }

  .app-phone-plan {
    right: -9%;
    width: 43%;
    transform: rotate(7deg);
  }

  .app-showcase-copy {
    margin-top: 18px;
    padding-top: 24px;
  }

  .app-showcase-label {
    margin-bottom: 12px;
    font-size: 10px;
  }

  .app-showcase h2 {
    font-size: clamp(38px, 11.2vw, 52px);
  }

  .app-showcase-copy > p:last-child {
    margin-top: 16px;
    font-size: 16px;
  }

  .food-rail {
    gap: 8px;
    padding-top: 28px;
  }

  .food-rail span,
  .food-rail span:nth-child(3n + 2),
  .food-rail span:nth-child(3n + 3) {
    font-size: 14px;
    padding: 9px 15px;
  }

  .food-language {
    padding-top: 72px;
    padding-bottom: 56px;
  }

  .recovery-story {
    padding-top: 58px;
  }

  footer {
    gap: 16px;
    padding-top: 28px;
    padding-bottom: 34px;
  }

  .footer-legal {
    gap: 8px 16px;
  }

  .legal-note {
    max-width: none;
    line-height: 1.6;
  }
}
