/* ============================================================
   Portfolio — Dark Technical Theme
   Robotics / Industrial Automation
   Zero-dependency, hand-written CSS.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Surfaces */
  --bg:            #0a0e14;
  --bg-elev:       #0e131b;
  --surface:       #121823;
  --surface-2:     #161e2b;
  --border:        #1d2735;
  --border-strong: #2b3a4d;

  /* Text */
  --text:        #e6edf3;
  --text-muted:  #93a1b3;
  --text-dim:    #5d6b7d;

  /* Accents — "signal" cyan + industrial amber */
  --accent:        #38bdf8;
  --accent-2:      #22d3ee;
  --accent-soft:   rgba(56, 189, 248, 0.12);
  --accent-glow:   rgba(56, 189, 248, 0.35);
  --amber:         #f5b14c;
  --success:       #34d399;

  /* Type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', 'Source Code Pro', Consolas, monospace;

  /* Layout */
  --maxw: 1100px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 14px;
  --radius-sm: 8px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; }

/* Background grid + radial glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.25;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
}
body::after {
  content: "";
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  z-index: -1;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

/* ---------- Helpers ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 300;
  background: var(--accent); color: #04121d; font-weight: 700;
  padding: 0.6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }

.section { padding-block: clamp(4rem, 9vw, 7rem); position: relative; }
.section-head { margin-bottom: 2.75rem; }
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.section-eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: var(--accent);
  opacity: 0.6;
}
.section-title {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 0.7rem;
  line-height: 1.15;
}
.section-sub { color: var(--text-muted); margin-top: 0.6rem; max-width: 60ch; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #04121d;
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px -10px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background: rgba(255,255,255,0.01);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Tag chips */
.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  padding: 0.28rem 0.6rem;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}

/* ============================================================
   Header / Nav
   ============================================================ */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.header.scrolled {
  background: rgba(10, 14, 20, 0.78);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.brand .dot { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 1.75rem; }
.nav-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  position: relative;
  transition: color 0.2s var(--ease);
}
.nav-links a .idx { font-family: var(--font-mono); color: var(--accent); font-size: 0.72rem; margin-right: 0.3rem; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 2px; background: var(--accent); border-radius: 2px;
}
.nav-cta { margin-left: 0.5rem; }

.nav-toggle { display: none; background: none; border: 0; color: var(--text); padding: 0.4rem; }
.nav-toggle svg { width: 26px; height: 26px; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: 70px;
  position: relative;
}
.hero-inner { max-width: 760px; }
.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  margin-bottom: 1.6rem;
}
.hero-status .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52,211,153,0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}
.hero h1 {
  font-size: clamp(2.5rem, 7vw, 4.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent) 10%, var(--accent-2) 60%, var(--amber) 110%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-role {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  color: var(--text-muted);
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
}
.hero-role b { color: var(--accent); font-weight: 600; }
.hero p.lead {
  margin-top: 1.4rem;
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 60ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
.hero-socials { display: flex; gap: 1.1rem; margin-top: 2.2rem; }
.hero-socials a {
  color: var(--text-dim);
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}
.hero-socials a:hover { color: var(--accent); transform: translateY(-2px); }
.hero-socials svg { width: 22px; height: 22px; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.hero-stats .stat .num {
  font-size: 1.8rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text);
}
.hero-stats .stat .label {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.2rem;
}

/* ============================================================
   About
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 3rem;
  align-items: start;
}
.about-text p { color: var(--text-muted); margin-bottom: 1.1rem; }
.about-text strong { color: var(--text); font-weight: 600; }
.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
}
.about-card h3 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.about-card li {
  display: flex;
  gap: 0.7rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.92rem;
}
.about-card li:last-child { border-bottom: 0; }
.about-card li .k { color: var(--text-dim); min-width: 92px; font-family: var(--font-mono); font-size: 0.82rem; }
.about-card li .v { color: var(--text); }

/* ============================================================
   Skills
   ============================================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.skill-card:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.skill-card h3 {
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
}
.skill-card h3 .icon {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}
.skill-card h3 .icon svg { width: 18px; height: 18px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }

/* ============================================================
   Projects
   ============================================================ */
.proj-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.2s var(--ease);
}
.filter-btn:hover { border-color: var(--border-strong); color: var(--text); }
.filter-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1.5rem;
}
.proj-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.proj-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -24px rgba(0,0,0,0.8);
}
.proj-media {
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, var(--surface-2), var(--bg-elev));
  position: relative;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.proj-media img, .proj-media video { width: 100%; height: 100%; object-fit: cover; }
.proj-media .placeholder {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  text-align: center;
  padding: 1rem;
}
.proj-media .placeholder svg { width: 34px; height: 34px; margin: 0 auto 0.6rem; opacity: 0.5; }
.proj-badge {
  position: absolute; top: 0.8rem; left: 0.8rem;
  font-family: var(--font-mono); font-size: 0.68rem;
  padding: 0.2rem 0.55rem; border-radius: 5px;
  background: rgba(10,14,20,0.8); color: var(--accent);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(4px);
}
.proj-body { padding: 1.3rem; display: flex; flex-direction: column; flex: 1; }
.proj-body h3 { font-size: 1.18rem; letter-spacing: -0.01em; }
.proj-role { font-family: var(--font-mono); font-size: 0.76rem; color: var(--accent); margin-top: 0.25rem; }
.proj-body p { color: var(--text-muted); font-size: 0.92rem; margin-top: 0.7rem; flex: 1; }
.proj-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.proj-links { display: flex; gap: 1.1rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.proj-links a {
  font-size: 0.85rem; font-weight: 600; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 0.4rem;
  transition: color 0.2s var(--ease);
}
.proj-links a:hover { color: var(--accent); }
.proj-links svg { width: 16px; height: 16px; }

/* ============================================================
   Experience / Education timeline
   ============================================================ */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px;
  width: 1px; background: var(--border);
}
.tl-item { position: relative; padding-bottom: 2.5rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -2rem; top: 6px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}
.tl-date { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); letter-spacing: 0.04em; }
.tl-item h3 { font-size: 1.15rem; margin-top: 0.35rem; }
.tl-org { color: var(--text-muted); font-size: 0.95rem; margin-top: 0.15rem; }
.tl-item ul.bullets { margin-top: 0.8rem; }
.tl-item ul.bullets li {
  position: relative; padding-left: 1.2rem; color: var(--text-muted);
  font-size: 0.92rem; margin-bottom: 0.4rem;
}
.tl-item ul.bullets li::before {
  content: "▹"; position: absolute; left: 0; color: var(--accent);
}
.tl-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.9rem; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; }
.col-label {
  font-family: var(--font-mono); font-size: 0.85rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text); margin-bottom: 1.6rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.col-label svg { width: 18px; height: 18px; color: var(--accent); }

/* ============================================================
   Contact
   ============================================================ */
.contact { text-align: center; }
.contact .section-title { font-size: clamp(2rem, 6vw, 3.2rem); }
.contact p.lead { color: var(--text-muted); max-width: 50ch; margin: 1rem auto 2rem; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; }
.contact-meta {
  display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: center;
  margin-top: 3rem; font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-dim);
}
.contact-meta a:hover { color: var(--accent); }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding-block: 2rem;
  text-align: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.footer a:hover { color: var(--accent); }

/* ============================================================
   Reveal on scroll
   ============================================================ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .two-col { grid-template-columns: 1fr; gap: 2.5rem; }
  .nav-links {
    position: fixed; inset: 70px 0 auto 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--bg-elev); border-bottom: 1px solid var(--border);
    padding: 0.5rem var(--gutter) 1.5rem;
    transform: translateY(-130%);
    transition: transform 0.35s var(--ease);
    height: auto;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { width: 100%; padding: 0.9rem 0; border-bottom: 1px solid var(--border); }
  .nav-links a.active::after { display: none; }
  .nav-links .nav-cta { margin: 1rem 0 0; }
  .nav-toggle { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   Clickable project cards
   ============================================================ */
.proj-card[data-href] { cursor: pointer; }
.proj-body h3 a { color: inherit; text-decoration: none; }
.proj-card:hover .proj-body h3 a { color: var(--accent); }
.proj-links a.proj-case { color: var(--accent); font-weight: 700; }
.proj-links a.proj-case:hover { color: var(--accent-2); }

/* ============================================================
   Project detail / case-study pages
   ============================================================ */
.detail-main { padding-top: 70px; }
.detail-wrap { max-width: 920px; }

.breadcrumb {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-muted);
  margin: 2.5rem 0 1.5rem;
}
.breadcrumb:hover { color: var(--accent); }

.detail-hero { padding-bottom: 1rem; }
.detail-hero h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.05;
  margin-top: 0.8rem;
}
.detail-hero .proj-role { font-size: 0.95rem; margin-top: 0.7rem; }
.detail-lead { color: var(--text-muted); font-size: 1.1rem; margin-top: 1.2rem; max-width: 65ch; }

.detail-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px; margin-top: 2rem;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.detail-meta .m { background: var(--surface); padding: 1rem 1.1rem; }
.detail-meta .m .k {
  font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-dim);
}
.detail-meta .m .v { color: var(--text); font-weight: 600; font-size: 0.92rem; margin-top: 0.3rem; }

.detail-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.8rem; }

.detail-cover {
  margin: 2.5rem 0;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--surface);
}
.detail-cover img { width: 100%; display: block; }
.detail-cover figcaption {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-dim);
  padding: 0.7rem 1rem; border-top: 1px solid var(--border);
}

/* layout: article + sticky skills sidebar */
.detail-layout {
  display: grid; grid-template-columns: 1fr 300px; gap: 3rem;
  align-items: start; padding-bottom: 4rem;
}
.detail-article h2 {
  font-size: 1.45rem; letter-spacing: -0.01em; margin: 2.4rem 0 0.9rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.detail-article h2:first-child { margin-top: 0; }
.detail-article h2 .n { font-family: var(--font-mono); color: var(--accent); font-size: 0.95rem; }
.detail-article h3 { font-size: 1.1rem; margin: 1.6rem 0 0.6rem; }
.detail-article p { color: var(--text-muted); margin-bottom: 1rem; }
.detail-article strong { color: var(--text); font-weight: 600; }
.detail-article ul.dash { margin: 0.5rem 0 1.2rem; }
.detail-article ul.dash li {
  position: relative; padding-left: 1.4rem; color: var(--text-muted); margin-bottom: 0.6rem;
}
.detail-article ul.dash li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }
.detail-article ul.dash li strong { color: var(--text); }

/* steps / numbered approach */
.steps { counter-reset: step; margin: 1rem 0 1.4rem; }
.step {
  position: relative; padding: 0 0 1.2rem 2.6rem; border-left: 1px solid var(--border);
  margin-left: 0.7rem;
}
.step:last-child { border-left-color: transparent; padding-bottom: 0; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: -0.85rem; top: -0.15rem;
  width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--accent); color: var(--accent);
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700;
  display: grid; place-items: center;
}
.step h4 { font-size: 1rem; margin-bottom: 0.25rem; }
.step p { font-size: 0.93rem; margin-bottom: 0; }

/* metrics row */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1rem; margin: 1.2rem 0 1.5rem; }
.metric {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 1.1rem;
}
.metric .num { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.metric .lbl { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.gallery figure { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.gallery img { width: 100%; display: block; aspect-ratio: 4/3; object-fit: cover; }
.gallery figcaption { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); padding: 0.5rem 0.7rem; border-top: 1px solid var(--border); }

/* sidebar */
.detail-side { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 1.25rem; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; }
.panel h3 {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 1rem;
}
.panel.skills { border-color: var(--border-strong); box-shadow: 0 0 0 1px var(--accent-soft); }
.panel .skill-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.panel .stack-list li { display: flex; gap: 0.6rem; padding: 0.4rem 0; border-bottom: 1px dashed var(--border); font-size: 0.88rem; color: var(--text-muted); }
.panel .stack-list li:last-child { border-bottom: 0; }
.panel .links-list a { display: flex; align-items: center; gap: 0.55rem; padding: 0.5rem 0; color: var(--text-muted); font-size: 0.9rem; font-weight: 600; }
.panel .links-list a:hover { color: var(--accent); }
.panel .links-list svg { width: 16px; height: 16px; }

/* prev / next */
.detail-nav {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  border-top: 1px solid var(--border); padding: 2rem 0; margin-top: 1rem;
}
.detail-nav a { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-muted); }
.detail-nav a:hover { color: var(--accent); }
.detail-nav .nxt { margin-left: auto; text-align: right; }

@media (max-width: 860px) {
  .detail-layout { grid-template-columns: 1fr; gap: 2rem; }
  .detail-side { position: static; }
}

/* ============================================================
   Relevant coursework
   ============================================================ */
.coursework { margin-top: 3.5rem; }
.cw-sub { font-family: var(--font-sans); font-size: 0.85rem; color: var(--text-dim); text-transform: none; letter-spacing: 0; font-weight: 400; }
.cw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.cw-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; }
.cw-card h4 { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.5rem; }
.cw-item { padding: 0.7rem 0; border-bottom: 1px dashed var(--border); }
.cw-item:last-child { border-bottom: 0; padding-bottom: 0; }
.cw-item .code { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text); font-weight: 700; }
.cw-item .ctitle { color: var(--text-muted); font-size: 0.88rem; margin-left: 0.5rem; }
.cw-item .gain { color: var(--text-dim); font-size: 0.82rem; margin-top: 0.3rem; line-height: 1.45; }

/* ============================================================
   VisionNav hub — sub-project grid
   ============================================================ */
.subgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; margin: 1.5rem 0; }
.subcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; display: flex; flex-direction: column; transition: border-color 0.25s var(--ease); }
.subcard:hover { border-color: var(--border-strong); }
.subcard .num { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); }
.subcard h3 { font-size: 1.05rem; margin: 0.3rem 0 0.5rem; }
.subcard p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; flex: 1; }
.subcard .proj-tags { margin-top: auto; }
.wip { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px dashed var(--border); }
