/* ============================================================
   Jacob Gareis — Portfolio
   Shared stylesheet (home + project pages)
   Dark editorial theme: Playfair Display / Inter / JetBrains Mono
   ============================================================ */

:root {
  --bg: #09090b;
  --bg-soft: #0c0c0f;
  --fg: #e3e3e3;
  --surface-1: #101012;
  --surface-2: #27272a;
  --muted: #71717a;
  --muted-2: #a1a1aa;
  --white: #ffffff;

  --accent-blue: #7dd3fc;
  --accent-yellow: #fde047;
  --accent-green: #6ee7b7;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;
  --ease-out: cubic-bezier(0.5, 1, 0.89, 1);

  --nav-h: 72px;
  --radius: 12px;
  --maxw: 1200px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a { color: inherit; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

::selection {
  background: rgba(125, 211, 252, 0.25);
  color: #fff;
}

/* ---------- Scroll reveal (progressive enhancement) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  will-change: opacity, transform;
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ============================================================
   Navigation
   ============================================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}

.site-nav.scrolled {
  background: rgba(9, 9, 11, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--surface-2);
}

nav.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--nav-h);
  position: relative;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  text-decoration: none;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.nav-logo span {
  color: #38bdf8;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: #fff;
}

.nav-cv {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--surface-2);
  border-radius: 100px;
  color: #fff !important;
  font-family: var(--font-mono);
  font-size: 0.78rem !important;
  letter-spacing: 0.02em;
  transition: border-color 0.2s, background 0.2s;
}
.nav-cv:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--surface-2);
  border-radius: 8px;
  width: 42px;
  height: 38px;
  cursor: pointer;
  position: relative;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 1.5px;
  background: #fff;
  transform: translate(-50%, -50%);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle span::before { transform: translate(-50%, -6px); }
.nav-toggle span::after  { transform: translate(-50%, 5px); }
.nav-toggle.open span { background: transparent; }
.nav-toggle.open span::before { transform: translate(-50%, -50%) rotate(45deg); }
.nav-toggle.open span::after  { transform: translate(-50%, -50%) rotate(-45deg); }

/* ============================================================
   Hero
   ============================================================ */
header.hero {
  padding: 8vh 0 10vh;
  position: relative;
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

header.hero canvas {
  position: absolute;
  top: 0;
  left: -10%;
  width: 120%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.tagline {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.tagline .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #10b981; display: inline-block;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.headline {
  font-family: var(--font-serif);
  font-size: clamp(1.95rem, 4vw, 3.65rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #ffffff;
  margin-bottom: 2rem;
  max-width: 64rem;
}
.headline.wide { max-width: 100%; }

.headline em.blue-accent {
  font-style: italic;
  color: #7dd3fc;
}
.headline em.yellow-accent {
  font-style: italic;
  color: #fde047;
}

.hero-bio {
  font-size: 1.12rem;
  color: var(--muted-2);
  max-width: 580px;
  line-height: 1.7;
  margin-bottom: 2.75rem;
}

.cta-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.95rem 1.7rem;
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s var(--ease-out);
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: #ffffff;
  color: #000000;
}
.btn-primary:hover {
  background-color: #e3e3e3;
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: transparent;
  border: 1px solid var(--surface-2);
  color: #ffffff;
}
.btn-secondary:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.03);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--surface-2);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.btn-ghost:hover {
  color: #fff;
  border-color: var(--muted);
}

/* ============================================================
   Section scaffolding
   ============================================================ */
section[id], .anchor-target { scroll-margin-top: calc(var(--nav-h) + 1.25rem); }

.section {
  padding: 2rem 0 5rem;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--surface-2);
  padding-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.section-title .count {
  color: #52525b;
}

.section-lead {
  max-width: 680px;
  color: var(--muted-2);
  margin: -0.75rem 0 2.5rem;
  font-size: 1.02rem;
  line-height: 1.7;
}

/* ============================================================
   Research grid / cards
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
}

.card {
  background: var(--surface-1);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 2.4rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 340px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.4s var(--ease-out), transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.card:hover,
.card:focus-visible {
  border-color: var(--active-color);
  transform: translateY(-4px);
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.45), 0 0 0 1px var(--active-color);
  outline: none;
}

.card canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.card:hover canvas,
.card:focus-visible canvas { opacity: 1; }

.card-content {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.card-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--active-color);
  margin-bottom: 1rem;
  display: block;
}

.card h3 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 500;
  color: #fff;
  margin-bottom: 1rem;
  line-height: 1.25;
}

.card p {
  font-size: 0.94rem;
  color: var(--muted-2);
  line-height: 1.65;
}

.card-footer {
  position: relative;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--active-color);
  margin-top: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: gap 0.3s var(--ease-out);
}
.card:hover .card-footer { gap: 0.75rem; }

/* ============================================================
   About / Methodology
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3.5rem;
  align-items: start;
}

.about-copy p {
  color: var(--muted-2);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
}
.about-copy p:last-child { margin-bottom: 0; }
.about-copy strong { color: #fff; font-weight: 600; }
.about-copy a.inline-link {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid var(--surface-2);
  transition: border-color 0.2s;
}
.about-copy a.inline-link:hover { border-color: #fff; }

.about-panel {
  background: var(--surface-1);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 2rem;
}
.about-panel h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.about-panel h4:not(:first-child) { margin-top: 2rem; }

.edu-item { margin-bottom: 1.25rem; }
.edu-item:last-child { margin-bottom: 0; }
.edu-item .deg { color: #fff; font-weight: 500; }
.edu-item .school {
  color: var(--muted-2);
  font-size: 0.92rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.edu-item .school .yr { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.edu-item .note { color: var(--muted); font-size: 0.85rem; margin-top: 0.15rem; }

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted-2);
  border: 1px solid var(--surface-2);
  background: rgba(255, 255, 255, 0.015);
  border-radius: 100px;
  padding: 0.35rem 0.8rem;
  transition: border-color 0.2s, color 0.2s;
}
.tag:hover { color: #fff; border-color: var(--muted); }

/* ============================================================
   Publications
   ============================================================ */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pub {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 1.5rem;
  align-items: start;
  padding: 1.75rem;
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  background: var(--surface-1);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.3s var(--ease-out), transform 0.3s var(--ease-out), background 0.3s;
}
.pub:hover {
  border-color: var(--muted);
  transform: translateY(-2px);
  background: #131316;
}
.pub.is-link:hover { border-color: var(--accent-green); }

.pub-year {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: #fff;
  line-height: 1.1;
}
.pub-year small {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.3rem;
}

.pub-body .pub-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.18rem;
  color: #fff;
  line-height: 1.35;
  margin-bottom: 0.6rem;
}
.pub-body .pub-authors {
  font-size: 0.92rem;
  color: var(--muted-2);
  line-height: 1.55;
}
.pub-body .pub-authors .me { color: #fff; font-weight: 600; }
.pub-body .pub-venue {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.pub-status {
  align-self: center;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.7rem;
  border-radius: 100px;
  border: 1px solid var(--surface-2);
  color: var(--muted-2);
}
.pub-status.published {
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.35);
  background: rgba(110, 231, 183, 0.06);
}
.pub-status.review {
  color: #fcd34d;
  border-color: rgba(252, 211, 77, 0.3);
  background: rgba(252, 211, 77, 0.05);
}
.pub-arrow {
  font-family: var(--font-mono);
  color: var(--accent-green);
  font-size: 0.82rem;
  margin-top: 0.5rem;
}

/* ============================================================
   Experience — vertical timeline
   ============================================================ */
.timeline {
  position: relative;
  margin-top: 1rem;
  padding-left: 2.25rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, var(--surface-2), rgba(39, 39, 42, 0.15));
}

.timeline-item {
  position: relative;
  padding: 0 0 2.75rem 0;
}
.timeline-item:last-child { padding-bottom: 0.5rem; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(-2.25rem + 1px);
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--exp-color, var(--muted));
  box-shadow: 0 0 0 4px var(--bg);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  z-index: 2;
}
.timeline-item:hover::before {
  transform: scale(1.15);
  box-shadow: 0 0 0 4px var(--bg), 0 0 16px color-mix(in srgb, var(--exp-color) 60%, transparent);
}

.timeline-card {
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.25rem 0.25rem 0.25rem 0.25rem;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.timeline-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.timeline-logo {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: #18181b;
}
.timeline-logo img {
  width: 30px; height: 30px; object-fit: contain; display: block;
}

.timeline-meta { flex: 1 1 280px; min-width: 0; }

.timeline-role {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  color: #fff;
  line-height: 1.2;
}
.timeline-org {
  color: var(--muted-2);
  font-size: 0.96rem;
  margin-top: 0.1rem;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--exp-color, var(--muted));
  white-space: nowrap;
  padding-top: 0.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.timeline-date .present {
  width: 6px; height: 6px; border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.timeline-bullets {
  list-style: none;
  margin: 1rem 0 0;
  padding-left: calc(46px + 1rem);
}
.timeline-bullets li {
  position: relative;
  color: var(--muted-2);
  font-size: 0.94rem;
  line-height: 1.6;
  padding-left: 1.1rem;
  margin-bottom: 0.5rem;
}
.timeline-bullets li:last-child { margin-bottom: 0; }
.timeline-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--exp-color, var(--muted));
  opacity: 0.7;
}

/* ============================================================
   Contact
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 3.5rem;
  align-items: start;
}

.contact-copy h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 500;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}
.contact-copy p {
  color: var(--muted-2);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 42ch;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.contact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--surface-2);
  text-decoration: none;
  color: var(--muted-2);
  transition: color 0.2s, padding-left 0.25s var(--ease-out);
}
.contact-link:last-child { border-bottom: 1px solid var(--surface-2); }
.contact-link:hover { color: #fff; padding-left: 0.4rem; }
.contact-link .label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  flex: 0 0 90px;
}
.contact-link .val { flex: 1; font-size: 0.98rem; }
.contact-link .arrow { color: var(--muted); transition: transform 0.25s var(--ease-out); }
.contact-link:hover .arrow { transform: translate(3px, -3px); color: #fff; }

/* form */
.contact-form {
  background: var(--surface-1);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 2rem;
}
.field { margin-bottom: 1.25rem; }
.field:last-of-type { margin-bottom: 1.5rem; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.field input,
.field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--surface-2);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder,
.field textarea::placeholder { color: #52525b; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.12);
}
.field textarea { resize: vertical; min-height: 130px; }

.form-submit {
  width: 100%;
  justify-content: center;
}
.form-status {
  margin-top: 1rem;
  font-size: 0.9rem;
  text-align: center;
  min-height: 1.2em;
}
.form-status.ok { color: #6ee7b7; }
.form-status.err { color: #fca5a5; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* ============================================================
   Footer
   ============================================================ */
footer.site-footer {
  padding: 3rem 0;
  border-top: 1px solid var(--surface-2);
  margin-top: 2rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-inner .copy {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #52525b;
}
.footer-links a {
  color: var(--muted-2);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  transition: color 0.2s;
}
.footer-links a:first-child { margin-left: 0; }
.footer-links a:hover { color: #fff; }

/* ============================================================
   Project pages
   ============================================================ */
.proj-hero {
  position: relative;
  padding: 4vh 0 3vh;
  overflow: hidden;
}
.proj-hero canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.55;
}
.proj-hero .container { position: relative; z-index: 2; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 2.5rem;
  transition: color 0.2s, gap 0.25s var(--ease-out);
}
.back-link:hover { color: #fff; gap: 0.8rem; }

.proj-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--proj-color, var(--accent-blue));
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.proj-kicker .sep { color: #3f3f46; }
.proj-kicker .field-name { color: var(--muted); }

.proj-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 500;
  color: #fff;
  line-height: 1.12;
  letter-spacing: -0.01em;
  max-width: 20ch;
  margin-bottom: 1.5rem;
}
.proj-summary {
  font-size: 1.18rem;
  color: var(--muted-2);
  line-height: 1.65;
  max-width: 62ch;
}

.proj-metabar {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--surface-2);
}
.proj-metabar .item .k {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.proj-metabar .item .v { color: #fff; font-size: 0.96rem; }
.proj-metabar .item .v .present {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: #10b981; margin-right: 0.4rem;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.15);
}

/* project body */
.proj-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 4rem;
  padding: 4vh 0 6vh;
  align-items: start;
}

.proj-article h2 {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 500;
  color: #fff;
  margin: 2.75rem 0 1rem;
}
.proj-article h2:first-child { margin-top: 0; }
.proj-article h3 {
  font-size: 1.05rem;
  color: #fff;
  font-weight: 600;
  margin: 1.75rem 0 0.6rem;
}
.proj-article p {
  color: var(--muted-2);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.2rem;
}
.proj-article p:last-child { margin-bottom: 0; }
.proj-article strong { color: #fff; font-weight: 600; }
.proj-article em { color: #e9d5ff; font-style: italic; }
.proj-article a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid var(--proj-color, var(--surface-2));
  transition: opacity 0.2s;
}
.proj-article a:hover { opacity: 0.75; }

.proj-article ul.clean {
  list-style: none;
  margin: 0.5rem 0 1.5rem;
  padding: 0;
}
.proj-article ul.clean li {
  position: relative;
  color: var(--muted-2);
  font-size: 1.02rem;
  line-height: 1.7;
  padding-left: 1.4rem;
  margin-bottom: 0.7rem;
}
.proj-article ul.clean li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--proj-color, var(--accent-blue));
  font-family: var(--font-mono);
  font-size: 0.85rem;
  top: 0.15em;
}

.callout {
  border: 1px solid var(--surface-2);
  border-left: 2px solid var(--proj-color, var(--accent-blue));
  background: var(--surface-1);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
}
.callout p { margin: 0; font-size: 1rem; color: var(--muted-2); }
.callout .label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--proj-color, var(--accent-blue));
  margin-bottom: 0.5rem;
}

/* project sidebar */
.proj-aside {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.aside-block {
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--surface-1);
}
.aside-block h4 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 1rem;
}
.aside-block .tag-cloud .tag:hover { border-color: var(--proj-color); color: #fff; }

.aside-link {
  display: block;
  text-decoration: none;
  color: var(--muted-2);
  padding: 0.7rem 0;
  border-top: 1px solid var(--surface-2);
  font-size: 0.92rem;
  transition: color 0.2s, padding-left 0.2s var(--ease-out);
}
.aside-link:first-of-type { border-top: none; padding-top: 0; }
.aside-link:hover { color: #fff; padding-left: 0.3rem; }
.aside-link .meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.proj-nextprev {
  border-top: 1px solid var(--surface-2);
  padding: 2.5rem 0 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.proj-nextprev a {
  text-decoration: none;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: color 0.2s;
}
.proj-nextprev a:hover { color: #fff; }
.proj-nextprev a .lab { display: block; color: var(--muted); font-size: 0.7rem; margin-bottom: 0.3rem; text-transform: uppercase; letter-spacing: 0.1em; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .proj-body { grid-template-columns: 1fr; gap: 2.5rem; }
  .proj-aside { position: static; flex-direction: row; flex-wrap: wrap; }
  .aside-block { flex: 1 1 240px; }
}

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

  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: calc(var(--nav-h) - 6px);
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    background: rgba(12, 12, 15, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--surface-2);
    border-radius: 14px;
    padding: 1.5rem 1.75rem;
    min-width: 220px;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .nav-links.open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .nav-cv { margin-top: 0.25rem; }

  .headline, .headline.wide { max-width: 100%; }
  .cta-group { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }

  .pub { grid-template-columns: 48px 1fr; }
  .pub-status { grid-column: 2; justify-self: start; margin-top: 0.5rem; }
  .pub-arrow { display: none; }

  .timeline-bullets { padding-left: 0; }

  .proj-metabar { gap: 1.5rem 2rem; }
}

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

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.05ms !important; }
}
