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

/* Midnight + Blue — default dark theme */
:root {
  --bg:        #0E1116;
  --bg-alt:    #13171F;
  --surface:   #181C24;
  --border:    #252A35;
  --text:      #F4F4F5;
  --text-muted:#9DA5B0;
  --accent:    #2B6DC9;
  --accent-lt: #387EE0;
  --accent-fg: #0E1116;
  --nav-h:     64px;
  --radius:    12px;
  --shadow:    0 2px 24px rgba(0,0,0,.5);
  --transition:200ms ease;
}

/* Light mode — cool off-white to stay on-brand */
[data-theme="light"] {
  --bg:        #F2F4F7;
  --bg-alt:    #E5E9EF;
  --surface:   #FFFFFF;
  --border:    #D2D8E0;
  --text:      #141720;
  --text-muted:#6B7280;
  --accent:    #2B6DC9;
  --accent-lt: #205CB3;
  --accent-fg: #FFFFFF;
  --shadow:    0 2px 20px rgba(0,0,0,.08);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

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

/* ── Typography ───────────────────────────────────────────────── */
h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 700; line-height: 1.1; letter-spacing: -.03em; }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700; letter-spacing: -.02em; }
h3 { font-size: 1.2rem; font-weight: 600; }
p  { color: var(--text-muted); font-size: 1rem; }

/* ── Layout helpers ───────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
section { padding: 96px 0; }

/* ── Cursor glow (desktop only) ───────────────────────────────── */
.cursor-glow {
  position: fixed; top: 0; left: 0;
  width: 700px; height: 700px;
  border-radius: 50%;
  transform: translate(calc(var(--cx, -9999px) - 50%), calc(var(--cy, -9999px) - 50%));
  background: radial-gradient(circle,
    color-mix(in srgb, var(--accent-lt) 5%, transparent) 0%,
    transparent 65%);
  pointer-events: none; z-index: 1;
  will-change: transform;
}
@media (pointer: coarse) { .cursor-glow { display: none; } }

/* ── Nav ──────────────────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  transition: background var(--transition), border-color var(--transition);
}

.nav-inner {
  display: flex; align-items: center; justify-content: center;
  height: 100%;
}

.nav-logo {
  font-size: 1rem; font-weight: 700; letter-spacing: -.02em;
  color: var(--text);
}
.nav-logo span { color: var(--accent-lt); }

.nav-links {
  display: flex; align-items: center; gap: 4px;
  list-style: none;
}
.nav-links a {
  font-size: .875rem; font-weight: 500; padding: 6px 12px;
  border-radius: 8px; color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text); background: var(--bg-alt);
}

.nav-actions { display: flex; align-items: center; gap: 8px; }

.btn-theme {
  background: none; border: 1px solid var(--border);
  border-radius: 8px; width: 36px; height: 36px;
  cursor: pointer; display: grid; place-items: center;
  color: var(--text-muted); transition: all var(--transition);
  font-size: 1rem;
}
.btn-theme:hover { background: var(--bg-alt); color: var(--text); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .875rem; font-weight: 600; padding: 9px 18px;
  border-radius: 8px; cursor: pointer;
  transition: all .2s ease;
  border: none; font-family: inherit;
}
.btn-primary {
  background: var(--accent); color: var(--accent-fg);
}
[data-theme="light"] .btn-primary { color: #ffffff; }
.btn-primary:hover { opacity: .88; transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg-alt); transform: translateY(-1px); }

/* Glowing primary CTA */
.btn-glow {
  box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 35%, transparent);
}
.btn-glow:hover {
  box-shadow: 0 0 36px color-mix(in srgb, var(--accent) 55%, transparent);
}

.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

/* Mobile nav */
.mobile-menu {
  display: none; position: fixed; inset: var(--nav-h) 0 0 0;
  background: var(--bg); border-top: 1px solid var(--border);
  padding: 24px; flex-direction: column; gap: 8px; z-index: 99;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 12px 16px; border-radius: 8px; font-weight: 500;
  color: var(--text-muted);
}
.mobile-menu a:hover { background: var(--bg-alt); color: var(--text); }

/* ── Hero ─────────────────────────────────────────────────────── */
#home {
  position: relative;
  overflow: hidden;
  padding: 96px 0 112px;
  border-bottom: 1px solid var(--border);
}

/* Dot grid — PCB-inspired */
.hero-bg-grid {
  position: absolute; inset: 0;
  background-image: radial-gradient(
    circle,
    color-mix(in srgb, var(--border) 70%, transparent) 1px,
    transparent 1px
  );
  background-size: 28px 28px;
  pointer-events: none;
}

/* Ambient glow */
.hero-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 70% at 75% -5%,
      color-mix(in srgb, var(--accent) 14%, transparent), transparent 58%),
    radial-gradient(ellipse 60% 50% at 20% 110%,
      color-mix(in srgb, var(--accent) 6%, transparent), transparent 60%);
  pointer-events: none;
  animation: glow-breathe 8s ease-in-out infinite;
}
@keyframes glow-breathe {
  0%, 100% { opacity: 1; }
  50%       { opacity: .6; }
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 80px; align-items: center;
  position: relative; z-index: 2;
}

/* Hero text — stagger on page load via CSS animation */
@keyframes hero-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.hero-text > *:nth-child(1) { animation: hero-in .5s  .08s ease both; }
.hero-text > *:nth-child(2) { animation: hero-in .55s .18s ease both; }
.hero-text > *:nth-child(3) { animation: hero-in .55s .28s ease both; }
.hero-text > *:nth-child(4) { animation: hero-in .55s .38s ease both; }
.hero-text > *:nth-child(5) { animation: hero-in .55s .48s ease both; }

.hero-photo-wrap { animation: hero-in .6s .28s ease both; }

.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-lt);
  background: color-mix(in srgb, var(--accent-lt) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-lt) 20%, transparent);
  padding: 5px 14px; border-radius: 100px; margin-bottom: 20px;
}
.hero-tag-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-lt);
  box-shadow: 0 0 6px var(--accent-lt);
  animation: dot-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes dot-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--accent-lt); }
  50%       { opacity: .5; box-shadow: 0 0 12px var(--accent-lt); }
}

.hero-text h1 { margin-bottom: 20px; }
.hero-text h1 .name { display: block; color: var(--accent-lt); }

.hero-desc { font-size: 1.1rem; max-width: 500px; margin-bottom: 32px; line-height: 1.7; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }

.hero-links { display: flex; gap: 20px; }
.hero-link {
  font-size: .875rem; font-weight: 500; color: var(--text-muted);
  display: flex; align-items: center; gap: 7px;
  border-bottom: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  padding-bottom: 2px;
}
.hero-link:hover { color: var(--text); border-color: var(--text); }

/* Hero photo */
.hero-photo-wrap { position: relative; }

.hero-photo {
  position: relative; z-index: 1;
  border-radius: var(--radius);
  overflow: hidden;
}
.hero-photo img {
  width: 100%; aspect-ratio: 3/4; object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--border), var(--shadow);
  transition: transform .4s ease;
}
.hero-photo-wrap:hover .hero-photo img { transform: scale(1.02); }

/* Decorative offset ring */
.hero-photo-ring {
  position: absolute;
  inset: 14px -14px -14px 14px;
  border: 2px solid color-mix(in srgb, var(--accent-lt) 28%, transparent);
  border-radius: var(--radius);
  z-index: 0;
  pointer-events: none;
}


/* ── Section header ───────────────────────────────────────────── */
.section-header { margin-bottom: 56px; }
.section-header h2 { margin-bottom: 12px; }
.section-header p { max-width: 520px; font-size: 1.05rem; }

.section-label {
  font-size: .72rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase;
  color: var(--accent-lt); margin-bottom: 12px; display: block;
}

/* ── Projects ─────────────────────────────────────────────────── */
#projects { background: var(--bg-alt); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  display: flex; flex-direction: column;
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
  border-color: color-mix(in srgb, var(--accent-lt) 28%, var(--border));
}
[data-theme="light"] .project-card:hover { box-shadow: 0 12px 40px rgba(0,0,0,.12); }

.project-img {
  aspect-ratio: 16/9; overflow: hidden;
  background: var(--bg-alt);
  position: relative;
}
.project-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .45s ease;
}
.project-card:hover .project-img img { transform: scale(1.05); }

/* Overlay gradient for depth */
.project-img-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 55%, rgba(0,0,0,.35));
  opacity: 0; transition: opacity .3s ease;
  pointer-events: none;
}
.project-card:hover .project-img-overlay { opacity: 1; }

.project-img-placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: var(--text-muted);
}

.project-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.project-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}

.tag {
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 4px;
  background: color-mix(in srgb, var(--accent-lt) 12%, transparent);
  color: var(--accent-lt);
}
.tag-wip { background: color-mix(in srgb, #f59e0b 12%, transparent); color: #f59e0b; }
[data-theme="light"] .tag-wip { color: #d97706; }

.project-body h3 { font-size: 1.15rem; margin-bottom: 8px; }
.project-body p { font-size: .9rem; flex: 1; margin-bottom: 20px; }

.project-footer { display: flex; align-items: center; justify-content: space-between; }
.project-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: .68rem; font-weight: 500; padding: 3px 9px;
  border: 1px solid var(--border); border-radius: 4px;
  color: var(--text-muted);
  transition: border-color .2s, color .2s;
}
.project-card:hover .chip {
  border-color: color-mix(in srgb, var(--accent-lt) 25%, var(--border));
}

.project-arrow {
  font-size: 1rem; color: var(--text-muted);
  transition: transform .2s, color .2s;
}
.project-card:hover .project-arrow { transform: translate(3px,-3px); color: var(--accent-lt); }

/* ── Skills ───────────────────────────────────────────────────── */
#skills { background: var(--bg); }

.skills-categories { display: flex; flex-direction: column; gap: 48px; }

.skill-cat-block {}

.skill-cat-label {
  font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 16px; display: block;
}

/* Icon grid */
.skill-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}

.skill-icon-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 18px 10px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; text-align: center; cursor: default;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.skill-icon-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
  border-color: color-mix(in srgb, var(--accent-lt) 32%, var(--border));
}


/* Custom inline SVG icons */
.skill-svg {
  width: 34px; height: 34px;
  color: var(--text-muted);
  transition: color .2s ease, transform .2s ease;
  flex-shrink: 0;
}
.skill-icon-card:hover .skill-svg {
  color: var(--accent-lt);
  transform: scale(1.1);
}

.skill-icon-card span {
  font-size: .7rem; font-weight: 600; color: var(--text-muted);
  letter-spacing: .01em; line-height: 1.2;
  transition: color .2s;
}
.skill-icon-card:hover span { color: var(--text); }

/* ── Resume — compact card ────────────────────────────────────── */
#resume { background: var(--bg-alt); padding: 64px 0; }

.resume-compact {
  display: flex; align-items: center; justify-content: space-between;
  gap: 40px; padding: 40px 48px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.resume-compact:hover {
  border-color: color-mix(in srgb, var(--accent-lt) 25%, var(--border));
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
}

.resume-compact-left .section-label { margin-bottom: 8px; }
.resume-compact-left h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: 8px; }
.resume-compact-left p { font-size: .9rem; }

.resume-compact-right {
  display: flex; gap: 12px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end;
}

/* ── About ────────────────────────────────────────────────────── */
#about { background: var(--bg); }

.about-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center;
}
.about-photo img {
  width: 100%; border-radius: var(--radius);
  box-shadow: var(--shadow); object-fit: cover;
  transition: transform .4s ease;
}
.about-photo:hover img { transform: scale(1.01); }

.about-text h2 { margin-bottom: 16px; }
.about-text p { margin-bottom: 16px; line-height: 1.75; }

.about-badges {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px;
}
.about-badge {
  font-size: .8rem; font-weight: 600;
  padding: 7px 16px; border-radius: 100px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all .2s ease;
}
.about-badge:hover {
  border-color: color-mix(in srgb, var(--accent-lt) 30%, var(--border));
  color: var(--text);
}

/* ── Contact ──────────────────────────────────────────────────── */
#contact { background: var(--bg-alt); }
.contact-wrapper { max-width: 640px; }
.contact-links { display: flex; flex-direction: column; gap: 16px; }
.contact-link {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 24px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: all var(--transition);
}
.contact-link:hover { border-color: var(--accent-lt); transform: translateX(4px); }
.contact-link-icon {
  width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent-lt) 10%, transparent);
  font-size: 1.2rem; flex-shrink: 0;
}
.contact-link-text span {
  display: block; font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px;
}
.contact-link-text strong { font-size: .95rem; color: var(--text); }

/* ── Footer ───────────────────────────────────────────────────── */
footer { border-top: 1px solid var(--border); padding: 32px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; }
footer p { font-size: .85rem; }

/* ── Scroll animations ────────────────────────────────────────── */
.fade-in {
  opacity: 0; transform: translateY(22px);
  transition: opacity .55s ease, transform .55s ease;
}
.fade-in.visible { opacity: 1; transform: none; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .resume-compact { flex-direction: column; align-items: flex-start; padding: 32px; }
  .resume-compact-right { justify-content: flex-start; }
}

@media (max-width: 768px) {
  section { padding: 64px 0; }
  .nav-links, .nav-actions .btn { display: none; }
  .hamburger { display: flex; }

  #home { padding: 72px 0 88px; }

  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-photo-wrap { order: -1; max-width: 280px; margin: 0 auto; }
  .hero-photo img { aspect-ratio: 4/3; }
  .hero-float-badge { display: none; }

  .about-grid { grid-template-columns: 1fr; gap: 40px; }

  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 480px) {
  .projects-grid { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { justify-content: center; }
  .resume-compact-right { flex-direction: column; width: 100%; }
  .resume-compact-right .btn { justify-content: center; }
}

/* ── Reduced motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
  .cursor-glow { display: none; }
}

/* ── Utility ──────────────────────────────────────────────────── */
.btn-nav        { font-size: .8rem; padding: 7px 14px; }
.btn-full       { width: 100%; justify-content: center; }
.btn-full-mb    { width: 100%; justify-content: center; margin-bottom: 12px; }
.footer-link    { color: var(--accent-lt); }
.footer-link-muted { font-size: .85rem; color: var(--text-muted); }
.footer-nav     { display: flex; gap: 16px; align-items: center; }
.project-date   { font-size: .8rem; color: var(--text-muted); }
.container-narrow { max-width: 720px; }
.results-note   { margin-top: 16px; }

/* ─────────────────────────────────────────────────────────────── */
/* PROJECT PAGE STYLES — preserved unchanged                       */
/* ─────────────────────────────────────────────────────────────── */

/* ── Project page layout ──────────────────────────────────────── */
.project-hero { padding: 64px 0 0; border-bottom: 1px solid var(--border); }
.project-hero--pad { padding-bottom: 64px; }
.project-hero .hero-tag { margin-bottom: 16px; }
.project-hero-text { max-width: 720px; margin-bottom: 56px; }

.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .875rem; font-weight: 500; color: var(--text-muted);
  margin-bottom: 32px; transition: color var(--transition);
}
.back-link:hover { color: var(--accent-lt); }

.project-hero h1 { margin-bottom: 20px; font-size: clamp(2rem, 5vw, 3.2rem); }
.lead { font-size: 1.1rem; color: var(--text-muted); max-width: 680px; margin-bottom: 32px; }

.meta-strip { display: flex; flex-wrap: wrap; gap: 32px; }
.meta-strip--sep {
  margin-bottom: 48px; padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}
.meta-item span {
  display: block; font-size: .7rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px;
}
.meta-item strong { font-size: .95rem; }

.hero-image-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.hero-image-grid img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
}
.hero-image-grid img:first-child { border-radius: var(--radius) 0 0 0; }
.hero-image-grid img:last-child  { border-radius: 0 var(--radius) 0 0; }
.hero-image-full img {
  width: 100%; height: 480px; object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  display: block;
}
.hero-image-container { padding-left: 24px; padding-right: 0; max-width: 1100px; }

/* ── Case study body ──────────────────────────────────────────── */
.case-study { padding: 80px 0; }
.case-study-inner {
  max-width: 740px;
  margin: 0 auto;
}
.case-body { min-width: 0; }

.section-block { margin-bottom: 64px; }
.section-block h2 {
  font-size: 1.5rem; margin-bottom: 16px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.section-block p { margin-bottom: 16px; }
.section-block p:last-child { margin-bottom: 0; }

.callout {
  background: color-mix(in srgb, var(--accent-lt) 8%, transparent);
  border-left: 3px solid var(--accent-lt);
  border-radius: 0 8px 8px 0; padding: 16px 20px; margin: 24px 0;
}
.callout p { color: var(--text); font-size: .9rem; margin: 0; }

.image-block { margin: 32px 0; }
.image-block img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.image-block figcaption { font-size: .8rem; color: var(--text-muted); margin-top: 10px; text-align: center; }

.image-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 32px 0; }
.image-row figure img {
  width: 100%; border-radius: var(--radius);
  border: 1px solid var(--border); object-fit: cover;
}
.image-row figcaption { font-size: .8rem; color: var(--text-muted); margin-top: 8px; text-align: center; }

.spec-list {
  list-style: none; display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin: 24px 0;
}
.spec-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; font-size: .9rem; border-bottom: 1px solid var(--border);
}
.spec-list li:last-child { border-bottom: none; }
.spec-list li:nth-child(even) { background: var(--bg-alt); }
.spec-list li span:first-child { color: var(--text-muted); }
.spec-list li span:last-child  { font-weight: 600; }

.challenge-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px; margin-bottom: 16px;
}
.challenge-card h4 { font-size: .9rem; margin-bottom: 8px; color: var(--text); }
.challenge-card p  { font-size: .875rem; margin: 0; }

.sidebar-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  margin-bottom: 20px; box-shadow: var(--shadow);
}
.sidebar-card h4 {
  font-size: .7rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 16px;
}
.sidebar-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.sidebar-card ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.sidebar-card ul li { font-size: .875rem; color: var(--text-muted); padding-left: 12px; position: relative; }
.sidebar-card ul li::before { content: '→'; position: absolute; left: 0; color: var(--accent-lt); }

.toc { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.toc a {
  display: block; font-size: .85rem; padding: 6px 0;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}
.toc a:last-child { border-bottom: none; }
.toc a:hover { color: var(--accent-lt); }

.results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
.result-stat {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.result-stat .number {
  font-size: 2rem; font-weight: 700; color: var(--accent-lt);
  letter-spacing: -.02em; display: block; margin-bottom: 4px;
}
.result-stat p { font-size: .85rem; margin: 0; }

/* ── WIP banner ───────────────────────────────────────────────── */
.wip-banner {
  background: color-mix(in srgb, #f59e0b 12%, transparent);
  border: 1px solid color-mix(in srgb, #f59e0b 30%, transparent);
  border-radius: 12px; padding: 20px 24px; margin: 48px 0;
  display: flex; gap: 16px; align-items: flex-start;
}
.wip-banner-icon { font-size: 1.5rem; flex-shrink: 0; }
.wip-banner h3 { font-size: 1rem; color: #d97706; margin-bottom: 6px; }
[data-theme="dark"] .wip-banner h3 { color: #f59e0b; }
.wip-banner p { font-size: .9rem; margin: 0; }

.content-section { padding: 80px 0; }
.content-section h2 {
  font-size: 1.5rem; margin-bottom: 16px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.content-section p { margin-bottom: 16px; }

.placeholder-img {
  width: 100%; aspect-ratio: 16/9;
  background: var(--bg-alt); border: 1px dashed var(--border);
  border-radius: 12px; display: grid; place-items: center;
  color: var(--text-muted); font-size: 3rem; margin: 32px 0;
}

/* ── Contact form ─────────────────────────────────────────────── */
.contact-form {
  max-width: 560px;
  display: flex; flex-direction: column; gap: 20px;
  margin-bottom: 40px;
}
.form-honeypot { display: none; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: .75rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted);
}
.form-input,
.form-textarea {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 16px;
  font-family: inherit; font-size: .95rem; color: var(--text);
  width: 100%; transition: border-color var(--transition);
}
.form-input:focus,
.form-textarea:focus { outline: none; border-color: var(--accent-lt); }
.form-textarea { resize: vertical; min-height: 120px; }
.form-submit { align-self: flex-start; }
.form-status {
  font-size: .875rem; padding: 10px 16px;
  border-radius: 8px; display: none;
}
.form-status.visible { display: block; }
.form-status--ok  { color: #4ade80; background: rgba(74,222,128,.08); }
.form-status--err { color: #f87171; background: rgba(248,113,113,.08); }

.contact-social-links { display: flex; flex-direction: column; gap: 12px; }
.contact-social-links .contact-link { padding: 16px 20px; }

/* ── Project pages — responsive ───────────────────────────────── */
@media (max-width: 900px) {
  .hero-image-grid { grid-template-columns: 1fr; }
  .hero-image-grid img { border-radius: 0; }
  .hero-image-grid img:first-child { border-radius: var(--radius) var(--radius) 0 0; }
  .hero-image-grid img:last-child  { display: none; }
  .results-grid { grid-template-columns: 1fr 1fr; }
  .image-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .results-grid { grid-template-columns: 1fr; }
  .meta-strip { gap: 20px; }
}

/* ── Lightbox ──────────────────────────────────────────────────── */
.lightbox-trigger {
  cursor: zoom-in;
  transition: opacity 0.15s;
}
.lightbox-trigger:hover { opacity: 0.88; }

.lightbox-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, 0.88);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.lightbox-overlay.open {
  opacity: 1; pointer-events: auto;
}
.lightbox-overlay img {
  max-width: 100%; max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}
.lightbox-overlay.open img { transform: scale(1); }

.lightbox-close {
  position: absolute; top: 20px; right: 24px;
  background: none; border: none;
  color: #fff; font-size: 1.8rem; line-height: 1;
  cursor: pointer; opacity: 0.7;
  transition: opacity 0.15s;
}
.lightbox-close:hover { opacity: 1; }

/* ── Utility classes (replace inline styles for CSP compliance) ── */
.hero-single-col { grid-template-columns: 1fr; }
.hero-text-centered { text-align: center; align-items: center; }
.sidebar-tags-spaced { margin: 1rem 0 1.5rem; }
