/* Med Timer — medtimer.app
   One typeface (Archivo, variable width + weight). Width is the display device:
   headlines are set condensed and heavy, like the drug name on a pharmacy label;
   body text runs at normal width. Colours come from the app icon and its rings. */

@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/Archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: #f2f7f6;
  --paper-2: #e3eeec;
  --ink: #0f2c35;
  --ink-2: #4a6670;
  --teal: #00888a;
  --teal-ink: #006e70;
  --deep: #0b4a6b;
  --due: #e5484d;
  --line: #c9dbd8;
  --card: #ffffff;
  --phone: #0f2c35;
  --measure: 34rem;
  --wrap: 72rem;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #08262e;
    --paper-2: #0d3039;
    --ink: #e6f2f0;
    --ink-2: #9db8bd;
    --teal: #3cc4c1;
    --teal-ink: #5fd6d3;
    --deep: #7cc3e6;
    --due: #ff6b6f;
    --line: #1e4650;
    --card: #0f3540;
    --phone: #02161b;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  font-stretch: 100%;
}

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

a { color: var(--teal-ink); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--card); padding: 0.5rem 1rem; z-index: 10; }

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

.site-head { padding: 1.25rem 0; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.brand {
  display: flex; align-items: center; gap: 0.6rem;
  color: var(--ink); text-decoration: none;
  font-weight: 750; font-stretch: 88%; font-size: 1.2rem; letter-spacing: -0.01em;
}
.brand img { width: 36px; height: 36px; border-radius: 9px; }

.site-nav { display: flex; gap: 1.5rem; font-size: 0.95rem; }
.site-nav a { color: var(--ink-2); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

/* ---------- Type ---------- */

h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }

.display {
  font-size: clamp(3rem, 9vw, 6.4rem);
  font-stretch: 68%;
  font-weight: 850;
  line-height: 0.92;
  letter-spacing: -0.005em;
  word-spacing: 0.06em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-stretch: 72%;
  line-height: 0.98;
  letter-spacing: -0.01em;
  word-spacing: 0.05em;
  text-wrap: balance;
}

h3 { font-size: 1.25rem; font-stretch: 85%; line-height: 1.15; letter-spacing: -0.01em; }

.lede { font-size: clamp(1.15rem, 2vw, 1.35rem); line-height: 1.45; color: var(--ink-2); max-width: var(--measure); }

p { max-width: var(--measure); }

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

.hero { padding: clamp(2rem, 6vw, 5rem) 0 clamp(3rem, 8vw, 6rem); }
.hero .wrap {
  display: grid; gap: clamp(2.5rem, 6vw, 5rem);
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
}
.hero .lede { margin: 1.5rem 0 2rem; }

.get { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem; }
.get img { height: 54px; width: auto; }
.get small { color: var(--ink-2); font-size: 0.9rem; }

/* The live demo: one medication card from the app, working. */
.demo {
  background: var(--card);
  border-radius: 28px;
  padding: 1.75rem;
  box-shadow: 0 1px 0 var(--line), 0 30px 60px -30px rgba(11, 74, 107, 0.35);
  max-width: 24rem;
  justify-self: center;
  width: 100%;
}
.demo-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.demo-name { font-weight: 750; font-stretch: 90%; font-size: 1.2rem; line-height: 1.2; }
.demo-dose { color: var(--ink-2); font-size: 0.95rem; }

.ring { position: relative; width: min(15rem, 70vw); aspect-ratio: 1; margin: 1.5rem auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--paper-2); }
.ring .fill {
  stroke: var(--due);
  stroke-linecap: round;
  transition: stroke-dashoffset 1.1s cubic-bezier(.2,.7,.2,1), stroke 0.4s;
}
.demo[data-state="waiting"] .ring .fill { stroke: var(--teal); }

.ring-label {
  position: absolute; inset: 0;
  display: grid; place-content: center; text-align: center;
}
.ring-time {
  font-size: clamp(2.2rem, 7vw, 2.9rem);
  font-weight: 800; font-stretch: 75%;
  font-variant-numeric: tabular-nums; letter-spacing: -0.01em; line-height: 1;
}
.demo[data-state="due"] .ring-time { color: var(--due); }
.ring-sub { color: var(--ink-2); font-size: 0.9rem; margin-top: 0.4rem; }

.demo-actions { display: flex; gap: 0.75rem; }
.btn {
  appearance: none; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 1.05rem;
  padding: 0.85rem 1.4rem; border-radius: 999px;
  flex: 1;
}
.btn-take { background: var(--due); color: #fff; }
.demo[data-state="waiting"] .btn-take { background: var(--paper-2); color: var(--ink-2); }
.btn-undo { background: transparent; color: var(--teal-ink); flex: 0 0 auto; padding-inline: 0.75rem; }
.btn-undo[hidden] { display: none; }
.demo-note { color: var(--ink-2); font-size: 0.85rem; text-align: center; margin: 1rem auto 0; min-height: 1.3em; }

@media (prefers-reduced-motion: no-preference) {
  .demo[data-state="due"] .ring svg { animation: due 1.6s ease-in-out infinite; }
  @keyframes due { 50% { opacity: 0.55; } }
}

/* ---------- Section rhythm ---------- */

.section { padding: clamp(3.5rem, 9vw, 7rem) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section h2 { margin-bottom: 1.25rem; }

/* ---------- The course: a prescription list ---------- */

.course .wrap { display: grid; gap: 2.5rem 4rem; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: start; }

.label {
  background: var(--card);
  border-radius: 6px;
  border-left: 8px solid var(--teal);
  padding: 0.5rem 1.5rem;
  list-style: none; margin: 0;
}
.label li {
  display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px dashed var(--line);
}
.label li:last-child { border-bottom: 0; }
.rx-name { font-weight: 800; font-stretch: 78%; font-size: 1.35rem; line-height: 1.1; }
.rx-dose { color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }
.rx-how { grid-column: 1 / -1; font-size: 0.95rem; }
.rx-how b { font-weight: 650; color: var(--teal-ink); }

/* ---------- Walkthrough ---------- */

.walk .wrap { display: grid; gap: 3rem 5rem; grid-template-columns: auto minmax(0, 1fr); align-items: center; }

.phone {
  background: var(--phone);
  padding: 10px;
  border-radius: 46px;
  width: min(300px, 72vw);
  box-shadow: 0 40px 80px -40px rgba(11, 74, 107, 0.5);
}
.phone > * { border-radius: 37px; width: 100%; height: auto; aspect-ratio: 1320 / 2868; object-fit: cover; background: #fff; }

.steps { list-style: none; padding: 0; margin: 2rem 0 0; counter-reset: step; max-width: var(--measure); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.5rem 1fr; gap: 0 0.75rem; padding: 0.9rem 0; }
.steps li::before {
  content: counter(step);
  font-weight: 850; font-stretch: 70%; font-size: 2rem; line-height: 1; color: var(--teal);
}
.steps h3 { margin-bottom: 0.25rem; }
.steps p { margin: 0; color: var(--ink-2); }

/* ---------- Screens ---------- */

.screens-intro { display: flex; justify-content: space-between; align-items: end; gap: 1rem 3rem; flex-wrap: wrap; }
.screens-intro p { margin: 0; color: var(--ink-2); }

.strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(240px, 62vw);
  gap: 1.75rem;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 2.5rem var(--pad) 1.5rem;
  margin: 0 calc(-1 * var(--pad));
  scrollbar-width: thin;
}
.strip figure { margin: 0; scroll-snap-align: start; }
.strip .phone { width: 100%; padding: 7px; border-radius: 36px; box-shadow: none; }
.strip .phone > * { border-radius: 30px; }
.strip figcaption { margin-top: 1rem; font-size: 0.95rem; }
.strip figcaption b { display: block; font-weight: 750; font-stretch: 88%; font-size: 1.05rem; }
.strip figcaption span { color: var(--ink-2); }

/* ---------- Privacy ---------- */

.privacy { background: var(--deep); color: #fff; }
@media (prefers-color-scheme: dark) { .privacy { background: #0b3a48; } }
.privacy a { color: #9fe6e3; }
.privacy .wrap { display: grid; gap: 2rem 5rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.privacy .display { font-size: clamp(2.6rem, 7vw, 5rem); }
.privacy ul { margin: 0; padding: 0; list-style: none; }
.privacy li { padding: 0.9rem 0; border-bottom: 1px solid rgba(255,255,255,0.18); }
.privacy li:last-child { border-bottom: 0; }
.privacy li b { display: block; font-weight: 700; }
.privacy li span { color: rgba(255,255,255,0.78); }
.section.privacy + .section { border-top: 0; }

/* ---------- Closing + footer ---------- */

.closing { text-align: left; }
.closing .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 2rem; }

.site-foot { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; font-size: 0.9rem; color: var(--ink-2); }
.site-foot .wrap { display: grid; gap: 1rem 3rem; grid-template-columns: minmax(0, 1fr) auto; }
.site-foot p { margin: 0; }
.site-foot nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* ---------- Text pages (privacy, support) ---------- */

.page { padding: clamp(2rem, 6vw, 4rem) 0 5rem; }
.page .wrap { max-width: calc(var(--measure) + 2 * var(--pad) + 4rem); }
.page h1 { font-size: clamp(2.6rem, 8vw, 4.4rem); font-stretch: 70%; font-weight: 850; line-height: 0.95; margin-bottom: 0.75rem; }
.page h2 { font-size: 1.5rem; font-stretch: 82%; margin: 2.5rem 0 0.5rem; letter-spacing: -0.01em; }
.page .updated { color: var(--ink-2); font-size: 0.95rem; margin-top: 0; }
.page .summary { font-size: 1.25rem; line-height: 1.45; }
.faq dt { font-weight: 700; margin-top: 1.5rem; }
.faq dd { margin: 0.35rem 0 0; max-width: var(--measure); }
.note { border-left: 4px solid var(--teal); padding: 0.25rem 0 0.25rem 1rem; color: var(--ink-2); }

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
  .hero .wrap, .course .wrap, .walk .wrap, .privacy .wrap { grid-template-columns: 1fr; }
  .walk .phone { margin: 0 auto; }
  .walk .phone-col { order: 2; }
  .site-foot .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .site-nav { gap: 1rem; }
  .site-nav .nav-optional { display: none; }
  .demo { padding: 1.25rem; }
}
