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

:root {
  --bg:         #090804;
  --bg-mid:     #110f08;
  --bg-card:    rgba(255,255,255,.028);
  --amber:      #c89040;
  --amber-lt:   #e8b060;
  --gold:       #d4a040;
  --parchment:  #e8dcc8;
  --parchment-lt:#f5f0e4;
  --text:       #c8b898;
  --muted:      #786848;
  --border:     rgba(200,144,64,.14);
  --border2:    rgba(255,255,255,.06);
  --rust:       #b05828;
  --rust-lt:    #d07848;
  --teal:       #488090;
  --teal-lt:    #68a8b8;
  --green:      #507840;
  --green-lt:   #78b060;
  --rose:       #a84858;
  --rose-lt:    #d07080;
  --blue:       #486898;
  --blue-lt:    #6890c8;
}

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

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

/* Paper texture overlay */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 60% 45% at 20% 20%, rgba(200,144,64,.06) 0%, transparent 65%),
    radial-gradient(ellipse 40% 55% at 80% 80%, rgba(176,88,40,.04) 0%, transparent 60%);
}

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

/* Subtle horizontal rule decoration */
.site-header::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
  opacity: .4;
}

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

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

.header-title {
  font-family: 'Lora', serif;
  font-size: clamp(72px, 11vw, 130px);
  font-weight: 700; line-height: .85;
  letter-spacing: -4px; color: var(--parchment-lt);
  margin-bottom: 22px;
}

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

.header-bone-svg { width: 150px; flex-shrink: 0; opacity: .14; }

/* ── NAV ── */
.topic-nav {
  background: rgba(8,7,4,.94); 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: 13px 18px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .5px;
  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(--amber-lt); border-bottom-color: var(--amber); }

/* ── 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: 5px; text-transform: uppercase;
  color: var(--amber); 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: 'Lora', serif; font-size: 28px; font-weight: 700; color: var(--parchment); margin-bottom: 18px; }

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

/* ── BONE TYPES GRID ── */
.bone-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-top: 24px; }
.bone-type {
  background: var(--bg-card); border: 1px solid var(--border2);
  border-radius: 12px; padding: 18px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 12px; transition: transform .25s, border-color .25s;
}
.bone-type:hover { transform: translateY(-4px); border-color: rgba(200,144,64,.3); }
.bt-icon { opacity: .7; }
.bt-name { font-family: 'Lora', serif; font-size: 15px; font-weight: 700; color: var(--parchment); }
.bt-example { font-size: 11.5px; color: var(--amber); font-weight: 600; letter-spacing: .5px; }
.bt-desc { font-size: 12px; color: var(--muted); line-height: 1.55; }

/* ── CELLS TABLE ── */
.cells-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 22px; }
.cell-card {
  background: var(--bg-card); border: 1px solid var(--border2); border-radius: 12px; padding: 20px;
  border-left: 3px solid var(--amber); transition: transform .2s;
}
.cell-card:nth-child(2) { border-left-color: var(--rust); }
.cell-card:nth-child(3) { border-left-color: var(--teal); }
.cell-card:nth-child(4) { border-left-color: var(--green); }
.cell-card:hover { transform: translateY(-3px); }
.cell-name { font-family: 'Lora', serif; font-size: 16px; font-weight: 700; color: var(--parchment); margin-bottom: 6px; }
.cell-role { font-size: 10px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 8px; }
.cell-desc { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ── CARDS ── */
.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(--border2);
  border-radius: 13px; padding: 22px;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(200,144,64,.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(200,144,64,.15); color: var(--amber-lt); margin-bottom: 12px;
}
.card-tag-rust  { background: rgba(176,88,40,.15); color: var(--rust-lt); }
.card-tag-teal  { background: rgba(72,128,144,.15); color: var(--teal-lt); }
.card-tag-green { background: rgba(80,120,64,.15); color: var(--green-lt); }
.card-tag-blue  { background: rgba(72,104,152,.15); color: var(--blue-lt); }

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

/* ── COMPOSITION BAR ── */
.compo-bars { margin-top: 24px; display: flex; flex-direction: column; gap: 14px; }
.compo-row { display: flex; align-items: center; gap: 16px; }
.compo-label { width: 180px; flex-shrink: 0; font-size: 13px; color: var(--text); }
.compo-track { flex: 1; height: 8px; background: rgba(255,255,255,.06); border-radius: 4px; }
.compo-fill { height: 100%; border-radius: 4px; width: 0; transition: width 1.3s cubic-bezier(.22,1,.36,1); }
.compo-pct { width: 40px; text-align: right; font-size: 12px; color: var(--amber-lt); font-weight: 600; }

/* ── REMODELAGE CYCLE ── */
.cycle-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 24px; }
.cycle-step {
  background: var(--bg-card); border: 1px solid var(--border2); padding: 20px 16px;
  text-align: center; position: relative;
  transition: background .2s;
}
.cycle-step:first-child { border-radius: 12px 0 0 12px; }
.cycle-step:last-child { border-radius: 0 12px 12px 0; }
.cycle-step:hover { background: rgba(200,144,64,.04); }
.cycle-step::after {
  content: '→'; position: absolute; right: -10px; top: 50%; transform: translateY(-50%);
  color: var(--amber); font-size: 16px; z-index: 1;
}
.cycle-step:last-child::after { display: none; }
.cs-num { font-size: 10px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--amber); margin-bottom: 6px; }
.cs-name { font-family: 'Lora', serif; font-size: 15px; font-weight: 700; color: var(--parchment); margin-bottom: 6px; }
.cs-desc { font-size: 12px; color: var(--muted); line-height: 1.55; }

/* ── FRACTURE 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: 3px; text-transform: uppercase;
  color: var(--amber); 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(200,144,64,.04); }
.patho-table td:first-child { color: var(--parchment); font-weight: 600; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-amber { background: rgba(200,144,64,.15); color: var(--amber-lt); }
.badge-rust  { background: rgba(176,88,40,.15); color: var(--rust-lt); }
.badge-teal  { background: rgba(72,128,144,.15); color: var(--teal-lt); }
.badge-green { background: rgba(80,120,64,.15); color: var(--green-lt); }
.badge-rose  { background: rgba(168,72,88,.15); color: var(--rose-lt); }

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

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

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-bone-svg { display: none; }
  .main { padding: 30px 22px 60px; }
  .topic-nav-inner { padding: 0 22px; }
  .cycle-strip { grid-template-columns: 1fr 1fr; }
  .cycle-step:nth-child(2) { border-radius: 0 12px 0 0; }
  .cycle-step:nth-child(3) { border-radius: 0 0 0 12px; }
  .cycle-step::after { display: none; }
}
