/* Home page only.
 *
 * hallmark.css stays the shared layer -- eight other pages depend on its
 * components, and this file must not reach them. Everything here is scoped
 * under .home so a rule that escapes cannot restyle the privacy policy.
 *
 * The page is built around the seven-day dose cycle, because that is what the
 * product actually is: one injection, then a week of the drug rising, peaking
 * and settling. The old page said "track your week" in a headline and then
 * showed a stack of sections that could have belonged to any app. The curve
 * below is not decoration -- it is plotted from the same Bateman function the
 * app draws on the Today screen.
 */

.home {
  --rail: clamp(1.25rem, 5vw, 4rem);
  --measure: 62ch;
}

/* 9rem top and bottom on adjacent sections compounds to a 336px gap between
   the day strip and the next headline -- a hole, not breathing room. */
.home section {
  padding-block: clamp(3.5rem, 7vw, 6rem);
}

.home .inner {
  width: min(100% - var(--rail) * 2, 78rem);
  margin-inline: auto;
}

.home .eyebrow {
  margin: 0 0 1rem;
  color: var(--color-accent);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.home h2 {
  /* 18ch measured 619px inside a 1248px column, so a 31-character heading was
     split in half with the other half of the row left empty. The cap exists to
     stop a display line running the full width, not to force a break; at this
     size 36ch is still a comfortable single line and text-wrap: balance handles
     the ones that genuinely need two. */
  max-width: 36ch;
  margin: 0 0 var(--space-lg);
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.98;
  text-wrap: balance;
}

/* No standalone prose block on this page. Text either fills its grid column or
   is not in one -- a paragraph that stops at 62ch inside a 1248px section reads
   as a broken line, however correct the measure is in isolation. */
.home p {
  max-width: none;
}

/* Same two-column rhythm as the feature list, so a section's intro fills its
   column instead of trailing off mid-row. */
.lead-row {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 38rem);
  align-items: start;
  gap: var(--space-md) var(--space-2xl);
  max-width: 63rem;
}

.lead-row h2 {
  margin-bottom: 0;
}

/* --- hero ---------------------------------------------------------------- */

/* Specificity has to match ".home section" above, which would otherwise win and
   give the hero the same 9rem top padding as every other section -- pushing the
   headline half a screen down under a fixed header. */
.home section.home-hero {
  position: relative;
  padding-block: clamp(5.5rem, 11vw, 8rem) 0;
  overflow: hidden;
}

.home-hero .mark {
  display: block;
  width: clamp(3.25rem, 6vw, 4.5rem);
  height: auto;
  margin-block-end: var(--space-lg);
  border-radius: 22%;
}

.home-hero .inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
}

.home-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  /* One line per clause on a wide screen, three on a phone. The size is bound
     to the viewport rather than a breakpoint so it never lands mid-word. */
  font-size: clamp(2.6rem, 7.4vw, 5.6rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.94;
  text-wrap: balance;
}

.home-hero .lede {
  /* No cap: the hero's own text column is the measure. A second, narrower cap
     here left the sentence breaking with 90px of empty column beside it. */
  margin: var(--space-lg) 0 0;
  color: var(--color-ink-2);
  font-size: var(--text-lg);
  line-height: 1.5;
}

.home-hero .store-action {
  margin-block-start: var(--space-xl);
}

.hero-device {
  position: relative;
  margin: 0;
  justify-self: end;
  max-width: 22rem;
}

.hero-device img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: 0 2rem 4rem -1.5rem var(--color-shadow);
}

/* --- the cycle ----------------------------------------------------------- */

/* The curve belongs to the hero visually even though it opens the next section,
   so the gap between them is deliberately small. */
.home section.cycle-section {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 2.5vw, 2rem);
}

.cycle {
  margin-block-start: clamp(2rem, 5vw, 3.5rem);
}

/* preserveAspectRatio="none" means the viewBox's 1200x220 would collapse to a
   63px-tall smear on a phone. Height is set explicitly so the curve keeps a
   readable shape at every width; the horizontal mapping stays exact, which is
   what keeps each day tick over its column. */
.cycle-curve {
  display: block;
  width: 100%;
  height: clamp(7rem, 17vw, 13.75rem);
  overflow: visible;
}

.cycle-curve .fill {
  fill: color-mix(in oklch, var(--color-coral) 16%, transparent);
}

.cycle-curve .line {
  fill: none;
  stroke: var(--color-coral);
  stroke-width: 4;
  stroke-linecap: round;
}

.cycle-curve .dose {
  fill: var(--color-accent);
}

.cycle-curve .grid {
  stroke: var(--color-rule);
  stroke-width: 1;
  stroke-dasharray: 2 6;
}

/* Seven cells, one per day of the cycle. The grid is the structure, not a
   decoration: each column lines up with a tick on the curve above it. */
.cycle-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  border-block-start: var(--rule-hair) solid var(--color-rule);
}

.cycle-days li {
  padding: var(--space-sm) 0 var(--space-md);
  border-inline-start: var(--rule-hair) solid var(--color-rule);
  padding-inline-start: 0.7rem;
}

.cycle-days li:first-child {
  border-inline-start: 0;
  padding-inline-start: 0;
}

.cycle-days b {
  display: block;
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cycle-days span {
  display: block;
  margin-block-start: 0.35rem;
  color: var(--color-ink-2);
  font-size: var(--text-sm);
  line-height: 1.35;
  text-wrap: balance;
}

.cycle-days li.is-dose b { color: var(--color-accent); }
.cycle-days li.is-peak b { color: var(--color-coral); }

/* --- medication rail ----------------------------------------------------- */

.meds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.meds li {
  padding: 0.4rem 0.85rem;
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* --- screens rail -------------------------------------------------------- */

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(70vw, 17rem);
  gap: var(--space-lg);
  margin-block-start: var(--space-xl);
  padding-block-end: var(--space-md);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.rail figure {
  margin: 0;
  scroll-snap-align: start;
}

.rail img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1.5rem;
  background: var(--color-surface);
  box-shadow: 0 1.25rem 2.5rem -1.25rem var(--color-shadow);
}

.rail figcaption {
  margin-block-start: var(--space-sm);
  color: var(--color-ink-2);
  font-size: var(--text-sm);
  font-weight: 600;
  text-wrap: balance;
}

/* The watch is a different shape and would otherwise be stretched to a phone's
   aspect ratio by the shared rule above. */
.rail figure.is-watch img {
  width: auto;
  max-width: 100%;
  margin-inline: auto;
  border-radius: 2rem;
}

/* --- features ------------------------------------------------------------ */

/* 18rem label + 42rem text + gutter. Bounding the list rather than the row
   means the section simply is this wide; the alternative left every row with a
   quarter of empty space on the right, which reads as text stopping early. */
.feature-list,
.faq {
  max-width: 63rem;
}

.feature-list {
  display: grid;
  gap: 0;
  margin-block-start: var(--space-xl);
}

/* The text column is bounded here, not by a second max-width on the paragraph
   inside it. With both, the column ran ~900px while the paragraph stopped at
   62ch/658px, leaving a visibly empty quarter to the right of every row -- text
   breaking with room to spare, which is the thing this layout keeps getting
   wrong. One measure, set by the grid. */
.feature-list > div {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 42rem);
  align-items: start;
  gap: var(--space-md) var(--space-2xl);
  padding-block: var(--space-lg);
  border-block-start: var(--rule-hair) solid var(--color-rule);
}

.feature-list > div:last-child {
  border-block-end: var(--rule-hair) solid var(--color-rule);
}

.feature-list h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.feature-list p,
.faq p {
  max-width: none;
  margin: 0;
  color: var(--color-ink-2);
}

/* --- dark band ----------------------------------------------------------- */

.band {
  background: var(--color-footer);
  color: var(--color-footer-ink);
}

.band h2 { color: var(--color-footer-ink); }
.band .eyebrow { color: var(--color-coral); }

.band p {
  color: color-mix(in oklch, var(--color-footer-ink) 80%, transparent);
}

.pledges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--space-xl);
  margin-block-start: var(--space-2xl);
}

.pledges h3 {
  margin: 0 0 var(--space-xs);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.pledges p {
  max-width: none;
  margin: 0;
}

.band a {
  color: var(--color-footer-ink);
  text-decoration-color: color-mix(in oklch, var(--color-footer-ink) 45%, transparent);
}

/* --- faq ----------------------------------------------------------------- */

.faq {
  display: grid;
  gap: 0;
  margin-block-start: var(--space-xl);
}

/* Question and answer side by side, the same grid the feature list uses. The
   answer then has a readable measure without capping the question to an
   arbitrary character count, which was breaking short questions in two. */
.faq > div {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, 42rem);
  align-items: start;
  gap: var(--space-xs) var(--space-2xl);
  padding-block: var(--space-lg);
  border-block-start: var(--rule-hair) solid var(--color-rule);
}

.faq > div:last-child {
  border-block-end: var(--rule-hair) solid var(--color-rule);
}

.faq h3 {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 700;
  text-wrap: balance;
}



/* --- closing ------------------------------------------------------------- */

.closing .inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-xl);
  align-items: start;
}

/* --- narrow -------------------------------------------------------------- */

@media (max-width: 60rem) {
  .home-hero .inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-device {
    justify-self: start;
    max-width: 15rem;
  }

  .feature-list > div,
  .faq > div {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-xs);
  }

  .lead-row {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Seven columns on a phone gives each day about forty pixels, which fits the
     day number and nothing else. Below this width the cycle becomes a list. */
  .cycle-days {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cycle-days li:nth-child(odd) {
    border-inline-start: 0;
    padding-inline-start: 0;
  }
}

/* Below this width the header stops floating (see hallmark.css), so the hero no
   longer needs to reserve room underneath it. */
@media (max-width: 48rem) {
  .home section.home-hero {
    padding-block-start: var(--space-xl);
  }
}

@media (max-width: 30rem) {
  .cycle-days {
    grid-template-columns: minmax(0, 1fr);
  }

  .cycle-days li {
    border-inline-start: 0;
    padding-inline-start: 0;
    padding-block: var(--space-xs);
  }
}
