/* ================================================================
   LIMES™ — Liver and Intestinal Medical Education for Students
   Design System | liverlimes.com
   Aesthetic: Editorial / Medical Premium — deep greens, clean type,
   structured like a clinical reference but warm and approachable
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&family=DM+Mono:wght@400;500&display=swap');

/* ── VARIABLES ─────────────────────────────────────────────────── */
:root {
  --forest:     #1A4731;
  --mid:        #2E7D52;
  --lime:       #6AAF3D;
  --lime-light: #A8D572;
  --cream:      #F8F5EE;
  --white:      #FFFFFF;
  --ink:        #1C1C1C;
  --ink-mid:    #3D3D3D;
  --ink-soft:   #6B6B6B;
  --border:     #D8E8D0;
  --bg-tint:    #F0F7EC;
  --shadow-sm:  0 2px 8px rgba(26,71,49,0.08);
  --shadow-md:  0 4px 24px rgba(26,71,49,0.12);
  --shadow-lg:  0 12px 48px rgba(26,71,49,0.16);
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;
  --max-w: 1120px;
  --max-w-text: 720px;
}

/* ── RESET ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── NAVIGATION ─────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--forest);
  border-bottom: 2px solid var(--lime);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.nav-logo-mark {
  width: 36px;
  height: 36px;
  background: var(--lime);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--forest);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.nav-logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--white);
  letter-spacing: -0.01em;
}
.nav-logo-tm {
  font-size: 0.55rem;
  vertical-align: super;
  color: var(--lime-light);
}
.nav-links {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.nav-links a {
  color: rgba(255,255,255,0.75);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.875rem;
  border-radius: var(--r-sm);
  transition: all 0.15s ease;
  letter-spacing: 0.01em;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
  background: rgba(106,175,61,0.2);
}
.nav-links a.active {
  color: var(--lime-light);
}

/* ── HERO ───────────────────────────────────────────────────────── */
.hero {
  background: var(--forest);
  color: var(--white);
  padding: 5rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -80px;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(106,175,61,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--lime), var(--lime-light), transparent);
}
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(106,175,61,0.15);
  border: 1px solid rgba(106,175,61,0.3);
  border-radius: 999px;
  padding: 0.3rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lime-light);
  margin-bottom: 1.5rem;
}
.hero-eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--lime);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  max-width: 700px;
  margin-bottom: 1.25rem;
}
.hero h1 em {
  font-style: italic;
  color: var(--lime-light);
}
.hero-sub {
  font-size: 1.0625rem;
  color: rgba(255,255,255,0.72);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 2.25rem;
  font-weight: 300;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--lime);
  color: var(--forest);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--r-sm);
  transition: all 0.2s ease;
  box-shadow: 0 0 0 0 rgba(106,175,61,0.4);
}
.hero-cta:hover {
  background: var(--lime-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(106,175,61,0.35);
}
.hero-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  flex-wrap: wrap;
}
.hero-stat-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--lime-light);
  line-height: 1;
  margin-bottom: 0.25rem;
}
.hero-stat-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
  font-weight: 400;
  max-width: 140px;
  line-height: 1.4;
}

/* ── SECTIONS ───────────────────────────────────────────────────── */
.section {
  padding: 4rem 2rem;
}
.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.section-alt {
  background: var(--bg-tint);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-dark {
  background: var(--forest);
  color: var(--white);
}
.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 0.625rem;
}
.section-dark .section-label { color: var(--lime-light); }
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}
.section-sub {
  font-size: 1rem;
  color: var(--ink-soft);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  font-weight: 300;
}
.section-dark .section-sub { color: rgba(255,255,255,0.6); }

/* ── CARD GRID ──────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.75rem;
  transition: all 0.2s ease;
  position: relative;
}
.card:hover {
  border-color: var(--lime);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--mid);
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.625rem;
  margin-bottom: 0.875rem;
}
.card h3 {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.625rem;
  letter-spacing: -0.01em;
}
.card p {
  font-size: 0.875rem;
  color: var(--ink-soft);
  line-height: 1.65;
}
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 1.125rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--mid);
  transition: gap 0.15s ease;
}
.card-link:hover { gap: 0.625rem; }
.card-link::after { content: '→'; }

/* ── BUTTONS ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1.375rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}
.btn-primary {
  background: var(--lime);
  color: var(--forest);
}
.btn-primary:hover {
  background: var(--lime-light);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--mid);
  border: 1.5px solid var(--mid);
}
.btn-outline:hover {
  background: var(--mid);
  color: var(--white);
}
.btn-ghost {
  background: rgba(106,175,61,0.12);
  color: var(--forest);
}
.btn-ghost:hover {
  background: rgba(106,175,61,0.22);
}

/* ── STAT PILLS ─────────────────────────────────────────────────── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}
.stat-pill {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--lime);
}
.stat-pill-num {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--forest);
  line-height: 1;
  margin-bottom: 0.3rem;
}
.stat-pill-label {
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* ── TOPIC DETAIL PAGE ──────────────────────────────────────────── */
.topic-hero {
  background: var(--forest);
  color: var(--white);
  padding: 3.5rem 2rem 3rem;
  position: relative;
  overflow: hidden;
}
.topic-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--lime), transparent);
}
.topic-hero-inner {
  max-width: var(--max-w-text);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 1.25rem;
}
.breadcrumb a { color: rgba(255,255,255,0.5); transition: color 0.15s; }
.breadcrumb a:hover { color: var(--lime-light); }
.breadcrumb span { color: rgba(255,255,255,0.25); }
.topic-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.625rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.875rem;
}
.topic-hero-summary {
  font-size: 1rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.7;
  font-weight: 300;
  max-width: 600px;
}

/* ── CONTENT BODY ───────────────────────────────────────────────── */
.content-wrap {
  max-width: var(--max-w-text);
  margin: 0 auto;
  padding: 3rem 2rem;
}
.content-body h2 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--forest);
  letter-spacing: -0.01em;
  margin: 2.25rem 0 0.75rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.content-body h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.content-body h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-mid);
  margin: 1.5rem 0 0.5rem;
}
.content-body p {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--ink-mid);
  margin-bottom: 1rem;
}
.content-body ul,
.content-body ol {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
}
.content-body li {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--ink-mid);
  margin-bottom: 0.375rem;
  list-style: disc;
}
.content-body ol li { list-style: decimal; }
.content-body strong { color: var(--ink); font-weight: 600; }
.content-body em { font-style: italic; }
.content-body code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15em 0.4em;
  color: var(--forest);
}

/* ── CLINICAL BOX ───────────────────────────────────────────────── */
.clinical-box {
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-left: 4px solid var(--lime);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
}
.clinical-box-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.clinical-box-label::before {
  content: '⚕';
  font-size: 0.875rem;
}
.clinical-box p,
.clinical-box li {
  font-size: 0.875rem;
  color: var(--ink-mid);
  line-height: 1.7;
}
.clinical-box ul { padding-left: 1.25rem; margin-top: 0.5rem; }
.clinical-box li { list-style: disc; margin-bottom: 0.3rem; }

/* ── EXTERNAL LINKS ─────────────────────────────────────────────── */
.ext-links {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.ext-links-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.875rem;
}
.ext-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--mid);
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  transition: all 0.15s ease;
}
.ext-link-btn:hover {
  border-color: var(--lime);
  background: var(--bg-tint);
  color: var(--forest);
}
.ext-link-btn::after { content: '↗'; font-size: 0.75rem; opacity: 0.6; }

/* ── BACK NAV ───────────────────────────────────────────────────── */
.back-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--mid);
  margin-bottom: 2rem;
  transition: gap 0.15s;
}
.back-nav:hover { gap: 0.75rem; }
.back-nav::before { content: '←'; }

/* ── RESOURCES PAGE ─────────────────────────────────────────────── */
.resource-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.75rem 2rem;
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
  transition: all 0.2s ease;
}
.resource-card:hover {
  border-color: var(--lime);
  box-shadow: var(--shadow-sm);
}
.resource-name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 0.375rem;
}
.resource-cost {
  font-size: 0.8rem;
  color: var(--mid);
  font-weight: 600;
  font-family: var(--font-mono);
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.625rem;
  display: inline-block;
  margin-bottom: 0.625rem;
}
.resource-desc {
  font-size: 0.875rem;
  color: var(--ink-soft);
  line-height: 1.65;
  margin-bottom: 0.75rem;
}
.resource-involvement {
  font-size: 0.8125rem;
  color: var(--ink-mid);
  line-height: 1.6;
}

/* ── CALENDAR PAGE ──────────────────────────────────────────────── */
.calendar-grid {
  display: grid;
  gap: 0.875rem;
}
.cal-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  align-items: start;
  transition: all 0.2s ease;
}
.cal-item:hover {
  border-color: var(--lime);
  box-shadow: var(--shadow-sm);
}
.cal-month {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: var(--r-sm);
  white-space: nowrap;
  text-align: center;
  min-width: 76px;
}
.cal-month.conference { background: #EAF5E2; color: #1A4731; border: 1px solid #B8D9A4; }
.cal-month.deadline   { background: #FEF3E2; color: #7C4A00; border: 1px solid #F5C88A; }
.cal-month.funding    { background: #EEF3FE; color: #1E3A8A; border: 1px solid #BFCFE9; }
.cal-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ink);
  margin-bottom: 0.25rem;
}
.cal-desc {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  line-height: 1.6;
}
.cal-note {
  font-size: 0.75rem;
  color: var(--mid);
  margin-top: 0.25rem;
  font-style: italic;
}
.cal-type-badge {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}
.cal-type-badge.conference { background: #EAF5E2; color: #1A4731; }
.cal-type-badge.deadline   { background: #FEF3E2; color: #7C4A00; }
.cal-type-badge.funding    { background: #EEF3FE; color: #1E3A8A; }

/* ── ABOUT PAGE ─────────────────────────────────────────────────── */
.about-section {
  max-width: 680px;
}
.about-section + .about-section {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}
.about-section h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--forest);
  margin-bottom: 1rem;
}
.about-section p {
  font-size: 0.9375rem;
  color: var(--ink-mid);
  line-height: 1.75;
  margin-bottom: 0.875rem;
}
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--forest);
  color: var(--white);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1.375rem;
  border-radius: var(--r-sm);
  margin-top: 0.5rem;
  transition: background 0.15s ease;
}
.contact-link:hover { background: var(--mid); }

/* ── FOOTER ─────────────────────────────────────────────────────── */
.footer {
  background: var(--forest);
  color: rgba(255,255,255,0.55);
  padding: 2.5rem 2rem;
  border-top: 2px solid var(--lime);
  margin-top: 4rem;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--white);
}
.footer-brand span { color: var(--lime-light); font-size: 0.6rem; vertical-align: super; }
.footer-text { font-size: 0.8125rem; line-height: 1.6; }
.footer-contact a {
  color: var(--lime-light);
  font-size: 0.8125rem;
  transition: color 0.15s;
}
.footer-contact a:hover { color: var(--white); }
.footer-tm {
  font-size: 0.725rem;
  opacity: 0.45;
  margin-top: 0.25rem;
}

/* ── ANIMATIONS ─────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.5s ease forwards; }
.fade-up-1 { animation-delay: 0.05s; opacity: 0; }
.fade-up-2 { animation-delay: 0.12s; opacity: 0; }
.fade-up-3 { animation-delay: 0.19s; opacity: 0; }
.fade-up-4 { animation-delay: 0.26s; opacity: 0; }

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero-stats { gap: 1.5rem; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .resource-card { grid-template-columns: 1fr; }
  .cal-item { grid-template-columns: 1fr; }
  .cal-month { width: fit-content; }
  .footer-inner { flex-direction: column; align-items: flex-start; }

  /* Mobile nav toggle */
  .nav-mobile-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 4px;
  }
  .nav-mobile-toggle span {
    display: block;
    width: 22px; height: 2px;
    background: rgba(255,255,255,0.8);
    border-radius: 2px;
    transition: all 0.2s;
  }
}
@media (min-width: 769px) {
  .nav-mobile-toggle { display: none; }
}
