/* ============================================
   NAILS IN THE COFFIN — style.css
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;1,400&family=Courier+Prime:wght@400;700&display=swap');

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

:root {
  --wood: #2a1a0e;
  --wood-light: #3d2410;
  --grain: #1a0f07;
  --gold: #c8952a;
  --gold-light: #e8b840;
  --blood: #8b1a1a;
  --blood-bright: #c0392b;
  --bone: #d4c5a0;
  --bone-dim: #7a6d55;
  --nail-silver: #a0a0a8;
  --nail-dark: #404048;
  --text-bright: #ede8dc;
  --text-dim: #8a7d65;
  --timeline-line: 52px;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--wood);
  background-image:
    repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(0,0,0,0.07) 3px, rgba(0,0,0,0.07) 4px),
    repeating-linear-gradient(0deg, transparent, transparent 8px, rgba(0,0,0,0.03) 8px, rgba(0,0,0,0.03) 9px);
  font-family: 'Courier Prime', monospace;
  color: var(--text-bright);
  min-height: 100vh;
  border-left: 3px solid var(--grain);
  border-right: 3px solid var(--grain);
  max-width: 860px;
  margin: 0 auto;
}

/* ============ STICKY COFFIN BAR ============ */

.sticky-coffin {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--grain);
  border-bottom: 2px solid #1a0f07;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.5);
}

.coffin-svg-wrap {
  flex-shrink: 0;
}

#coffinSvg rect#bloodFill {
  transition: y 0.4s ease, height 0.4s ease;
}

.coffin-meta {
  flex: 1;
  min-width: 0;
}

.coffin-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.1;
}

.coffin-subtitle {
  font-size: 10px;
  color: var(--bone-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
}

.coffin-progress {
  margin-top: 7px;
}

.progress-label {
  font-size: 10px;
  color: var(--bone-dim);
  letter-spacing: 0.08em;
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.progress-bar-bg {
  height: 5px;
  background: var(--wood-light);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blood), var(--blood-bright));
  border-radius: 2px;
  width: 0%;
  transition: width 0.4s ease;
}

/* ============ SITE HEADER ============ */

.site-header {
  text-align: center;
  padding: 36px 24px 24px;
  border-bottom: 1px solid var(--grain);
}

.skull {
  font-size: 28px;
  display: block;
  margin-bottom: 6px;
  filter: sepia(1) saturate(2) hue-rotate(10deg);
}

.main-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
  text-shadow: 0 0 24px rgba(200, 149, 42, 0.35);
  line-height: 1.2;
}

.main-sub {
  font-size: 10px;
  color: var(--bone-dim);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 5px;
}

.separation-quote {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 13px;
  color: var(--bone-dim);
  margin-top: 14px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
  border-top: 1px solid var(--grain);
  padding-top: 12px;
}

/* ============ STATS BAR ============ */

.stats-bar {
  display: flex;
  border-bottom: 1px solid var(--grain);
}

.stat {
  flex: 1;
  text-align: center;
  padding: 12px 4px;
  border-right: 1px solid var(--grain);
}

.stat:last-child {
  border-right: none;
}

.stat-n {
  font-size: 20px;
  font-weight: 700;
  color: var(--blood-bright);
  letter-spacing: 0.02em;
}

.stat-l {
  font-size: 9px;
  color: var(--bone-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ============ FILTERS ============ */

.filters {
  display: flex;
  gap: 6px;
  padding: 11px 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--grain);
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.fbtn {
  font-family: 'Courier Prime', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 10px;
  border: 1px solid;
  border-radius: 2px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  background: transparent;
}

.fbtn.all         { border-color: var(--bone-dim);   color: var(--bone-dim);   }
.fbtn.all.active  { background: var(--bone-dim);     color: var(--wood);       }

.fbtn.monetary         { border-color: var(--gold);         color: var(--gold);         }
.fbtn.monetary.active  { background: var(--gold);           color: var(--wood);         }

.fbtn.crisis         { border-color: #e05555; color: #e05555; }
.fbtn.crisis.active  { background: #e05555;  color: #fff;    }

.fbtn.debt         { border-color: #b07cc6; color: #b07cc6; }
.fbtn.debt.active  { background: #b07cc6;  color: var(--wood); }

.fbtn.geopolitical         { border-color: #6a9fb5; color: #6a9fb5; }
.fbtn.geopolitical.active  { background: #6a9fb5;  color: var(--wood); }

.fbtn.policy         { border-color: #d4884a; color: #d4884a; }
.fbtn.policy.active  { background: #d4884a;  color: var(--wood); }

.fbtn.crypto         { border-color: #7ac0a4; color: #7ac0a4; }
.fbtn.crypto.active  { background: #7ac0a4;  color: var(--wood); }

.click-hint {
  font-size: 9px;
  color: var(--bone-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  padding: 7px 0;
  opacity: 0.5;
}

/* ============ TIMELINE ============ */

.timeline {
  padding: 0 16px;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: var(--timeline-line);
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, var(--grain), var(--blood) 30%, var(--blood) 70%, var(--grain));
}

/* ============ DECADE HEADER ============ */

.decade-hdr {
  font-family: 'Playfair Display', serif;
  font-size: 13px;
  font-style: italic;
  color: var(--bone-dim);
  letter-spacing: 0.1em;
  padding: 22px 0 6px 68px;
  border-top: 1px solid var(--grain);
  margin-top: 6px;
}

.decade-hdr.first {
  border-top: none;
  margin-top: 0;
}

/* ============ NAIL ENTRY ============ */

.nail-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  position: relative;
  cursor: pointer;
}

.nail-entry.fout {
  display: none;
}

.nail-entry:hover .nv {
  transform: translateY(-2px) rotate(-3deg);
}

/* Year column */
.yr {
  width: 32px;
  flex-shrink: 0;
  text-align: right;
  font-size: 10px;
  font-weight: 700;
  color: var(--bone-dim);
  padding-top: 14px;
  letter-spacing: 0.02em;
}

/* Nail visual */
.nv {
  width: 20px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 6px;
  transition: transform 0.2s ease;
  position: relative;
  z-index: 1;
}

.nh { border-radius: 2px 2px 1px 1px; }
.ns { border-radius: 0 0 2px 2px; }

.nail-entry.s1 .nh { width: 14px; height: 6px;  background: #404048; }
.nail-entry.s1 .ns { width: 3px;  height: 18px; background: #505058; }

.nail-entry.s2 .nh { width: 16px; height: 7px;  background: #606068; }
.nail-entry.s2 .ns { width: 3px;  height: 22px; background: #707078; }

.nail-entry.s3 .nh { width: 18px; height: 8px;  background: var(--nail-silver); }
.nail-entry.s3 .ns { width: 4px;  height: 28px; background: #909098; }

.nail-entry.s4 .nh { width: 20px; height: 9px;  background: var(--gold); box-shadow: 0 0 6px rgba(200,149,42,0.4); }
.nail-entry.s4 .ns { width: 4px;  height: 34px; background: #a07520; }

.nail-entry.s5 .nh { width: 24px; height: 11px; background: var(--blood-bright); box-shadow: 0 0 10px rgba(192,57,43,0.5); }
.nail-entry.s5 .ns { width: 5px;  height: 42px; background: var(--blood); }

/* Nail content */
.nc {
  flex: 1;
  min-width: 0;
}

.ntop {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.nname {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.2;
}

.ntag {
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 1px;
  font-family: 'Courier Prime', monospace;
}

.tag-monetary    { background: rgba(200,149,42,0.18);  color: var(--gold);   border: 1px solid rgba(200,149,42,0.3);   }
.tag-crisis      { background: rgba(192,57,43,0.18);   color: #e57368;       border: 1px solid rgba(192,57,43,0.3);    }
.tag-geopolitical{ background: rgba(106,159,181,0.18); color: #8bbfd4;       border: 1px solid rgba(106,159,181,0.3);  }
.tag-crypto      { background: rgba(122,192,164,0.18); color: #7ac0a4;       border: 1px solid rgba(122,192,164,0.3);  }
.tag-debt        { background: rgba(176,124,198,0.18); color: #c49de0;       border: 1px solid rgba(176,124,198,0.3);  }
.tag-policy      { background: rgba(212,136,74,0.18);  color: #d4884a;       border: 1px solid rgba(212,136,74,0.3);   }

/* Expandable description */
.ndesc {
  font-size: 12px;
  color: var(--bone-dim);
  line-height: 1.55;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, margin-top 0.2s;
}

.nail-entry.exp .ndesc {
  max-height: 260px;
  margin-top: 6px;
}

.nimp {
  font-size: 10px;
  color: var(--blood-bright);
  font-style: italic;
  margin-top: 5px;
  letter-spacing: 0.04em;
}

/* Separator line between nails */
.sep {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--grain) 30%, var(--grain) 70%, transparent);
  margin-left: 68px;
}

/* ============ SITE FOOTER ============ */

.site-footer {
  text-align: center;
  padding: 28px 24px 32px;
  border-top: 2px solid var(--grain);
  margin-top: 16px;
}

.footer-quote {
  margin-bottom: 16px;
}

.rip {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-style: italic;
  color: var(--blood-bright);
  letter-spacing: 0.06em;
}

.rip-sub {
  font-size: 11px;
  color: var(--bone-dim);
  max-width: 480px;
  margin: 8px auto 0;
  line-height: 1.6;
  letter-spacing: 0.03em;
}

.footer-coffin {
  display: block;
  margin: 12px auto;
}

.footer-note {
  font-size: 10px;
  color: var(--bone-dim);
  letter-spacing: 0.06em;
  margin-top: 10px;
  opacity: 0.7;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 480px) {
  .stats-bar {
    flex-wrap: wrap;
  }
  .stat {
    flex: 1 1 50%;
    border-bottom: 1px solid var(--grain);
  }
  .coffin-title { font-size: 15px; }
  .coffin-subtitle { display: none; }
  .nname { font-size: 13px; }
}
