/* CareDuo site styles.
   Visual direction follows PRD §43: calm ground, restrained cards, strong
   typographic hierarchy, a subtle blue/teal primary, muted green for success
   and a restrained amber for a missed state. No neon, no glass, no gradient
   pile-ups, and nothing that reads as clinical hospital software.
   The system font stack is deliberate: it matches iOS, and it costs no
   network request, which is the cheapest performance win a marketing site has. */

:root {
  --brand:        #2E7D8F;
  --brand-deep:   #1D5C6B;
  --brand-soft:   #E4F0F2;
  --success:      #4E8D6E;
  --success-soft: #E6F0EA;
  --attention:    #B57A2A;
  --attention-soft:#F7EEDF;

  --ink:          #14262B;
  --ink-2:        #3C5158;
  --muted:        #63797F;
  --line:         #E1E7E8;
  --bg:           #FBFCFC;
  --surface:      #FFFFFF;
  --surface-2:    #F4F7F8;

  --radius:       14px;
  --radius-lg:    22px;
  --shadow:       0 1px 2px rgba(20, 38, 43, .05), 0 8px 24px rgba(20, 38, 43, .05);
  --maxw:         1120px;
  --maxw-narrow:  760px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand:        #6FBECD;
    --brand-deep:   #A7D9E3;
    --brand-soft:   #16333B;
    --success:      #7CB79A;
    --success-soft: #17302A;
    --attention:    #D7A65C;
    --attention-soft:#33291A;

    --ink:          #EAF1F2;
    --ink-2:        #C2D2D6;
    --muted:        #93A8AE;
    --line:         #23414A;
    --bg:           #0F2E36;
    --surface:      #14383F;
    --surface-2:    #123239;
    --shadow:       0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .22);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); font-weight: 700; letter-spacing: -.03em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); font-weight: 650; margin-top: 2.2em; }
h3 { font-size: 1.2rem; font-weight: 640; margin-top: 1.8em; }
p  { margin: 0 0 1.1em; color: var(--ink-2); }
a  { color: var(--brand-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand); }
strong { color: var(--ink); font-weight: 640; }
small { font-size: .875rem; }
img { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: var(--maxw-narrow); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--surface); color: var(--ink); padding: 12px 18px; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

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

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: .975rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-deep); color: #fff; }
@media (prefers-color-scheme: dark) {
  .btn--primary { color: #08222A; }
  .btn--primary:hover { color: #08222A; }
}
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn--pending {
  background: var(--surface); color: var(--ink-2); border: 1px dashed var(--line);
  cursor: default; font-weight: 580;
}
.btn--sm { padding: 9px 16px; font-size: .9rem; }
.btn__icon { width: 15px; height: 15px; opacity: .7; }

/* --- Header --------------------------------------------------------------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.navbar__inner { display: flex; align-items: center; gap: 20px; height: 66px; }
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--brand-deep); text-decoration: none; }
.logo__mark { width: 27px; height: 27px; flex: none; }
.logo__word { font-size: 1.14rem; font-weight: 680; letter-spacing: -.025em; color: var(--ink); }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 10px; flex: 1; }
.nav-links > a, .nav-dropdown__toggle {
  font: inherit; font-size: .95rem; font-weight: 540; color: var(--ink-2);
  background: none; border: 0; padding: 8px 12px; border-radius: 9px;
  text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.nav-links > a:hover, .nav-dropdown__toggle:hover { background: var(--surface-2); color: var(--ink); }
.nav-dropdown { position: relative; }
.nav-dropdown__toggle svg { width: 11px; height: 11px; opacity: .6; }
.nav-dropdown__menu { display: none; position: absolute; top: calc(100% + 8px); left: 0; }
.nav-dropdown__toggle[aria-expanded="true"] + .nav-dropdown__menu { display: block; }
.nav-dropdown__menu-inner {
  min-width: 320px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px;
}
.nav-dropdown__item { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.nav-dropdown__item:hover { background: var(--surface-2); }
.nav-dropdown__item strong { display: block; color: var(--ink); font-size: .93rem; font-weight: 620; }
.nav-dropdown__item span { display: block; color: var(--muted); font-size: .845rem; line-height: 1.45; }

.nav-cta { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.hamburger { display: none; flex-direction: column; gap: 4px; background: none; border: 0; padding: 8px; cursor: pointer; }
.hamburger span { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; }

.mobile-nav {
  position: fixed; inset: 0; z-index: 60; background: var(--bg);
  padding: 20px 24px 48px; overflow-y: auto;
}
.mobile-nav__head { display: flex; align-items: center; justify-content: space-between; height: 46px; margin-bottom: 12px; }
.mobile-nav__close { background: none; border: 0; font-size: 2rem; line-height: 1; color: var(--ink); cursor: pointer; }
.mobile-nav nav a { display: block; padding: 11px 0; color: var(--ink); text-decoration: none; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
.mobile-nav__group { margin: 22px 0 4px; font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 650; }

@media (max-width: 940px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
}
@media (max-width: 480px) {
  .nav-cta .btn { display: none; }
}

/* --- Hero ----------------------------------------------------------------- */
.hero { padding: clamp(56px, 9vw, 104px) 0 clamp(40px, 6vw, 72px); }
.hero__grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero h1 { margin-bottom: .35em; }
.hero .lede { font-size: clamp(1.06rem, 1.9vw, 1.25rem); color: var(--ink-2); max-width: 34em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; align-items: center; }
.hero__note { font-size: .9rem; color: var(--muted); margin: 14px 0 0; }
.eyebrow {
  font-size: .8rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase;
  color: var(--brand); margin: 0 0 14px;
}
.lede { font-size: 1.14rem; color: var(--ink-2); }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
}

/* --- Phone mock ----------------------------------------------------------- */
.phone {
  width: 100%; max-width: 320px; margin-inline: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 34px;
  box-shadow: var(--shadow); padding: 16px 14px 20px;
}
.phone__bar { display: flex; justify-content: space-between; font-size: .74rem; color: var(--muted); padding: 0 6px 10px; }
.phone__title { font-size: 1.32rem; font-weight: 680; letter-spacing: -.025em; padding: 4px 6px 2px; }
.phone__sub { font-size: .85rem; color: var(--muted); padding: 0 6px 14px; }
.dose {
  display: flex; align-items: center; gap: 12px; padding: 13px 12px; margin-bottom: 9px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
}
.dose__time { font-size: .8rem; color: var(--muted); width: 52px; flex: none; font-variant-numeric: tabular-nums; }
.dose__name { font-size: .95rem; font-weight: 600; color: var(--ink); line-height: 1.3; }
.dose__meta { font-size: .8rem; color: var(--muted); }
.pill { margin-left: auto; font-size: .74rem; font-weight: 650; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill--taken { background: var(--success-soft); color: var(--success); }
.pill--due { background: var(--brand-soft); color: var(--brand-deep); }
.pill--missed { background: var(--attention-soft); color: var(--attention); }
.pill--later  { background: var(--surface-2); color: var(--muted); }

/* --- Sections ------------------------------------------------------------- */
.section { padding: clamp(48px, 7vw, 88px) 0; }
.section--tint { background: var(--surface-2); border-block: 1px solid var(--line); }
.section__head { max-width: 42em; margin-bottom: 44px; }
.section__head h2 { margin-top: 0; }

.grid { display: grid; gap: 20px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 26px 24px; text-decoration: none; display: block; color: inherit;
}
a.card:hover { border-color: var(--brand); }
.card h3 { margin: 0 0 .45em; font-size: 1.08rem; }
.card p { margin: 0; font-size: .955rem; color: var(--ink-2); }
.card__icon {
  width: 38px; height: 38px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-deep);
  display: grid; place-items: center; margin-bottom: 16px;
}
.card__icon svg { width: 20px; height: 20px; }
.card__more { display: inline-block; margin-top: 14px; font-size: .9rem; font-weight: 600; color: var(--brand-deep); }

/* Numbered steps */
.steps { counter-reset: step; display: grid; gap: 8px; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 18px; padding: 20px 0; border-top: 1px solid var(--line); }
.step:last-child { border-bottom: 1px solid var(--line); }
.step::before {
  counter-increment: step; content: counter(step);
  width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-deep);
  display: grid; place-items: center; font-weight: 680; font-size: .92rem;
}
.step h3 { margin: 3px 0 .3em; font-size: 1.06rem; }
.step p { margin: 0; font-size: .96rem; }

/* Pull quote / principle band */
.principle {
  border-left: 3px solid var(--brand); padding: 6px 0 6px 22px; margin: 2.2rem 0;
  font-size: 1.16rem; line-height: 1.5; color: var(--ink); font-weight: 540;
}

/* Comparison + spec tables */
.table-wrap { overflow-x: auto; margin: 1.6rem 0; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 650; color: var(--ink); font-size: .87rem; letter-spacing: .01em; }
tbody tr:last-child td { border-bottom: 0; }

/* --- Prose pages ---------------------------------------------------------- */
.prose-page { padding: clamp(30px, 5vw, 56px) 0 clamp(40px, 6vw, 72px); }
.page-head { margin-bottom: 2.2rem; }
.page-head h1 { margin-bottom: .3em; }
.prose-page ul, .prose-page ol { color: var(--ink-2); padding-left: 1.25em; margin: 0 0 1.2em; }
.prose-page li { margin-bottom: .5em; }
.prose-page li::marker { color: var(--brand); }
.prose-page--legal { font-size: 16px; }
.legal-date { color: var(--muted); font-size: .92rem; }
.prose-page--legal h2 { font-size: 1.3rem; }

.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 1.6rem; font-size: .87rem; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--line); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); text-decoration: underline; }

.note {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin: 1.8rem 0;
}
.note p:last-child { margin-bottom: 0; }
.note strong { display: block; margin-bottom: .3em; }

/* --- FAQ ------------------------------------------------------------------ */
.faq { border-top: 1px solid var(--line); margin: 1.4rem 0 0; }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary {
  cursor: pointer; padding: 17px 34px 17px 0; font-weight: 600; color: var(--ink);
  list-style: none; position: relative;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 1.3rem; font-weight: 400; color: var(--muted);
}
.faq__item[open] summary::after { content: "\2212"; }
.faq__answer { padding: 0 0 18px; }
.faq__answer p:last-child { margin-bottom: 0; }

/* --- CTA banner + footer -------------------------------------------------- */
.cta-banner { background: var(--surface-2); border-top: 1px solid var(--line); padding: clamp(48px, 7vw, 80px) 0; text-align: center; }
.cta-banner h2 { margin-top: 0; }
.cta-banner p { max-width: 46em; margin-inline: auto; }
.cta-banner__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

.footer { border-top: 1px solid var(--line); padding: 56px 0 36px; background: var(--bg); }
.footer__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.footer__brand p { font-size: .93rem; color: var(--muted); max-width: 30em; }
.footer__disclaimer { font-size: .85rem !important; margin-top: 1em; }
.footer__col h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0 0 12px; font-weight: 650; }
.footer__col ul { list-style: none; padding: 0; margin: 0; }
.footer__col li { margin-bottom: 9px; }
.footer__col a { font-size: .93rem; color: var(--ink-2); text-decoration: none; }
.footer__col a:hover { color: var(--brand); text-decoration: underline; }
.footer__base {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  border-top: 1px solid var(--line); margin-top: 40px; padding-top: 22px;
}
.footer__base p { margin: 0; font-size: .88rem; color: var(--muted); }
@media (max-width: 860px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer__grid { grid-template-columns: 1fr; } }

/* --- Blog ----------------------------------------------------------------- */
.post-list { border-top: 1px solid var(--line); }
.post-card { padding: 28px 0; border-bottom: 1px solid var(--line); }
.post-card__date { font-size: .84rem; color: var(--muted); margin: 0 0 8px; }
.post-card h2 { font-size: 1.32rem; margin: 0 0 .4em; line-height: 1.3; }
.post-card h2 a { color: var(--ink); text-decoration: none; }
.post-card h2 a:hover { color: var(--brand-deep); }
.post-card p { margin: 0; font-size: .97rem; color: var(--ink-2); }
.post-card .card__more { margin-top: 12px; }
