/*
 * The marketing page at `/`. Tokens, the base type and the masthead come from
 * `/styles.css`, which `tool/build_legal_site.dart` writes; this file adds only
 * what the home page needs.
 *
 * Direction A, "clinical notebook" (`docs/plan/09-ui-design-system.md` §9.1):
 * cool paper ground, ink blue, hairlines rather than shadows, tabular
 * numerals. The hero's rules and band are the app-icon mark drawn at page
 * scale, at the same proportions as `BrandMark`: hairlines at 20, 34, 76 and
 * 90 per cent, the band from 46 to 68. A fixed brand graphic, not data.
 */

:root {
  --band: #DCE8F2;
  --band-edge: #B9CFE2;
  --device: #1B2A3A;
  --device-ring: #1B2A3A;
  --on-primary: #FFFFFF;
  --button: #2C5F8A;
}

@media (prefers-color-scheme: dark) {
  :root {
    --band: #1E3648;
    --band-edge: #2F536E;
    --device: #0B0F13;
    --device-ring: #3A4653;
    --on-primary: #FFFFFF;
    --button: #2C5F8A;
  }
}

html { scroll-behavior: smooth; scroll-padding-top: 1rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.wide { width: 100%; max-width: 70rem; margin-inline: auto; padding-inline: 1.25rem; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
}
.skip:focus { top: 0.75rem; }

/* Masthead */
.masthead .wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 0.875rem;
}
.home-nav { display: none; gap: 1.5rem; margin-left: auto; font-size: 0.9375rem; }
.home-nav a { color: var(--ink-muted); text-decoration: none; padding-block: 0.25rem; }
.home-nav a:hover { color: var(--ink); }
@media (min-width: 58rem) { .home-nav { display: flex; } }

.button {
  display: inline-block;
  flex: none;
  padding: 0.5rem 1rem;
  background: var(--button);
  border-radius: var(--radius);
  color: var(--on-primary);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}
.button:hover { background: #24507A; }
@media (max-width: 30rem) { .masthead .brand-caption { display: none; } }

/* Type */
main.home { padding-block: 0; }

.eyebrow {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--primary);
}
.eyebrow .num { margin-right: 0.625rem; color: var(--ink-muted); }

.home h1 {
  margin: 0.875rem 0 1.25rem;
  font-size: clamp(2.25rem, 1.3rem + 4vw, 3.75rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.home h2 {
  margin: 0.625rem 0 1rem;
  font-size: clamp(1.75rem, 1.25rem + 2vw, 2.5rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
:where(.home) h3 { margin: 0 0 0.5rem; font-size: 1.0625rem; font-weight: 600; line-height: 1.35; }
:where(.home) p { margin: 0 0 1rem; }
:where(.section) p { color: var(--ink-muted); }
.lede { max-width: 36rem; font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem); line-height: 1.55; color: var(--ink-muted); }
.intro { max-width: 38rem; font-size: 1.125rem; line-height: 1.6; color: var(--ink-muted); }
.small { margin-top: 1.25rem; font-size: 0.875rem; line-height: 1.55; color: var(--ink-muted); }

/* Hero */
.hero-home { position: relative; overflow: hidden; border-bottom: 1px solid var(--hairline); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.hero-copy { padding-block: clamp(2.5rem, 7vw, 5.5rem) 1rem; }

.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 2rem; }
.badge { display: block; flex: none; border-radius: 9px; }
.badge img { display: block; width: auto; height: 3.25rem; }
.cta-note { margin: 0; font-size: 0.875rem; line-height: 1.5; color: var(--ink-muted); }
.cta-note strong { display: block; font-weight: 600; color: var(--ink); }

.hero-devices {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: clamp(24rem, 96vw, 31rem);
  padding-top: 2.5rem;
}
.hero-devices::before {
  content: "";
  position: absolute;
  inset: 0 -100vw;
  background: linear-gradient(
    to bottom,
    transparent calc(20% - 1px),
    var(--hairline) calc(20% - 1px) 20%,
    transparent 20% calc(34% - 1px),
    var(--hairline) calc(34% - 1px) 34%,
    transparent 34% 46%,
    var(--band-edge) 46% calc(46% + 1px),
    var(--band) calc(46% + 1px) calc(68% - 1px),
    var(--band-edge) calc(68% - 1px) 68%,
    transparent 68% calc(76% - 1px),
    var(--hairline) calc(76% - 1px) 76%,
    transparent 76% calc(90% - 1px),
    var(--hairline) calc(90% - 1px) 90%,
    transparent 90%
  );
}

.device {
  position: relative;
  flex: none;
  margin: 0;
  padding: 0.5rem;
  background: var(--device);
  border: 1px solid var(--device-ring);
  border-radius: 2.75rem;
}
.device img { display: block; width: 100%; height: auto; border-radius: 2.25rem; background: #F7F8F9; }
.device-front { z-index: 2; width: min(17rem, 52vw); }
.device-back { z-index: 1; width: min(15rem, 46vw); margin: 3rem 0 0 max(-3.5rem, -11vw); }

@media (min-width: 58rem) {
  .hero-grid { grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: 3rem; }
  .hero-copy { align-self: center; padding-block: 5.5rem; }
  .hero-devices { align-self: end; height: 39rem; padding-top: 4rem; }
  .hero-devices::before {
    inset: 0 -100vw 0 -2rem;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 7rem);
    mask-image: linear-gradient(to right, transparent, #000 7rem);
  }
  .device-front { width: 18rem; }
  .device-back { width: 16rem; margin: 3.5rem 0 0 -4rem; }
}

/* At a glance */
.glance { background: var(--surface); border-bottom: 1px solid var(--hairline); }
.glance ul { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; padding: 0; list-style: none; }
.glance li { padding: 1.5rem 0; border-top: 1px solid var(--hairline); }
.glance li:first-child { border-top: 0; }
.glance strong { display: block; margin-bottom: 0.25rem; font-weight: 600; }
.glance span { display: block; font-size: 0.9375rem; line-height: 1.55; color: var(--ink-muted); }
@media (min-width: 48rem) {
  .glance ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .glance li { padding: 1.75rem 2rem; border-top: 0; border-left: 1px solid var(--hairline); }
  .glance li:first-child { padding-left: 0; border-left: 0; }
  .glance li:last-child { padding-right: 0; }
}

/* Sections */
.section { padding-block: clamp(3.5rem, 8vw, 6rem); border-bottom: 1px solid var(--hairline); }
.section.on-surface { background: var(--surface); }

.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3rem; align-items: center; }
@media (min-width: 58rem) {
  .split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 5rem; }
  .split.flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .split.flip > .copy { order: 2; }
  .split.even { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4rem; }
}

/* A heading in the margin, and what it introduces beside it */
.rail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
@media (min-width: 58rem) {
  .rail { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 5rem; }
  .rail .faq { margin-top: 0.5rem; }
}

.ledger { margin: 2rem 0 0; border-top: 1px solid var(--ink); }
.ledger > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.125rem 1.5rem; padding: 0.9375rem 0; border-bottom: 1px solid var(--hairline); }
.ledger dt { font-weight: 600; }
.ledger dd { margin: 0; color: var(--ink-muted); }
@media (min-width: 36rem) { .ledger > div { grid-template-columns: 10rem minmax(0, 1fr); } }

.points { margin: 1.75rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.points li { padding: 0.9375rem 0; border-bottom: 1px solid var(--hairline); color: var(--ink-muted); }
.points strong { font-weight: 600; color: var(--ink); }

.more { margin-top: 1.5rem; font-weight: 600; }

/* A device standing on a rule, cut off below the fold of its own screen */
.stage { display: flex; justify-content: center; align-items: flex-end; gap: 1.25rem; margin: 0; padding-inline: 0.5rem; border-bottom: 1px solid var(--ink); }
.stage .device { width: min(17rem, 72vw); padding-bottom: 0; border-bottom: 0; border-radius: 2.75rem 2.75rem 0 0; }
.stage .device img { aspect-ratio: 400 / 600; object-fit: cover; object-position: top; border-radius: 2.25rem 2.25rem 0 0; }
.stage.pair .device { width: min(13.5rem, 43vw); border-radius: min(2.5rem, 8vw) min(2.5rem, 8vw) 0 0; padding: min(0.5rem, 1.6vw) min(0.5rem, 1.6vw) 0; }
.stage.pair .device img { border-radius: min(2rem, 6.4vw) min(2rem, 6.4vw) 0 0; }
.stage.pair .device:first-child img { aspect-ratio: 400 / 640; }
.stage.pair .device:last-child img { aspect-ratio: 400 / 560; }
.caption { margin: 0.875rem 0 0; font-size: 0.875rem; line-height: 1.5; color: var(--ink-muted); text-align: center; }

/* Reminders, drawn as the notifications they arrive as */
.notes { display: grid; gap: 0.75rem; max-width: 24rem; margin: 0 auto; padding: 0; list-style: none; }
.note { padding: 0.875rem 1rem 1rem; background: var(--surface); border: 1px solid var(--hairline); border-radius: 1rem; }
.on-surface .note { background: var(--ground); }
.note-app { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.375rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-muted); }
.note-app .mark { border-radius: 5px; }
.note strong { display: block; font-weight: 600; line-height: 1.35; }
.note span.body { display: block; line-height: 1.4; color: var(--ink-muted); }

/* Does, and does not */
.columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin-top: 2.5rem; }
@media (min-width: 48rem) { .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; } }
.card { padding: 1.75rem; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); }
.on-surface .card { background: var(--ground); }
.card h3 { padding-bottom: 0.875rem; border-bottom: 1px solid var(--ink); }
.marks { margin: 0; padding: 0; list-style: none; }
.marks li { position: relative; padding: 0.75rem 0 0.75rem 1.75rem; border-bottom: 1px solid var(--hairline); }
.marks li:last-child { padding-bottom: 0; border-bottom: 0; }
.marks li::before { position: absolute; left: 0; font-weight: 600; color: var(--primary); }
.marks.does li::before { content: "\2713"; }
.marks.does-not li::before { content: "\2715"; color: var(--ink-muted); }

/* Pricing */
.home .price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; margin: 0.75rem 0 1.25rem; }
.price b { font-size: 2.5rem; font-weight: 600; line-height: 1; letter-spacing: -0.02em; color: var(--ink); }
.price span { font-size: 0.875rem; color: var(--ink-muted); }
.card.plan h3 { padding: 0; border: 0; font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); }
.card.plan .marks { border-top: 1px solid var(--ink); }
.card.plan .later { margin: 0; padding-top: 0.875rem; border-top: 1px solid var(--hairline); }
.card.plan .marks li:last-child { padding-bottom: 0.75rem; }
.card.plan .marks:last-child li:last-child { padding-bottom: 0; }

/* Questions */
.faq { max-width: 46rem; margin-top: 1rem; border-top: 1px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary {
  position: relative;
  padding: 1.125rem 2.5rem 1.125rem 0;
  font-weight: 600;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.25rem; top: 0.875rem; font-size: 1.5rem; font-weight: 400; line-height: 1.2; color: var(--primary); }
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { color: var(--primary); }
.faq .answer { padding: 0 2.5rem 1.25rem 0; color: var(--ink-muted); }
.faq .answer > :last-child { margin-bottom: 0; }

/* Support, and the closing band */
.contact { display: inline-block; margin-top: 0.5rem; font-size: clamp(1.125rem, 1rem + 1vw, 1.5rem); font-weight: 600; overflow-wrap: anywhere; }

.closing { background: var(--band); border-block: 1px solid var(--band-edge); margin-top: -1px; }
.closing .wide { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; padding-block: clamp(2.5rem, 6vw, 4rem); }
.closing h2 { margin: 0 0 0.375rem; }
.closing p { margin: 0; color: var(--ink-muted); }

/* Footer */
.home-foot { padding-block: 2.5rem 3rem; font-size: 0.875rem; line-height: 1.6; color: var(--ink-muted); }
.home-foot a { color: var(--ink-muted); }
.home-foot a:hover { color: var(--ink); }
.foot-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--hairline); }
.foot-top .brand-name { color: var(--ink); }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0; padding: 0; list-style: none; }
.foot-notes { max-width: 52rem; padding-top: 1.5rem; }
.foot-notes p { margin: 0 0 0.5rem; }

/* Coming soon */
@media (min-width: 58rem) { .columns.three { grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); } }
.home .tag {
  display: inline-block;
  margin: 0 0 0.875rem;
  padding: 0.125rem 0.5rem;
  border: 1px dashed var(--ink-muted);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.marks.plain li { padding-left: 0; color: var(--ink-muted); }
.marks.plain strong { font-weight: 600; color: var(--ink); }
