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

:root {
  --forest:    #0d2818;
  --forest-mid:#143520;
  --forest-lt: #1e4d2c;
  --sage:      #5a9e6a;
  --sage-lt:   #7dc48e;
  --mint:      #a8ddb5;
  --bg:        #080f09;
  --bg-mid:    #0d1a0e;
  --bg-card:   rgba(255,255,255,.032);
  --bone:      #dde8d8;
  --bone-lt:   #edf5ea;
  --text:      #b0c8b4;
  --muted:     #6a8870;
  --border:    rgba(255,255,255,.07);
  --amber:     #c8a050;
  --amber-lt:  #e0c070;
  --rust:      #b05030;
  --rust-lt:   #d07050;
  --sky:       #5090b8;
  --sky-lt:    #78b8e0;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.78;
}

/* Subtle organic texture */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 55% 45% at 15% 25%, rgba(90,158,106,.07) 0%, transparent 65%),
    radial-gradient(ellipse 35% 55% at 85% 75%, rgba(13,40,24,.3) 0%, transparent 60%);
}

/* ── HEADER ── */
.site-header {
  background: linear-gradient(155deg, #030805 0%, #0a1a0c 30%, #122016 60%, #1a3020 100%);
  border-bottom: 1px solid var(--border);
  overflow: hidden; position: relative;
}

.header-inner {
  max-width: 1020px; margin: auto;
  padding: 68px 44px 60px;
  position: relative; z-index: 1;
  display: flex; gap: 44px; align-items: flex-end;
}

.header-eyebrow {
  font-size: 10px; font-weight: 600;
  letter-spacing: 4px; text-transform: uppercase;
  color: var(--sage-lt); margin-bottom: 18px;
  display: flex; align-items: center; gap: 12px;
}
.header-eyebrow::before { content: ''; width: 28px; height: 1px; background: var(--sage); }

.header-title {
  font-family: 'Spectral', serif;
  font-size: clamp(44px, 7vw, 86px);
  font-weight: 700; line-height: .92;
  letter-spacing: -2px; color: var(--bone-lt);
  margin-bottom: 22px;
}

.header-subtitle {
  font-size: 15px; font-weight: 300;
  color: var(--muted); max-width: 500px; line-height: 1.72;
}

/* Cross-section SVG */
.header-svg { width: 140px; flex-shrink: 0; opacity: .18; align-self: center; }

/* Leaf pattern overlay */
.header-leaves {
  position: absolute; right: 0; top: 0; bottom: 0; width: 300px;
  opacity: .06; pointer-events: none;
}

/* ── NAV ── */
.topic-nav {
  background: rgba(8,15,9,.93);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(16px);
}
.topic-nav-inner {
  max-width: 1020px; margin: auto; padding: 0 44px;
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
}
.topic-nav-inner::-webkit-scrollbar { display: none; }
.nav-pill {
  flex-shrink: 0; padding: 14px 18px;
  font-size: 12px; font-weight: 500; letter-spacing: .4px;
  color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; transition: all .2s; white-space: nowrap;
  background: none; border-top: none; border-left: none; border-right: none;
}
.nav-pill:hover, .nav-pill.active { color: var(--sage-lt); border-bottom-color: var(--sage); }

/* ── LAYOUT ── */
.main { max-width: 1020px; margin: auto; padding: 56px 44px 90px; position: relative; z-index: 1; }

.section { margin-bottom: 66px; opacity: 0; transform: translateY(26px); transition: opacity .65s, transform .65s; }
.section.visible { opacity: 1; transform: none; }

.section-label {
  font-size: 10px; font-weight: 600; letter-spacing: 4px; text-transform: uppercase;
  color: var(--sage); margin-bottom: 12px;
  display: flex; align-items: center; gap: 12px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.section-title {
  font-family: 'Spectral', serif;
  font-size: 28px; font-weight: 700; color: var(--bone-lt); margin-bottom: 18px; line-height: 1.2;
}

p { color: var(--text); margin-bottom: 14px; }
p strong { color: var(--bone); }
p em { color: var(--bone); font-style: italic; }

/* ── LAYERS STACK ── */
.layers-stack {
  margin-top: 28px; display: flex; flex-direction: column; gap: 0;
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border);
}
.layer {
  display: grid; grid-template-columns: 56px 1fr 2fr;
  gap: 0; align-items: stretch;
  border-bottom: 1px solid rgba(255,255,255,.05);
  transition: background .2s;
  cursor: default;
}
.layer:last-child { border-bottom: none; }
.layer:hover { background: rgba(90,158,106,.05); }

.layer-initial {
  display: flex; align-items: center; justify-content: center;
  font-family: 'Spectral', serif;
  font-size: 22px; font-weight: 700;
  padding: 18px 0;
}
.layer-name-col {
  padding: 16px 18px;
  border-left: 1px solid rgba(255,255,255,.05);
  border-right: 1px solid rgba(255,255,255,.05);
  display: flex; flex-direction: column; justify-content: center;
}
.layer-name {
  font-family: 'Spectral', serif; font-size: 15px; font-weight: 600;
  color: var(--bone); margin-bottom: 3px;
}
.layer-en { font-size: 10.5px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }
.layer-desc { padding: 16px 20px; font-size: 13.5px; color: var(--muted); display: flex; align-items: center; }

/* Layer color coding */
.layer:nth-child(1) .layer-initial { color: #d8b060; background: rgba(200,160,80,.08); }
.layer:nth-child(2) .layer-initial { color: #a08050; background: rgba(160,120,60,.07); }
.layer:nth-child(3) .layer-initial { color: #7a9870; background: rgba(100,150,90,.08); }
.layer:nth-child(4) .layer-initial { color: #608890; background: rgba(80,130,140,.07); }
.layer:nth-child(5) .layer-initial { color: #8878a0; background: rgba(120,100,150,.07); }

/* ── CARDS GRID ── */
.cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 16px; margin-top: 24px;
}
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 13px; padding: 22px;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(90,158,106,.3); box-shadow: 0 14px 36px rgba(0,0,0,.5); }

.card-tag {
  display: inline-block; padding: 3px 10px; border-radius: 4px;
  font-size: 10px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase;
  background: rgba(90,158,106,.18); color: var(--sage-lt); margin-bottom: 12px;
}
.card-tag-amber { background: rgba(200,160,80,.15); color: var(--amber-lt); }
.card-tag-rust  { background: rgba(176,80,48,.15); color: var(--rust-lt); }
.card-tag-sky   { background: rgba(80,144,184,.15); color: var(--sky-lt); }

.card-title {
  font-family: 'Spectral', serif; font-size: 17px; font-weight: 600;
  color: var(--bone); margin-bottom: 8px;
}
.card-body { font-size: 13.5px; color: var(--muted); line-height: 1.65; }

/* ── PATHO TABLE ── */
.patho-table { width: 100%; border-collapse: collapse; margin-top: 22px; font-size: 13.5px; }
.patho-table th {
  text-align: left; padding: 11px 16px;
  font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--sage); border-bottom: 1px solid var(--border); font-weight: 600;
}
.patho-table td {
  padding: 13px 16px; border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: top; color: var(--muted);
}
.patho-table tr:hover td { background: rgba(90,158,106,.04); }
.patho-table td:first-child { color: var(--bone); font-weight: 500; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-green  { background: rgba(90,158,106,.18); color: var(--sage-lt); }
.badge-amber  { background: rgba(200,160,80,.15); color: var(--amber-lt); }
.badge-rust   { background: rgba(176,80,48,.15); color: var(--rust-lt); }
.badge-sky    { background: rgba(80,144,184,.15); color: var(--sky-lt); }

/* ── HIGHLIGHT BOXES ── */
.highlight-box {
  background: rgba(90,158,106,.08); border: 1px solid rgba(90,158,106,.2);
  border-radius: 10px; padding: 20px 24px; margin: 24px 0;
}
.highlight-box strong { color: var(--sage-lt); }

.warn-box {
  background: rgba(176,80,48,.08); border: 1px solid rgba(176,80,48,.2);
  border-radius: 10px; padding: 20px 24px; margin: 24px 0;
}
.warn-box strong { color: var(--rust-lt); }

/* ── STATS ── */
.stats-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 52px; }
.stat-pill {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 24px;
  display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 140px;
}
.stat-num {
  font-family: 'Spectral', serif; font-size: 28px; font-weight: 700;
  color: var(--sage-lt); line-height: 1;
}
.stat-label { font-size: 11.5px; color: var(--muted); }

/* ── VASCULAR GRID ── */
.vasc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.vasc-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 20px;
  border-left: 3px solid var(--sage);
}
.vasc-item.veins { border-left-color: var(--sky); }
.vasc-item.nerves { border-left-color: var(--amber); }
.vasc-title {
  font-family: 'Spectral', serif; font-size: 15px; font-weight: 600;
  color: var(--bone); margin-bottom: 8px;
}
.vasc-list { list-style: none; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.vasc-list li::before { content: '—  '; color: var(--sage); }
.vasc-item.veins .vasc-list li::before { color: var(--sky); }
.vasc-item.nerves .vasc-list li::before { color: var(--amber); }

footer {
  text-align: center; padding: 28px; font-size: 11.5px; color: var(--muted);
  border-top: 1px solid var(--border); position: relative; z-index: 1;
}

@media (max-width: 680px) {
  .header-inner { flex-direction: column; padding: 40px 22px; gap: 20px; }
  .header-svg { display: none; }
  .main { padding: 30px 22px 60px; }
  .topic-nav-inner { padding: 0 22px; }
  .layer { grid-template-columns: 44px 1fr; }
  .layer-desc { display: none; }
  .vasc-grid { grid-template-columns: 1fr; }
}
