/* ==========================================================================
   MedUp — medup.com.ng
   Colour and type tokens mirror lib/core/theme/ so the site and the app read
   as one product. Do not introduce raw hex values below the :root blocks.
   ========================================================================== */

:root {
  /* Brand ramp (teal-green) */
  --teal-50:  #E6F5F1;
  --teal-100: #C0E7DC;
  --teal-200: #95D7C5;
  --teal-300: #69C7AD;
  --teal-400: #44BA9B;
  --teal-500: #14AE8C;
  --teal-600: #0E9377;
  --teal-700: #0B7660;
  --teal-800: #085A49;
  --teal-900: #053B30;

  /* Neutral ramp */
  --n-0:   #FFFFFF;
  --n-50:  #F7F8F9;
  --n-100: #EDEFF2;
  --n-200: #DCE0E5;
  --n-300: #BFC6CF;
  --n-400: #98A2AE;
  --n-500: #6C7885;
  --n-600: #4E5964;
  --n-700: #39424B;
  --n-800: #232A31;
  --n-900: #151A1F;
  --n-950: #0D1114;

  /* Mastery tiers */
  --tier-not-started: #D3D8DE;
  --tier-attempted:   #E0A030;
  --tier-familiar:    #6FA8E8;
  --tier-stuffed:     #14AE8C;
  --tier-hyper:       #0B7660;
  --streak:           #F0803C;

  /* Semantic — light */
  --brand: var(--teal-600);
  --brand-strong: var(--teal-700);
  --brand-subtle: var(--teal-50);
  --on-brand: var(--n-0);
  --bg: var(--n-50);
  --surface: var(--n-0);
  --surface-subtle: var(--n-100);
  --border: var(--n-200);
  --border-strong: var(--n-300);
  --text: var(--n-900);
  --text-secondary: var(--n-600);
  --text-tertiary: var(--n-500);
  --tier-track: var(--n-100);
  --shadow-sm: 0 1px 2px rgba(13, 17, 20, .06), 0 1px 3px rgba(13, 17, 20, .05);
  --shadow-md: 0 4px 12px rgba(13, 17, 20, .07), 0 2px 4px rgba(13, 17, 20, .04);
  --shadow-lg: 0 18px 44px rgba(13, 17, 20, .12), 0 4px 10px rgba(13, 17, 20, .05);

  /* Spacing + radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;
  --gutter: clamp(20px, 5vw, 40px);
  --section-y: clamp(64px, 9vw, 112px);
  --max: 1140px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: var(--teal-400);
    --brand-strong: var(--teal-300);
    --brand-subtle: #0F2E28;
    --on-brand: var(--n-950);
    --bg: var(--n-950);
    --surface: var(--n-900);
    --surface-subtle: #1B2229;
    --border: #2C343C;
    --border-strong: #3E474F;
    --text: #F2F4F6;
    --text-secondary: var(--n-400);
    --text-tertiary: var(--n-500);
    --tier-track: #262E35;
    --tier-not-started: #3E474F;
    --tier-attempted: #D9A048;
    --tier-stuffed: var(--teal-400);
    --tier-hyper: var(--teal-200);
    --streak: #FF9A5C;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .45);
    --shadow-lg: 0 18px 44px rgba(0, 0, 0, .55);
  }
}

/* --- Reset ---------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--brand-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.02em; font-weight: 700; text-wrap: balance; }
p { text-wrap: pretty; }
ul, ol { padding-left: 1.25em; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: var(--on-brand);
  padding: 12px 20px; border-radius: 0 0 var(--r-md) 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Layout --------------------------------------------------------------- */

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.section--tint { background: var(--surface); border-block: 1px solid var(--border); }

.section-head { max-width: 46rem; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head h2 { font-size: clamp(1.85rem, 4vw, 2.6rem); margin-bottom: 14px; }
.section-head p { color: var(--text-secondary); font-size: 1.075rem; }

.eyebrow {
  display: inline-block;
  font-size: .78rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--brand-strong); margin-bottom: 14px;
}

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 26px; border-radius: var(--r-pill);
  font-size: 1rem; font-weight: 650; font-family: inherit;
  text-decoration: none; border: 1.5px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-md); }
.btn--primary:hover { background: var(--brand-strong); box-shadow: var(--shadow-lg); }

.btn--ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--surface-subtle); border-color: var(--brand); }

.btn--onbrand { background: var(--n-0); color: var(--teal-800); }
.btn--onbrand:hover { background: var(--teal-50); }

.btn--sm { padding: 10px 20px; font-size: .94rem; }
.btn svg { flex: none; }

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

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 68px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand span { font-size: 1.2rem; font-weight: 750; letter-spacing: -.03em; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav a {
  color: var(--text-secondary); text-decoration: none; font-size: .96rem; font-weight: 550;
}
.nav a:hover { color: var(--brand-strong); }
.header-cta { display: inline-flex; }

@media (max-width: 860px) {
  .nav { display: none; }
}
@media (max-width: 420px) {
  .header-cta { display: none; }
}

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

.hero {
  position: relative;
  padding-block: clamp(52px, 8vw, 96px) clamp(60px, 9vw, 104px);
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: -30% -20% auto -20%; height: 130%;
  background:
    radial-gradient(52% 46% at 78% 18%, color-mix(in srgb, var(--teal-500) 20%, transparent), transparent 68%),
    radial-gradient(46% 42% at 8% 6%, color-mix(in srgb, var(--teal-300) 16%, transparent), transparent 66%);
  pointer-events: none;
}
.hero .wrap {
  position: relative;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
@media (max-width: 940px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
}

.hero h1 {
  font-size: clamp(2.3rem, 6vw, 3.75rem);
  letter-spacing: -.035em;
  margin-bottom: 20px;
}
.hero h1 em { font-style: normal; color: var(--brand-strong); }
.hero-sub {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 34rem; margin-bottom: 30px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 26px; }

.badge-row {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 16px 8px 10px; border-radius: var(--r-pill);
  background: var(--brand-subtle); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
  font-size: .88rem; font-weight: 600; color: var(--brand-strong);
  margin-bottom: 22px;
}
.badge-row .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; margin-left: 6px;
}

.hero-notes {
  display: flex; flex-wrap: wrap; gap: 10px 22px;
  font-size: .9rem; color: var(--text-tertiary); list-style: none; padding: 0;
}
.hero-notes li { display: flex; align-items: center; gap: 7px; }
.hero-notes svg { color: var(--brand); }

/* --- Phone mock ----------------------------------------------------------- */

.hero-visual { display: flex; justify-content: center; }

.phone {
  width: min(310px, 82vw);
  border-radius: 38px;
  padding: 11px;
  background: linear-gradient(160deg, var(--n-800), var(--n-950));
  box-shadow: var(--shadow-lg);
  position: relative;
}
.phone::after {
  content: ""; position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
  width: 92px; height: 22px; border-radius: var(--r-pill); background: var(--n-950);
}
.phone-screen {
  background: var(--bg);
  border-radius: 28px;
  padding: 46px 16px 20px;
  display: grid; gap: 12px;
}

.mock-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 14px;
  box-shadow: var(--shadow-sm);
}
.mock-label {
  font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-tertiary); margin-bottom: 6px;
}
.mock-title { font-size: .98rem; font-weight: 700; margin-bottom: 3px; }
.mock-meta { font-size: .78rem; color: var(--text-secondary); }

.mock-next { display: flex; align-items: center; gap: 12px; }
.mock-next .grow { flex: 1 1 auto; min-width: 0; }
.mock-play {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand); color: var(--on-brand);
  display: grid; place-items: center;
}

.mock-ring { display: flex; align-items: center; gap: 14px; }
.mock-ring-figure { flex: none; position: relative; width: 76px; height: 76px; }
.mock-ring-figure figcaption {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
  font-size: .58rem; font-weight: 700; letter-spacing: .04em; color: var(--text-secondary);
  text-transform: uppercase;
}
.mock-ring-figure figcaption b { display: block; font-size: 1.12rem; letter-spacing: -.02em; color: var(--text); }

/* Segmented mastery bar — the core visual identity. Never a smooth fill. */
.mbar { display: flex; gap: 3px; height: 9px; margin-top: 9px; }
.mbar span { flex: 1; background: var(--tier-track); border-radius: 3px; overflow: hidden; }
.mbar span i { display: block; height: 100%; border-radius: 3px; }
.mbar .s1 i { background: var(--tier-attempted); }
.mbar .s2 i { background: var(--tier-familiar); }
.mbar .s3 i { background: var(--tier-stuffed); }
.mbar .s4 i { background: var(--tier-hyper); }

.mock-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mock-stat { text-align: center; }
.mock-stat b { display: block; font-size: 1.25rem; letter-spacing: -.02em; }
.mock-stat span { font-size: .7rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
.mock-stat .flame { color: var(--streak); }

/* --- Feature grid --------------------------------------------------------- */

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); }
.card h3 { font-size: 1.14rem; margin-bottom: 8px; }
.card p { color: var(--text-secondary); font-size: .97rem; }

.card-icon {
  width: 46px; height: 46px; border-radius: var(--r-md);
  background: var(--brand-subtle); color: var(--brand-strong);
  display: grid; place-items: center; margin-bottom: 18px;
}

/* --- Steps ---------------------------------------------------------------- */

.steps { counter-reset: step; display: grid; gap: 22px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 780px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-top: 8px; }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--brand); color: var(--on-brand);
  font-weight: 750; font-size: 1.05rem; margin-bottom: 16px;
}
.step h3 { font-size: 1.12rem; margin-bottom: 8px; }
.step p { color: var(--text-secondary); font-size: .97rem; }

/* --- Tier ladder ---------------------------------------------------------- */

.ladder { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 820px) { .ladder { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .ladder { grid-template-columns: 1fr; } }

.tier {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 20px 18px;
  border-top: 4px solid var(--tier-color, var(--tier-not-started));
}
.tier h3 { font-size: 1.02rem; margin-bottom: 6px; }
.tier p { font-size: .9rem; color: var(--text-secondary); }
.tier--0 { --tier-color: var(--tier-not-started); }
.tier--1 { --tier-color: var(--tier-attempted); }
.tier--2 { --tier-color: var(--tier-familiar); }
.tier--3 { --tier-color: var(--tier-stuffed); }
.tier--4 { --tier-color: var(--tier-hyper); }

/* --- Split feature -------------------------------------------------------- */

.split {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 64px); align-items: center;
}
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } }
.split h2 { font-size: clamp(1.7rem, 3.6vw, 2.3rem); margin-bottom: 16px; }
.split p { color: var(--text-secondary); margin-bottom: 16px; }

.ticks { list-style: none; padding: 0; display: grid; gap: 12px; }
.ticks li { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; font-size: .99rem; }
.ticks svg { color: var(--brand); margin-top: 3px; }
.ticks b { font-weight: 650; }

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: clamp(22px, 3vw, 32px);
  box-shadow: var(--shadow-md); display: grid; gap: 14px;
}
.panel-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; border-radius: var(--r-md);
  background: var(--surface-subtle);
}
.panel-row .icon {
  flex: none; width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; background: var(--surface); color: var(--brand-strong);
  border: 1px solid var(--border);
}
.panel-row .grow { flex: 1 1 auto; min-width: 0; }
.panel-row b { display: block; font-size: .96rem; }
.panel-row small { color: var(--text-secondary); font-size: .84rem; }
.pill {
  flex: none; font-size: .72rem; font-weight: 700; padding: 4px 10px;
  border-radius: var(--r-pill); background: var(--brand-subtle); color: var(--brand-strong);
}

/* --- Subjects ------------------------------------------------------------- */

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 9px 18px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border);
  font-size: .93rem; font-weight: 600;
}
.chip--soon { color: var(--text-tertiary); border-style: dashed; font-weight: 550; }

/* --- FAQ ------------------------------------------------------------------ */

.faq { display: grid; gap: 12px; max-width: 52rem; margin-inline: auto; }
.faq details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 4px 20px;
}
.faq details[open] { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.faq summary {
  cursor: pointer; list-style: none;
  padding: 16px 0; font-weight: 650; font-size: 1.02rem;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; font-size: 1.4rem; font-weight: 400; line-height: 1;
  color: var(--brand-strong); transition: transform .18s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding-bottom: 18px; color: var(--text-secondary); font-size: .97rem; }
.faq details p + p { padding-top: 0; margin-top: -8px; }

/* --- CTA band ------------------------------------------------------------- */

.cta-band {
  background: linear-gradient(140deg, var(--teal-700), var(--teal-900));
  color: var(--teal-50);
  text-align: center;
}
.cta-band h2 { font-size: clamp(1.9rem, 4.2vw, 2.7rem); color: var(--n-0); margin-bottom: 14px; }
.cta-band p { max-width: 40rem; margin: 0 auto 30px; color: var(--teal-100); font-size: 1.08rem; }
.cta-band .hero-actions { justify-content: center; margin-bottom: 18px; }
.cta-band small { color: var(--teal-200); font-size: .87rem; }

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

.site-footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding-block: 56px 34px; font-size: .93rem;
}
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; margin-bottom: 40px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-tertiary); margin-bottom: 14px;
}
.site-footer ul { list-style: none; padding: 0; display: grid; gap: 10px; }
.site-footer a { color: var(--text-secondary); text-decoration: none; }
.site-footer a:hover { color: var(--brand-strong); text-decoration: underline; }
.footer-about p { color: var(--text-secondary); max-width: 30rem; margin-top: 14px; }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 24px;
  display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between;
  color: var(--text-tertiary); font-size: .87rem;
}

/* --- Legal pages ---------------------------------------------------------- */

.legal { padding-block: clamp(44px, 6vw, 76px); }
.legal-inner { max-width: 46rem; margin-inline: auto; }
.legal h1 { font-size: clamp(2rem, 5vw, 2.7rem); margin-bottom: 10px; }
.legal .updated {
  color: var(--text-tertiary); font-size: .9rem; margin-bottom: 34px;
  padding-bottom: 24px; border-bottom: 1px solid var(--border);
}
.legal h2 {
  font-size: 1.32rem; margin-top: 44px; margin-bottom: 12px;
  scroll-margin-top: 90px;
}
.legal h3 { font-size: 1.04rem; margin-top: 26px; margin-bottom: 8px; }
.legal p, .legal li { color: var(--text-secondary); font-size: 1rem; }
.legal p { margin-bottom: 14px; }
.legal ul, .legal ol { display: grid; gap: 9px; margin-bottom: 18px; }
.legal strong { color: var(--text); font-weight: 650; }

.legal table {
  width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: .94rem;
}
.legal .table-scroll { overflow-x: auto; margin-bottom: 20px; }
.legal th, .legal td {
  text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.legal th { font-weight: 650; color: var(--text); white-space: nowrap; }
.legal td { color: var(--text-secondary); }

.callout {
  background: var(--brand-subtle);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
  border-radius: var(--r-md); padding: 20px 22px; margin-bottom: 24px;
}
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--brand-strong); }

.toc {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 22px 26px; margin-bottom: 40px;
}
.toc h2 { margin: 0 0 12px; font-size: .8rem; text-transform: uppercase; letter-spacing: .09em; color: var(--text-tertiary); }
.toc ol { margin: 0; display: grid; gap: 7px; }
.toc a { color: var(--text-secondary); text-decoration: none; }
.toc a:hover { color: var(--brand-strong); text-decoration: underline; }

/* --- 404 ------------------------------------------------------------------ */

.notfound { text-align: center; padding-block: clamp(70px, 12vw, 140px); }
.notfound .code {
  font-size: clamp(4rem, 14vw, 7rem); font-weight: 750; letter-spacing: -.05em;
  color: var(--brand); line-height: 1;
}
.notfound h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 12px 0 14px; }
.notfound p { color: var(--text-secondary); max-width: 32rem; margin: 0 auto 28px; }

@media print {
  .site-header, .site-footer, .cta-band, .toc { display: none; }
  body { background: #fff; color: #000; }
}
