:root {
  --paper: #faf8f2;
  --paper-raised: #ffffff;
  --ink: #1c231f;
  --muted: #5c655e;
  --hairline: #ded6c2;
  --brand-green: #2f4e46;
  --brand-green-soft: #e7ede9;
  --brand-gold: #ab8a44;
  --brand-gold-bright: #cfae5f;
  --link: #2f4e46;

  /* Masthead: deliberately fixed in both themes so the header always reads as
     the brand banner (matches the app icon / feature graphic). Defined only
     here on bare :root — never redefined in a dark block — because
     --brand-green itself flips to gold under dark mode. */
  --header-bg: #2f4e46;
  --header-fg: #cfae5f;
  --header-fg-soft: #ddc384;
  --header-fg-strong: #f4f0e4;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #171d1a;
    --paper-raised: #1f2622;
    --ink: #eef1ee;
    --muted: #a3aca4;
    --hairline: #3a453e;
    --brand-green: #cfae5f;
    --brand-green-soft: #262f29;
    --brand-gold: #d9bd76;
    --brand-gold-bright: #e6cd8f;
    --link: #d9bd76;
  }
}

:root[data-theme="dark"] {
  --paper: #171d1a;
  --paper-raised: #1f2622;
  --ink: #eef1ee;
  --muted: #a3aca4;
  --hairline: #3a453e;
  --brand-green: #cfae5f;
  --brand-green-soft: #262f29;
  --brand-gold: #d9bd76;
  --brand-gold-bright: #e6cd8f;
  --link: #d9bd76;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--brand-green-soft);
  background-image:
    radial-gradient(60rem 40rem at 12% 0%, color-mix(in srgb, var(--brand-gold-bright) 45%, transparent), transparent 60%),
    radial-gradient(55rem 42rem at 100% 8%, color-mix(in srgb, var(--brand-green) 38%, transparent), transparent 62%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper) 12%, var(--brand-green-soft) 100%);
  background-repeat: no-repeat, no-repeat, no-repeat;
  color: var(--ink);
  font-family: "Karla", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration-color: var(--hairline); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
a:focus-visible { outline: 2px solid var(--brand-gold-bright); outline-offset: 2px; border-radius: 2px; }

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

/* ---- shared header ---- */

.site-header {
  /* Full-bleed green band; the max() padding keeps the content itself on the
     same 900px measure as the rest of the page. */
  max-width: none;
  margin: 0 0 0 0;
  padding: 1.25rem max(1.5rem, calc((100% - 900px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--header-bg);
  border-bottom: 1px solid color-mix(in srgb, var(--header-fg) 28%, transparent);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.mark-img {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--header-fg) 40%, transparent), 0 6px 16px -6px rgba(0, 0, 0, 0.45);
}

.mark-name {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  /* -soft rather than -fg: the exact brand gold lands at 4.29:1 on the brand
     green, just under AA for this size/weight. Hierarchy is carried by the
     serif face and size instead of hue. */
  color: var(--header-fg-soft);
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.92rem;
}

.site-nav a { color: var(--header-fg-soft); text-decoration: none; }
.site-nav a:hover { color: var(--header-fg-strong); text-decoration-color: currentColor; }

/* ---- legal page layout (privacy / data-deletion) ---- */

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 1.5rem 6rem;
}

.page .mark { margin-bottom: 2.5rem; }

h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.1rem, 5vw, 2.6rem);
  line-height: 1.1;
  margin: 0 0 0.5rem;
  text-wrap: balance;
  color: var(--ink);
}

.updated {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 2.75rem;
}

.lede {
  font-size: 1.08rem;
  color: var(--ink);
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--hairline);
}

h2 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.3rem;
  margin: 2.75rem 0 0.9rem;
  color: var(--ink);
  text-wrap: balance;
}

h2::before {
  content: "";
  display: block;
  width: 2.25rem;
  height: 3px;
  border-radius: 2px;
  background: var(--brand-gold-bright);
  margin-bottom: 0.9rem;
}

h3 {
  font-family: "Karla", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin: 1.75rem 0 0.6rem;
  color: var(--ink);
}

p { margin: 0 0 1rem; color: var(--ink); }
.section p:last-child { margin-bottom: 0; }

ul { padding-left: 1.3rem; margin: 0 0 1rem; }
li { margin: 0.4rem 0; }

.callout {
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin: 0 0 1rem;
}
.callout p:last-child { margin-bottom: 0; }

.note {
  background: var(--brand-green-soft);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin: 0 0 1rem;
}
.note p:last-child { margin-bottom: 0; }

footer {
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.85rem;
  color: var(--muted);
}
footer a { color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  a { transition: text-decoration-color 0.15s ease; }
}

/* ---- home page ---- */

.home main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
  padding: 4rem 0 5rem;
  isolation: isolate;
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding: 2.5rem 0 3rem; gap: 2.5rem; }
}

.hero-glow {
  position: absolute;
  inset: -6rem -4rem auto -4rem;
  height: 32rem;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38rem 22rem at 12% 18%, color-mix(in srgb, var(--brand-gold-bright) 22%, transparent), transparent 60%),
    radial-gradient(30rem 24rem at 85% 8%, color-mix(in srgb, var(--brand-green) 16%, transparent), transparent 65%);
  filter: blur(2px);
}

.hero-badge {
  display: block;
  width: 100%;
  max-width: 27.5rem;
  height: auto;
  border-radius: 14px;
  margin-bottom: 1.75rem;
  box-shadow: 0 20px 38px -20px rgba(28, 35, 31, 0.55);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0.4rem 0.9rem 0.4rem 0.7rem;
  margin-bottom: 1.75rem;
}

.status-pill .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--brand-gold-bright);
}

.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.4rem);
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 46ch;
  margin: 1.25rem 0 2rem;
}

.hero-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 8px;
  padding: 0.75rem 1.3rem;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--brand-green);
  color: var(--paper);
}
.btn-primary:hover { opacity: 0.92; }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--hairline);
}
.btn-secondary:hover { border-color: var(--muted); }

.hero-links-note {
  margin-top: 1.1rem;
  font-size: 0.92rem;
}

.store-badge {
  position: relative;
  display: inline-flex;
  border-radius: 10px;
  box-shadow: 0 10px 22px -12px rgba(28, 35, 31, 0.45);
  transition: transform 0.15s ease;
}
.store-badge:hover { transform: translateY(-2px); }
.store-badge img {
  display: block;
  height: 54px;
  width: 182px;
  object-fit: contain;
}

.store-badge-disabled { cursor: default; }
.store-badge-disabled:hover { transform: none; }

.store-badge-soon {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--brand-gold-bright);
  color: var(--ink);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  box-shadow: 0 2px 6px -1px rgba(28, 35, 31, 0.4);
}

/* dose-card mockup, mirrors the in-app card */

.dose-card {
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 1.5rem 1.5rem 1.65rem;
  box-shadow: 0 24px 48px -28px rgba(28, 35, 31, 0.28);
}

.dose-card .compound {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.2rem;
  margin: 0 0 0.2rem;
}

.dose-card .category {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-gold);
  margin: 0 0 1.1rem;
}

.dose-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem 1rem;
  font-size: 0.94rem;
}

.dose-card dt {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding-top: 0.1rem;
}

.dose-card dd {
  margin: 0;
  font-weight: 600;
}

.dose-card hr {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 1rem 0;
}

/* feature grid */

.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
  padding: 1rem 0 4rem;
}

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

.feature {
  position: relative;
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 1.9rem 1.6rem 1.75rem;
  box-shadow: 0 18px 36px -22px rgba(28, 35, 31, 0.4);
  overflow: hidden;
}

.feature::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-gold-bright), var(--brand-green));
}

.feature-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--brand-green-soft);
  color: var(--brand-green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.feature-icon svg { width: 1.3rem; height: 1.3rem; }

.feature h3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}

.feature p { color: var(--muted); margin: 0; }

/* demo section */

.demo-band {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: 2rem;
  margin-bottom: 3rem;
  padding: 4rem 1.5rem;
  background: color-mix(in srgb, var(--brand-green-soft) 70%, transparent);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.demo-heading {
  max-width: 46ch;
  margin: 0 auto 1.75rem;
  text-align: center;
}

.demo-heading h2 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.8rem;
  margin: 0 0 0.5rem;
}

.demo-heading p { color: var(--muted); margin: 0; }

.demo-frame {
  max-width: 300px;
  margin: 0 auto;
  border-radius: 32px;
  overflow: hidden;
  border: 6px solid var(--ink);
  box-shadow: 0 36px 70px -28px rgba(28, 35, 31, 0.5), 0 0 0 1px var(--hairline);
  background: var(--ink);
  position: relative;
}

.demo-frame::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  height: 22px;
  background: var(--ink);
  border-radius: 0 0 14px 14px;
  z-index: 2;
}

.demo-frame video {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
}

.disclaimer-band {
  background: color-mix(in srgb, var(--brand-green-soft) 75%, transparent);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 2.75rem 0;
  margin-bottom: 4rem;
}

.disclaimer-band .inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.disclaimer-band h2 {
  margin: 0 0 0.5rem;
}

.disclaimer-band p {
  color: var(--muted);
  max-width: 60ch;
  margin: 0;
}

.site-footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer .footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.site-footer .footer-links a { color: var(--muted); }
.site-footer .copyright { border-top: 1px solid var(--hairline); padding-top: 1.5rem; }
