/*
 * EveryCare marketing site.
 *
 * The palette mirrors apps/mobile/src/theme/tokens.ts: Green #2EC480 primary,
 * Teal #36D8C6 secondary, Blue #3B82F6 accent, neutral surfaces,
 * yellow for warnings and red for alerts. Green is bright, so it fills buttons
 * (with dark text) while --primary-ink carries it as readable text. Dark mode
 * uses the app's Neutral Charcoal ramp so the site and the app read as one
 * product after dusk.
 *
 * Inter sets headings and body, the same font as the app UI. Icons are
 * Ionicons, the set the app itself uses (assets/icons.svg).
 *
 * The phone mockups are drawn in HTML and sized in em, so one custom property,
 * --phone-w, scales a whole phone and everything inside it.
 */

:root {
  color-scheme: light;

  --bg: #f8faf9;
  --surface: #ffffff;
  --surface-muted: #f1f7f4;
  --tint: #f1f7f4;
  --ink: #0f172a;
  --ink-soft: #5e6e82;
  --border: #dde7e2;
  --ring: #cbd5e1;

  --primary: #2ec480;
  --primary-strong: #098048;
  --primary-ink: #098048;
  --primary-hover: #3dd48d;
  --on-primary: #0f172a;
  --link: #2563eb;
  --mint: #36d8c6;

  --success: #2ec480;
  --success-bg: #f4fdf9;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;

  --bezel: #101817;
  --bezel-edge: #2b3533;

  --badge-bg: #172b2a;
  --badge-ink: #ffffff;
  --badge-edge: transparent;

  --closing-bg: #098048;
  --closing-ink: #f4fdf9;
  --closing-soft: #2ec480;
  --closing-edge: transparent;

  --av-n-bg: #f4fdf9;
  --av-n-ink: #098048;
  --av-s-bg: #e0f2fe;
  --av-s-ink: #0369a1;
  --av-a-bg: #ede9fe;
  --av-a-ink: #6d28d9;
  --av-o-bg: #f1f5f9;
  --av-o-ink: #475569;
  --av-g-bg: #fce7f3;
  --av-g-ink: #be185d;

  --shadow-lift: 0 1px 2px rgb(10 92 50 / 0.08), 0 30px 60px -36px rgb(10 92 50 / 0.45);
  --shadow-float: 0 12px 28px -12px rgb(10 92 50 / 0.32);

  --shell: min(1160px, 100% - 2.5rem);
  --display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Dark tokens are written twice: once for the system preference (unless the
   visitor chose light), once for an explicit choice of dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;

    --bg: #0f172a;
    --surface: #1e293b;
    --surface-muted: #243447;
    --tint: #163d2e;
    --ink: #e2e8f0;
    --ink-soft: #94a3b8;
    --border: #334155;
    --ring: #475569;

    --primary: #2ec480;
    --primary-strong: #098048;
    --primary-ink: #2ec480;
    --primary-hover: #3dd48d;
    --on-primary: #0f172a;
    --link: #60a5fa;

    --success: #4ade80;
    --success-bg: #123524;
    --warn: #facc15;
    --warn-bg: #3a2e05;
    --danger: #f87171;
    --danger-bg: #3f1414;

    --bezel: #000000;
    --bezel-edge: #3a3b40;

    --badge-bg: #000000;
    --badge-ink: #f4f4f5;
    --badge-edge: #3f4046;

    --closing-bg: #0e2219;
    --closing-ink: #f4f4f5;
    --closing-soft: #a3ebc1;
    --closing-edge: #0a5c32;

    --av-n-bg: #0f2e1d;
    --av-n-ink: #2ec480;
    --av-s-bg: #0c2d40;
    --av-s-ink: #7dd3fc;
    --av-a-bg: #2a1f45;
    --av-a-ink: #c4b5fd;
    --av-o-bg: #27282c;
    --av-o-ink: #d4d4d8;
    --av-g-bg: #3b1229;
    --av-g-ink: #f9a8d4;

    --shadow-lift: 0 1px 2px rgb(0 0 0 / 0.4), 0 30px 60px -30px rgb(0 0 0 / 0.85);
    --shadow-float: 0 12px 28px -10px rgb(0 0 0 / 0.7);
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;

  --bg: #0f172a;
  --surface: #1e293b;
  --surface-muted: #243447;
  --tint: #163d2e;
  --ink: #e2e8f0;
  --ink-soft: #94a3b8;
  --border: #334155;
  --ring: #475569;

  --primary: #2ec480;
  --primary-strong: #098048;
  --primary-ink: #2ec480;
  --primary-hover: #3dd48d;
  --on-primary: #0f172a;
  --link: #60a5fa;

  --success: #4ade80;
  --success-bg: #123524;
  --warn: #facc15;
  --warn-bg: #3a2e05;
  --danger: #f87171;
  --danger-bg: #3f1414;

  --bezel: #000000;
  --bezel-edge: #3a3b40;

  --badge-bg: #000000;
  --badge-ink: #f4f4f5;
  --badge-edge: #3f4046;

  --closing-bg: #0e2219;
  --closing-ink: #f4f4f5;
  --closing-soft: #a3ebc1;
  --closing-edge: #0a5c32;

  --av-n-bg: #0f2e1d;
  --av-n-ink: #2ec480;
  --av-s-bg: #0c2d40;
  --av-s-ink: #7dd3fc;
  --av-a-bg: #2a1f45;
  --av-a-ink: #c4b5fd;
  --av-o-bg: #27282c;
  --av-o-ink: #d4d4d8;
  --av-g-bg: #3b1229;
  --av-g-ink: #f9a8d4;

  --shadow-lift: 0 1px 2px rgb(0 0 0 / 0.4), 0 30px 60px -30px rgb(0 0 0 / 0.85);
  --shadow-float: 0 12px 28px -10px rgb(0 0 0 / 0.7);
}

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

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

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

img,
svg {
  display: block;
  max-width: 100%;
}

p {
  margin: 0;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
}

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

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  background: var(--surface);
  color: var(--ink);
  border-radius: 10px;
}

.skip-link:focus {
  top: 1rem;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark svg {
  width: 32px;
  height: 32px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.6rem 0.8rem;
  color: var(--ink-soft);
  font-size: 0.975rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 10px;
}

.nav-link:hover {
  color: var(--ink);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--ring);
}

/* Show the icon for the theme a click would switch to. */
.icon-to-light {
  display: none;
}

:root[data-theme='dark'] .icon-to-light {
  display: block;
}

:root[data-theme='dark'] .icon-to-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .icon-to-light {
    display: block;
  }

  :root:not([data-theme='light']) .icon-to-dark {
    display: none;
  }
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1.1rem;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 0.975rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
}

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

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

.hero {
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(4rem, 8vw, 6.5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(2.5rem, 5vw, 4.5rem);
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  max-width: 16ch;
}

.lede {
  margin-top: 1.5rem;
  max-width: 33rem;
  color: var(--ink-soft);
  font-size: 1.1875rem;
  line-height: 1.6;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 56px;
  padding: 0.55rem 1.2rem 0.55rem 1rem;
  background: var(--badge-bg);
  color: var(--badge-ink);
  border: 1px solid var(--badge-edge);
  border-radius: 14px;
  text-decoration: none;
  font-size: 0.75rem;
  line-height: 1.2;
}

.store-badge .icon {
  width: 24px;
  height: 24px;
  /* The Apple and Play logos carry no fill of their own, so without this they
     render black and vanish on the black dark-mode badge. */
  fill: currentColor;
}

.store-badge span {
  display: flex;
  flex-direction: column;
}

.store-badge strong {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Not in the stores yet: the badge is a label, not a link. */
.store-badge.is-soon {
  cursor: default;
}

.fineprint {
  margin-top: 1rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

/* ---------- Phones ---------- */

.phone {
  --phone-w: 240px;
  width: var(--phone-w);
  font-size: calc(var(--phone-w) * 0.0525);
  line-height: 1.35;
}

.phone-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-weight: 500;
}

.phone-frame {
  aspect-ratio: 9 / 19;
  padding: 0.5em;
  background: var(--bezel);
  border: 1px solid var(--bezel-edge);
  border-radius: 3.1em;
  box-shadow: var(--shadow-lift);
}

.screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  border-radius: 2.65em;
}

.status-bar {
  position: relative;
  display: flex;
  align-items: center;
  flex: none;
  height: 2.7em;
  padding-inline: 1.7em;
  font-size: 0.8em;
  font-weight: 600;
}

.island {
  position: absolute;
  top: 0.65em;
  left: 50%;
  width: 6.5em;
  height: 1.9em;
  margin-left: -3.25em;
  background: #000000;
  border-radius: 999px;
}

.app-head {
  padding: 0.35em 1.1em 0.85em;
}

.app-title {
  font-size: 1.45em;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.app-sub {
  color: var(--ink-soft);
  font-size: 0.82em;
}

.rows {
  margin: 0;
  padding: 0 0.8em;
  list-style: none;
}

.rows > li + li {
  margin-top: 0.5em;
}

.row {
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.7em 0.75em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1em;
  transition:
    background-color 400ms ease,
    border-color 400ms ease;
}

.row-title {
  font-size: 0.9em;
  font-weight: 600;
  line-height: 1.25;
}

.row-sub {
  color: var(--ink-soft);
  font-size: 0.78em;
}

.tick {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.75em;
  height: 1.75em;
  border: 0.13em solid var(--ring);
  border-radius: 999px;
  color: var(--success);
  transition:
    background-color 300ms ease,
    border-color 300ms ease;
}

.tick .icon {
  width: 1em;
  height: 1em;
  opacity: 0;
  transition: opacity 250ms ease;
}

.tick--done,
.is-done .tick {
  background: var(--success-bg);
  border-color: var(--success-bg);
}

.tick--done .icon,
.is-done .tick .icon {
  opacity: 1;
}

.tick--late {
  color: var(--ink-soft);
}

.tick--late .icon {
  opacity: 1;
}

.is-late .tick--late {
  background: var(--warn-bg);
  border-color: var(--warn-bg);
  color: var(--warn);
}

.row-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.75em;
  height: 1.75em;
  background: var(--tint);
  color: var(--primary-ink);
  border-radius: 0.55em;
}

.row-icon .icon {
  width: 1.05em;
  height: 1.05em;
}

.row.is-highlight {
  background: var(--tint);
  border-color: color-mix(in srgb, var(--primary) 45%, transparent);
}

/* Rows the hero scene adds. Collapsed only when script is there to open them. */
.row--collapsible {
  transition:
    max-height 500ms cubic-bezier(0.22, 1, 0.36, 1),
    padding 500ms cubic-bezier(0.22, 1, 0.36, 1),
    margin 500ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 400ms ease,
    background-color 600ms ease,
    border-color 600ms ease;
}

.js .row--collapsible {
  max-height: 0;
  padding-block: 0;
  border-width: 0;
  opacity: 0;
  overflow: hidden;
}

.js .rows > li + .row--collapsible:not(.is-open),
.js .rows > .row--collapsible:first-child:not(.is-open) + li {
  margin-top: 0;
}

.js .row--collapsible.is-open {
  max-height: 5em;
  padding-block: 0.7em;
  border-width: 1px;
  opacity: 1;
}

.screen .avatar {
  width: 2.3em;
  height: 2.3em;
  font-size: 0.72em;
}

.tab-bar {
  display: flex;
  justify-content: space-around;
  flex: none;
  margin-top: auto;
  padding: 0.75em 0 1.3em;
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--ink-soft);
}

.tab-bar span {
  position: relative;
  display: grid;
  place-items: center;
}

.tab-bar .icon {
  width: 1.35em;
  height: 1.35em;
}

.tab-bar .is-active {
  color: var(--primary-ink);
}

.badge {
  position: absolute;
  top: -0.45em;
  right: -0.75em;
  display: grid;
  place-items: center;
  min-width: 1.55em;
  height: 1.55em;
  padding-inline: 0.3em;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 0.66em;
  font-weight: 600;
  border-radius: 999px;
}

.tap {
  position: absolute;
  z-index: 6;
  width: 2.8em;
  height: 2.8em;
  margin: -1.4em 0 0 -1.4em;
  background: color-mix(in srgb, var(--ink) 30%, transparent);
  border: 2px solid color-mix(in srgb, var(--surface) 80%, transparent);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
}

/* The reminder that drops in on Layla's phone. */
.notif {
  position: absolute;
  top: 2.9em;
  left: 0.6em;
  right: 0.6em;
  z-index: 4;
  padding: 0.75em 0.85em 0.8em;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 1.25em;
  box-shadow: var(--shadow-float);
}

.js .notif {
  opacity: 0;
  transform: translateY(-130%);
}

.notif-top {
  display: flex;
  align-items: center;
  gap: 0.4em;
  margin-bottom: 0.35em;
  color: var(--ink-soft);
  font-size: 0.72em;
}

.notif-app svg {
  width: 1.5em;
  height: 1.5em;
}

.notif-when {
  margin-left: auto;
}

.notif-title {
  font-size: 0.9em;
  font-weight: 600;
}

.notif-body {
  color: var(--ink-soft);
  font-size: 0.8em;
}

.notif-actions {
  display: flex;
  gap: 0.35em;
  margin-top: 0.65em;
}

.notif-actions span {
  flex: 1;
  padding: 0.5em 0.2em;
  background: var(--surface-muted);
  font-size: 0.7em;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  border-radius: 0.7em;
}

.notif-actions [data-taken] {
  background: var(--primary);
  color: var(--on-primary);
}

/* The sheet Sara books the appointment in. */
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 1.1em 1.1em 1.6em;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 1.4em 1.4em 0 0;
  box-shadow: 0 -18px 40px -24px rgb(0 0 0 / 0.45);
}

.js .sheet {
  transform: translateY(105%);
}

.sheet-title {
  margin-bottom: 0.5em;
  font-size: 1em;
  font-weight: 600;
}

.field {
  display: flex;
  justify-content: space-between;
  gap: 0.6em;
  padding: 0.55em 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.78em;
}

.field span {
  color: var(--ink-soft);
}

.field strong {
  font-weight: 600;
  white-space: nowrap;
}

.sheet-save {
  display: block;
  margin-top: 0.9em;
  padding: 0.7em;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 0.82em;
  font-weight: 600;
  text-align: center;
  border-radius: 0.8em;
}

/* Today's progress, shown on both hero phones. */
.progress {
  margin: 0 0.8em 0.7em;
  padding: 0.7em 0.8em 0.8em;
  background: var(--tint);
  border-radius: 1em;
  font-size: 0.8em;
}

.progress strong {
  font-weight: 700;
}

.bar {
  display: block;
  height: 0.5em;
  margin-top: 0.5em;
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  border-radius: 999px;
  overflow: hidden;
}

.bar i {
  display: block;
  width: 20%;
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
}

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

.stage-phones {
  display: grid;
  grid-template-columns: auto minmax(2.5rem, 1fr) auto;
  align-items: center;
  justify-content: center;
}

.phone--a,
.phone--b {
  --phone-w: clamp(150px, 19vw, 236px);
}

.phone--b {
  margin-top: 3.5rem;
}

.sync {
  position: relative;
  align-self: center;
  height: 2.4rem;
  margin-top: 2rem;
}

.sync-line {
  position: absolute;
  top: 50%;
  left: -0.5rem;
  right: -0.5rem;
  border-top: 2px dashed color-mix(in srgb, var(--primary) 45%, transparent);
}

.sync-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  margin: -1.05rem 0 0 -1.05rem;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 1.05rem;
  border-radius: 999px;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary) 18%, transparent);
}

.js .sync-dot {
  opacity: 0;
}

.stage-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.75rem;
}

.stage-caption {
  display: grid;
  max-width: 30rem;
  color: var(--ink-soft);
  font-size: 0.975rem;
}

.stage-caption span {
  grid-area: 1 / 1;
  opacity: 0;
  transition: opacity 400ms ease;
}

.stage-caption .is-current {
  opacity: 1;
}

.stage-pause {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: none;
  min-height: 44px;
  padding: 0 1rem;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}

.stage-pause:hover {
  color: var(--ink);
  border-color: var(--ring);
}

.stage-pause .icon-play,
.stage-pause[aria-pressed='true'] .icon-pause {
  display: none;
}

.stage-pause[aria-pressed='true'] .icon-play {
  display: block;
}

html:not(.js) .stage-pause {
  display: none;
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(4rem, 9vw, 7rem);
}

.section--tinted {
  --section-bg: color-mix(in srgb, var(--tint) 65%, var(--bg));
  background: var(--section-bg);
}

.section-head {
  max-width: 40rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section-head h2,
.principles h2,
.closing h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.section-head p {
  margin-top: 1rem;
  color: var(--ink-soft);
  font-size: 1.125rem;
}

/* ---------- Feature tour ---------- */

.tour {
  padding-block: clamp(4rem, 8vw, 6rem) clamp(2rem, 4vw, 3rem);
}

.tour-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 6vw, 6rem);
}

.tour-sticky {
  position: sticky;
  top: calc(50vh - 290px + 2rem);
  align-self: start;
  display: flex;
  justify-content: center;
}

.phone--tour {
  --phone-w: 268px;
}

.tour-screen {
  position: absolute;
  top: 2.7em;
  left: 0;
  right: 0;
  bottom: 4.2em;
}

.js .tour-screen {
  opacity: 0;
  visibility: hidden;
}

.js .tour-screen.is-active {
  opacity: 1;
  visibility: visible;
}

html:not(.js) .tour-screen:not(.is-active) {
  display: none;
}

.tour-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tour-step {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 78vh;
  transition: opacity 400ms ease;
}

.js .tour-step {
  opacity: 0.3;
}

.js .tour-step.is-active {
  opacity: 1;
}

.step-feature {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
  color: var(--primary-ink);
  font-size: 1rem;
  font-weight: 600;
}

.step-feature .icon {
  width: 1.3rem;
  height: 1.3rem;
}

.tour-step h3 {
  font-size: clamp(1.65rem, 2.7vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.tour-step > p:last-child {
  max-width: 32rem;
  margin-top: 1rem;
  color: var(--ink-soft);
  font-size: 1.0625rem;
}

/* Medications screen */
.alert-card {
  display: flex;
  gap: 0.65em;
  margin: 0.8em 0.8em 0;
  padding: 0.8em 0.85em;
  background: var(--warn-bg);
  border-radius: 1em;
}

.alert-card > .icon {
  width: 1.3em;
  height: 1.3em;
  color: var(--warn);
}

.alert-card .row-sub {
  color: var(--ink);
  opacity: 0.8;
}

/* Appointments screen */
.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin: 0 0.8em 0.8em;
  color: var(--ink-soft);
  font-size: 0.68em;
  text-align: center;
}

.week span {
  padding: 0.45em 0;
  border-radius: 0.9em;
}

.week b {
  display: block;
  margin-top: 0.15em;
  color: var(--ink);
  font-size: 1.3em;
  font-weight: 600;
}

.week .is-today {
  background: var(--primary);
  color: var(--on-primary);
}

.week .is-today b {
  color: inherit;
}

.appt-card {
  margin: 0 0.8em;
  padding: 0.95em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.1em;
}

.appt-time {
  color: var(--primary-ink);
  font-size: 1.6em;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.with-icon {
  display: flex;
  align-items: center;
  gap: 0.3em;
  margin-top: 0.2em;
}

.appt-change {
  display: inline-block;
  margin-top: 0.7em;
  padding: 0.35em 0.65em;
  background: var(--tint);
  color: var(--primary-strong);
  font-size: 0.75em;
  font-weight: 600;
  border-radius: 0.6em;
}

.appt-going {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-top: 0.75em;
  padding-top: 0.75em;
  border-top: 1px solid var(--border);
  font-size: 0.8em;
  font-weight: 500;
}

/* Routines screen */
.by {
  opacity: 0;
  transition: opacity 300ms ease;
}

.is-done .by {
  opacity: 1;
}

html:not(.js) [data-routine] .tick {
  background: var(--success-bg);
  border-color: var(--success-bg);
}

html:not(.js) [data-routine] .tick .icon,
html:not(.js) .by {
  opacity: 1;
}

/* Care circle screen */
.perms {
  margin: 0 0.8em;
  padding: 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1em;
}

.perms li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6em;
  padding: 0.8em 0.9em;
  font-size: 0.84em;
  font-weight: 500;
}

.perms li + li {
  border-top: 1px solid var(--border);
}

.switch {
  position: relative;
  flex: none;
  width: 2.6em;
  height: 1.5em;
  background: var(--ring);
  border-radius: 999px;
  transition: background-color 300ms ease;
}

.switch::after {
  content: '';
  position: absolute;
  top: 0.2em;
  left: 0.2em;
  width: 1.1em;
  height: 1.1em;
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
  transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.switch.is-on {
  background: var(--primary);
}

.switch.is-on::after {
  transform: translateX(1.1em);
}

.saved-chip {
  display: flex;
  align-items: center;
  gap: 0.45em;
  margin: 0.8em;
  padding: 0.6em 0.8em;
  background: var(--success-bg);
  color: var(--success);
  font-size: 0.78em;
  font-weight: 600;
  border-radius: 0.8em;
}

/* Help screen: an urgent alert someone has taken on */
.alarm-card {
  display: grid;
  gap: 0.35em;
  margin: 0.8em;
  padding: 0.9em;
  background: var(--danger-bg);
  border-radius: 0.9em;
}

.alarm-title {
  color: var(--danger);
  font-size: 1.05em;
  font-weight: 700;
}

.alarm-meta {
  color: var(--ink-soft);
  font-size: 0.75em;
}

.alarm-owner,
.checkin-chip {
  display: flex;
  align-items: center;
  gap: 0.45em;
  font-size: 0.8em;
  font-weight: 600;
}

.alarm-owner {
  color: var(--ink);
}

.alarm-owner .icon {
  color: var(--success);
}

.checkin-chip {
  margin: 0 0.8em;
  padding: 0.6em 0.8em;
  background: var(--success-bg);
  color: var(--success);
  border-radius: 0.8em;
}

.step-note {
  margin-top: 0.9rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* Messages screen */
.chat {
  display: grid;
  gap: 0.6em;
  padding: 0 0.8em;
}

.bubble {
  display: flex;
  align-items: flex-end;
  gap: 0.5em;
}

.bubble p {
  margin: 0;
  padding: 0.6em 0.75em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1em 1em 1em 0.3em;
  font-size: 0.8em;
  line-height: 1.35;
}

.bubble--typing {
  display: none;
}

.bubble--typing.is-typing {
  display: flex;
}

.bubble--typing p {
  display: flex;
  gap: 0.3em;
  padding-block: 0.85em;
}

.bubble--typing i {
  width: 0.45em;
  height: 0.45em;
  background: var(--ink-soft);
  border-radius: 999px;
  animation: typing 1s ease-in-out infinite;
}

.bubble--typing i:nth-child(2) {
  animation-delay: 150ms;
}

.bubble--typing i:nth-child(3) {
  animation-delay: 300ms;
}

@keyframes typing {
  0%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  50% {
    opacity: 0.9;
    transform: translateY(-0.2em);
  }
}

/* ---------- Who it's for ---------- */

.arrange-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  max-width: 26rem;
  padding: 0.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.segmented button {
  min-height: 44px;
  padding: 0 1rem;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  border: 0;
  border-radius: 15px;
  cursor: pointer;
  transition:
    background-color 250ms ease,
    color 250ms ease;
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button {
  position: relative;
  overflow: hidden;
}

/* Fills while the tab is on screen, so the next switch never comes as a surprise. */
.tab-progress {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 5px;
  height: 3px;
  background: currentColor;
  border-radius: 999px;
  opacity: 0.55;
  transform: scaleX(0);
  transform-origin: left center;
}

.arrange-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.segmented button[aria-selected='true'] {
  background: var(--primary);
  color: var(--on-primary);
}

.arrange-copy {
  min-height: 3.5em;
  margin-top: 1.25rem;
  max-width: 32rem;
  font-size: 1.125rem;
}

.orbit {
  position: relative;
  width: min(100%, 440px);
  aspect-ratio: 1;
  margin-inline: auto;
}

.orbit-ring {
  position: absolute;
  inset: 14%;
  border: 1.5px dashed color-mix(in srgb, var(--primary) 40%, transparent);
  border-radius: 999px;
}

.orbit-ring--inner {
  inset: 34%;
  border-style: solid;
  border-color: color-mix(in srgb, var(--primary) 14%, transparent);
  background: color-mix(in srgb, var(--primary) 6%, transparent);
}

.node {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 0;
  margin-top: -28px;
  transform: translate(var(--x, 0), var(--y, 0));
}

.node .avatar {
  width: 56px;
  height: 56px;
  font-size: 1.2rem;
  box-shadow:
    0 0 0 4px var(--section-bg, var(--bg)),
    var(--shadow-float);
}

.node-name {
  position: absolute;
  top: 62px;
  padding: 0.15rem 0.6rem;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.node--centre {
  margin-top: -40px;
  transform: none;
}

.node--centre .avatar {
  width: 80px;
  height: 80px;
  font-size: 1.6rem;
}

.node--centre .node-name {
  top: 88px;
  font-weight: 600;
}

.pro-badge {
  position: absolute;
  top: -4px;
  left: 14px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: var(--surface);
  color: var(--primary-ink);
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
}

/* ---------- Principles ---------- */

.principles {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.principles h2 {
  max-width: 12ch;
}

.offline-demo {
  max-width: 24rem;
  margin-top: 2rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 1rem;
}

.offline-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  color: var(--warn);
  font-size: 0.875rem;
  font-weight: 600;
}

.offline-status .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.offline-demo .icon-online,
.offline-demo.is-online .icon-offline {
  display: none;
}

.offline-demo.is-online .icon-online {
  display: block;
}

.offline-demo.is-online .offline-status {
  color: var(--success);
}

.offline-demo .row {
  background: var(--bg);
}

.queue-chip {
  margin-left: auto;
  padding: 0.3rem 0.65rem;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 999px;
  transition:
    background-color 300ms ease,
    color 300ms ease;
}

.offline-demo.is-online .queue-chip {
  background: var(--success-bg);
  color: var(--success);
}

.principle-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem clamp(1.5rem, 4vw, 3rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.p-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: var(--tint);
  color: var(--primary-ink);
  font-size: 22px;
  border-radius: 14px;
}

.principle-list h3 {
  margin-top: 1rem;
  font-family: var(--body);
  font-size: 1.0625rem;
  font-weight: 600;
}

.principle-list p {
  margin-top: 0.35rem;
  color: var(--ink-soft);
}

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

.closing {
  padding-block: clamp(1rem, 3vw, 2rem) clamp(4rem, 8vw, 6rem);
}

.closing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  align-items: end;
  gap: 2.5rem 4rem;
  padding: clamp(2rem, 5vw, 3.75rem);
  background: var(--closing-bg);
  color: var(--closing-ink);
  border: 1px solid var(--closing-edge);
  border-radius: 32px;
}

.closing h2 {
  color: var(--closing-ink);
  max-width: 18ch;
}

.steps {
  display: grid;
  gap: 0.85rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  color: var(--closing-soft);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  border: 1.5px solid color-mix(in srgb, var(--closing-ink) 40%, transparent);
  border-radius: 999px;
  color: var(--closing-ink);
  font-size: 0.875rem;
  font-weight: 600;
  transform: translateY(-1px);
}

.closing .stores {
  margin-top: 0;
}

.closing .store-badge {
  background: #000000;
  color: #ffffff;
  border-color: color-mix(in srgb, var(--closing-ink) 25%, transparent);
}

.closing .fineprint {
  color: var(--closing-soft);
}

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

.site-footer {
  padding-block: 2.5rem 3rem;
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem 2rem;
  align-items: start;
}

.footer-note {
  margin-top: 0.75rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.9375rem;
}

.copyright {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

/* ---------- Text pages (privacy, terms, support, account deletion) ---------- */

.doc {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3.5rem, 8vw, 6rem);
}

.prose {
  max-width: 44rem;
}

.prose .eyebrow {
  color: var(--primary-ink);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.prose h1 {
  margin-top: 0.5rem;
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  line-height: 1.15;
}

.prose .lede {
  margin-top: 1rem;
  color: var(--ink-soft);
  font-size: 1.125rem;
}

.prose .updated {
  margin-top: 0.75rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.prose h2 {
  margin-top: 2.75rem;
  font-size: 1.375rem;
  line-height: 1.3;
}

.prose h3 {
  margin-top: 1.75rem;
  font-size: 1.0625rem;
  line-height: 1.4;
}

.prose p,
.prose ul,
.prose ol {
  margin-top: 1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 0.5rem;
}

.prose strong {
  font-weight: 600;
}

.callout {
  margin-top: 1.75rem;
  padding: 1.25rem 1.5rem;
  background: var(--tint);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.callout > :first-child {
  margin-top: 0;
}

.callout--warn {
  background: var(--warn-bg);
  border-color: transparent;
}

.callout--warn strong {
  color: var(--warn);
}

.toc {
  margin-top: 1.75rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 0.9375rem;
}

.prose .toc ol {
  margin-top: 0.5rem;
  columns: 2 14rem;
  column-gap: 2rem;
}

.prose .toc li + li {
  margin-top: 0.25rem;
}

.toc-title {
  font-weight: 600;
}

/* ---------- Account deletion on the web ---------- */

.web-deletion-ready .web-deletion-fallback {
  display: none;
}

.deletion-panel {
  margin-top: 1.25rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.deletion-panel h3 {
  font-size: 1.125rem;
  line-height: 1.4;
  outline: none;
}

.deletion-panel h3 [data-email] {
  overflow-wrap: anywhere;
}

.deletion-panel > div > :first-child {
  margin-top: 0;
}

.stack {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

.form-field {
  display: grid;
  gap: 0.4rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

.form-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 0.9rem;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
  font-size: 1rem;
  border: 1px solid var(--ring);
  border-radius: 12px;
}

.form-field input:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 1px;
}

.provider-buttons,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.prose .or {
  margin-top: 1.25rem;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.form-error {
  color: var(--danger);
  font-size: 0.9375rem;
}

.button {
  justify-content: center;
  border: 1px solid transparent;
  font-family: inherit;
  cursor: pointer;
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button--secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--ring);
}

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

.button--ghost {
  background: transparent;
  color: var(--ink-soft);
}

.button--ghost:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

/* A fixed deep red: the dark theme's danger tone is too light to carry white text. */
.button--danger {
  background: #b91c1c;
  color: #ffffff;
}

.button--danger:hover:not(:disabled) {
  background: #991b1b;
}

/* ---------- Avatars ---------- */

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  font-family: var(--body);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.avatar--l {
  background: var(--av-n-bg);
  color: var(--av-n-ink);
}

.avatar--s {
  background: var(--av-s-bg);
  color: var(--av-s-ink);
}

.avatar--a {
  background: var(--av-a-bg);
  color: var(--av-a-ink);
}

.avatar--o {
  background: var(--av-o-bg);
  color: var(--av-o-ink);
}

.avatar--g {
  background: var(--av-g-bg);
  color: var(--av-g-ink);
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .hero-grid,
  .arrange-grid,
  .principles,
  .closing-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .stage {
    max-width: 36rem;
  }

  .phone--a,
  .phone--b {
    --phone-w: min(236px, 38vw);
  }
}

@media (max-width: 820px) {
  .tour-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  /* On a phone the mockup pins under the header and the steps scroll past it. */
  .tour-sticky {
    top: 4.25rem;
    z-index: 2;
    padding-block: 0.75rem 1.25rem;
    background: linear-gradient(var(--bg) 85%, transparent);
  }

  .phone--tour {
    --phone-w: min(170px, 44vw);
  }

  .tour-step {
    min-height: 62vh;
    justify-content: flex-start;
    padding-top: 2rem;
  }

  .nav-link {
    display: none;
  }

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

@media (max-width: 560px) {
  :root {
    --shell: min(1160px, 100% - 2rem);
  }

  .phone-label {
    font-size: 0.75rem;
  }

  .phone--b {
    margin-top: 2rem;
  }

  .stage-foot {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .store-badge {
    flex: 1 1 12rem;
  }

  .node-name {
    font-size: 0.75rem;
  }
}

.auth-callback {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1.25rem;
}

.auth-callback__panel {
  max-width: 22rem;
  text-align: center;
}

.auth-callback__panel h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.auth-callback__lead {
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0 0 1.25rem;
}

.auth-callback__actions {
  margin: 0 0 1rem;
}

.auth-callback__hint {
  color: var(--ink-soft);
  font-size: 0.8125rem;
  line-height: 1.45;
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .bubble--typing i {
    animation: none;
  }
}
