/*
 * Daytrove website. Colours, radii and spacing follow the app's design tokens
 * (packages/ui/lib/src/theme). Dark first; prefers-color-scheme: light switches to the app's light
 * palette. The app's fonts (Inter, Manrope) are used when installed; nothing is downloaded.
 */

:root {
  color-scheme: dark light;

  /* AppTheme.dark and HealthColors.dark */
  --bg: #000000;
  --surface: #111318;
  --surface-muted: #1a1e25;
  --hairline: #1f242b;
  --outline: #3a414d;
  --text: #f5f7fa;
  --muted: #8b93a1;
  --primary: #2dd4bf;
  --on-primary: #00302b;
  --steps: #3b82f6;
  --heart: #ef4444;
  --sleep: #8b5cf6;
  --energy: #f97316;
  --weight: #14b8a6;
  --water: #0ea5e9;
  --nutrition: #22c55e;
  --habits: #eab308;
  --medication: #ec4899;
  --warning: #eab308;
  --mark-track: rgb(255 255 255 / 0.12);
  --mark-pulse: #ffffff;
  --glow: rgb(45 212 191 / 0.13);
  --phone-shadow: rgb(0 0 0 / 0.7);
  --banner-bg: #1f1a0a;
  --banner-text: #fde68a;
  --banner-line: rgb(234 179 8 / 0.35);
  --placeholder-bg: rgb(234 179 8 / 0.18);

  /* Radii: chip 12, card 16, sheet 24, hero 28 */
  --radius-chip: 12px;
  --radius-card: 16px;
  --radius-sheet: 24px;
  --radius-hero: 28px;
  --radius-pill: 999px;

  /* Spacing: the app's 4 to 32 scale, plus larger steps for page rhythm */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 32px;
  --space-4xl: 48px;
  --space-5xl: 72px;
  --space-6xl: 96px;

  --gutter: 20px;
  --max-width: 1180px;
  --ease: cubic-bezier(0.215, 0.61, 0.355, 1);
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: Manrope, Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    /* AppTheme.light and HealthColors.light */
    --bg: #f7f9f8;
    --surface: #ffffff;
    --surface-muted: #eef2f0;
    --hairline: #e6eae8;
    --outline: #c5ccc8;
    --text: #0f1318;
    --muted: #5b6470;
    --primary: #0f766e;
    --on-primary: #ffffff;
    --steps: #2563eb;
    --heart: #dc2626;
    --sleep: #7c3aed;
    --energy: #ea580c;
    --weight: #0d9488;
    --water: #0284c7;
    --nutrition: #16a34a;
    --habits: #a16207;
    --medication: #db2777;
    --warning: #a16207;
    --mark-track: rgb(15 19 24 / 0.08);
    --mark-pulse: #0f1318;
    --glow: rgb(15 118 110 / 0.1);
    --phone-shadow: rgb(15 19 24 / 0.22);
    --banner-bg: #fef3c7;
    --banner-text: #78350f;
    --banner-line: rgb(161 98 7 / 0.35);
    --placeholder-bg: rgb(234 179 8 / 0.28);
  }
}

@media (min-width: 768px) {
  :root {
    --gutter: 32px;
  }
}

/* Base ---------------------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 1.55rem + 3.2vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.75rem, 1.35rem + 1.8vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

h3 {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

img,
svg {
  display: block;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

strong {
  font-weight: 600;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 6px;
}

main:focus {
  outline: none;
}

.container {
  width: min(100% - 2 * var(--gutter), var(--max-width));
  margin-inline: auto;
}

.icon {
  width: 24px;
  height: 24px;
  flex: none;
}

mark.placeholder {
  background: var(--placeholder-bg);
  /* Explicit, not inherit: muted text on the highlight falls below 4.5:1. */
  color: var(--text);
  border-radius: 4px;
  padding: 0 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.skip-link {
  position: absolute;
  left: var(--space-lg);
  top: -100px;
  z-index: 10;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-chip);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-md);
}

/* Draft banner, header, footer ---------------------------------------------------------------- */

.draft-banner {
  background: var(--banner-bg);
  color: var(--banner-text);
  border-bottom: 1px solid var(--banner-line);
  font-size: 0.875rem;
  line-height: 1.45;
}

.draft-banner p {
  padding-block: var(--space-sm);
}

.site-header {
  border-bottom: 1px solid var(--hairline);
  background: var(--bg);
}

.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-lg);
  padding-block: var(--space-md);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
}

.brand-mark-track {
  stroke: var(--mark-track);
}

.brand-mark-pulse {
  stroke: var(--mark-pulse);
}

.site-nav {
  width: 100%;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-inline: -10px;
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  background: var(--surface-muted);
}

@media (min-width: 768px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: color-mix(in srgb, var(--bg) 84%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
  }

  .site-nav {
    width: auto;
  }

  .site-nav ul {
    margin-inline: 0;
    gap: var(--space-xs);
  }

  .site-nav a {
    padding: 0 14px;
  }
}

.site-footer {
  padding-block: var(--space-4xl) var(--space-3xl);
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 0.9375rem;
}

.footer-grid {
  display: grid;
  gap: var(--space-3xl);
  margin-bottom: var(--space-3xl);
}

.footer-brand p {
  margin-top: var(--space-sm);
  max-width: 32ch;
}

.footer-links {
  display: grid;
  gap: var(--space-xs);
  list-style: none;
}

.footer-links a,
.site-footer a {
  color: var(--text);
  text-decoration: none;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}

.footer-links a:hover,
.site-footer a:hover {
  color: var(--primary);
}

.footer-label {
  margin-bottom: var(--space-sm);
  color: var(--text);
  font-weight: 600;
}

.footer-contact p + p {
  margin-top: var(--space-sm);
}

.footer-disclaimer,
.footer-legal {
  padding-top: var(--space-lg);
  border-top: 1px solid var(--hairline);
  font-size: 0.8125rem;
  line-height: 1.55;
}

.footer-legal {
  border-top: 0;
  padding-top: var(--space-sm);
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.3fr 1fr 1fr;
  }
}

/* Shared pieces ------------------------------------------------------------------------------- */

.eyebrow {
  margin-bottom: var(--space-md);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.byline {
  margin-bottom: var(--space-md);
  color: var(--primary);
  font-size: 0.9375rem;
  font-weight: 600;
}

.lead {
  margin-top: var(--space-xl);
  max-width: 60ch;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-3xl);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 48px;
  padding: var(--space-md) var(--space-2xl);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.button-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.button-primary:hover {
  background: color-mix(in srgb, var(--primary) 88%, var(--text));
}

.button-secondary {
  border-color: var(--outline);
  color: var(--text);
}

.button-secondary:hover {
  background: var(--surface-muted);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  text-decoration: none;
}

.text-link .icon {
  width: 18px;
  height: 18px;
}

.text-link:hover {
  text-decoration: underline;
}

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
}

.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: var(--radius-chip);
  color: var(--tone, var(--primary));
  background: color-mix(in srgb, var(--tone, var(--primary)) 12%, transparent);
}

.tone-primary { --tone: var(--primary); }
.tone-steps { --tone: var(--steps); }
.tone-heart { --tone: var(--heart); }
.tone-sleep { --tone: var(--sleep); }
.tone-energy { --tone: var(--energy); }
.tone-weight { --tone: var(--weight); }
.tone-water { --tone: var(--water); }
.tone-nutrition { --tone: var(--nutrition); }
.tone-habits { --tone: var(--habits); }
.tone-medication { --tone: var(--medication); }
.tone-warning { --tone: var(--warning); }

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

a.status-live {
  border-color: transparent;
  background: var(--primary);
  color: var(--on-primary);
  text-decoration: none;
}

/* Phone frames around the screenshots (720 x 1616). */
.phone {
  width: min(100%, 300px);
  margin-inline: auto;
  padding: 7px;
  border-radius: 42px;
  background: linear-gradient(160deg, #262b33, #0a0b0e 45%, #16191f);
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.06) inset,
    0 40px 80px -32px var(--phone-shadow);
}

.phone img {
  width: 100%;
  height: auto;
  border-radius: 35px;
  background: #000;
}

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

.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-4xl) var(--space-5xl);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: min(900px, 120vw);
  aspect-ratio: 1;
  background: radial-gradient(closest-side, var(--glow), transparent);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  gap: var(--space-4xl);
  align-items: center;
}

.promise-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-2xl);
  list-style: none;
}

.promise-list li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 0.875rem;
  font-weight: 500;
}

.promise-list .icon {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

/* Washington's My Health My Data Act wants this link on the home page, separate from the privacy
   policy's. */
.hero-legal {
  margin-top: var(--space-lg);
  font-size: 0.9375rem;
}

.availability {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  color: var(--muted);
  font-size: 0.9375rem;
}

.availability .icon {
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.phone-hero {
  width: min(100%, 290px);
}

@media (min-width: 960px) {
  .hero {
    padding-block: var(--space-5xl) var(--space-6xl);
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }

  /* 330 px wide, narrower in short windows so the whole phone stays above the fold. Its top is
     141 px down the page, and a phone W px wide is (W - 14) * 1616 / 720 + 14 px tall (a 720 x 1616
     screenshot in a 7 px frame). In a window 830 px tall it is 312 px wide and ends 5 px above the
     fold. */
  .phone-hero {
    width: 330px;
    width: min(330px, calc((100svh - 160px) * 720 / 1616 + 14px));
  }
}

.section {
  padding-block: var(--space-5xl);
}

.section-tinted {
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--surface) 55%, transparent) 20%, color-mix(in srgb, var(--surface) 55%, transparent) 80%, transparent);
}

@media (min-width: 960px) {
  .section {
    padding-block: var(--space-6xl);
  }
}

.section-head {
  max-width: 720px;
  margin-bottom: var(--space-3xl);
}

.section-lead {
  margin-top: var(--space-lg);
  color: var(--muted);
  font-size: 1.0625rem;
}

.feature-grid,
.card-grid {
  display: grid;
  gap: var(--space-md);
  list-style: none;
}

.feature {
  padding: var(--space-2xl);
}

.feature h3 {
  margin-top: var(--space-lg);
}

.feature p {
  margin-top: var(--space-sm);
  color: var(--muted);
}

.feature p + p {
  margin-top: var(--space-md);
}

@media (min-width: 640px) {
  .feature-grid,
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-lg);
  }
}

@media (min-width: 1024px) {
  .feature-grid,
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.screens {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(72%, 260px);
  gap: var(--space-xl);
  margin-top: var(--space-4xl);
  padding: var(--space-sm) var(--space-xs) var(--space-3xl);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.screens .phone {
  width: 100%;
  scroll-snap-align: center;
}

@media (min-width: 900px) {
  .screens {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 290px));
    justify-content: center;
    gap: var(--space-3xl);
    overflow: visible;
  }
}

.split {
  display: grid;
  gap: var(--space-4xl);
  align-items: center;
}

.split .phone {
  width: min(100%, 280px);
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-5xl);
  }

  .split-reverse .split-media {
    order: -1;
  }

  .split .phone {
    width: 310px;
  }
}

.check-list {
  display: grid;
  gap: var(--space-lg);
  margin-top: var(--space-3xl);
  list-style: none;
}

.check-list li {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.check-list .icon {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  color: var(--primary);
}

.feature-list {
  display: grid;
  gap: var(--space-xl);
  margin-top: var(--space-3xl);
  list-style: none;
}

.feature-list li {
  display: flex;
  gap: var(--space-lg);
  align-items: flex-start;
}

.feature-list p {
  margin-top: 2px;
  color: var(--muted);
}

.panel {
  padding: var(--space-3xl) var(--space-2xl);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-hero);
  background:
    radial-gradient(120% 90% at 100% 0%, var(--glow), transparent 60%),
    var(--surface);
}

.panel-grid {
  display: grid;
  gap: var(--space-3xl);
  list-style: none;
}

.panel-grid h3 {
  margin-top: var(--space-lg);
}

.panel-grid p {
  margin-top: var(--space-sm);
  color: var(--muted);
}

.panel-foot {
  margin-top: var(--space-3xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--hairline);
}

@media (min-width: 768px) {
  .panel {
    padding: var(--space-4xl);
  }

  .panel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3xl) var(--space-4xl);
  }
}

@media (min-width: 1100px) {
  .panel-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.platform-list {
  display: grid;
  gap: var(--space-md);
  list-style: none;
}

.platform {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-md) var(--space-lg);
  align-items: start;
  padding: var(--space-xl);
}

.platform p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.platform .status {
  grid-column: 2;
  justify-self: start;
}

@media (min-width: 640px) {
  .platform {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .platform .status {
    grid-column: auto;
    justify-self: end;
  }
}

@media (min-width: 1024px) {
  .platform-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-lg);
  }
}

.notice {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding: var(--space-2xl);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sheet);
  background: var(--surface);
}

.notice h2 {
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
}

.notice p {
  margin-top: var(--space-sm);
  max-width: 72ch;
  color: var(--muted);
}

@media (min-width: 640px) {
  .notice {
    flex-direction: row;
    gap: var(--space-xl);
    padding: var(--space-3xl);
  }
}

/* Inner pages --------------------------------------------------------------------------------- */

.page {
  padding-top: var(--space-4xl);
}

.page-narrow {
  max-width: 720px;
  min-height: 50vh;
}

.page-header {
  max-width: 760px;
  margin-bottom: var(--space-4xl);
}

@media (min-width: 960px) {
  .page {
    padding-top: var(--space-5xl);
  }
}

.contact-card {
  padding: var(--space-2xl);
  border-radius: var(--radius-hero);
  background:
    radial-gradient(100% 120% at 100% 0%, var(--glow), transparent 60%),
    var(--surface);
}

.contact-card h2,
.help-section h2,
.option h2,
.notice-compact h2 {
  font-size: 1.375rem;
  letter-spacing: -0.02em;
}

.contact-list {
  display: grid;
  gap: var(--space-xl);
  margin: var(--space-2xl) 0 0;
}

.contact-list dt {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contact-list dd {
  margin: var(--space-xs) 0 0;
  font-size: 1.0625rem;
  overflow-wrap: anywhere;
}

.dd-note {
  display: block;
  margin-top: var(--space-xs);
  color: var(--muted);
  font-size: 0.875rem;
}

.contact-tip {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 0.9375rem;
}

.contact-tip .icon {
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

@media (min-width: 768px) {
  .contact-card {
    padding: var(--space-4xl);
  }

  .contact-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2xl) var(--space-4xl);
  }
}

.help-grid,
.facts-grid {
  display: grid;
  gap: var(--space-md);
  margin-top: var(--space-4xl);
}

.help-section {
  padding: var(--space-2xl);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--surface);
  scroll-margin-top: 96px;
}

.help-section h2 {
  margin-top: var(--space-lg);
}

.help-section > p,
.help-section > ul {
  margin-top: var(--space-md);
}

.help-section p + p {
  margin-top: var(--space-md);
}

.help-section ul,
.doc-body ul {
  display: grid;
  gap: var(--space-sm);
  list-style: none;
}

.help-section li,
.doc-body li {
  position: relative;
  padding-left: 20px;
}

.help-section li::before,
.doc-body li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.68em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.help-section li,
.help-section p {
  color: var(--muted);
}

.help-section strong {
  color: var(--text);
}

@media (min-width: 900px) {
  .help-grid,
  .facts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-lg);
    /* Cards end with their content; a stretched short card reads as missing text. */
    align-items: start;
  }

  .help-section {
    padding: var(--space-3xl);
  }
}

.notice-compact {
  margin-bottom: var(--space-lg);
}

.options-grid {
  display: grid;
  gap: var(--space-md);
}

.option {
  padding: var(--space-2xl);
  border-radius: var(--radius-sheet);
  scroll-margin-top: 96px;
}

.option > p {
  margin-top: var(--space-md);
  color: var(--muted);
}

.option-label {
  display: inline-flex;
  margin-bottom: var(--space-md);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.option > .option-label {
  margin-top: 0;
  color: var(--primary);
}

.steps {
  display: grid;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  min-height: 32px;
  padding: 4px 0 0 44px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--outline);
  border-radius: 50%;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 900px) {
  .options-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-lg);
  }

  .option {
    padding: var(--space-3xl);
  }
}

/* Legal documents ----------------------------------------------------------------------------- */

.doc {
  padding-top: var(--space-4xl);
}

.doc-header {
  max-width: 760px;
  margin-bottom: var(--space-3xl);
}

.doc-header .note {
  margin-top: var(--space-lg);
  color: var(--muted);
}

.doc-app-note {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  color: var(--muted);
  font-size: 0.9375rem;
}

.doc-app-note .icon {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.doc-layout {
  display: grid;
  gap: var(--space-3xl);
}

.doc-toc ol {
  display: grid;
  gap: 2px;
  list-style: none;
}

.doc-toc a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.35;
  text-decoration: none;
}

.doc-toc a:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.doc-toc-compact {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.doc-toc-compact summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: 48px;
  padding: 0 var(--space-lg);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.doc-toc-compact summary::-webkit-details-marker {
  display: none;
}

/* Chevron, because a flex summary drops the default marker. */
.doc-toc-compact summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
}

.doc-toc-compact[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

.doc-toc-compact ol {
  padding: 0 var(--space-sm) var(--space-md);
}

.doc-toc-side {
  display: none;
}

.doc-toc-title {
  margin: 0 0 var(--space-sm) 10px;
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.doc-body {
  max-width: 72ch;
  min-width: 0;
}

.doc-heading {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  margin: var(--space-4xl) 0 var(--space-md);
}

.doc-body > .doc-heading:first-child {
  margin-top: 0;
}

.doc-heading h2 {
  font-size: clamp(1.375rem, 1.25rem + 0.6vw, 1.625rem);
  letter-spacing: -0.02em;
  scroll-margin-top: 96px;
}

.heading-anchor {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  opacity: 0;
}

.doc-heading:hover .heading-anchor,
.heading-anchor:focus-visible {
  opacity: 1;
}

.doc-body p {
  margin-bottom: var(--space-md);
}

.doc-body ul {
  margin-bottom: var(--space-lg);
}

.doc-body .note {
  color: var(--muted);
  font-size: 0.9375rem;
}

@media (min-width: 1024px) {
  .doc {
    padding-top: var(--space-5xl);
  }

  .doc-layout {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: var(--space-5xl);
    align-items: start;
  }

  .doc-toc-compact {
    display: none;
  }

  .doc-toc-side {
    display: block;
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    /* overflow-y makes this a scroll container on both axes, which would clip the
       focus ring drawn outside the links. Room for it, without moving them. */
    padding-inline: 6px;
    margin-inline: -6px;
  }
}

/* Motion, only when the visitor has not asked for less ----------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  a,
  .button,
  .card,
  .heading-anchor {
    transition:
      color 150ms var(--ease),
      background-color 150ms var(--ease),
      border-color 150ms var(--ease),
      opacity 150ms var(--ease),
      transform 250ms var(--ease);
  }

  .card:hover {
    border-color: var(--outline);
  }

  .button:active {
    transform: scale(0.98);
  }

  .hero-copy > *,
  .hero-media {
    animation: rise 700ms var(--ease) both;
  }

  .hero-copy > :nth-child(2) { animation-delay: 60ms; }
  .hero-copy > :nth-child(3) { animation-delay: 120ms; }
  .hero-copy > :nth-child(4) { animation-delay: 180ms; }
  .hero-copy > :nth-child(n + 5) { animation-delay: 240ms; }
  .hero-media { animation-delay: 150ms; animation-duration: 900ms; }

  @supports (animation-timeline: view()) {
    .section .phone,
    .section .card,
    .panel,
    .notice {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (forced-colors: active) {
  .card,
  .help-section,
  .panel,
  .notice,
  .status {
    border: 1px solid CanvasText;
  }
}
