/* ============================================================
   NEPHROZAYAN — Design System
   Editorial Clinical • Warm authority • Globally accessible
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }

/* ---- Design Tokens ---- */
:root {
  /* Color — refined to match the brand mark (NephroZayan logo) */
  /* Deep Navy — kidneys + "Nephro" wordmark */
  --navy-900: #061A3D;
  --navy-800: #0E2A5E;
  --navy-700: #1A3D7A;
  --navy-100: #DCE4F2;
  --navy-50:  #EEF2F8;

  /* Brand Teal — "Zayan" wordmark + book accents */
  --teal-900: #0A3540;
  --teal-800: #155E70;
  --teal-700: #1F7B8E;
  --teal-600: #2B95AB;
  --teal-100: #DCEEF2;
  --teal-50:  #EEF6F8;

  /* Brand Green — human figures + Arabic wordmark */
  --green-800: #2A6B47;
  --green-700: #3A8B5F;
  --green-600: #4FA378;
  --green-100: #DDEEE2;

  /* Brand Gold — ".org" + globe arcs + Arabic dashes */
  --gold-800: #9B7641;
  --gold-700: #B08358;
  --gold-600: #C89B5B;
  --gold-500: #D4AC6E;
  --gold-100: #F6EBDB;

  /* Legacy aliases for existing components (sage / coral mapped to brand) */
  --sage-700: var(--green-700);
  --sage-600: var(--green-600);
  --sage-500: #7AB994;
  --sage-100: var(--green-100);
  --coral-700: var(--gold-700);
  --coral-600: var(--gold-600);
  --coral-500: var(--gold-500);
  --coral-100: var(--gold-100);

  --cream:    #FAF7F2;
  --cream-2:  #F2EDE3;
  --paper:    #FFFFFF;

  --slate-900: #0E1822;
  --slate-800: #1A2332;
  --slate-700: #2D3A4B;
  --slate-600: #475569;
  --slate-500: #6B7B8C;
  --slate-400: #94A3B5;
  --slate-300: #CBD5E0;
  --slate-200: #E2E8F0;
  --slate-100: #F1F5F9;

  /* Semantic tokens */
  --color-bg: var(--cream);
  --color-surface: var(--paper);
  --color-ink: var(--slate-800);
  --color-muted: var(--slate-500);
  --color-line: var(--slate-200);
  --color-brand: var(--navy-800);          /* primary — deep navy */
  --color-brand-soft: var(--navy-50);
  --color-brand-2: var(--teal-700);        /* secondary — Zayan teal */
  --color-accent: var(--gold-600);         /* warm accent */
  --color-eco: var(--green-700);           /* sustainability/growth */

  /* Typography */
  --font-display: 'Fraunces', 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  --font-arabic: 'IBM Plex Sans Arabic', 'Noto Sans Arabic', sans-serif;

  /* Type scale (1.25 — modular) */
  --fs-xs:   0.78rem;
  --fs-sm:   0.875rem;
  --fs-base: 1rem;
  --fs-md:   1.125rem;
  --fs-lg:   1.375rem;
  --fs-xl:   1.75rem;
  --fs-2xl:  2.25rem;
  --fs-3xl:  3rem;
  --fs-4xl:  4rem;
  --fs-5xl:  5.25rem;

  /* Spacing (4pt grid) */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem;
  --s-5: 1.5rem; --s-6: 2rem; --s-7: 3rem; --s-8: 4rem;
  --s-9: 6rem;  --s-10: 8rem;

  /* Radius */
  --r-sm: 4px; --r-md: 8px; --r-lg: 14px; --r-xl: 24px; --r-pill: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(14, 42, 94, 0.04);
  --shadow-md: 0 4px 18px rgba(14, 42, 94, 0.08);
  --shadow-lg: 0 18px 48px rgba(14, 42, 94, 0.12);

  /* Layout */
  --container: 1240px;
  --container-narrow: 880px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast: 180ms;
  --dur: 320ms;
  --dur-slow: 600ms;
}

/* ---- Body ---- */
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--color-ink);
  background: var(--color-bg);
  min-height: 100vh;
  font-weight: 400;
}

[dir="rtl"] body { font-family: var(--font-arabic); }

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--slate-900);
  font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 0;
}

h1 { font-size: clamp(var(--fs-3xl), 6vw, var(--fs-5xl)); font-weight: 400; }
h2 { font-size: clamp(var(--fs-2xl), 4vw, var(--fs-4xl)); font-weight: 400; }
h3 { font-size: clamp(var(--fs-xl), 3vw, var(--fs-2xl)); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); font-family: var(--font-body); font-weight: 600; letter-spacing: 0; }
h6 { font-size: var(--fs-sm); font-family: var(--font-body); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-muted); }

p { font-size: var(--fs-md); line-height: 1.65; color: var(--slate-700); max-width: 68ch; }
small { font-size: var(--fs-sm); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-brand);
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.display-serif { font-family: var(--font-display); font-style: italic; font-weight: 300; }

/* ---- Layout ---- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--s-5); }
.container--narrow { max-width: var(--container-narrow); }

section { padding: var(--s-9) 0; }
.section-tight { padding: var(--s-7) 0; }

/* ---- Nav ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 242, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
}
.nav.scrolled { border-bottom-color: var(--color-line); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: var(--s-6);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-display);
  font-size: clamp(var(--fs-md), 2.2vw, var(--fs-lg));
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--navy-800);
  font-variation-settings: "opsz" 144, "SOFT" 30;
  line-height: 1;
}
.brand__nephro { color: var(--navy-800); }
.brand__zayan { color: var(--teal-700); }
.brand__mark {
  width: 42px; height: 42px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.brand__mark img { width: 100%; height: auto; object-fit: contain; display: block; }
@media (max-width: 420px) {
  .brand { font-size: var(--fs-base); gap: var(--s-2); }
  .brand__mark { width: 36px; height: 36px; }
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  list-style: none;
}
.nav__menu a {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--slate-700);
  position: relative;
  padding: var(--s-2) 0;
  transition: color var(--dur-fast) var(--ease);
}
.nav__menu a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 4px;
  height: 1px;
  background: var(--color-brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.nav__menu a:hover { color: var(--color-brand); }
.nav__menu a:hover::after { transform: scaleX(1); }
.nav__menu a.active { color: var(--color-brand); }
.nav__menu a.active::after { transform: scaleX(1); }

/* Calculator link — flagged as external since it leaves the main domain.
   Slightly emphasised so it reads as a destination, not a content page. */
.nav__menu a.nav__calc {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-secondary);
  font-weight: 600;
}
.nav__menu a.nav__calc:hover { color: var(--color-brand); }
.nav__calc-icon {
  opacity: 0.7;
  margin-top: -1px;
  transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.nav__menu a.nav__calc:hover .nav__calc-icon {
  opacity: 1;
  transform: translate(1px, -1px);
}

.nav__toggle {
  display: none;
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
}

/* Search trigger button in nav */
.nav__search-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3) var(--s-2) var(--s-3);
  margin-left: var(--s-3);
  background: var(--paper);
  border: 1px solid var(--color-line);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  color: var(--color-muted);
  transition: all var(--dur-fast) var(--ease);
  cursor: pointer;
}
.nav__search-trigger:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
}
.nav__search-trigger svg { width: 16px; height: 16px; }
.nav__search-trigger kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 5px;
  background: var(--cream-2);
  border-radius: 3px;
  color: var(--color-muted);
  border: 1px solid var(--color-line);
}
@media (max-width: 880px) {
  .nav__search-trigger { padding: var(--s-2); }
  .nav__search-trigger span, .nav__search-trigger kbd { display: none; }
}
.nav__toggle span {
  width: 22px; height: 1.5px;
  background: var(--slate-800);
  position: relative;
}
.nav__toggle span::before,
.nav__toggle span::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 1.5px;
  background: currentColor;
}
.nav__toggle span::before { top: -7px; }
.nav__toggle span::after { top: 7px; }

@media (max-width: 880px) {
  .nav__menu { display: none; }
  .nav__menu.open {
    display: flex;
    position: absolute;
    top: 76px; left: 0; right: 0;
    flex-direction: column;
    padding: var(--s-5);
    background: var(--cream);
    border-bottom: 1px solid var(--color-line);
    gap: var(--s-4);
  }
  .nav__toggle { display: flex; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
}
.btn--primary {
  background: var(--color-brand);
  color: var(--paper);
}
.btn--primary:hover {
  background: var(--teal-900);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn--ghost {
  background: transparent;
  color: var(--color-brand);
  border-color: var(--color-brand);
}
.btn--ghost:hover { background: var(--color-brand); color: var(--paper); }
.btn--text {
  padding: var(--s-2) 0;
  color: var(--color-brand);
  border-radius: 0;
  border-bottom: 1px solid var(--color-brand);
}
.btn--text:hover { gap: var(--s-3); }

.arrow {
  display: inline-block;
  transition: transform var(--dur) var(--ease);
}
.btn:hover .arrow { transform: translateX(4px); }

/* ---- Hero ---- */
.hero {
  position: relative;
  padding: var(--s-10) 0 var(--s-9);
  overflow: hidden;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--s-8);
  align-items: center;
}
@media (max-width: 980px) {
  .hero__inner { grid-template-columns: 1fr; }
}

.hero__copy h1 {
  margin-top: var(--s-5);
  margin-bottom: var(--s-5);
}
.hero__copy h1 em {
  font-style: italic;
  color: var(--color-brand);
  font-weight: 300;
}
.hero__lede {
  font-size: clamp(var(--fs-md), 1.6vw, var(--fs-lg));
  color: var(--slate-700);
  line-height: 1.55;
  margin-bottom: var(--s-6);
  max-width: 56ch;
}
.hero__cta {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
}

/* Hero visual — animated atmosphere with featured logo */
.hero__visual {
  position: relative;
  aspect-ratio: 4/5;
  background: linear-gradient(135deg, var(--navy-50) 0%, var(--teal-50) 50%, var(--gold-100) 100%);
  border-radius: var(--r-xl);
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: var(--s-6);
}
.hero__visual::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle at 30% 30%, rgba(200, 155, 91, 0.10), transparent 50%),
              radial-gradient(circle at 70% 70%, rgba(58, 139, 95, 0.14), transparent 50%),
              radial-gradient(circle at 50% 90%, rgba(31, 123, 142, 0.12), transparent 55%);
  animation: drift 20s ease-in-out infinite alternate;
  pointer-events: none;
}
.hero__visual::after {
  content: "";
  position: absolute;
  width: 280px; height: 280px;
  border-radius: 50%;
  border: 1px solid rgba(14, 42, 94, 0.08);
  animation: pulseRing 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes drift {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(5%, -5%) rotate(8deg); }
}
@keyframes pulseRing {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 0.15; }
}
.hero__svg {
  position: relative;
  width: 85%;
  max-width: 460px;
  z-index: 1;
  filter: drop-shadow(0 10px 30px rgba(14, 42, 94, 0.12));
}

/* ---- Trust strip ---- */
.trust {
  padding: var(--s-6) 0;
  background: var(--paper);
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
}
.trust__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-6);
  flex-wrap: wrap;
}
.trust__label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-muted);
  font-weight: 600;
}
.trust__items {
  display: flex;
  gap: var(--s-7);
  list-style: none;
  flex-wrap: wrap;
}
.trust__items li {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  color: var(--slate-700);
  font-style: italic;
  font-weight: 300;
}

/* ---- Feature grid ---- */
.features {
  background: var(--paper);
}
.features__head {
  max-width: 720px;
  margin-bottom: var(--s-8);
}
.features__head h2 { margin: var(--s-4) 0; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--s-5);
}
.feature {
  position: relative;
  padding: var(--s-6);
  background: var(--cream);
  border-radius: var(--r-lg);
  border: 1px solid transparent;
  transition: all var(--dur) var(--ease);
  display: flex;
  flex-direction: column;
  min-height: 260px;
}
.feature:hover {
  border-color: var(--color-line);
  background: var(--paper);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.feature--lg { grid-column: span 8; min-height: 340px; }
.feature--md { grid-column: span 6; }
.feature--sm { grid-column: span 4; }
@media (max-width: 880px) {
  .feature--lg, .feature--md, .feature--sm { grid-column: span 12; }
}

.feature__icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  background: var(--color-brand);
  color: var(--paper);
  border-radius: var(--r-md);
  margin-bottom: var(--s-5);
}
.feature__icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.feature__icon--sage { background: var(--sage-600); }
.feature__icon--coral { background: var(--coral-600); }
.feature__icon--gold { background: var(--gold-600); }

.feature h3 { font-size: var(--fs-xl); margin-bottom: var(--s-3); }
.feature p { font-size: var(--fs-base); color: var(--slate-600); margin-bottom: var(--s-4); flex: 1; }
.feature__link {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-brand);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.feature__link:hover { gap: var(--s-3); }

.feature__tag {
  position: absolute;
  top: var(--s-5); right: var(--s-5);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-700);
  padding: var(--s-1) var(--s-3);
  background: var(--gold-100);
  border-radius: var(--r-pill);
}

/* ---- Two column quote / stat ---- */
.mission {
  background: var(--teal-900);
  color: var(--cream);
  position: relative;
  overflow: hidden;
}
.mission::before {
  content: "";
  position: absolute;
  top: -20%; right: -10%;
  width: 60%; height: 140%;
  background: radial-gradient(circle, rgba(122, 158, 126, 0.18), transparent 60%);
  pointer-events: none;
}
.mission__inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--s-8);
  align-items: center;
  position: relative;
}
@media (max-width: 880px) {
  .mission__inner { grid-template-columns: 1fr; }
}
.mission h2 { color: var(--cream); margin-bottom: var(--s-5); }
.mission h2 em { color: var(--sage-500); font-style: italic; font-weight: 300; }
.mission p { color: rgba(250, 247, 242, 0.78); font-size: var(--fs-md); }
.mission__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-6);
}
.stat {
  padding: var(--s-5) 0;
  border-top: 1px solid rgba(250, 247, 242, 0.18);
}
.stat__num {
  font-family: var(--font-display);
  font-size: clamp(var(--fs-2xl), 4vw, var(--fs-4xl));
  font-weight: 300;
  color: var(--sage-500);
  line-height: 1;
  font-variation-settings: "SOFT" 100;
}
.stat__label {
  font-size: var(--fs-sm);
  color: rgba(250, 247, 242, 0.7);
  margin-top: var(--s-2);
}

/* ---- Page header ---- */
.page-header {
  padding: var(--s-9) 0 var(--s-7);
  border-bottom: 1px solid var(--color-line);
  position: relative;
  background: linear-gradient(to bottom, var(--cream) 0%, var(--paper) 100%);
}
.page-header__inner { max-width: var(--container-narrow); margin: 0 auto; }
.page-header h1 { margin: var(--s-5) 0 var(--s-4); }
.page-header p { font-size: var(--fs-md); color: var(--slate-600); }

.breadcrumb {
  display: flex;
  gap: var(--s-3);
  align-items: center;
  font-size: var(--fs-sm);
  color: var(--color-muted);
}
.breadcrumb a:hover { color: var(--color-brand); }
.breadcrumb__sep { opacity: 0.4; }

/* ---- Calculator widget ---- */
.calc {
  background: var(--paper);
  border: 1px solid var(--color-line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.calc__header {
  padding: var(--s-5) var(--s-6);
  background: var(--teal-50);
  border-bottom: 1px solid var(--color-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.calc__title { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 500; color: var(--slate-900); }
.calc__source { font-size: var(--fs-xs); color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.calc__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
@media (max-width: 760px) {
  .calc__body { grid-template-columns: 1fr; }
}
.calc__inputs { padding: var(--s-6); border-right: 1px solid var(--color-line); }
.calc__result { padding: var(--s-6); background: var(--cream); display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 760px) {
  .calc__inputs { border-right: none; border-bottom: 1px solid var(--color-line); }
}

.field { margin-bottom: var(--s-5); }
.field:last-child { margin-bottom: 0; }
.field label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: var(--s-2);
}
.field input, .field select {
  width: 100%;
  padding: var(--s-3) var(--s-4);
  background: var(--paper);
  border: 1px solid var(--color-line);
  border-radius: var(--r-md);
  font-size: var(--fs-base);
  transition: border-color var(--dur-fast) var(--ease);
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px var(--teal-50);
}
.field__hint {
  font-size: var(--fs-xs);
  color: var(--color-muted);
  margin-top: var(--s-2);
}

.radio-group {
  display: flex;
  gap: var(--s-2);
  background: var(--cream);
  padding: 4px;
  border-radius: var(--r-md);
}
.radio-group input { display: none; }
.radio-group label {
  flex: 1;
  text-align: center;
  padding: var(--s-2) var(--s-3);
  border-radius: 6px;
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--slate-600);
  margin-bottom: 0;
  transition: all var(--dur-fast) var(--ease);
}
.radio-group input:checked + label {
  background: var(--paper);
  color: var(--color-brand);
  box-shadow: var(--shadow-sm);
}

.result__label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  font-weight: 600;
  margin-bottom: var(--s-2);
}
.result__value {
  font-family: var(--font-mono);
  font-size: clamp(var(--fs-3xl), 5vw, var(--fs-4xl));
  font-weight: 500;
  color: var(--slate-900);
  line-height: 1;
  letter-spacing: -0.02em;
}
.result__unit {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  color: var(--color-muted);
  font-weight: 400;
  margin-left: var(--s-2);
}
.result__stage {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-top: var(--s-4);
}
.result__stage::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stage-g1 { color: #1f7a3e; background: #e1f3e7; }
.stage-g2 { color: #4d7a1f; background: #ecf3df; }
.stage-g3a{ color: #8b6c1f; background: #f9eece; }
.stage-g3b{ color: #b8551f; background: #fae0cb; }
.stage-g4 { color: #a8341f; background: #f9d6cc; }
.stage-g5 { color: #7a1f1f; background: #f0bbb1; }

.result__note {
  font-size: var(--fs-sm);
  color: var(--slate-600);
  margin-top: var(--s-5);
  padding-top: var(--s-5);
  border-top: 1px solid var(--color-line);
}

/* ---- Guideline cards ---- */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s-5);
}
.guide-card {
  padding: var(--s-6);
  background: var(--paper);
  border: 1px solid var(--color-line);
  border-radius: var(--r-lg);
  transition: all var(--dur) var(--ease);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
.guide-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-brand);
  box-shadow: var(--shadow-md);
}
.guide-card__topic {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-brand);
  font-weight: 700;
}
.guide-card h3 { font-size: var(--fs-lg); }
.guide-card__meta {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--color-muted);
  padding-top: var(--s-3);
  border-top: 1px solid var(--color-line);
  margin-top: auto;
}

/* ---- Article style ---- */
.prose {
  max-width: 720px;
  margin: 0 auto;
}
.prose h2 { margin-top: var(--s-7); margin-bottom: var(--s-4); }
.prose h3 { margin-top: var(--s-6); margin-bottom: var(--s-3); }
.prose p { margin-bottom: var(--s-4); }
.prose ul, .prose ol { margin-left: var(--s-5); margin-bottom: var(--s-4); color: var(--slate-700); }
.prose li { margin-bottom: var(--s-2); }

.callout {
  padding: var(--s-5) var(--s-6);
  border-left: 3px solid var(--color-brand);
  background: var(--teal-50);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  margin: var(--s-6) 0;
}
.callout__title {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-brand);
  margin-bottom: var(--s-2);
}
.callout--warn { border-left-color: var(--coral-600); background: var(--coral-100); }
.callout--warn .callout__title { color: var(--coral-700); }
.callout--eco { border-left-color: var(--sage-600); background: var(--sage-100); }
.callout--eco .callout__title { color: var(--sage-700); }

/* ---- Footer ---- */
.footer {
  background: var(--slate-900);
  color: rgba(250, 247, 242, 0.7);
  padding: var(--s-8) 0 var(--s-5);
  font-size: var(--fs-sm);
}
.footer__top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--s-6);
  padding-bottom: var(--s-7);
  border-bottom: 1px solid rgba(250, 247, 242, 0.1);
}
@media (max-width: 880px) {
  .footer__top { grid-template-columns: 1fr 1fr; }
}
.footer__brand { color: var(--cream); font-family: var(--font-display); font-size: var(--fs-lg); margin-bottom: var(--s-3); }
.footer__brand-text { max-width: 36ch; line-height: 1.5; }
.footer h6 { color: var(--cream); margin-bottom: var(--s-4); }
.footer ul { list-style: none; display: flex; flex-direction: column; gap: var(--s-3); }
.footer a:hover { color: var(--cream); }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--s-5);
  font-size: var(--fs-xs);
  color: rgba(250, 247, 242, 0.4);
  flex-wrap: wrap;
  gap: var(--s-3);
}

/* ---- Disclaimer banner ---- */
.disclaimer {
  background: var(--cream-2);
  padding: var(--s-3) 0;
  font-size: var(--fs-xs);
  color: var(--slate-600);
  text-align: center;
  border-bottom: 1px solid var(--color-line);
}
.disclaimer strong { color: var(--slate-800); }

/* ---- Utility ---- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--s-5); }
.hidden { display: none; }

/* ---- Animations on load ---- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s var(--ease) forwards;
}
.fade-in-1 { animation-delay: 0.1s; }
.fade-in-2 { animation-delay: 0.25s; }
.fade-in-3 { animation-delay: 0.4s; }
.fade-in-4 { animation-delay: 0.55s; }
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Focus visible for accessibility ---- */
:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ---- Print ---- */
@media print {
  .nav, .footer, .disclaimer, .hero__visual { display: none; }
  body { background: white; color: black; }
}

/* ============================================================
   Search Modal
   ============================================================ */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(14, 24, 34, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh var(--s-4) var(--s-4);
  animation: fadeIn 0.2s var(--ease);
}
.search-modal.open { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.search-box {
  width: 100%;
  max-width: 640px;
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
  animation: searchSlide 0.25s var(--ease);
}
@keyframes searchSlide {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--color-line);
}
.search-input-row svg {
  width: 20px;
  height: 20px;
  color: var(--color-muted);
  flex-shrink: 0;
}
.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: var(--fs-md);
  background: transparent;
  font-family: var(--font-body);
  color: var(--slate-900);
}
.search-input::placeholder { color: var(--color-muted); }
.search-close {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-sm);
  background: var(--cream);
  color: var(--color-muted);
  border: 1px solid var(--color-line);
  cursor: pointer;
}

.search-results {
  flex: 1;
  overflow-y: auto;
  padding: var(--s-2);
}
.search-empty {
  padding: var(--s-7) var(--s-5);
  text-align: center;
  color: var(--color-muted);
  font-size: var(--fs-sm);
}
.search-result {
  display: block;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  transition: background var(--dur-fast) var(--ease);
}
.search-result:hover,
.search-result.is-active {
  background: var(--teal-50);
}
.search-result__type {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-brand);
  font-weight: 700;
  margin-bottom: 2px;
}
.search-result__title {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  color: var(--slate-900);
  font-weight: 500;
  margin-bottom: 2px;
}
.search-result__snippet {
  font-size: var(--fs-sm);
  color: var(--slate-600);
  line-height: 1.5;
}
.search-result__snippet mark {
  background: var(--gold-100);
  color: var(--slate-900);
  font-weight: 600;
  padding: 0 2px;
  border-radius: 2px;
}

.search-footer {
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--color-line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-xs);
  color: var(--color-muted);
  background: var(--cream);
}
.search-footer .kbds { display: flex; gap: var(--s-3); }
.search-footer .kbds span { display: inline-flex; align-items: center; gap: 4px; }
.search-footer kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  background: var(--paper);
  border-radius: 3px;
  color: var(--slate-700);
  border: 1px solid var(--color-line);
}

/* ============================================================
   PubMed Live Feed widget
   ============================================================ */
.feed {
  background: var(--paper);
  border: 1px solid var(--color-line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.feed__head {
  padding: var(--s-4) var(--s-5);
  background: var(--teal-50);
  border-bottom: 1px solid var(--color-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.feed__title {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 500;
  color: var(--slate-900);
}
.feed__live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--coral-700);
}
.feed__live::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--coral-600);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}
.feed__source {
  font-size: var(--fs-xs);
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.feed__list { list-style: none; }
.feed__item {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--color-line);
  transition: background var(--dur-fast) var(--ease);
}
.feed__item:last-child { border-bottom: none; }
.feed__item:hover { background: var(--cream); }
.feed__item a {
  display: block;
  color: inherit;
  text-decoration: none;
}
.feed__item h4 {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--slate-900);
  margin-bottom: var(--s-2);
  line-height: 1.3;
}
.feed__item:hover h4 { color: var(--color-brand); }
.feed__meta {
  font-size: var(--fs-xs);
  color: var(--color-muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}
.feed__meta strong { color: var(--slate-700); font-weight: 600; }
.feed__loading,
.feed__error {
  padding: var(--s-6) var(--s-5);
  text-align: center;
  color: var(--color-muted);
  font-size: var(--fs-sm);
}
.feed__skeleton {
  height: 1em;
  background: linear-gradient(90deg, var(--cream-2) 0%, var(--cream) 50%, var(--cream-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: var(--s-2);
}
.feed__skeleton:last-child { width: 60%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* eChapters topic card grid */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--s-5);
}
.chapter-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-6);
  background: var(--paper);
  border: 1px solid var(--color-line);
  border-radius: var(--r-lg);
  transition: all var(--dur) var(--ease);
}
.chapter-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-brand);
  box-shadow: var(--shadow-md);
}
.chapter-card__num {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--coral-600);
  letter-spacing: 0.1em;
  font-weight: 600;
}
.chapter-card h3 { font-size: var(--fs-lg); line-height: 1.3; }
.chapter-card__status {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-xs);
  color: var(--color-muted);
  margin-top: auto;
  padding-top: var(--s-3);
  border-top: 1px solid var(--color-line);
}
.chapter-card__status::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--slate-300);
}
.chapter-card[data-status="published"] .chapter-card__status::before { background: var(--sage-600); }
.chapter-card[data-status="review"] .chapter-card__status::before { background: var(--gold-600); }
.chapter-card[data-status="drafting"] .chapter-card__status::before { background: var(--coral-600); }

/* Educations — learning path cards */
.path-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--s-5);
}
.path-card {
  padding: var(--s-6);
  border-radius: var(--r-lg);
  background: var(--paper);
  border: 1px solid var(--color-line);
  position: relative;
  overflow: hidden;
  transition: all var(--dur) var(--ease);
}
.path-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.path-card__level {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--color-brand);
  margin-bottom: var(--s-3);
}
.path-card h3 { margin-bottom: var(--s-3); }
.path-card p { font-size: var(--fs-sm); color: var(--slate-600); margin-bottom: var(--s-4); }
.path-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--slate-700);
}
.path-card li::before {
  content: "→ ";
  color: var(--color-brand);
  font-weight: 700;
}

/* ============================================================
   Founder attribution — footer signature
   ============================================================ */
.signature {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-5) var(--s-5);
  background: linear-gradient(135deg, rgba(14,42,94,0.45) 0%, rgba(31,123,142,0.30) 100%);
  border: 1px solid rgba(250, 247, 242, 0.10);
  border-radius: var(--r-lg);
  margin-bottom: var(--s-5);
  position: relative;
  overflow: hidden;
}
.signature::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold-600) 0%, var(--green-600) 100%);
}
.signature__seal {
  flex-shrink: 0;
  width: 56px; height: 56px;
  display: grid;
  place-items: center;
  background: var(--cream);
  border-radius: 50%;
  padding: 4px;
  box-shadow: 0 0 0 1px rgba(200, 155, 91, 0.4);
}
.signature__seal img { width: 100%; height: auto; }
.signature__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.signature__line {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gold-500);
}
.signature__name {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 500;
  font-style: italic;
  color: var(--cream);
  font-variation-settings: "opsz" 144, "SOFT" 60, "WONK" 1;
  line-height: 1.15;
}
.signature__role {
  font-size: var(--fs-sm);
  color: rgba(250, 247, 242, 0.7);
  margin-top: 2px;
}
@media (max-width: 540px) {
  .signature { flex-direction: column; align-items: flex-start; gap: var(--s-3); }
  .signature::before { width: 100%; height: 3px; bottom: auto; }
}

/* ============================================================
   Founder section (About page) — full feature card
   ============================================================ */
.founder {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-6);
  padding: var(--s-7);
  background: linear-gradient(135deg, var(--navy-50) 0%, var(--teal-50) 100%);
  border-radius: var(--r-xl);
  border: 1px solid var(--color-line);
  margin: var(--s-6) 0;
  align-items: start;
  position: relative;
  overflow: hidden;
}
.founder::after {
  content: "";
  position: absolute;
  top: -40%; right: -10%;
  width: 50%; height: 180%;
  background: radial-gradient(circle, rgba(200, 155, 91, 0.10) 0%, transparent 65%);
  pointer-events: none;
}
.founder__portrait {
  width: 130px; height: 130px;
  border-radius: 50%;
  background: var(--paper);
  display: grid;
  place-items: center;
  padding: 12px;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 1;
}
.founder__portrait img { width: 100%; height: auto; }
.founder__body { position: relative; z-index: 1; }
.founder__eyebrow {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--gold-700);
  margin-bottom: var(--s-2);
}
.founder__name {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 500;
  color: var(--navy-800);
  letter-spacing: -0.02em;
  margin-bottom: var(--s-2);
  line-height: 1.1;
}
.founder__role {
  font-size: var(--fs-md);
  color: var(--teal-700);
  font-weight: 500;
  margin-bottom: var(--s-3);
}
.founder__role em { font-family: var(--font-display); font-style: italic; }
.founder__bio {
  color: var(--slate-700);
  font-size: var(--fs-base);
  max-width: 60ch;
}
@media (max-width: 640px) {
  .founder { grid-template-columns: 1fr; text-align: left; padding: var(--s-5); }
  .founder__portrait { width: 100px; height: 100px; }
}
