/* ============================================
   Justin Aunger — Academic portfolio
   Dark theme inspired by minimal portfolio style
   ============================================ */

:root {
  --bg: #0b0b0b;
  --bg-alt: #050505;
  --card: #161616;
  --card-light: #ececea;
  --text: #f4f4f2;
  --muted: #a3a3a0;
  --faint: #6e6e6b;
  --line: #262626;
  --amber: #f5c544;
  --green: #8ed9a0;
  --blue: #8ab4f8;
  --purple: #b79cf6;
  --coral: #f08a6c;
  --radius: 18px;
  --maxw: 1080px;
  --font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 11, 11, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled { border-bottom-color: var(--line); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
}

.brand .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a4d3e, #1d3557);
  color: #cfe8d8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  font-size: 14px;
  color: var(--muted);
}
.nav-links a { transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero { padding: 72px 0 56px; }

.hero h1 {
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.01em;
  max-width: 760px;
}

.hero .lede {
  margin-top: 26px;
  max-width: 640px;
  color: var(--muted);
  font-size: 17px;
}
.hero .lede strong { color: var(--text); font-weight: 600; }
.hl-green { color: var(--green); font-weight: 600; }
.hl-amber { color: var(--amber); font-weight: 600; }
.hl-blue { color: var(--blue); font-weight: 600; }
.hl-purple { color: var(--purple); font-weight: 600; }

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid #3a3a3a;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.btn:hover { background: #1d1d1d; border-color: #555; }
.btn.primary { background: var(--text); color: #111; border-color: var(--text); }
.btn.primary:hover { background: #d8d8d4; }

.hero-socials { display: flex; gap: 10px; margin-left: auto; }
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #2e2e2e;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
}
.icon-btn:hover { color: var(--text); border-color: #555; }
.icon-btn svg { width: 17px; height: 17px; fill: currentColor; }

/* ---------- Hero portrait ---------- */
.hero-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 56px;
  align-items: center;
}
.hero-portrait {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
}
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Stats band ---------- */
.stats {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 64px 0;
}

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

.stat-card {
  border-radius: var(--radius);
  padding: 28px 26px;
  border: 1px solid var(--line);
}
.stat-card.tint-amber  { background: linear-gradient(160deg, #1d1505, #141414 70%); }
.stat-card.tint-green  { background: linear-gradient(160deg, #0e1d12, #141414 70%); }
.stat-card.tint-purple { background: linear-gradient(160deg, #161023, #141414 70%); }

.stat-value {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.stat-value .accent-amber { color: var(--amber); }
.stat-value .accent-green { color: var(--green); }
.stat-value .accent-purple { color: var(--purple); }
.stat-value .dim { color: var(--faint); font-weight: 500; }

.stat-card p { font-size: 14.5px; color: var(--muted); }

/* ---------- Work cards ---------- */
.section { padding: 80px 0; }

.section-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  margin-bottom: 14px;
}

.section h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}

.work-card {
  display: block;
  margin-bottom: 64px;
}

.work-card .thumb {
  border-radius: var(--radius);
  background: var(--card-light);
  aspect-ratio: 16 / 7.5;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s ease;
}
.work-card:hover .thumb { transform: translateY(-4px); }
.work-card .thumb svg { width: 100%; height: 100%; }
.work-card .thumb img { width: 100%; height: 100%; object-fit: contain; }

.work-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
}
.work-meta .tag-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #111;
}
.work-card h3 {
  margin-top: 8px;
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: color 0.2s;
}
.work-card:hover h3 { color: var(--green); }

/* ---------- Two-column prose ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}
.two-col h2 { font-size: 26px; margin-bottom: 14px; }
.two-col p { color: var(--muted); font-size: 15.5px; }
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.read-more:hover { color: var(--green); }

/* ---------- Page headers (inner pages) ---------- */
.page-head { padding: 64px 0 36px; }
.page-head h1 {
  font-size: clamp(32px, 4.4vw, 46px);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.page-head .lede {
  margin-top: 18px;
  max-width: 680px;
  color: var(--muted);
}

/* ---------- Prose blocks ---------- */
.prose { max-width: 720px; color: var(--muted); }
.prose p + p { margin-top: 16px; }
.prose strong { color: var(--text); }
.prose a { color: var(--blue); }
.prose a:hover { text-decoration: underline; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; max-width: 820px; }
.timeline li {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.timeline .when {
  font-size: 14px;
  font-weight: 600;
  color: var(--faint);
  padding-top: 2px;
  white-space: nowrap;
}
.timeline .what { color: var(--text); font-size: 15.5px; }
.timeline .what .sub { color: var(--muted); font-size: 14px; margin-top: 3px; }
.timeline .what a { color: var(--blue); }
.timeline .what a:hover { text-decoration: underline; }

/* ---------- Publication cards ---------- */
.pub-featured {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 20px;
  background: var(--card);
}
.pub-featured .journal {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.pub-featured h3 { font-size: 19px; font-weight: 600; line-height: 1.4; }
.pub-featured h3 a:hover { color: var(--green); }
.pub-featured .note { margin-top: 10px; color: var(--muted); font-size: 14.5px; }

/* ---------- Publication list ---------- */
.pub-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 8px;
  align-items: center;
}
.pub-controls input[type="search"] {
  flex: 1;
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 9px 18px;
  outline: none;
}
.pub-controls input[type="search"]:focus { border-color: #555; }

.chip {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}
.chip:hover { border-color: #555; color: var(--text); }
.chip.active { background: var(--text); color: #111; border-color: var(--text); }

.pub-year { margin-top: 34px; }
.pub-year h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--faint);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.pub-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  color: var(--muted);
}
.pub-item .title { color: var(--text); font-weight: 600; }
.pub-item a .title:hover { color: var(--green); }
.pub-item .src { font-size: 13.5px; margin-top: 3px; }
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 9px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: 2px;
}
.badge.fa { background: rgba(142, 217, 160, 0.12); color: var(--green); }
.badge.status { background: rgba(245, 197, 68, 0.12); color: var(--amber); }

.pub-count { font-size: 13px; color: var(--faint); margin-top: 14px; }

/* ---------- Grants table ---------- */
.grants-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.grants-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--line);
}
.grants-table td {
  padding: 14px 14px 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  vertical-align: top;
}
.grants-table td:first-child { color: var(--faint); white-space: nowrap; }
.grants-table .g-title { color: var(--text); font-weight: 500; }
.grants-table .g-amount { color: var(--amber); font-weight: 700; white-space: nowrap; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0;
  margin-top: 40px;
}
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-socials { display: flex; gap: 10px; }
.site-footer .copyright { font-size: 12.5px; color: var(--faint); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .stats-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; gap: 40px; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }

  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 16px;
  }
  .nav-links.open { display: flex; }
  .nav-links li { padding: 10px 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-portrait { max-width: 360px; }
}
