/* Lentio home page: the LiftTracker site's layout, in Lentio's colors.
   privacy/ and support/ keep their own inline styles, since the app links to them:
   changing this file must never restyle those.

   Colors are the app's Automatic theme (TaperCore's Palette.teal), light and dark:
   background, surface, primary, secondary, ink, muted. */

:root {
  color-scheme: light dark;

  --page: #F3F6F5;          /* background */
  --card: #FFFFFF;          /* surface */
  --fg: #12201C;            /* ink */
  --muted: #56645F;
  --accent: #0F766E;        /* primary */
  --ph: #D6EBE7;            /* secondary: chart panel and glyph fills, as on Today's cards */
  --rule: rgba(18, 32, 28, 0.08);

  --bezel: #1C1F1E;         /* placeholder phones */
  --bezel-edge: rgba(0, 0, 0, 0);

  --glow-a: rgba(15, 118, 110, 0.18);
  --glow-b: rgba(45, 212, 191, 0.12);
  --glow-c: rgba(87, 159, 154, 0.16);
  --hero-base: linear-gradient(#fff 0%, #fff 30%, #f6faf9 62%, var(--page) 100%);

  --radius-card: 26px;
  --radius-media: 16px;
  --maxw: 1100px;
  --rounded: ui-rounded, -apple-system, BlinkMacSystemFont, "SF Pro Rounded", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #000000;
    --card: #161616;
    --fg: #FFFFFF;
    --muted: #A1A1A6;
    --accent: #2DD4BF;
    --ph: #0F2E2A;
    --rule: rgba(255, 255, 255, 0.1);

    --bezel: #1E2120;
    --bezel-edge: rgba(255, 255, 255, 0.14);

    --glow-a: rgba(45, 212, 191, 0.20);
    --glow-b: rgba(45, 212, 191, 0.10);
    --glow-c: rgba(24, 96, 87, 0.30);
    --hero-base: linear-gradient(#000 0%, #020d0b 34%, #010908 70%, var(--page) 100%);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--page);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--rounded); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 4.5rem 0 3.5rem;
  background:
    radial-gradient(52% 42% at 22% 74%, var(--glow-b) 0%, transparent 64%),
    radial-gradient(46% 40% at 50% 82%, var(--glow-a) 0%, transparent 64%),
    radial-gradient(52% 44% at 80% 72%, var(--glow-c) 0%, transparent 64%),
    var(--hero-base);
}
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 140px;
  background: linear-gradient(transparent, var(--page));
  pointer-events: none;
}

.app-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 1.6rem;
  border-radius: 17px;      /* the app icon's 228 of 1024 */
  border: 1px solid var(--rule);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: block;
}

.hero h1 {
  font-size: clamp(2.2rem, 5.4vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
  max-width: 20ch;
  margin: 0 auto;
}
/* Sits below the phone group, inside the 140px `.hero::after` fade, which paints over
   in-flow content. Apple's terms rule out altering the badge's appearance, so the badge
   lifts above the fade rather than the fade being softened. */
.hero .store { position: relative; z-index: 1; margin-top: 1.8rem; display: flex; flex-direction: column; align-items: center; }

/* App Store badge: Apple's artwork, referenced as a file so no rule can recolor it.
   Size only, no hover transform, since Apple's terms rule out altering or animating it. */
.badge-link { display: inline-block; }
/* Stands in for the badge's link until the app is approved; see index.html. */
.cta-note { margin-top: 0.7rem; color: var(--muted); font-size: 0.95rem; }
.appstore { height: 52px; width: auto; display: block; }

/* Phone group: three identical upright devices on one baseline, center in front.
   Offsets are from the fan's center line, so the group stays centered at any width. */
.fan {
  position: relative;
  margin: 2.5rem auto 0;
  max-width: 760px;
  height: 540px;
}
.fan .fan-shot {
  position: absolute;
  left: 50%;
  bottom: 30px;
  width: 236px;
  display: block;
  height: auto;
  filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.42));
}
.fan .left   { z-index: 1; transform: translateX(calc(-50% - 216px)); }
.fan .right  { z-index: 1; transform: translateX(calc(-50% + 216px)); }
.fan .center { z-index: 2; transform: translateX(-50%); }

@media (max-width: 700px) {
  .fan { height: 360px; }
  .fan .fan-shot { width: 140px; }
  .fan .left  { transform: translateX(calc(-50% - 118px)); }
  .fan .right { transform: translateX(calc(-50% + 118px)); }
}

/* ---------- Placeholder phones ----------
   Stand in for screenshots until they're taken. Each is the size of a screenshot with
   Apple's bezel (720 × 1491, or 600 × 1105 for one cut off by its tile's edge), so a
   real <img> drops into its place with the same class and nothing else changes.
   Everything inside is sized in container units, so it scales with the phone. */
.phone {
  container-type: inline-size;
  aspect-ratio: 720 / 1491;
  background: var(--bezel);
  border-radius: 14% / 6.76%;
  box-shadow: inset 0 0 0 1px var(--bezel-edge);
  padding: 3.4%;
}
.phone .screen {
  position: relative;
  height: 100%;
  background: var(--page);
  border-radius: 11.4% / 5.3%;
  display: grid;
  place-items: center;
  overflow: hidden;
}
/* The Dynamic Island */
.phone .screen::before {
  content: "";
  position: absolute;
  top: 3.6cqw;
  left: 50%;
  transform: translateX(-50%);
  width: 31cqw;
  height: 9cqw;
  border-radius: 999px;
  background: #000;
}
.phone .label {
  font-family: var(--rounded);
  font-size: 7.5cqw;
  font-weight: 600;
  color: var(--muted);
}
.phone.cut {
  aspect-ratio: 600 / 1105;
  border-radius: 14% 14% 0 0 / 7.6% 7.6% 0 0;
  padding-bottom: 0;
}
.phone.cut .screen { border-radius: 11.4% 11.4% 0 0 / 5.9% 5.9% 0 0; }

/* ---------- Section headers ---------- */

.section { padding-block: 2.5rem; }
.section-head { max-width: 38rem; margin-bottom: 1.9rem; }
.section-head h2 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ---------- Bento grid ---------- */

.bento {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.tile {
  --tile-pad: 2rem;
  --tile-pad-b: 1.25rem;
  position: relative;      /* anchor for a bleed shot, see .media-bleed */
  grid-column: 1 / -1;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  padding: var(--tile-pad) var(--tile-pad) var(--tile-pad-b);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tile h3 { font-size: clamp(1.35rem, 1.9vw, 1.6rem); font-weight: 650; letter-spacing: -0.01em; }
.tile p { margin-top: 0.55rem; color: var(--muted); font-size: clamp(1.05rem, 1.4vw, 1.22rem); line-height: 1.7; max-width: 40ch; }
/* The media box takes whatever height the row gains from a taller neighbor. */
.tile .media { margin-top: 1.6rem; flex: 1 0 auto; }

/* The screenshot tile is a fixed width, so the phone in it never shrinks; the chart
   tile takes the rest. */
@media (min-width: 860px) {
  .bento { grid-template-columns: 458px minmax(0, 1fr); }
  .span-5 { grid-column: 1; }
  .span-7 { grid-column: 2; }
}

/* A phone that runs off the bottom of its tile. It anchors to the tile, so `bottom: 0`
   lands on the card's edge even when a neighbor stretches the tile taller. This box's
   height only reserves the space. */
.media-bleed { min-height: 400px; }
.media-bleed .tile-shot {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 236px;
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.34));
}

/* The interval chart, drawn rather than a screenshot */
.chart {
  height: 100%;
  min-height: 400px;
  background: var(--ph);
  border-radius: var(--radius-media);
  padding: 1.5rem;
  display: grid;
  place-items: center;
}
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--rounded); font-weight: 650; font-variant-numeric: tabular-nums; }
@media (max-width: 859px) {
  .chart { min-height: 240px; }
}

/* ---------- "And much more" and Premium ---------- */

.more { padding-block: 3rem 2.5rem; text-align: center; }
.more h2 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2.25rem;
}
.more .sub {
  margin: -1.6rem auto 2.25rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.4vw, 1.22rem);
}
.more-grid {
  display: grid;
  gap: 1.6rem 3rem;
  text-align: left;
}
@media (min-width: 720px) {
  .more-grid { grid-template-columns: 1fr 1fr; }
}
.more-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.35rem;
}
.more-item .glyph {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--ph);
  border: 1px solid var(--rule);
  color: var(--accent);
  display: grid;
  place-items: center;
}
.more-item .glyph svg { width: 22px; height: 22px; display: block; }
.more-item .lettering {
  font-family: var(--rounded);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.02em;
  line-height: 1;
}
.more-item h3 { font-size: 1.22rem; font-weight: 650; }
.more-item p { margin-top: 0.35rem; color: var(--muted); font-size: 1.08rem; line-height: 1.65; }

/* ---------- Closing CTA ---------- */

.closer { text-align: center; padding: 2rem 0 3rem; display: flex; flex-direction: column; align-items: center; }

/* ---------- Footer ---------- */

footer {
  padding: 2.5rem 1.5rem 3rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}
footer .medical { max-width: 40rem; margin: 0 auto 1.6rem; line-height: 1.6; }
footer .medical p + p { margin-top: 0.5rem; }
footer .links { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin-bottom: 0.7rem; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--accent); text-decoration: underline; }
