/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --surface: #f5f7fa;
  --border: #dde1ea;
  --accent: #1a56db;
  --accent2: #0ea5e9;
  --text: #111827;
  --muted: #6b7280;
  --heading-font: 'DM Serif Display', Georgia, serif;
  --body-font: 'DM Sans', sans-serif;
  --mono-font: 'DM Mono', monospace;
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body-font);
  font-size: 16px;
  line-height: 1.75;
  min-height: 100vh;
  margin-left: 30px;
}

/* ── NOISE OVERLAY ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 200px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
}

/* ── HEADER ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-family: var(--mono-font);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  text-decoration: none;
}

/* index.html: nav links */
nav a {
  font-family: var(--mono-font);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-decoration: none;
  margin-left: 2rem;
  transition: color 0.2s;
}
nav a:hover { color: var(--text); }

/* article pages: back link */
.back-link {
  font-family: var(--mono-font);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s;
}
.back-link:hover { color: var(--text); }

/* ── INDEX: HERO ── */
.hero {
  position: relative;
  padding: 7rem 2.5rem 5rem;
  max-width: 860px;
  z-index: 1;
}

.hero-like {
  position: relative;
  padding: 0rem 2.5rem 2.5rem;
  max-width: 860px;
  z-index: 1;
}

.hero-tag {
  font-family: var(--mono-font);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.indent {
  text-indent: 30px;
}
.hero-tag::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.hero h1 {
  font-family: var(--heading-font);
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1.8rem;
}

h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 520px;
  font-weight: 300;
}

/* ── GRID DECORATION ── */
.grid-lines {
  position: absolute;
  top: 0; right: 0;
  width: 50%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.06;
}
.grid-lines svg { width: 100%; height: 100%; }

/* ── PUBLICATION TIMELINE ── */
.timeline-figure {
  margin: 1.75rem 0 1.25rem;
  position: relative;
  z-index: 1;
  max-width: 100%;
}

.timeline-figure figcaption {
  font-family: var(--mono-font);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 0.3rem;
}

#pub-timeline svg { display: block; overflow: visible; }

/* ── WORD CLOUD ── */
.word-cloud-figure {
  position: absolute;
  right: -600px;
  top: 42%;
  transform: translateY(-50%);
  width: 700px;
  height: 700px;
  z-index: 0;
  pointer-events: none;
  margin: 0;
  padding-left: 75px;
}

#word-cloud {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
  border: none;
  -webkit-mask-image: radial-gradient(circle, black 55%, transparent 75%);
  mask-image: radial-gradient(circle, black 55%, transparent 75%);
}

#word-cloud svg { display: block; }

.hero-like > p,
.hero-like > hr {
  position: relative;
  z-index: 1;
}

/* ── INDEX: ARTICLES SECTION ── */
.section {
  position: relative;
  z-index: 1;
  padding: 1rem 2.5rem 6rem;
  max-width: 900px;
}

.section-label {
  font-family: var(--mono-font);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

/* ── ACCORDION ── */
.accordion {
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 30px;
}

.accordion-item {
  border-bottom: 1px solid var(--border);
  animation: fadeUp 0.4s ease both;
}
.accordion-item:last-child { border-bottom: none; }

.accordion-item:nth-child(1) { animation-delay: 0.05s; }
.accordion-item:nth-child(2) { animation-delay: 0.10s; }
.accordion-item:nth-child(3) { animation-delay: 0.15s; }
.accordion-item:nth-child(4) { animation-delay: 0.20s; }
.accordion-item:nth-child(5) { animation-delay: 0.25s; }
.accordion-item:nth-child(6) { animation-delay: 0.30s; }
.accordion-item:nth-child(7) { animation-delay: 0.35s; }
.accordion-item:nth-child(8) { animation-delay: 0.40s; }

.accordion-trigger {
  width: 100%;
  background: var(--surface);
  border: none;
  cursor: pointer;
  padding: 1.4rem 1.8rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  text-align: left;
  transition: background 0.18s;
}
.accordion-trigger:hover { background: #181c25; }
.accordion-trigger.open { background: #181c25; }

.accordion-trigger:hover .article-num,
.accordion-trigger.open .article-num { color: #93c5fd; }

.accordion-trigger:hover .article-title,
.accordion-trigger.open .article-title { color: #ffffff; }

.accordion-trigger:hover .article-tag,
.accordion-trigger.open .article-tag { color: #9ca3af; border-color: #4b5563; }

.article-num {
  font-family: var(--mono-font);
  font-size: 0.7rem;
  color: var(--accent);
  min-width: 28px;
  letter-spacing: 0.06em;
  transition: color 0.18s;
}

.article-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}

.article-tag {
  font-family: var(--mono-font);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  border: 1px solid var(--border);
  color: var(--muted);
  text-transform: uppercase;
  display: none;
  transition: color 0.18s, border-color 0.18s;
}
@media (min-width: 600px) { .article-tag { display: inline-block; } }

.chevron {
  color: var(--muted);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s;
  flex-shrink: 0;
}
.accordion-trigger.open .chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}
.accordion-panel.open { max-height: 400px; }

.panel-inner {
  padding: 0 1.8rem 1.6rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel-desc {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.65;
  max-width: 560px;
  padding-top: 1rem;
}

.panel-meta {
  display: flex;
  gap: 1.5rem;
  font-family: var(--mono-font);
  font-size: 0.72rem;
  color: var(--muted);
}

.read-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  font-family: var(--mono-font);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 0.55rem 1.1rem;
  border-radius: 3px;
  width: fit-content;
  transition: opacity 0.2s, transform 0.15s;
}
.read-btn:hover { opacity: 0.88; transform: translateX(3px); }
.read-btn svg { transition: transform 0.2s; }
.read-btn:hover svg { transform: translateX(2px); }

/* ── INDEX: SITE FOOTER ── */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 2rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

footer p {
  font-family: var(--mono-font);
  font-size: 0.72rem;
  color: var(--muted);
}

.dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 0.4rem;
  animation: pulse 2s ease-in-out infinite;
}

/* ── ARTICLE PAGES: MAIN CONTENT ── */
main {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 4rem 2.5rem 6rem;
  animation: fadeIn 0.4s ease;
}

main h1 {
  font-family: var(--heading-font);
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.article-eyebrow {
  font-family: var(--mono-font);
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.7rem;
}

.subtitle {
  font-family: var(--heading-font);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

/* ── BOOK METADATA CARD ── */
.book-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 2.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 2rem;
}

@media (max-width: 520px) {
  .book-card { grid-template-columns: 1fr; }
}

.field-label {
  font-family: var(--mono-font);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.field-value {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 400;
}

/* ── TAGS ROW ── */
.tags-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.tag {
  font-family: var(--mono-font);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.6rem;
  background: rgba(26, 86, 219, 0.08);
  border: 1px solid rgba(26, 86, 219, 0.25);
  color: var(--accent);
  border-radius: 3px;
  text-transform: uppercase;
}

/* ── LEAD / SUMMARY ── */
.lead {
  font-size: 1.05rem;
  color: var(--muted);
  font-weight: 300;
  border-left: 2px solid var(--accent);
  padding-left: 1.2rem;
  margin-bottom: 3rem;
  line-height: 1.75;
}

/* ── DIVIDER ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* ── BODY SECTIONS ── */
.section-heading {
  font-family: var(--heading-font);
  font-size: 1.45rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 1rem;
}

p {
  color: #374151;
  font-weight: 300;
  margin-bottom: 1.2rem;
}

/* ── PULL QUOTE ── */
blockquote {
  margin: 2rem 0;
  padding: 1.4rem 1.6rem;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
}

blockquote p {
  font-family: var(--heading-font);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 0.6rem;
  font-weight: 400;
}

blockquote cite {
  font-family: var(--mono-font);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  font-style: normal;
}

/* ── HIGHLIGHT CALLOUT ── */
.callout {
  display: flex;
  gap: 1rem;
  background: rgba(26, 86, 219, 0.05);
  border: 1px solid rgba(26, 86, 219, 0.18);
  border-radius: 5px;
  padding: 1.1rem 1.3rem;
  margin: 2rem 0;
}

.callout-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  line-height: 1.75;
}

.callout p {
  margin-bottom: 0;
  font-size: 0.92rem;
  color: #374151;
}

/* ── FIGURE / IMAGE ── */
.figure {
  margin: 2.2rem 0;
}

.figure-placeholder {
  width: 100%;
  height: 220px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--muted);
}

.figure-placeholder svg { opacity: 0.4; }

.figure-placeholder span {
  font-family: var(--mono-font);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

figcaption {
  margin-top: 0.7rem;
  font-family: var(--mono-font);
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── ARTICLE NAV FOOTER ── */
.nav-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono-font);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-decoration: none;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  transition: color 0.2s, border-color 0.2s;
}
.nav-btn:hover { color: var(--text); border-color: var(--muted); }

.nav-btn.primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  font-weight: 500;
}
.nav-btn.primary:hover { opacity: 0.88; }

/* ── CHART TOGGLES ── */
.chart-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  padding: 0.6rem 0 0.2rem;
}

.chart-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono-font);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.22rem 0.6rem;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.18s, color 0.18s, border-color 0.18s, background 0.18s;
}

.chart-toggle-btn.active {
  opacity: 1;
  color: var(--text);
  border-color: var(--muted);
}

.chart-toggle-btn:hover {
  border-color: var(--swatch-color, var(--muted));
  background: color-mix(in srgb, var(--swatch-color, transparent) 15%, transparent);
}

.toggle-swatch {
  display: inline-block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  flex-shrink: 0;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.authors {
  margin-top: 40px;
}

/* ── ABOUT PAGE ── */
.about-main {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 4rem 2.5rem 6rem;
  animation: fadeIn 0.4s ease;
}

.about-main h1 {
  font-family: var(--heading-font);
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.team-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2.5rem;
}

@media (max-width: 640px) {
  .team-grid { grid-template-columns: 1fr; }
}

.team-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: fadeUp 0.4s ease both;
}

.team-card:nth-child(1) { animation-delay: 0.05s; }
.team-card:nth-child(2) { animation-delay: 0.10s; }
.team-card:nth-child(3) { animation-delay: 0.15s; }
.team-card:nth-child(4) { animation-delay: 0.20s; }

.headshot-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.headshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.headshot-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
}

.team-info {
  padding: 1.4rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.team-name {
  font-family: var(--heading-font);
  font-size: 1.25rem;
  color: var(--text);
  font-weight: 400;
}

.team-major {
  font-family: var(--mono-font);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
}

.team-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.4rem 0;
}

.team-bio {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.65;
  margin-bottom: 0.5rem;
}

.team-articles {
  margin-top: auto;
  padding-top: 0.8rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}