/* FreezeLog site. Colors come from the app icon: its sky-to-deep-blue field and the strawberry red. */
:root {
  color-scheme: light dark;
  --sky: #6ccbfa;
  --deep: #1a4fa0;
  --berry: #c01a44;
  --bg: #f3f7fb;
  --surface: #ffffff;
  --fg: #10233a;
  --muted: #52667a;
  --faint: #c3cfdb;
  --line: #d9e3ec;
  --link: #1a4fa0;
  --night: #081426;
}
@media (prefers-color-scheme: dark) {
  :root {
    --berry: #fb587c;
    --bg: #0c1828;
    --surface: #13233a;
    --fg: #e8f0f7;
    --muted: #9fb2c4;
    --faint: #33475f;
    --line: #23364f;
    --link: #8fd3fb;
    --night: #050d19;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: .18em; }
a:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 4px; }

/* Header: the icon and name on the left, a short nav on the right. */
header, main, footer { max-width: 62rem; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 24px; padding-top: 18px; padding-bottom: 18px;
}
header .brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em;
  color: var(--fg); text-decoration: none;
}
header .brand::before {
  content: ""; width: 32px; height: 32px; border-radius: 8px;
  background: url(img/icon-64.png) center / cover;
  box-shadow: 0 0 0 .5px rgba(16, 35, 58, .2);
}
nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: .95rem; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--fg); }

/* Reading pages: one calm column. */
main { max-width: 42rem; padding-bottom: 2rem; }
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.15; }
h1 { font-size: clamp(2rem, 5vw, 2.6rem); margin: 2rem 0 .8rem; }
h2 { font-size: 1.45rem; margin: 2.6rem 0 .6rem; }
h3 { font-size: 1.1rem; margin: 1.6rem 0 .4rem; }
.lead { font-size: 1.2rem; color: var(--muted); }
li { margin: .35rem 0; }
.note {
  background: var(--surface); border-radius: 14px; padding: 14px 18px; margin: 1.6rem 0;
  font-size: .95rem; box-shadow: inset 0 0 0 1px var(--line);
}
.table-wrap { overflow-x: auto; margin: 1.2rem 0; background: var(--surface); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
table { border-collapse: collapse; width: 100%; min-width: 40rem; font-size: .95rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
td:last-child { min-width: 18rem; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (min-width: 1100px) { main .table-wrap { margin-left: -8rem; margin-right: -8rem; } }
.button {
  display: inline-block; background: var(--berry); color: #fff; font-weight: 600;
  text-decoration: none; padding: 12px 22px; border-radius: 999px;
}

/* Food pages and the food hub. */
.crumbs { margin: 1.6rem 0 -1rem; font-size: .92rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 1.6rem 0; }
.facts div { background: var(--surface); border-radius: 14px; padding: 12px 16px; box-shadow: inset 0 0 0 1px var(--line); }
.facts dt { font-size: .85rem; color: var(--muted); }
.facts dd { margin: 0; font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.note.caution { box-shadow: inset 4px 0 0 var(--berry), inset 0 0 0 1px var(--line); margin-top: .6rem; }
.sources { font-size: .95rem; }
.callout { margin: 2.6rem 0 0; padding: 18px 20px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: .95rem; color: var(--muted); }
.callout p { margin: 0 0 .5rem; }
.callout p:last-child { margin: 0; }
.callout strong { color: var(--fg); }
.food-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0 24px; }
.food-list li { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.food-list a { font-weight: 600; text-decoration: none; }
.food-list span { color: var(--muted); font-size: .88rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Comparison table: short cells, so no wide last column. */
table.compare td:last-child { min-width: 0; }
table.compare.narrow { min-width: 0; }
@media (max-width: 480px) { table.compare.narrow th, table.compare.narrow td { padding: 8px 9px; font-size: .9rem; } table.compare.narrow th { white-space: normal; } }
table.compare td:first-child { font-weight: 600; }
.faq h3 { margin-top: 1.4rem; }

footer {
  max-width: 62rem; margin-top: 3rem; padding-top: 22px; padding-bottom: 40px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem;
}
footer p { max-width: 44rem; }

/* ---------- Home page ---------- */

.home main { max-width: none; padding: 0; }
.wrap { max-width: 62rem; margin: 0 auto; padding: 0 20px; }

/* Hero: the icon's own blue field, with the real app on the right. */
.hero {
  background: linear-gradient(160deg, var(--sky) 0%, #3b8fdb 45%, var(--deep) 100%);
  color: #fff;
  overflow-x: clip;
}
.hero header .brand, .hero nav a { color: #fff; }
.hero nav a { opacity: .85; }
.hero nav a:hover { opacity: 1; color: #fff; }
.hero header .brand::before { box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); }
.hero-inner {
  max-width: 62rem; margin: 0 auto; padding: 56px 20px 0;
  display: grid; grid-template-columns: 1fr; gap: 40px; align-items: end;
}
.hero .app-icon {
  width: 104px; border-radius: 23px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 18px 40px rgba(8, 30, 70, .35);
}
.hero h1 { font-size: clamp(2.4rem, 7vw, 3.9rem); margin: 22px 0 14px; letter-spacing: -.035em; line-height: 1.02; max-width: 12ch; }
.hero p { font-size: 1.2rem; line-height: 1.45; max-width: 30rem; margin: 0 0 12px; color: rgba(255, 255, 255, .9); }
.hero .availability { font-size: .95rem; color: rgba(255, 255, 255, .78); margin-top: 22px; }
.hero-copy { padding-bottom: 8px; }

.phones { display: flex; justify-content: center; gap: 20px; margin-bottom: -90px; position: relative; z-index: 1; }
.phone {
  flex: none; width: min(250px, 62vw); border-radius: 40px; border: 9px solid #0d1b2c;
  background: #0d1b2c; box-shadow: 0 30px 60px rgba(6, 24, 56, .4);
}
.phone img { border-radius: 31px; }
.phones .second { display: none; margin-top: 46px; }

/* The statement: one sentence, large, that fills in as it scrolls past. */
.statement { padding: 170px 0 110px; }
.statement p {
  margin: 0; max-width: 21ch;
  font-size: clamp(1.9rem, 5.2vw, 3.4rem); line-height: 1.12; font-weight: 700; letter-spacing: -.03em;
}

/* Chapters: one idea each, big type beside the screen that proves it. */
.chapter { padding: 90px 0; }
.chapter .wrap { display: grid; grid-template-columns: 1fr; gap: 48px; align-items: center; }
.chapter h2 { font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.02; letter-spacing: -.035em; margin: 0 0 18px; max-width: 13ch; }
.chapter p { font-size: 1.2rem; line-height: 1.5; color: var(--muted); margin: 0 0 14px; max-width: 28rem; }
.chapter .phone { width: min(280px, 70vw); margin: 0 auto; box-shadow: 0 40px 80px rgba(10, 30, 60, .22); }
.chapter .kicker { color: var(--berry); font-weight: 600; font-size: 1.05rem; margin-bottom: 10px; }
.stage { perspective: 1200px; }

/* The weights chapter has no screenshot. The numbers are the picture. */
.scale-figure { display: grid; gap: 4px; justify-items: start; }
.scale-figure .weight { font-size: clamp(3rem, 10vw, 5.6rem); font-weight: 700; letter-spacing: -.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.scale-figure .weight small { font-size: .4em; letter-spacing: -.01em; color: var(--muted); font-weight: 600; margin-left: .15em; }
.scale-figure .label { color: var(--muted); font-size: 1rem; margin-bottom: 16px; }
.scale-figure .loss { color: var(--berry); }
.scale-figure .bar { width: 100%; max-width: 26rem; height: 14px; border-radius: 99px; background: var(--faint); overflow: hidden; margin: 6px 0 18px; }
.scale-figure .bar span { display: block; height: 100%; width: 79%; border-radius: 99px; background: linear-gradient(90deg, var(--sky), var(--deep)); transform-origin: left; }

/* Offline: a night band, because that's when the alarm matters. */
.night { background: var(--night); color: #e8f0f7; padding: 130px 0; margin: 60px 0; }
.night h2 { font-size: clamp(2.2rem, 6vw, 3.8rem); line-height: 1.04; letter-spacing: -.035em; margin: 0 0 22px; max-width: 16ch; }
.night p { font-size: 1.2rem; color: #9fb2c4; max-width: 34rem; margin: 0; }
.night a { color: var(--sky); }

/* Pricing: two plans side by side. Pro is the raised, blue one, in the icon's colors. */
.pricing { padding: 90px 0 40px; }
.pricing h2 { font-size: clamp(2.4rem, 7vw, 4rem); letter-spacing: -.04em; line-height: 1; margin: 0 0 14px; text-align: center; }
.pricing .sub { font-size: 1.2rem; color: var(--muted); margin: 0 auto 52px; max-width: 30rem; text-align: center; }
.plans { display: grid; grid-template-columns: 1fr; gap: 20px; max-width: 52rem; margin: 0 auto; align-items: stretch; }
.plan { background: var(--surface); border-radius: 28px; padding: 32px 30px 30px; box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; }
.plan h3 { font-size: 1.15rem; margin: 0 0 6px; letter-spacing: -.01em; }
.plan .amount { margin: 0; display: flex; align-items: baseline; gap: 12px; }
.plan .figure { font-size: 3.6rem; font-weight: 700; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.plan s { font-size: 1.3rem; color: rgba(255, 255, 255, .6); font-weight: 600; }
.plan .terms { margin: 10px 0 24px; color: var(--muted); }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.plan li { margin: 0; display: flex; gap: 10px; align-items: flex-start; line-height: 1.4; }
.plan li svg { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--link); }
.plan.pro {
  position: relative; color: #fff;
  background: linear-gradient(165deg, #4aa6ec 0%, var(--deep) 62%, #12397a 100%);
  box-shadow: 0 30px 70px rgba(26, 79, 160, .35), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.plan.pro .terms { color: rgba(255, 255, 255, .8); }
.plan.pro li svg { color: #fff; }
.plan.pro .badge {
  position: absolute; top: -14px; left: 30px; margin: 0;
  background: var(--berry); color: #fff; font-size: .82rem; font-weight: 700;
  padding: 6px 12px; border-radius: 99px; box-shadow: 0 6px 16px rgba(192, 26, 68, .35);
}
.plan .cta {
  margin: 28px 0 0; text-align: center; padding: 14px 18px; border-radius: 99px;
  background: #fff; color: var(--deep); font-weight: 700;
}
.assurances { list-style: none; padding: 0; margin: 56px auto 0; max-width: 52rem; display: grid; grid-template-columns: 1fr; gap: 18px; }
.assurances li { margin: 0; color: var(--muted); font-size: .98rem; }
.assurances strong { display: block; color: var(--fg); }

.more { padding: 70px 0 20px; }
.more h2 { font-size: 1.6rem; margin: 0 0 18px; }
.reading { margin: 0; padding: 0; list-style: none; }
.reading li { margin: 0; border-top: 1px solid var(--line); }
.reading li:last-child { border-bottom: 1px solid var(--line); }
.reading a { display: block; padding: 20px 0; text-decoration: none; font-weight: 600; font-size: 1.25rem; letter-spacing: -.015em; color: var(--fg); }
.reading a:hover { color: var(--link); }

@media (min-width: 760px) {
  .hero-inner { grid-template-columns: 1.05fr 1fr; padding-top: 72px; }
  .hero-copy { padding-bottom: 150px; }
  .phones { justify-content: flex-start; }
  .phones .phone { width: 230px; }
  .phones .second { display: block; }
  .chapter .wrap { grid-template-columns: 1fr 1fr; gap: 64px; }
  .chapter.flip .copy { order: 2; }
  .plans { grid-template-columns: 1fr 1fr; gap: 28px; }
  .plan.pro { transform: translateY(-14px); }
  .assurances { grid-template-columns: repeat(3, 1fr); gap: 32px; }
}

/* ---------- Motion ---------- */
/* Scroll-linked, in CSS only, so the page stays script-free. Browsers without scroll timelines show everything still. */
@media (prefers-reduced-motion: no-preference) {
  .phones .phone { animation: rise .9s cubic-bezier(.2, .8, .2, 1) both; }
  .phones .second { animation-delay: .14s; }
  @keyframes rise { from { opacity: 0; translate: 0 50px; } }

  @supports (animation-timeline: view()) {
    /* The hero phones drift up a little faster than the page as it scrolls away. */
    .phones { animation: drift linear both; animation-timeline: scroll(root); animation-range: 0 70vh; }
    @keyframes drift { to { translate: 0 -70px; } }

    /* The statement fills from faint to full ink, line by line, as it crosses the screen. */
    .statement p span {
      background: linear-gradient(90deg, var(--fg) 50%, var(--faint) 50%) 100% 0 / 200% 100% no-repeat;
      -webkit-background-clip: text; background-clip: text; color: transparent;
      -webkit-box-decoration-break: clone; box-decoration-break: clone;
      animation: ink linear both; animation-timeline: view(); animation-range: cover 10% cover 50%;
    }
    @keyframes ink { to { background-position: 0 0; } }

    /* Each chapter's screen rises and settles from a slight tilt. */
    .chapter .phone { animation: settle linear both; animation-timeline: view(); animation-range: entry 0% cover 45%; }
    @keyframes settle { from { opacity: 0; transform: translateY(120px) scale(.88) rotateX(16deg); } }
    .chapter .copy { animation: lift linear both; animation-timeline: view(); animation-range: entry 10% cover 35%; }
    @keyframes lift { from { opacity: 0; transform: translateY(40px); } }

    /* The water-loss bar fills as the numbers come into view. */
    .scale-figure .bar span { animation: fill linear both; animation-timeline: view(); animation-range: entry 40% cover 50%; }
    @keyframes fill { from { transform: scaleX(0); } }

    /* The night band's headline comes up out of the dark. */
    .night .wrap > * { animation: lift linear both; animation-timeline: view(); animation-range: entry 0% cover 35%; }
  }
}
