/* ══════════════════════════════════════════════════════════
   Site stylesheet — V1.1
   Changes from V1.0 (style.css):
   • Removed the permanent green box on the Contact nav link
     (.nav-cta). Contact now looks like every other nav link
     and only shows the green box when it is the active page.
   ══════════════════════════════════════════════════════════ */

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

:root {
  --bg:        #ffffff;
  --bg-soft:   #f7f7f5;
  --border:    #e8e8e4;
  --text:      #1a1a1a;
  --muted:     #666;
  --accent:    #2d7a4f;
  --accent-lt: #e8f5ee;
  --accent-md: #4caf7d;
  --font:      'Inter', system-ui, sans-serif;
  --mono:      'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.65; font-size: 15px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.container { max-width: 860px; margin: 0 auto; padding: 0 28px; }

/* ── Nav ── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 860px; margin: 0 auto; padding: 0 28px; height: 56px;
}
.nav-logo {
  font-weight: 800; font-size: 1rem; color: var(--text); letter-spacing: -0.3px;
}
.nav-logo span { color: var(--accent); }
.nav-logo:hover { text-decoration: none; }

.nav-links {
  display: flex; align-items: center; gap: 8px;
  list-style: none; margin: 0; padding: 0;
}
.nav-links a {
  display: inline-block; padding: 5px 12px; border-radius: 7px;
  font-size: 0.85rem; font-weight: 500; color: var(--muted);
  white-space: nowrap; transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--accent); background: var(--accent-lt); text-decoration: none; }
.nav-links a.active {
  color: var(--accent); font-weight: 600;
  background: var(--accent-lt); border-radius: 7px;
}
/* V1.1: the Contact link has no special styling. The old .nav-cta class
   (permanent green box) was removed from both this stylesheet and the
   HTML, so Contact is styled by the shared .nav-links a rules above and
   only shows the green box when it is the active page. */

/* Home section heading */
.home-sec { margin-bottom: 18px; }
.home-sec h2 { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.3px; }
.home-featured { margin-bottom: 64px; }

/* ── Hamburger ── */
.hamburger {
  display: flex; flex-direction: column; justify-content: center;
  gap: 5px; width: 36px; height: 36px; cursor: pointer;
  padding: 4px; border-radius: 6px; background: none; border: none;
  transition: background 0.2s;
}
.hamburger:hover { background: var(--accent-lt); }
.hamburger .bar {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px; transition: all 0.3s ease;
}
.hamburger.open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open .bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Drawer ── */
.drawer-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.18); z-index: 200; backdrop-filter: blur(2px);
}
.drawer-overlay.open { display: block; }
.drawer {
  position: fixed; top: 0; right: -280px;
  width: 260px; height: 100vh; background: #fff;
  border-left: 1px solid var(--border); z-index: 201;
  padding: 64px 0 32px; transition: right 0.3s ease;
  display: flex; flex-direction: column;
}
.drawer.open { right: 0; }
.drawer-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; cursor: pointer;
  font-size: 1.3rem; color: var(--muted); padding: 4px 8px; border-radius: 6px;
}
.drawer-close:hover { background: var(--bg-soft); }
.drawer-name {
  padding: 0 28px 24px; font-weight: 800; font-size: 1rem;
  border-bottom: 1px solid var(--border); color: var(--text);
}
.drawer-name span { color: var(--accent); }
.drawer nav ul { list-style: none; padding: 20px 0; flex: 1; }
.drawer nav ul li a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 28px; font-size: 0.95rem; font-weight: 600;
  color: var(--text); text-decoration: none; transition: background 0.15s, color 0.15s;
}
.drawer nav ul li a:hover { background: var(--accent-lt); color: var(--accent); }
.drawer nav ul li a.active { color: var(--accent); background: var(--accent-lt); }
.drawer nav ul li a .di { font-size: 1rem; width: 20px; }
.drawer-footer {
  padding: 20px 28px 0; border-top: 1px solid var(--border);
  display: flex; gap: 14px;
}
.drawer-footer a { color: var(--muted); transition: color 0.2s; }
.drawer-footer a:hover { color: var(--accent); }

/* ── Page Header ── */
.page-header {
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 56px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; flex-wrap: wrap;
}
.page-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}
.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 800;
  letter-spacing: -0.5px; margin-bottom: 10px;
}
.page-header p { color: var(--muted); font-size: 0.95rem; max-width: 520px; }
.page-header-logos { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; flex-shrink: 0; }
.uni-row { display: flex; align-items: center; gap: 10px; }
.uni-icon {
  display: inline-block; width: 42px; height: 42px; flex-shrink: 0;
  background-repeat: no-repeat; border-radius: 7px;
}
.uni-name { font-size: 0.85rem; font-weight: 600; color: var(--text); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: 8px;
  font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-primary { background: var(--accent); color: #fff; border: none; }
.btn-primary:hover { background: #256040; text-decoration: none; color: #fff; }
.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ── Hero Page ── */
.hero-page { padding: 80px 0 72px; }
.hero-tag {
  display: inline-block; background: var(--accent-lt); color: var(--accent);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 4px 12px; border-radius: 99px; margin-bottom: 20px;
}
.hero-page h1 {
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 800;
  letter-spacing: -1px; line-height: 1.15; margin-bottom: 20px;
}
.accent { color: var(--accent); }
.hero-sub { font-size: 1.05rem; color: var(--muted); max-width: 540px; margin-bottom: 36px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 64px; }

/* ── Page Grid (home) ── */
.page-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.page-card {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column; gap: 6px;
  color: var(--text);
}
.page-card:hover {
  border-color: var(--accent-md);
  box-shadow: 0 4px 20px rgba(45,122,79,0.08);
  text-decoration: none;
}
.page-card-icon { font-size: 1.4rem; margin-bottom: 4px; }
.page-card h3 { font-size: 0.95rem; font-weight: 700; }
.page-card p { font-size: 0.8rem; color: var(--muted); flex: 1; }
.page-card-arrow { font-size: 0.9rem; color: var(--accent); font-weight: 700; margin-top: 8px; }

/* ── About Page ── */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; margin-bottom: 48px; }
.about-text p { color: var(--muted); margin-bottom: 16px; font-size: 0.95rem; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat-card { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 20px 18px; }
.stat-card .num { font-size: 1.75rem; font-weight: 800; color: var(--accent); letter-spacing: -1px; }
.stat-card .label { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }

/* ── About Page: "Outside the Lab" ── */
.beyond { border-top: 1px solid var(--border); }
.beyond-header { padding: 56px 0 4px; }
.beyond-header h2 {
  font-size: clamp(1.5rem, 3.2vw, 1.9rem); font-weight: 800;
  letter-spacing: -0.5px; margin-bottom: 10px;
}
.beyond-header .lede { color: var(--muted); font-size: 0.98rem; max-width: 560px; }

/* Intro block: text beside a single photo, alternating sides */
.intro-block {
  display: grid; grid-template-columns: 1.25fr 1fr;
  gap: 32px; align-items: center;
  padding: 44px 0;
  border-bottom: 1px solid var(--border);
}
.intro-block:last-of-type { border-bottom: none; }
.intro-block.flip .ib-text { order: 2; }
.intro-block.flip .ib-media { order: 1; }
.ib-text h3 { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.3px; margin-bottom: 4px; }
.ib-text .kicker {
  display: block; font-family: var(--mono); font-size: 0.72rem;
  color: var(--accent); margin-bottom: 12px;
}
.ib-text p { color: var(--muted); font-size: 0.94rem; margin-bottom: 12px; }
.ib-text p:last-child { margin-bottom: 0; }
.ib-text .more {
  display: inline-block; margin-top: 6px;
  font-size: 0.82rem; font-weight: 600; color: var(--accent);
}
.ib-media .figure { margin: 0; }
.ib-media .figure.missing .ph { min-height: 210px; }

/* Philosophy */
.philosophy { padding: 44px 0; border-bottom: 1px solid var(--border); }
.philosophy h3 { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.3px; margin-bottom: 4px; }
.philosophy .kicker {
  display: block; font-family: var(--mono); font-size: 0.72rem;
  color: var(--accent); margin-bottom: 14px;
}
.philosophy p { color: var(--muted); font-size: 0.94rem; margin-bottom: 14px; max-width: 660px; }
.reading { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.book {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 18px; flex: 1 1 240px;
}
.book .bk-label {
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 5px;
}
.book .bk-title { font-size: 0.9rem; font-weight: 700; line-height: 1.4; }
.book .bk-author { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

/* ── Projects Page ── */
.projects-list { display: flex; flex-direction: column; gap: 18px; }
.project-card {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px;
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.project-card:hover { border-color: var(--accent-md); box-shadow: 0 4px 24px rgba(45,122,79,0.08); }
.project-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.project-card p { font-size: 0.875rem; color: var(--muted); margin-bottom: 16px; }
.project-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag { background: var(--accent-lt); color: var(--accent); border-radius: 6px; padding: 3px 10px; font-size: 0.72rem; font-weight: 600; }
.tag-grey { background: #f0f0ee; color: var(--muted); border-radius: 6px; padding: 3px 10px; font-size: 0.72rem; font-weight: 500; }
.project-link { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; color: var(--accent); white-space: nowrap; }

/* ── Ongoing Page ── */
.ongoing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.ongoing-card { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 22px 20px; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 600; color: var(--accent); margin-bottom: 12px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.ongoing-card h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; }
.ongoing-card p { font-size: 0.83rem; color: var(--muted); margin-bottom: 14px; }
.progress-bar { height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width 1.2s ease; width: 0; }
.progress-label { font-size: 0.72rem; color: var(--muted); margin-top: 6px; text-align: right; }

/* ── Skills Page ── */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.skill-group { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 22px 20px; }
.skill-group h4 { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 14px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tag { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; font-size: 0.78rem; font-family: var(--mono); color: var(--text); }

/* ── Learnings index: draft entries (greyed, not yet clickable) ── */
.blog-item.draft { opacity: 0.55; pointer-events: none; }

/* ── Post page: back link ── */
.post-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 600; color: var(--muted);
  margin-bottom: 20px;
}
.post-back:hover { color: var(--accent); text-decoration: none; }

/* ══════════════════════════════════════════════════════════
   Astronomy gallery (post-astronomy.html)
   ══════════════════════════════════════════════════════════ */
.astro-intro { color: var(--muted); font-size: 0.94rem; max-width: 640px; margin-bottom: 36px; }

.astro-gallery {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px;
}
.astro-card {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.astro-card:hover { border-color: var(--accent-md); box-shadow: 0 4px 24px rgba(45,122,79,0.08); }

/* Image area — fixed ratio so the grid stays tidy whatever you upload */
.astro-shot {
  position: relative; margin: 0;
  aspect-ratio: 4 / 3; background: #10131a;
  cursor: zoom-in; overflow: hidden;
}
.astro-shot img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; transition: transform 0.35s ease;
}
.astro-card:hover .astro-shot img { transform: scale(1.04); }
.astro-shot .zoom-hint {
  position: absolute; right: 10px; bottom: 10px;
  background: rgba(0,0,0,0.55); color: #fff;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.03em;
  padding: 3px 9px; border-radius: 99px;
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.astro-card:hover .astro-shot .zoom-hint { opacity: 1; }

/* Placeholder when the photo isn't in the repo yet */
.astro-shot .ph { display: none; }
.astro-shot.missing img { display: none; }
.astro-shot.missing { cursor: default; background: var(--bg-soft); }
.astro-shot.missing .zoom-hint { display: none; }
.astro-shot.missing .ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; width: 100%; height: 100%; padding: 20px;
  border-bottom: 1.5px dashed var(--border); text-align: center;
}
.astro-shot.missing .ph .ph-icon { font-size: 1.5rem; opacity: 0.5; }
.astro-shot.missing .ph .ph-title { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.astro-shot.missing .ph .ph-path {
  font-family: var(--mono); font-size: 0.7rem; color: var(--muted);
  background: #fff; border: 1px solid var(--border); border-radius: 5px;
  padding: 3px 8px; word-break: break-all;
}

.astro-body { padding: 20px 22px 18px; display: flex; flex-direction: column; flex: 1; }
.astro-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 6px;
}
.astro-head h3 { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.2px; }
.astro-when { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.astro-note { font-size: 0.87rem; color: var(--muted); margin-bottom: 14px; flex: 1; }

/* Expandable detail */
.astro-more { border-top: 1px solid var(--border); padding-top: 12px; }
.astro-more summary {
  cursor: pointer; list-style: none;
  font-size: 0.78rem; font-weight: 700; color: var(--accent);
  display: flex; align-items: center; gap: 6px;
}
.astro-more summary::-webkit-details-marker { display: none; }
.astro-more summary::after {
  content: '+'; font-size: 0.95rem; font-weight: 700; line-height: 1;
}
.astro-more[open] summary::after { content: '−'; }
.astro-more summary:hover { text-decoration: underline; }
.astro-specs { width: 100%; border-collapse: collapse; font-size: 0.8rem; margin-top: 12px; }
.astro-specs td { padding: 6px 0; border-bottom: 1px solid var(--border); color: var(--muted); vertical-align: top; }
.astro-specs td:first-child { color: var(--text); font-weight: 600; white-space: nowrap; padding-right: 14px; width: 40%; }
.astro-specs tr:last-child td { border-bottom: none; }
.astro-write { font-size: 0.86rem; color: var(--muted); margin-top: 12px; }

/* ── Lightbox ── */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(8,10,14,0.94);
  align-items: center; justify-content: center;
  padding: 56px 64px;
}
.lightbox.open { display: flex; }
.lb-figure { margin: 0; max-width: 100%; max-height: 100%; text-align: center; }
.lb-figure img {
  max-width: 100%; max-height: calc(100vh - 150px);
  object-fit: contain; border-radius: 6px; display: block; margin: 0 auto;
}
.lb-caption { color: #d8dde3; font-size: 0.85rem; margin-top: 14px; }
.lb-caption b { color: #fff; font-weight: 700; }
.lb-caption .lb-sub { display: block; color: #9aa3ad; font-size: 0.76rem; margin-top: 4px; }
.lb-btn {
  position: absolute; background: rgba(255,255,255,0.08); border: none;
  color: #fff; cursor: pointer; border-radius: 50%;
  width: 42px; height: 42px; font-size: 1.2rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.lb-btn:hover { background: rgba(255,255,255,0.2); }
.lb-close { top: 18px; right: 18px; font-size: 1.4rem; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lb-counter {
  position: absolute; top: 24px; left: 50%; transform: translateX(-50%);
  color: #9aa3ad; font-family: var(--mono); font-size: 0.74rem;
}

@media (max-width: 760px) {
  .astro-gallery { grid-template-columns: 1fr; }
  .lightbox { padding: 52px 12px; }
  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }
}

/* ── Blog Page ── */
.blog-list { display: flex; flex-direction: column; }
.blog-item {
  display: grid; grid-template-columns: 118px 1fr 24px;
  align-items: center; gap: 20px;
  padding: 22px 0; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.15s;
}
.blog-item:last-child { border-bottom: none; }
/* 118px fits a full MM / DD / YYYY date on one line */
.blog-date { font-size: 0.75rem; font-family: var(--mono); color: var(--muted); white-space: nowrap; }
.blog-item h4 { font-size: 0.95rem; font-weight: 600; transition: color 0.2s; }
.blog-item p { font-size: 0.83rem; color: var(--muted); margin-top: 4px; }
.blog-arrow { color: var(--muted); font-size: 1rem; transition: color 0.2s, transform 0.2s; }
.blog-item:hover .blog-arrow { color: var(--accent); transform: translateX(4px); }
.blog-item:hover h4 { color: var(--accent); }
/* Rows are links to their post pages */
a.blog-item { color: inherit; }
a.blog-item:hover { text-decoration: none; }

/* ── Contact Page ── */
.contact-wrap { max-width: 560px; }
.contact-wrap p { color: var(--muted); margin-bottom: 36px; font-size: 0.95rem; }
.social-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 48px; }
.social-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 8px; border: 1.5px solid var(--border);
  font-size: 0.84rem; font-weight: 600; color: var(--text); transition: all 0.2s;
}
.social-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.form-group input, .form-group textarea {
  padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px;
  font-family: var(--font); font-size: 0.9rem; color: var(--text);
  background: var(--bg-soft); transition: border-color 0.2s; resize: vertical;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--accent);
}

/* ── Project Detail Page ── */
.proj-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 600; color: var(--muted);
  margin-bottom: 24px;
}
.proj-back:hover { color: var(--accent); text-decoration: none; }

.proj-header { padding: 40px 0 32px; }
.proj-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 800;
  letter-spacing: -0.5px; margin-bottom: 12px;
}
.proj-header .lede { color: var(--muted); font-size: 1rem; max-width: 620px; margin-bottom: 20px; }
.proj-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }

/* Facts strip */
.facts-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  padding: 24px 0 8px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.fact .fact-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 4px;
}
.fact .fact-value { font-size: 0.9rem; font-weight: 700; color: var(--text); }

/* Sections */
.proj-section { padding: 48px 0 0; }
.proj-section > h2 {
  font-size: 1.3rem; font-weight: 800; letter-spacing: -0.3px;
  margin-bottom: 8px; scroll-margin-top: 72px;
}
.proj-section > .sec-note { color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; }
.proj-section h3 {
  font-size: 0.95rem; font-weight: 700; margin: 28px 0 10px;
}
.proj-section p { color: var(--muted); font-size: 0.93rem; margin-bottom: 14px; }
.proj-section p strong { color: var(--text); }

.bullets { list-style: none; margin: 0 0 16px; }
.bullets li {
  position: relative; padding-left: 20px; margin-bottom: 8px;
  font-size: 0.92rem; color: var(--muted);
}
.bullets li::before {
  content: '▸'; position: absolute; left: 0; color: var(--accent); font-size: 0.8rem;
}
.bullets li strong { color: var(--text); font-weight: 600; }

/* Numbered variant — keeps the step order visible */
ol.bullets { counter-reset: step; }
ol.bullets li { padding-left: 30px; }
ol.bullets li::before {
  counter-increment: step; content: counter(step);
  display: flex; align-items: center; justify-content: center;
  position: absolute; left: 0; top: 3px;
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--accent-lt); color: var(--accent);
  font-size: 0.7rem; font-weight: 700;
}

/* Spec table */
.spec-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 0.88rem; }
.spec-table th {
  text-align: left; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
  padding: 10px 12px; border-bottom: 1.5px solid var(--border);
}
.spec-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); color: var(--muted); vertical-align: top; }
.spec-table td:first-child { color: var(--text); font-weight: 600; white-space: nowrap; }
.spec-table tr:hover td { background: var(--bg-soft); }
.spec-table .mono { font-family: var(--mono); font-size: 0.82rem; }

/* Value the author still needs to confirm */
.todo {
  background: #fff6e0; border: 1px dashed #d9a441; color: #8a6212;
  border-radius: 4px; padding: 1px 7px; font-size: 0.78rem; font-weight: 600;
}

/* Callout */
.callout {
  background: var(--accent-lt); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; padding: 16px 20px; margin: 20px 0;
}
.callout p { color: #1f5637; margin: 0; font-size: 0.89rem; }
.callout p + p { margin-top: 8px; }

/* Code */
.code-block {
  background: #1c1f23; border-radius: 10px; padding: 18px 20px;
  overflow-x: auto; margin-bottom: 8px;
}
.code-block pre { margin: 0; }
.code-block code {
  font-family: var(--mono); font-size: 0.78rem; line-height: 1.7;
  color: #e4e6e8; white-space: pre;
}
.code-block .c { color: #7d8590; }
.code-block .k { color: #ff9d7a; }
.code-block .n { color: #9fd3ff; }
.code-caption { font-size: 0.78rem; color: var(--muted); margin-bottom: 20px; }

/* Figures */
.figure { margin: 0 0 22px; }
.figure img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft);
}
.figure figcaption { font-size: 0.78rem; color: var(--muted); margin-top: 8px; }
.figure figcaption b { color: var(--text); font-weight: 600; }
.figure .ph { display: none; }
.figure.missing img { display: none; }
.figure.missing .ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; min-height: 190px; padding: 24px;
  border: 1.5px dashed var(--border); border-radius: 10px;
  background: var(--bg-soft); text-align: center;
}
.figure.missing .ph .ph-icon { font-size: 1.5rem; opacity: 0.5; }
.figure.missing .ph .ph-title { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.figure.missing .ph .ph-path {
  font-family: var(--mono); font-size: 0.74rem; color: var(--muted);
  background: #fff; border: 1px solid var(--border); border-radius: 5px; padding: 3px 8px;
}

.figure-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Video */
.video-wrap {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--bg-soft); margin-bottom: 8px;
}
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Downloads */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.dl-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px; color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.dl-card:hover {
  border-color: var(--accent-md); text-decoration: none;
  box-shadow: 0 4px 20px rgba(45,122,79,0.08);
}
.dl-card .dl-icon { font-size: 1.15rem; line-height: 1.3; flex-shrink: 0; }
.dl-card .dl-name { display: block; font-size: 0.86rem; font-weight: 700; margin-bottom: 2px; }
.dl-card .dl-sub {
  display: block; font-size: 0.72rem; color: var(--muted);
  font-family: var(--mono); word-break: break-all;
}

/* Footer */
.proj-footer-nav {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 40px 0 0; margin-top: 48px; border-top: 1px solid var(--border);
}

/* ── Footer ── */
footer { text-align: center; padding: 28px 0; font-size: 0.78rem; color: var(--muted); border-top: 1px solid var(--border); margin-top: 72px; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .page-grid { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .page-header-logos { align-items: flex-start; }
  .intro-block { grid-template-columns: 1fr; gap: 22px; padding: 34px 0; }
  .intro-block.flip .ib-text { order: 1; }
  .intro-block.flip .ib-media { order: 2; }
  .blog-item { grid-template-columns: 1fr; gap: 4px; }
  .project-card { grid-template-columns: 1fr; }
  .nav-inner { gap: 12px; }
  .nav-links {
    gap: 4px; overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { font-size: 0.8rem; padding: 4px 9px; }
  .facts-grid { grid-template-columns: 1fr 1fr; gap: 18px 12px; }
  .figure-grid { grid-template-columns: 1fr; }
  .spec-table { font-size: 0.82rem; }
  .spec-table th, .spec-table td { padding: 9px 8px; }
  .spec-table td:first-child { white-space: normal; }
}
@media (max-width: 480px) {
  .page-grid { grid-template-columns: 1fr; }
}
