/* ============================================================
   Presentations page — lvy-style chronological timeline
   Self-contained (mirrors blog.css's one-file-per-page convention).
   Duplicates the token block per project convention (no bundler).
   Reuses the site's established glass/mint recipe; introduces one
   new primitive (.reveal) for scroll-triggered entrance, gated by
   assets/js/reveal-on-scroll.js and prefers-reduced-motion.
   ============================================================ */

:root {
  --ink: #141e2d;
  --graphite: #4a5568;
  --mint: #2a8a6e;
  --mint-bright: #49bf9d;
  --surface-pearl: #fafafc;
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-border-strong: rgba(20, 30, 45, 0.08);
  --radius-card: 20px;
  --radius-pill: 999px;
  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-text: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --gold: #92670a;
  --gold-bg: rgba(245, 185, 66, 0.18);
}

/* ---------- Section rhythm (tighter than the generic #main > section gap) ---------- */

#pres-intro {
  padding-bottom: 1.5em !important;
}

#pres-timeline {
  padding-top: 1.5em !important;
}

/* ---------- Stats row ---------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 1.8em 0 0;
}

.stat-tile {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 8px 24px rgba(20, 30, 45, 0.06);
  padding: 20px 16px;
  text-align: center;
  transition: transform 220ms var(--ease-spring), box-shadow 220ms ease;
}

.stat-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(20, 30, 45, 0.10);
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2.1em;
  font-weight: 700;
  color: var(--mint);
  line-height: 1;
}

.stat-label {
  display: block;
  margin-top: 8px;
  color: var(--graphite);
  font-size: 0.85em;
  line-height: 1.4;
}

/* ---------- Timeline ---------- */

#pres-timeline h3.timeline-year-heading {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.15em;
  font-weight: 700;
  color: var(--ink);
  border-bottom: 2px solid var(--mint);
  padding-bottom: 4px;
  margin: 2em 0 0.6em;
}

#pres-timeline .timeline-year-group:first-of-type h3.timeline-year-heading {
  margin-top: 0.6em;
}

.timeline-year-group {
  padding-left: 0;
}

/* Rail line lives on the rows wrapper (not the group), so it never
   runs through the year heading text above it. */
.timeline-rows {
  position: relative;
}

.timeline-rows::before {
  content: "";
  position: absolute;
  left: 54px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: rgba(42, 138, 110, 0.22);
}

.timeline-row-wrap {
  position: relative;
}

.timeline-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 10px 14px 0;
  border-radius: 12px;
  cursor: default;
  transition: background 180ms ease;
}

a.timeline-row,
.spring-header.timeline-row {
  cursor: pointer;
  text-decoration: none;
}

.spring-header.timeline-row:hover,
.spring-header.timeline-row:focus-visible {
  background: rgba(42, 138, 110, 0.06);
  outline: none;
}

.tl-when {
  flex: 0 0 76px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 3px;
}

.tl-date {
  width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 600;
  color: var(--graphite);
}

.tl-dot {
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mint);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(42, 138, 110, 0.35);
  position: relative;
  z-index: 1;
}

.tl-body {
  flex: 1;
  min-width: 0;
  padding-left: 6px;
}

.tl-title {
  display: block;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02em;
  line-height: 1.35;
  margin-bottom: 3px;
}

.tl-talk {
  display: block;
  color: var(--graphite);
  font-size: 0.88em;
  font-style: italic;
  line-height: 1.4;
  margin-bottom: 3px;
}

.tl-meta {
  display: block;
  color: var(--graphite);
  font-size: 0.82em;
  line-height: 1.5;
}

.tl-meta .icon {
  margin-right: 3px;
}

.tl-pill {
  flex: 0 0 auto;
  align-self: flex-start;
  margin-top: 3px;
  margin-left: 10px;
  font-family: var(--font-text);
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.tl-pill--talk {
  background: rgba(42, 138, 110, 0.12);
  color: var(--mint);
}

.tl-pill--poster {
  background: transparent;
  border: 1px solid rgba(20, 30, 45, 0.15);
  color: var(--graphite);
}

.tl-pill--award {
  background: var(--gold-bg);
  color: var(--gold);
}

.tl-chev {
  flex: 0 0 auto;
  align-self: center;
  margin-left: 6px;
  color: var(--mint);
  font-size: 0.9em;
  display: inline-block;
  transition: transform 200ms var(--ease-spring);
}

.timeline-row-wrap[aria-expanded="true"] .tl-chev {
  transform: rotate(90deg);
}

.timeline-row-wrap .spring-panel {
  margin: -4px 0 10px 76px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--glass-border-strong);
  border-radius: 14px;
  color: var(--graphite);
  font-size: 0.92em;
  line-height: 1.6;
}

.timeline-row-wrap .spring-panel p,
.timeline-row-wrap .spring-panel ul {
  margin: 0 0 10px;
}

.timeline-row-wrap .spring-panel ul {
  padding-left: 18px;
}

.timeline-row-wrap .spring-panel a {
  color: var(--mint);
  font-weight: 600;
}

.timeline-row-wrap .spring-panel a:hover {
  color: var(--mint-bright);
}

.tl-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tl-gallery img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

/* ---------- Teaching & Communication: glass card grid ---------- */

.teaching-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 1.6em;
}

.teaching-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(20, 30, 45, 0.08);
  border-radius: 18px;
  padding: 26px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px -10px rgba(20, 30, 45, 0.12);
  transition: transform 200ms var(--ease-spring), box-shadow 200ms ease;
}

.teaching-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px rgba(20, 30, 45, 0.18);
}

.tc-badge {
  display: inline-block;
  background: rgba(42, 138, 110, 0.1);
  color: var(--mint);
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 10px;
}

.teaching-card h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 1.15em;
}

.tc-meta {
  color: var(--graphite);
  font-size: 0.85em;
  margin: 0 0 12px;
}

.teaching-card .row-header-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-text);
  font-size: 13px;
  color: var(--mint);
  margin-top: 8px;
  text-decoration: none;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
}

.teaching-card .row-header-toggle:hover { color: var(--mint-bright); }

.teaching-card .row-header-toggle .chev {
  display: inline-block;
  transition: transform 200ms var(--ease-spring);
}

.teaching-card[aria-expanded="true"] .row-header-toggle .chev {
  transform: rotate(90deg);
}

.teaching-card .spring-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--glass-border-strong);
  color: var(--graphite);
  font-size: 0.95em;
  line-height: 1.6;
}

.teaching-card .spring-panel p { margin: 0 0 10px; }

.teaching-card .tl-gallery img {
  width: 100px;
  height: 100px;
}

/* ---------- Responsive ---------- */

@media screen and (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline-rows::before {
    left: 44px;
  }

  .tl-when {
    flex: 0 0 56px;
    gap: 6px;
  }

  .tl-date {
    width: 30px;
    font-size: 12px;
  }

  .tl-pill {
    display: none;
  }

  .timeline-row-wrap .spring-panel {
    margin-left: 56px;
  }
}

@media screen and (max-width: 480px) {
  .tl-talk {
    display: none;
  }
}
