/*
  Gentle Pulse website. Direction: paper and ink (design spec 5.1).
  Visual rules adapted from unslop by Damir Sokolovsky (@heydamir), CC BY 4.0.
  Every margin, padding, gap and fixed height is a multiple of 4.
*/

:root {
  --page: #f6f4ef;
  --card: #fdfcf9;
  --raised: #eeebe4;
  --table: #e9e5dc;
  --paper: #fdfcf9;
  --text: #1c1a17;
  --text-2: #4a443c;
  --muted: #6f675c;
  --border: #7d756a;
  --hair: rgba(28, 26, 23, 0.1);
  --accent: #2443b5;
  --accent-hover: #1d3796;
  --on-accent: #ffffff;
  --red: #8f170e;
  --red-tint: #f7e1dd;
  --bezel: #1c1a17;
  --shadow-sm: 0 1px 2px rgba(28, 26, 23, 0.06);
  --shadow: 0 1px 2px rgba(28, 26, 23, 0.06), 0 12px 32px rgba(28, 26, 23, 0.1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: 24px;
  --edge: 32px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #161513;
    --card: #1c1a18;
    --raised: #262421;
    --table: #100f0d;
    --paper: #262421;
    --text: #efe9de;
    --text-2: #c2bbaf;
    --muted: #9a9388;
    --border: #8a847a;
    --hair: rgba(239, 233, 222, 0.1);
    --accent: #a9bbff;
    --accent-hover: #bfcdff;
    --on-accent: #10152b;
    --red: #ff9d92;
    --red-tint: #331c19;
    --bezel: #34312d;
    --shadow-sm: none;
    --shadow: none;
  }
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.25rem;
  line-height: 1.5;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl, dd, figure, table { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3 { font-weight: 500; text-wrap: balance; }
p { text-wrap: pretty; }

h1 { font-size: clamp(2.5rem, 1.5rem + 3.2vw, 4rem); line-height: 1.05; }
h2 { font-size: clamp(2rem, 1.4rem + 1.8vw, 2.75rem); line-height: 1.12; }
h3 { font-size: 1.5rem; line-height: 1.25; }

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

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: 16px; top: -80px; z-index: 10;
  background: var(--card); color: var(--accent);
  padding: 12px 16px; border-radius: 12px; border: 2px solid var(--border);
}
.skip:focus { top: 16px; }

.icon {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Grid ---------- */

.wrap { max-width: calc(1248px + 2 * var(--edge)); margin-inline: auto; padding-inline: var(--edge); }

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
}

.section { padding-block: 96px; border-top: 1px solid var(--hair); row-gap: 64px; align-items: start; }
[id] { scroll-margin-top: 24px; }

.section-head { grid-column: 1 / span 8; }
.intro { margin-top: 20px; color: var(--text-2); max-width: 36rem; }
.note { color: var(--text-2); }
.sub { margin-top: 48px; margin-bottom: 12px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 56px; padding: 12px 24px;
  border-radius: 12px; border: 2px solid transparent;
  font: inherit; font-weight: 500; line-height: 1.2; text-align: center; text-decoration: none;
  transition: background-color 150ms var(--ease), transform 150ms var(--ease);
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-secondary { background: var(--card); color: var(--text); border-color: var(--border); }
a.btn-primary:hover { background: var(--accent-hover); }
a.btn-secondary:hover { background: var(--raised); }
a.btn:active { transform: scale(0.98); }
.btn-nav { min-height: 48px; padding: 8px 20px; font-size: 1.125rem; }

/* ---------- Reading stack (signature; blood pressure readings only) ---------- */

.stack {
  display: inline-grid; justify-items: end; row-gap: 0.2em; padding-block: 0.04em;
  font-weight: 500; line-height: 0.72; font-variant-numeric: tabular-nums; color: var(--text);
}
.stack .rule { width: 100%; height: 2px; background: currentColor; }

/* ---------- Header ---------- */

.nav { display: flex; align-items: center; gap: 32px; height: 80px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-weight: 500; font-size: 1.25rem; }
.mark { width: 24px; height: 24px; fill: currentColor; }
.sprite { position: absolute; }
.nav-links { display: flex; gap: 32px; margin-left: auto; }
.nav-links a, .menu nav a { color: var(--text-2); text-decoration: none; font-size: 1.125rem; padding-block: 12px; transition: color 150ms var(--ease); }
.nav-links a:hover, .menu nav a:hover { color: var(--text); text-decoration: underline; }
.menu { display: none; position: relative; margin-left: auto; }
.menu summary {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 16px;
  list-style: none; cursor: pointer; font-weight: 500; font-size: 1.125rem;
  background: var(--card); border: 2px solid var(--border); border-radius: 12px;
}
.menu summary::-webkit-details-marker { display: none; }
.menu nav {
  position: absolute; right: 0; top: 56px; z-index: 5; min-width: 240px;
  display: grid; padding: 8px 20px;
  background: var(--card); border: 1px solid var(--hair); border-radius: 20px; box-shadow: var(--shadow);
}
.menu nav a + a { border-top: 1px solid var(--hair); }

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

.hero-grid { align-items: center; min-height: calc(100svh - 80px); padding-block: 16px 64px; row-gap: 48px; }
.hero-text { grid-column: 1 / span 5; }
.lede { margin-top: 24px; color: var(--text-2); font-size: 1.375rem; line-height: 1.45; max-width: 30rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

.hero-visual { grid-column: 6 / -1; background: var(--table); border-radius: 24px; padding: 40px; }
.stage { position: relative; width: 640px; max-width: 100%; height: 624px; margin-inline: auto; }

.paper {
  position: absolute; left: 0; top: 56px; width: 420px;
  background: var(--paper); border: 1px solid var(--hair); border-radius: 4px; box-shadow: var(--shadow-sm);
  padding: 0 0 16px;
  transform: rotate(-1.5deg); transform-origin: 30% 40%;
}
.paper-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 20px 112px 12px 20px; border-bottom: 2px solid var(--text); }
.paper-title { font-weight: 500; font-size: 1.125rem; }
.paper-sub { font-size: 0.9375rem; color: var(--text-2); }
.paper-row {
  display: grid; grid-template-columns: 68px 80px 64px 48px 1fr; column-gap: 8px; align-items: center;
  height: 60px; padding-inline: 20px; border-bottom: 1px solid var(--hair);
}
.paper-row .r { text-align: right; }
.paper-cols { height: 36px; font-size: 0.9375rem; color: var(--text-2); }
.paper-row.ink { color: var(--accent); font-size: 1.0625rem; }
.paper-row.ink .stack { color: var(--accent); font-size: 1.125rem; }

.phone {
  position: absolute; right: 0; top: 0; width: 312px;
  background: var(--bezel); border-radius: 44px; padding: 8px; box-shadow: var(--shadow);
}
.screen { background: var(--page); border-radius: 36px; padding: 8px 16px 20px; display: grid; row-gap: 12px; }
.p-status { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 28px; padding-inline: 12px; font-size: 0.875rem; font-weight: 500; }
.p-cam { width: 12px; height: 12px; border-radius: 50%; background: var(--bezel); }
.p-title { font-size: 1.5rem; font-weight: 500; line-height: 1.2; margin-top: 4px; }
.p-date { font-size: 0.9375rem; color: var(--text-2); margin-top: -8px; }
.p-card { background: var(--card); border: 1px solid var(--hair); border-radius: 16px; padding: 16px; margin-top: 4px; }
.p-card-title { font-size: 1.25rem; font-weight: 500; line-height: 1.25; }
.p-pills { margin-block: 8px 16px; font-size: 1rem; color: var(--text-2); }
.p-pills li { padding-block: 8px; }
.p-pills li + li { border-top: 1px solid var(--hair); }
.m-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; border-radius: 10px; border: 2px solid transparent;
  font-size: 1rem; font-weight: 500;
}
.m-btn .icon { color: var(--text-2); }
.m-primary { background: var(--accent); color: var(--on-accent); }
.m-secondary { background: var(--card); color: var(--text); border-color: var(--border); }
.p-last { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 4px 0; margin-top: 4px; border-top: 1px solid var(--hair); }
.p-last-label { font-size: 1rem; font-weight: 500; }
.p-last-meta { font-size: 0.9375rem; color: var(--text-2); line-height: 1.4; }
.stack-home { font-size: 1.75rem; }
.p-link { font-size: 1rem; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; padding: 4px; }

/* ---------- How it works ---------- */

.how-text { grid-column: 1 / span 5; }
.how-visual { grid-column: 7 / -1; }
.ways { margin-top: 40px; border-top: 1px solid var(--hair); }
.ways li { display: flex; gap: 16px; padding-block: 20px; border-bottom: 1px solid var(--hair); }
.ways .icon { margin-top: 4px; color: var(--text-2); }
.ways p { color: var(--text-2); margin-top: 4px; }
.how-text .note { margin-top: 24px; }

.sheet { background: var(--card); border: 1px solid var(--hair); border-radius: 24px; box-shadow: var(--shadow); padding: 24px; }
.confirm { max-width: 480px; margin-inline: auto; }
.photo { border-radius: 12px; overflow: hidden; aspect-ratio: 400 / 248; }
.cuff-photo { display: block; width: 100%; height: 100%; }
.confirm-reading { display: flex; align-items: flex-end; justify-content: center; gap: 24px; margin-top: 32px; }
.stack-xl { font-size: 5.5rem; }
.confirm-pulse { font-size: 1.25rem; color: var(--text-2); padding-bottom: 8px; }
.readback { margin-top: 24px; text-align: center; color: var(--text-2); }
.confirm-actions { display: grid; gap: 12px; margin-top: 24px; }

/* ---------- Pills ---------- */

.pills-visual { grid-column: 1 / span 6; }
.pills-text { grid-column: 8 / -1; }
.card { background: var(--card); border: 1px solid var(--hair); border-radius: 20px; box-shadow: var(--shadow-sm); padding: 24px; }
.alarm-time { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 1.125rem; }
.alarm-title { font-size: 1.75rem; font-weight: 500; line-height: 1.2; margin-top: 12px; }
.alarm-pills { margin-top: 12px; color: var(--text-2); }
.alarm-pills li { padding-block: 12px; }
.alarm-pills li + li { border-top: 1px solid var(--hair); }
.alarm-actions { display: grid; gap: 12px; margin-top: 12px; }

.ruled-title { font-size: 1.125rem; font-weight: 400; color: var(--text-2); padding-bottom: 12px; border-bottom: 2px solid var(--text); }
.pills-visual .ruled-title { margin-top: 48px; }
.timeline li { display: grid; grid-template-columns: 112px 1fr; column-gap: 24px; padding-block: 16px; border-bottom: 1px solid var(--hair); }
.timeline .t { font-weight: 500; }
.timeline li span + span { color: var(--text-2); }

.slots { margin-top: 32px; border-top: 1px solid var(--hair); }
.slots div { display: flex; justify-content: space-between; padding-block: 12px; border-bottom: 1px solid var(--hair); }
.slots dd { font-weight: 500; }
.pills-text .note { margin-top: 16px; }
.pills-text p + p { margin-top: 12px; }
.pills-text .sub + p { color: var(--text-2); }
.pills-text .sub ~ p { color: var(--text-2); }

/* ---------- Family ---------- */

.family-card-col { grid-column: 1 / span 5; }
.alerts-col { grid-column: 7 / -1; }
.fam { padding: 8px 24px; font-size: 1.0625rem; }
.fam-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 16px; }
.fam-name { font-size: 1.375rem; font-weight: 500; }
.fam-meta { font-size: 0.9375rem; color: var(--muted); font-weight: 400; }
.fam-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding-block: 12px; border-top: 1px solid var(--hair); }
.fam-label { color: var(--text-2); }
.fam-value { font-size: 1.375rem; font-weight: 500; text-align: right; line-height: 1.3; }
.fam-value .fam-meta { display: block; }
.fam-label { white-space: nowrap; }
.fam-value-sm { text-align: right; }
.stack-fam { font-size: 1.75rem; }
.fam-slots { display: block; }
.fam-slots ul { margin-top: 4px; }
.fam-slots li { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 40px; }
.status { display: inline-flex; align-items: center; gap: 8px; }
.status .icon { color: var(--text-2); }

.ruled-table { width: 100%; border-collapse: collapse; text-align: left; }
.ruled-table caption { text-align: left; font-size: 1.5rem; font-weight: 500; padding-bottom: 16px; }
.ruled-table thead th { font-weight: 400; font-size: 1.125rem; color: var(--text-2); padding-block: 8px; border-bottom: 2px solid var(--text); }
.ruled-table tbody th { font-weight: 500; width: 38%; padding: 16px 24px 16px 0; vertical-align: top; border-bottom: 1px solid var(--hair); }
.ruled-table td { color: var(--text-2); padding-block: 16px; vertical-align: top; border-bottom: 1px solid var(--hair); }
.table-note { margin-top: 16px; color: var(--text-2); }

.quote-a { grid-column: 1 / span 7; }
.quote-b { grid-column: 9 / -1; }
.quote { font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2rem); line-height: 1.3; margin-top: 24px; }
.quote-sm { font-size: 1.5rem; line-height: 1.3; margin-top: 24px; }
.quote-b p + p { margin-top: 16px; color: var(--text-2); }

/* ---------- My readings ---------- */

.chart-col { grid-column: 1 / span 8; }
.readings-aside { grid-column: 9 / -1; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; margin-bottom: 24px; }
.chart-title { font-size: 1.5rem; font-weight: 500; line-height: 1.25; }
.chart-sub { color: var(--text-2); font-size: 1.125rem; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 1.125rem; color: var(--text-2); padding-top: 4px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.swatch { width: 24px; }
.swatch-sys { height: 3px; background: var(--text); }
.swatch-dia { height: 2px; background: var(--text-2); }

.chart { display: block; width: 100%; height: auto; font-family: inherit; }
.chart-m { display: none; }
.c-grid { stroke: var(--hair); stroke-width: 1; }
.c-target { stroke: var(--text); stroke-opacity: 0.45; stroke-width: 1; }
.c-axis, .c-label { fill: var(--text-2); }
.c-sys { fill: none; stroke: var(--text); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.c-dia { fill: none; stroke: var(--text-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.c-dot-sys { fill: var(--text); }
.c-dot-dia { fill: var(--text-2); }
.c-new { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.c-value { fill: var(--text); font-weight: 500; }

.facts { border-top: 2px solid var(--text); }
.facts div { padding-block: 20px; border-bottom: 1px solid var(--hair); }
.facts dt { font-size: 1.125rem; color: var(--text-2); margin-bottom: 4px; }
.fact-figure { display: block; font-size: 2.5rem; font-weight: 500; line-height: 1.1; }

/* ---------- Safety, privacy, questions ---------- */

.side-head { grid-column: 1 / span 4; }
.side-body { grid-column: 6 / -1; }
.ruled-list { border-top: 2px solid var(--text); }
.ruled-list li { padding-block: 16px; border-bottom: 1px solid var(--hair); }

.band { display: flex; gap: 16px; padding: 20px; border-radius: 12px; }
.band-red { background: var(--red-tint); color: var(--red); }
.band .icon { margin-top: 4px; }
.band ol { list-style: decimal; padding-left: 24px; }
.band li + li { margin-top: 12px; }
.side-body .note { margin-top: 20px; }

.faq { border-top: 2px solid var(--text); }
.faq div { padding-block: 24px; border-bottom: 1px solid var(--hair); }
.faq dt { font-size: 1.5rem; font-weight: 500; line-height: 1.25; }
.faq dd { margin-top: 8px; color: var(--text-2); max-width: 40rem; }

/* ---------- Pricing ---------- */

.plan-free { grid-column: 1 / span 5; }
.plan-paid { grid-column: 6 / -1; }
.plan h3 { font-size: 1.125rem; font-weight: 400; color: var(--text-2); }
.price { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 500; line-height: 1.2; margin-block: 4px 20px; }
.plan .ruled-list li { min-height: 64px; display: flex; align-items: center; }
.plan-notes { grid-column: 6 / -1; margin-top: -32px; color: var(--text-2); }
.plan-notes p + p { margin-top: 12px; }

/* ---------- Coming, footer ---------- */

.coming { align-items: end; }
.coming-text { grid-column: 1 / span 7; }
.coming-action { grid-column: 9 / -1; justify-self: end; }
.footer { border-top: 2px solid var(--text); padding-block: 32px 64px; row-gap: 24px; }
.footer-brand { grid-column: 1 / span 4; }
.footer-notes { grid-column: 6 / -1; color: var(--text-2); font-size: 1.125rem; }

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .enter { animation: enter 400ms var(--ease) both; }
  .enter-2 { animation-delay: 60ms; }
  @keyframes enter { from { opacity: 0; transform: translateY(8px); } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* ---------- Narrower screens ---------- */

@media (min-width: 1120px) and (max-width: 1295px) {
  .hero-visual { padding: 32px; }
  .stage { width: 640px; max-width: none; zoom: 0.8; }
}

@media (max-width: 1119px) {
  .nav-links, .btn-nav { display: none; }
  .menu { display: block; }
  .hero-grid { min-height: 0; padding-top: 32px; }
  .hero-text, .hero-visual,
  .how-text, .how-visual,
  .pills-visual, .pills-text,
  .section-head, .family-card-col, .alerts-col, .quote-a, .quote-b,
  .chart-col, .readings-aside,
  .side-head, .side-body,
  .plan-free, .plan-paid, .plan-notes,
  .coming-text, .coming-action,
  .footer-brand, .footer-notes { grid-column: 1 / -1; }
  .section { row-gap: 48px; }
  .side-body { margin-top: -16px; }
  .pills-text { order: -1; }
  .plan-notes { margin-top: -16px; }
  .coming-action { justify-self: start; }
  .family-card-col .fam, .confirm { max-width: 520px; margin-inline: 0; }
}

@media (max-width: 767px) {
  :root { --edge: 16px; --gutter: 16px; }
  .section { padding-block: 64px; }
  .nav { height: 72px; }
  .lede { font-size: 1.25rem; }
  .actions .btn { flex: 1 1 100%; }

  .hero-visual { padding: 16px 16px 24px; }
  .stage { width: auto; height: auto; }
  .paper { position: static; width: auto; padding-bottom: 56px; transform: none; }
  .paper-head { padding-right: 20px; }
  .paper-row { grid-template-columns: 64px 80px 1fr 48px; padding-inline: 16px; }
  .paper-row > :nth-child(5), .hide-m { display: none; }
  .phone { position: relative; margin: -40px auto 0; width: min(312px, 100%); }

  .sheet { padding: 20px; }
  .stack-xl { font-size: 4.5rem; }
  .card { padding: 20px; }
  .fam { padding: 4px 20px; }
  .timeline li { grid-template-columns: 96px 1fr; column-gap: 16px; }
  .ruled-table tbody th { width: 42%; padding-right: 16px; }
  .chart-d { display: none; }
  .chart-m { display: block; }
  .chart-card { padding: 20px 12px 16px 16px; }
  .footer { padding-bottom: 48px; }
}
