/* ==========================================================================
   SIMULEN DOWNLOAD PAGE
   One rounded shell with a pill-tab bar (after the owner's "Cardiology"
   reference), Simulen ink / cream / teal, Sora for headings, the phone's own
   font for reading. Light and dark. No framework, no build step.
   ========================================================================== */

@font-face {
  font-family: "Sora";
  src: url("assets/fonts/sora.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ---- Tokens ------------------------------------------------------------ */
:root {
  --ink: #17181C;
  --cream: #F3ECDD;
  --teal: #0F9C8B;
  --teal-strong: #0B7D70;   /* button fill: white text reads at AA */

  --outer: #E4E0D7;         /* the grey around the shell */
  --frame: #F6F4EF;         /* the shell itself, the app's paper */
  --card: #FFFFFF;
  --sunk: #EEEBE4;          /* pill track, placeholders */
  --line: #E2DED5;
  --text: #17181C;
  --muted: #5F6066;
  --btn-text: #FFFFFF;
  --pill-ink-bg: #17181C;
  --pill-ink-text: #F3ECDD;
  --node-off: #FFFFFF;
  --screen-a: #F3ECDD;
  --screen-b: #E7E1D3;

  --radius-shell: 40px;
  --radius-card: 26px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --display: "Sora", ui-sans-serif, system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="dark"] {
  --outer: #07090C;
  --frame: #0E1116;
  --card: #1B1F29;
  --sunk: #151922;
  --line: #2A2F3B;
  --text: #E6E8EC;
  --muted: #A3A8B3;
  --teal: #2BB8A5;
  --teal-strong: #0B7D70;
  --pill-ink-bg: #F3ECDD;
  --pill-ink-text: #17181C;
  --node-off: #1B1F29;
  --screen-a: #1B1F29;
  --screen-b: #141822;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--outer);
  color: var(--text);
  font: 400 1rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--display);
  color: var(--text);
  margin: 0;
}

p { margin: 0; }
b { font-weight: 650; }
a { color: inherit; }

svg { display: block; }

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

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--pill-ink-bg);
  color: var(--pill-ink-text);
  border-radius: 999px;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---- Shell ------------------------------------------------------------- */
.shell {
  background: var(--frame);
  min-height: 100vh;
  overflow-x: clip;
}

@media (min-width: 960px) {
  body { padding: 22px; }
  .shell {
    max-width: 1240px;
    margin: 0 auto;
    border-radius: var(--radius-shell);
    min-height: auto;
  }
}

/* ---- Top bar ----------------------------------------------------------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "brand end"
    "tabs tabs";
  align-items: center;
  gap: 12px 12px;
  padding: 14px 16px 12px;
  background: color-mix(in srgb, var(--frame) 94%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.bar.scrolled { border-bottom-color: var(--line); }

.brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
}
.brand-mark { width: 38px; height: auto; }
.brand-word { width: 92px; height: auto; }

.tabs {
  grid-area: tabs;
  display: flex;
  gap: 6px;
  padding: 5px;
  background: var(--sunk);
  border-radius: 999px;
  overflow-x: auto;
  scrollbar-width: none;
  justify-self: stretch;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 550;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;
}
.tab:hover { color: var(--text); }
.tab[aria-current="true"] {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 0 var(--line);
}

.bar-end {
  grid-area: end;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.round {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.round svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.round .i-sun { display: none; }
:root[data-theme="dark"] .round .i-sun { display: block; }
:root[data-theme="dark"] .round .i-moon { display: none; }

.pill-ink {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--pill-ink-bg);
  color: var(--pill-ink-text);
  font-weight: 600;
  font-size: .92rem;
  text-decoration: none;
  white-space: nowrap;
}

@media (min-width: 960px) {
  .bar {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand tabs end";
    padding: 18px 22px;
    border-radius: var(--radius-shell) var(--radius-shell) 0 0;
  }
  .tabs { justify-self: center; }
  .brand {
    background: var(--card);
    border: 1px solid var(--line);
  }
}

/* ---- Hero -------------------------------------------------------------- */
main { padding: 0 16px; }
@media (min-width: 960px) { main { padding: 0 40px; } }

.hero {
  display: grid;
  gap: 36px;
  padding: 26px 0 56px;
}

h1 {
  font-size: clamp(2.05rem, 7.4vw, 3.55rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.035em;
  max-width: 15ch;
  text-wrap: balance;
}

.lede {
  margin-top: 18px;
  font-size: 1.06rem;
  color: var(--muted);
  max-width: 54ch;
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    align-items: center;
    gap: 56px;
    padding: 46px 0 80px;
  }
}

/* The download card */
.dl {
  margin-top: 28px;
  max-width: 520px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 18px;
}

.readout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 2px 2px 16px;
}
.read {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
  border-left: 1px solid var(--line);
  min-width: 0;
}
.read:first-child { border-left: 0; padding-left: 4px; }
.read-label {
  font-size: .8rem;
  color: var(--muted);
}
.read-value {
  font-family: var(--display);
  font-size: clamp(1.05rem, 4.6vw, 1.45rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dl-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 62px;
  border-radius: 999px;
  background: var(--teal-strong);
  color: var(--btn-text);
  font-family: var(--display);
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: transform .15s var(--ease), filter .2s ease;
}
.dl-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dl-button:hover { filter: brightness(1.06); }
.dl-button:active { transform: scale(.985); }
.dl[data-state="soon"] .dl-button {
  background: var(--sunk);
  color: var(--muted);
}

.dl-fit {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  color: var(--muted);
}
.dl-fit::before {
  content: "";
  flex: 0 0 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
}

.variants { margin-top: 6px; }
.variants summary {
  list-style: none;
  cursor: pointer;
  display: inline-block;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
  padding: 6px 0;
}
.variants summary::-webkit-details-marker { display: none; }

.variant-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.variant-list button {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--frame);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.variant-list button b { font-weight: 650; }
.variant-list button span { font-size: .84rem; color: var(--muted); }
@media (min-width: 560px) {
  .variant-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.variant-list button[aria-pressed="true"] {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px var(--teal);
}

/* After the tap: what happens next */
.dl-started {
  margin-top: 14px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 18px;
  background: var(--frame);
  border: 1px solid var(--line);
}
.dl-started[hidden] { display: none; }
.started-title { font-weight: 650; }
.started-text { font-size: .9rem; color: var(--muted); margin-top: 2px; }
.started-link {
  display: inline-block;
  margin-top: 8px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--teal-strong);
}
:root[data-theme="dark"] .started-link { color: var(--teal); }

.tray {
  position: relative;
  flex: 0 0 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  overflow: hidden;
}
.tray::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 10px;
  height: 3px;
  border-radius: 2px;
  background: var(--teal);
}
.drop {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 3px;
  height: 14px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--text);
  animation: drop 1s var(--ease) 3;
}
.drop::after {
  content: "";
  position: absolute;
  left: -4px;
  bottom: -2px;
  width: 7px;
  height: 7px;
  border-right: 3px solid var(--text);
  border-bottom: 3px solid var(--text);
  transform: rotate(45deg);
}
@keyframes drop {
  0% { transform: translateY(-14px); opacity: 0; }
  40% { opacity: 1; }
  100% { transform: translateY(4px); opacity: 1; }
}

.desk-note {
  margin-top: 14px;
  font-size: .9rem;
  color: var(--muted);
  max-width: 46ch;
}
.desk-note[hidden] { display: none; }

/* ---- Phones ------------------------------------------------------------ */
.hero-phone {
  margin: 0;
  display: flex;
  justify-content: center;
}
.hero-phone .phone { width: min(240px, 62vw); }
@media (min-width: 960px) {
  .hero-phone .phone { width: 300px; }
}

.phone {
  width: min(300px, 74vw);
  aspect-ratio: 9 / 19.5;
  border-radius: 46px;
  background: var(--ink);
  padding: 10px;
  box-shadow: 0 30px 60px -30px rgba(23, 24, 28, .45);
}
:root[data-theme="dark"] .phone {
  background: #000;
  box-shadow: 0 0 0 1px var(--line);
}
.phone.small {
  width: 200px;
  border-radius: 32px;
  padding: 7px;
  box-shadow: none;
}

.phone-screen {
  height: 100%;
  border-radius: 37px;
  overflow: hidden;
  background: linear-gradient(170deg, var(--screen-a), var(--screen-b));
}
.phone.small .phone-screen { border-radius: 26px; }
.phone-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shot-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
}
.shot-placeholder svg {
  width: 96px;
  height: auto;
  color: var(--text);
  opacity: .85;
}

/* ---- Sections ---------------------------------------------------------- */
.install, .shots, .features, .faq {
  padding: 56px 0;
  border-top: 1px solid var(--line);
}

.section-head { max-width: 640px; margin-bottom: 30px; }
.section-head h2 {
  font-size: clamp(1.55rem, 4.6vw, 2.25rem);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.section-head p {
  margin-top: 12px;
  color: var(--muted);
}

/* ---- Install timeline (the one bold piece) ----------------------------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  display: grid;
  gap: 18px;
  --node: 44px;
}

/* the line that joins the steps: on phones each step draws its own piece
   down to the next node, so the line ends exactly at step 4 */
.step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: calc(var(--node) / 2 - 1px);
  top: var(--node);
  bottom: -18px;
  width: 2px;
  background: var(--teal);
  transform-origin: top;
  transform: scaleY(0);
  transition: transform .5s var(--ease);
}
.timeline.lit .step:not(:last-child)::before { transform: scaleY(1); }
.timeline.lit .step:nth-child(2)::before { transition-delay: .3s; }
.timeline.lit .step:nth-child(3)::before { transition-delay: .6s; }

.step {
  position: relative;
  display: grid;
  grid-template-columns: var(--node) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.node {
  position: relative;
  z-index: 1;
  width: var(--node);
  height: var(--node);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  background: var(--node-off);
  color: var(--muted);
  border: 2px solid var(--line);
  transition: background-color .35s ease, color .35s ease, border-color .35s ease, transform .35s var(--ease);
}
.timeline.lit .node {
  background: var(--teal-strong);
  border-color: var(--teal-strong);
  color: #fff;
}
.timeline.lit .step:nth-child(1) .node { transition-delay: .05s; }
.timeline.lit .step:nth-child(2) .node { transition-delay: .35s; }
.timeline.lit .step:nth-child(3) .node { transition-delay: .65s; }
.timeline.lit .step:nth-child(4) .node { transition-delay: .95s; }

.step-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px 18px;
}
.step-card h3 {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.step-card p {
  margin-top: 6px;
  font-size: .93rem;
  color: var(--muted);
}
.step-card b { color: var(--text); }

/* on wide screens the line runs across, cards hang under the nodes */
@media (min-width: 900px) {
  .timeline {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }
  .step:not(:last-child)::before { display: none; }
  .timeline::before {
    content: "";
    position: absolute;
    left: 12.5%;
    right: 12.5%;
    top: calc(var(--node) / 2 - 1px);
    height: 2px;
    background: var(--teal);
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 1.2s var(--ease);
  }
  .timeline.lit::before { transform: scaleX(1); }
  .step {
    grid-template-columns: 1fr;
    justify-items: center;
    align-content: start;
    gap: 0;
  }
  /* the short drop from node to card, as in the reference */
  .step::after {
    content: "";
    order: 1;
    width: 2px;
    height: 22px;
    background: var(--line);
  }
  .node { order: 0; }
  .step-card { order: 2; width: 100%; }
}

/* ---- Screenshots ------------------------------------------------------- */
.shot-rail {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 16px;
  padding: 4px 2px 14px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  scrollbar-width: thin;
}
.shot {
  margin: 0;
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 200px;
}
.shot figcaption {
  margin-top: 12px;
  font-size: .88rem;
  color: var(--muted);
}
@media (min-width: 960px) {
  .shot-rail { margin: 0; padding-left: 2px; padding-right: 2px; justify-content: space-between; }
}

/* ---- Features ---------------------------------------------------------- */
.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0 40px;
}
.feature-list li {
  padding: 18px 0 20px;
  border-top: 1px solid var(--line);
}
.feature-list h3 {
  font-size: 1.05rem;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 10px;
}
.feature-list h3::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--teal);
  flex: 0 0 auto;
}
.feature-list p {
  margin-top: 6px;
  color: var(--muted);
  font-size: .95rem;
  max-width: 44ch;
}
@media (min-width: 700px) { .feature-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .feature-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---- Other devices ----------------------------------------------------- */
.soon {
  display: grid;
  gap: 12px;
  padding: 0 0 56px;
}
.soon-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-radius: 999px;
  border: 1px dashed var(--line);
}
.soon-item h3 { font-size: 1rem; font-weight: 650; }
.soon-item p {
  font-size: .85rem;
  color: var(--muted);
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--sunk);
  white-space: nowrap;
}
@media (min-width: 700px) { .soon { grid-template-columns: 1fr 1fr; } }

/* ---- FAQ --------------------------------------------------------------- */
.faq-list { max-width: 780px; }
.faq details {
  border-top: 1px solid var(--line);
}
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 2px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: 0 0 12px;
  height: 12px;
  background:
    linear-gradient(var(--text), var(--text)) center / 12px 2px no-repeat,
    linear-gradient(var(--text), var(--text)) center / 2px 12px no-repeat;
  transition: transform .25s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p {
  padding: 0 2px 20px;
  color: var(--muted);
  max-width: 64ch;
}
.faq a { color: var(--text); font-weight: 600; }

/* ---- Footer ------------------------------------------------------------ */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin: 0 16px;
  padding: 26px 0 34px;
  border-top: 1px solid var(--line);
  font-size: .9rem;
  color: var(--muted);
}
.foot-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--display);
  font-weight: 650;
}
.foot-brand .brand-mark { width: 30px; }
.foot a { color: var(--text); font-weight: 600; text-decoration: none; }
@media (min-width: 960px) { .foot { margin: 0 40px; } }

/* ---- Toast ------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  max-width: min(92vw, 440px);
  padding: 12px 18px;
  border-radius: 18px;
  background: var(--pill-ink-bg);
  color: var(--pill-ink-text);
  font-size: .92rem;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .4);
}
.toast[hidden] { display: none; }

/* ---- Reduced motion ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    animation: none !important;
  }
}
