/* ============================================
   TOGETHER WE SOLVE — impact-archive.css
   Evolved Editorial Timeline & Registry CSS
   ============================================ */

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

:root {
  /* Editorial Color System */
  --bg-warm: #FAF6F0;       /* Warm Ivory Paper */
  --text-charcoal: #1C1E1D; /* Charcoal Ink */
  --accent-moss: #23382B;   /* Deep Forest Moss */
  --accent-ocean: #3D5A6C;  /* Muted Ocean Blue */
  --accent-clay: #C87D55;   /* Earthy Warm Clay */
  --bg-fog: #EBECE8;        /* Soft Foggy Grey-Green */
  --bg-dark-moss: #1A2E22;  /* Rich Dark Moss Background */

  /* Spacing & Borders */
  --border-light: rgba(28, 30, 29, 0.08);
  --border-dark: rgba(250, 246, 240, 0.1);
  --font-display: 'DM Serif Display', serif;
  --font-body: 'DM Sans', sans-serif;
  --transition-smooth: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  font-size: 16px;
  scroll-behavior: auto;
  background-color: var(--bg-warm);
}

body {
  background-color: var(--bg-warm);
  color: var(--text-charcoal);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ─── Tactile Paper Texture Overlay ────────────────── */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  opacity: 0.045;
  pointer-events: none;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ─── UTILITY ─────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 64px;
}

@media (max-width: 768px) {
  .container { padding: 0 28px; }
}

.label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-clay);
  margin-bottom: 28px;
  display: block;
}

.section {
  padding: 140px 0;
  position: relative;
}

@media (max-width: 768px) {
  .section { padding: 90px 0; }
}

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

/* ─── NAV (Editorial Header) ────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 24px 64px;
  display: flex;
  align-items: center;
  transition: var(--transition-smooth);
}

.nav.scrolled {
  background: rgba(250, 246, 240, 0.92);
  backdrop-filter: blur(16px);
  padding: 16px 64px;
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02);
}

.nav-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text-charcoal);
  text-decoration: none;
  letter-spacing: -0.01em;
  font-weight: 400;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-link {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-charcoal);
  text-decoration: none;
  letter-spacing: 0.01em;
  opacity: 0.75;
  transition: opacity 0.3s, color 0.3s;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  opacity: 1;
  color: var(--accent-moss);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-clay);
  border-radius: 2px;
}

.nav-cta {
  font-size: 13px;
  font-weight: 500;
  color: var(--bg-warm);
  text-decoration: none;
  padding: 12px 28px;
  border: none;
  border-radius: 100px;
  transition: var(--transition-smooth);
  letter-spacing: 0.03em;
  background: var(--accent-moss);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.nav-cta:hover {
  background: var(--text-charcoal);
  color: var(--bg-warm);
  transform: translateY(-1px);
}

.nav-cta-arrow {
  font-size: 14px;
  display: inline-block;
  transition: transform 0.3s;
}

.nav-cta:hover .nav-cta-arrow {
  transform: translate(2px, -2px);
}

@media (max-width: 900px) {
  .nav-links { display: none; }
}

@media (max-width: 600px) {
  .nav { padding: 18px 24px; }
  .nav.scrolled { padding: 14px 24px; }
}

/* ─── BUTTONS ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: 100px;
  transition: var(--transition-smooth);
  cursor: pointer;
  white-space: nowrap;
}

.btn-ghost {
  color: var(--text-charcoal);
  opacity: 0.8;
  padding: 15px 28px;
  border: 1px solid transparent;
}

.btn-ghost:hover {
  opacity: 1;
  color: var(--accent-clay);
}

.btn-sm {
  font-size: 12px;
  padding: 10px 22px;
}

/* ─── ARCHIVE HERO (Watercolor Ripple Backdrop) ── */
.archive-hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  background-color: var(--bg-warm);
  border-bottom: 1px solid var(--border-light);
}

.canvas-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto; /* Enable mouse triggers on canvas */
  z-index: 1;
}

#rippleCanvas {
  width: 100%;
  height: 100%;
  opacity: 0.85;
}

.archive-hero .hero-content {
  position: relative;
  z-index: 2;
  text-align: left;
  padding: 160px 64px 80px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 780px;
  pointer-events: none; /* Let clicks pass through to canvas */
}

/* Re-enable events for buttons or links in hero content if added later */
.archive-hero .hero-content * {
  pointer-events: auto;
}

.archive-hero .hero-eyebrow-text {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-clay);
  display: block;
  margin-bottom: 12px;
}

.archive-hero .hero-eyebrow-line {
  width: 48px;
  height: 2px;
  background: var(--accent-moss);
}

.archive-hero .hero-headline {
  font-family: var(--font-display);
  font-size: clamp(48px, 6vw, 84px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text-charcoal);
  margin-bottom: 28px;
}

.archive-hero .hero-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(20px, 2.2vw, 28px);
  color: var(--accent-moss);
  line-height: 1.4;
  margin-bottom: 20px;
}

.archive-hero .hero-body {
  font-size: clamp(15px, 1.3vw, 17px);
  color: var(--text-charcoal);
  max-width: 580px;
  margin: 0;
  line-height: 1.8;
}

@media (max-width: 768px) {
  .archive-hero .hero-content {
    padding: 120px 28px 60px 28px;
  }
}

/* ─── STATS DASHBOARD ───────────────────────── */
.stats-section {
  background: var(--bg-fog);
  border-radius: 60px 60px 0 0;
  margin-top: -60px;
  position: relative;
  z-index: 3;
  box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.015);
  border-bottom: 1px solid var(--border-light);
  padding: 80px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

@media (max-width: 960px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 560px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.stat-card {
  background: var(--bg-warm);
  border: 1px solid rgba(28, 30, 29, 0.05);
  border-radius: 8px;
  padding: 32px 24px;
  box-shadow: 0 8px 24px rgba(28, 30, 29, 0.01);
  text-align: left;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s;
  
  --rot: 0deg;
  transform: rotate(var(--rot));
}

.stat-card:nth-child(1) { --rot: -0.5deg; }
.stat-card:nth-child(2) { --rot: 0.6deg; }
.stat-card:nth-child(3) { --rot: -0.8deg; }
.stat-card:nth-child(4) { --rot: 0.4deg; }

.stat-card:hover {
  transform: translateY(-6px) rotate(0deg);
  box-shadow: 0 16px 36px rgba(28, 30, 29, 0.04);
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.5vw, 44px);
  color: var(--accent-clay);
  line-height: 1.1;
  display: block;
  margin-bottom: 6px;
}

.stat-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-moss);
  display: block;
  margin-bottom: 12px;
}

.stat-desc {
  font-size: 13px;
  line-height: 1.6;
  opacity: 0.75;
}

/* ─── TIMELINE SECTION ─────────────────────── */
.archive-section {
  background: var(--bg-warm);
  border-top: 1px solid var(--border-light);
}

.section-headline {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--accent-moss);
  margin-bottom: 64px;
}

.archive-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 64px;
  flex-wrap: wrap;
  gap: 32px;
}

@media (max-width: 768px) {
  .archive-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.archive-header .section-headline {
  margin-bottom: 0;
}

.archive-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  min-width: 260px;
}

@media (max-width: 600px) {
  .search-box {
    width: 100%;
  }
}

.search-box input {
  width: 100%;
  padding: 12px 18px 12px 42px;
  border-radius: 100px;
  border: 1px solid rgba(28, 30, 29, 0.15);
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-charcoal);
  outline: none;
  transition: var(--transition-smooth);
}

.search-box input:focus {
  border-color: var(--accent-moss);
  background: rgba(28, 30, 29, 0.01);
  box-shadow: 0 4px 12px rgba(35, 56, 43, 0.03);
}

.search-box svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-charcoal);
  opacity: 0.4;
  pointer-events: none;
}

.filter-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-btn {
  background: transparent;
  border: 1px solid rgba(28, 30, 29, 0.12);
  color: var(--text-charcoal);
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.tag-btn:hover {
  background: rgba(28, 30, 29, 0.03);
  border-color: rgba(28, 30, 29, 0.3);
}

.tag-btn.active {
  background: var(--accent-moss);
  border-color: var(--accent-moss);
  color: var(--bg-warm);
}

/* Timeline Layout */
.archive-timeline {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  padding-left: 48px; /* Offset for left timeline bar */
}

.archive-timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 16px;
  width: 1px;
  background: rgba(28, 30, 29, 0.12);
}

@media (max-width: 600px) {
  .archive-timeline {
    padding-left: 28px;
  }
  .archive-timeline::before {
    left: 8px;
  }
}

.timeline-item {
  position: relative;
  margin-bottom: 60px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

/* Dot Marker */
.timeline-marker {
  position: absolute;
  left: -48px;
  top: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-warm);
  border: 1px solid rgba(28, 30, 29, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
  z-index: 2;
  transition: var(--transition-smooth);
}

.timeline-marker::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-moss);
  transition: var(--transition-smooth);
}

@media (max-width: 600px) {
  .timeline-marker {
    left: -28px;
    width: 24px;
    height: 24px;
    top: 6px;
  }
  .timeline-marker::after {
    width: 6px;
    height: 6px;
  }
}

.timeline-item:hover .timeline-marker {
  border-color: var(--accent-clay);
}

.timeline-item:hover .timeline-marker::after {
  background: var(--accent-clay);
  transform: scale(1.25);
}

/* Cards */
.timeline-card {
  background: var(--bg-warm);
  border: 1px solid rgba(28, 30, 29, 0.06);
  border-radius: 8px;
  padding: 36px;
  box-shadow: 0 4px 16px rgba(28, 30, 29, 0.01);
  transition: transform 0.4s, box-shadow 0.4s, border-color 0.4s;
}

.timeline-item:hover .timeline-card {
  box-shadow: 0 12px 30px rgba(28, 30, 29, 0.03);
  border-color: rgba(28, 30, 29, 0.12);
}

@media (max-width: 600px) {
  .timeline-card {
    padding: 24px;
  }
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.item-date {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  opacity: 0.6;
}

/* Category pills */
.category-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 100px;
}

.category-tag.edu {
  color: #213f52;
  background: rgba(61, 90, 108, 0.06);
}

.category-tag.tech {
  color: #1b4a2e;
  background: rgba(35, 56, 43, 0.05);
}

.category-tag.env {
  color: #1d3324;
  background: rgba(26, 46, 34, 0.05);
}

.category-tag.comm {
  color: #9c552b;
  background: rgba(200, 125, 85, 0.07);
}

.item-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 400;
  color: var(--text-charcoal);
  line-height: 1.2;
  margin-bottom: 12px;
}

.item-summary {
  font-size: clamp(14px, 1.5vw, 16px);
  opacity: 0.8;
  line-height: 1.7;
  margin-bottom: 24px;
}

/* Meta & score row */
.item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-light);
  padding-top: 18px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.meta-field {
  font-size: 13px;
  opacity: 0.8;
}

.ripple-score {
  display: flex;
  gap: 16px;
}

.score-val {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-moss);
  background: var(--bg-fog);
  padding: 3px 12px;
  border-radius: 100px;
}

.archive-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(35, 56, 43, 0.08);
  color: var(--accent-moss);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: middle;
}

.archive-empty-state {
  border: 1px dashed var(--border-light);
  border-radius: 8px;
  padding: 40px 24px;
  text-align: center;
  color: var(--text-charcoal);
  opacity: 0.68;
  background: rgba(28, 30, 29, 0.015);
}

.drawer-section.archive-wide {
  grid-column: 1 / -1;
  border-top: 1px dashed var(--border-light);
  padding-top: 18px;
}

/* Expand Button */
.expand-btn {
  background: transparent;
  border: none;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-clay);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  outline: none;
  transition: color 0.3s;
  padding: 0;
}

.expand-btn:hover {
  color: var(--accent-moss);
}

.expand-btn .arrow {
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-card.expanded .expand-btn .arrow {
  transform: rotate(180deg);
}

/* Expanding Accordion Drawer */
.item-drawer {
  height: 0;
  overflow: hidden;
  opacity: 0;
  transition: height 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s;
}

.timeline-card.expanded .item-drawer {
  opacity: 1;
}

.drawer-content {
  border-top: 1px solid var(--border-light);
  padding-top: 24px;
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

@media (max-width: 768px) {
  .drawer-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.drawer-section h4 {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-clay);
  margin-bottom: 12px;
}

.drawer-section p {
  font-size: 13.5px;
  line-height: 1.7;
  opacity: 0.85;
}

/* ─── FOOTER (Consistent with Homepage) ──────── */
.footer {
  background: var(--bg-dark-moss);
  color: var(--bg-warm);
  padding: 80px 0;
  border-top: 1px solid rgba(250, 246, 240, 0.08);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 64px;
  display: flex;
  flex-direction: column;
  gap: 60px;
}

@media (max-width: 768px) {
  .footer-inner { padding: 0 28px; }
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 40px;
}

.footer-brand {
  max-width: 320px;
}

.footer-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.footer-tagline {
  font-size: 13px;
  opacity: 0.7;
  line-height: 1.6;
}

.footer-nav {
  display: flex;
  gap: 40px;
}

@media (max-width: 600px) {
  .footer-nav {
    flex-direction: column;
    gap: 16px;
  }
}

.footer-nav a {
  color: var(--bg-warm);
  text-decoration: none;
  font-size: 14px;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.footer-nav a:hover {
  opacity: 1;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(250, 246, 240, 0.08);
  padding-top: 40px;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-copy {
  font-size: 13px;
  opacity: 0.6;
  max-width: 600px;
}
