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

:root {
  /* Dark (blueprint) theme */
  --bg:            #0a0f1e;
  --bg-secondary:  #0d1530;
  --bg-card:       #0f1a2e;
  --border:        rgba(100, 180, 255, 0.25);
  --accent:        #4da6ff;
  --accent-dim:    #1a4a7a;
  --accent-glow:   rgba(77, 166, 255, 0.15);
  --text:          #c8dff5;
  --text-dim:      #7a9dbf;
  --text-bright:   #e8f4ff;
  --grid-line:     rgba(100, 180, 255, 0.07);
  --blueprint-bg:  #061020;
  --plane-stroke:  #4da6ff;
  --plane-fill:    rgba(13, 40, 80, 0.7);
  --plane-hover:   rgba(77, 166, 255, 0.3);
  --shadow:        0 8px 32px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
  --bg:            #f0f4f8;
  --bg-secondary:  #e2eaf3;
  --bg-card:       #ffffff;
  --border:        rgba(30, 80, 160, 0.2);
  --accent:        #1a5cb5;
  --accent-dim:    #c5d8f5;
  --accent-glow:   rgba(26, 92, 181, 0.1);
  --text:          #1a2a40;
  --text-dim:      #5a7090;
  --text-bright:   #0a1520;
  --grid-line:     rgba(30, 80, 160, 0.06);
  --blueprint-bg:  #dce8f5;
  --plane-stroke:  #1a5cb5;
  --plane-fill:    rgba(200, 220, 245, 0.7);
  --plane-hover:   rgba(26, 92, 181, 0.2);
  --shadow:        0 8px 32px rgba(0, 0, 0, 0.12);
}

/* ─── Base ──────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

/* ─── Blueprint Grid Background ────────────────────────────────── */
.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
}

/* ─── Nav ───────────────────────────────────────────────────────── */
nav.modal-open { display: none !important; }

nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}

[data-theme="light"] nav {
  background: rgba(240, 244, 248, 0.9);
}

.nav-logo {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-decoration: none;
}

.nav-logo span {
  color: var(--text-dim);
  font-weight: 400;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--accent); }

/* ─── Theme Toggle ──────────────────────────────────────────────── */
#theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

#theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.toggle-icon { font-size: 1rem; transition: transform 0.4s; }
#theme-toggle:hover .toggle-icon { transform: rotate(20deg); }

/* ─── Hero Section ──────────────────────────────────────────────── */
#hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 200px 40px 10px;
  z-index: 1;
}

.hero-header {
  text-align: center;
  margin-bottom: 20px;
}

.hero-label {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  display: block;
}

.hero-header h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hero-header h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-subtitle {
  margin-top: 12px;
  font-size: 0.95rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.hero-tagline {
  font-size: 1rem;
  color: var(--text-dim);
  margin: 6px 0 0;
  letter-spacing: 0.04em;
}

.hero-instruction {
  display: inline-block;
  margin-top: 10px;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: var(--accent);
  opacity: 0.7;
  text-decoration: none;
  cursor: pointer;
  animation: blink-fade 2.5s ease-in-out infinite;
}

@keyframes blink-fade {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

/* ─── Blueprint Plane Overlay Container ─────────────────────────── */
.blueprint-wrapper {
  position: relative;
  width: 100%;
  max-width: 1350px;
  margin: 0 auto;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  /* Replaced background color with transparent to let your grid show through */
}

.blueprint-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  
  /* Invert(1) turns the black lines of the SVG into pure white */
  filter: invert(1) drop-shadow(0 0 30px var(--accent-glow));
  transition: filter 0.3s ease;
}

/* Ensure the plane lines switch back to dark when in Light Mode */
[data-theme="light"] .blueprint-bg {
  filter: invert(0) drop-shadow(0 0 30px var(--accent-glow));
}

.blueprint-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
}

/* ─── Hotspot Zones & Interactions ──────────────────────────────── */
.hotspot {
  cursor: pointer;
  outline: none;
  transition: opacity 0.2s;
}

.zone-dot {
  fill: var(--accent);
  opacity: 0.6;
  transition: all 0.3s ease;
}

.callout-line {
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
  opacity: 0.5;
  transition: all 0.3s ease;
}

.zone-label {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  font-weight: bold;
  fill: var(--accent);
  opacity: 1;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Hover, Focus, and Active States */
.hotspot:hover .zone-dot,
.hotspot:focus .zone-dot,
.hotspot.active .zone-dot {
  opacity: 1;
  r: 10; /* Expands the dot */
  filter: drop-shadow(0 0 6px var(--accent));
}

.hotspot:hover .callout-line,
.hotspot:focus .callout-line,
.hotspot.active .callout-line {
  opacity: 1;
  stroke-dasharray: none;
}

.hotspot:hover .zone-label,
.hotspot:focus .zone-label,
.hotspot.active .zone-label {
  opacity: 1;
  font-size: 14px;
}

/* ─── Project Cards Rail ────────────────────────────────────────── */
#projects-rail {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 0 20px;
}

.rail-title {
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
  padding-left: 2px;
}

.project-cards {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.project-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 14px;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.project-chip:hover,
.project-chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* ─── Modal Overlay ─────────────────────────────────────────────── */
#modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 10, 20, 0.85);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

[data-theme="light"] #modal-overlay {
  background: rgba(200, 215, 235, 0.75);
}

#modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ─── Modal Card ────────────────────────────────────────────────── */
#modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 680px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow), 0 0 60px rgba(77, 166, 255, 0.08);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

#modal-overlay.open #modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 28px 28px 0;
  position: relative;
}

.modal-tag-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.modal-tag {
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

[data-theme="light"] .modal-tag {
  background: #dce8f8;
  color: #1a5cb5;
}

.modal-period {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 10px;
  letter-spacing: 0.08em;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.2;
  margin-bottom: 6px;
}

.modal-subtitle {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.modal-divider {
  height: 1px;
  background: var(--border);
  margin: 0 -28px;
}

.modal-body {
  padding: 22px 28px 12px;
}

.modal-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 12px;
}

.modal-nav-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 14px;
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  cursor: pointer;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: background 0.2s, border-color 0.2s;
  max-width: 45%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-nav-btn:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
}

.modal-gallery {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.modal-gallery:empty { display: none; }

.modal-gallery img {
  cursor: zoom-in;
  flex: 0 0 auto;
  height: 160px;
  width: auto;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.modal-description {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 18px;
}

.modal-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-bullets li {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  padding-left: 18px;
  position: relative;
}

.modal-bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.85rem;
}

.modal-close {
  position: absolute;
  top: 0;
  right: 0;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 8px 12px;
  line-height: 1;
  transition: color 0.2s;
  border-radius: 0 12px 0 0;
}

.modal-close:hover { color: var(--accent); }

/* ─── About Section ─────────────────────────────────────────────── */
#about {
  position: relative;
  z-index: 1;
  padding: 100px 40px;
  max-width: 900px;
  margin: 0 auto;
}

.section-label {
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 30px;
}

.about-block h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.about-block p,
.about-block li {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-dim);
}

.about-block ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.about-block li::before {
  content: '→ ';
  color: var(--accent);
  font-size: 0.85rem;
}

.stat-row {
  display: flex;
  gap: 24px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.stat-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 20px;
  text-align: center;
  min-width: 100px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-family: 'Courier New', monospace;
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ─── Footer ────────────────────────────────────────────────────── */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover { text-decoration: underline; }

/* ─── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent-dim); border-radius: 3px; }

/* ─── Info Modal (Education / Skills / Honors / Contact) ────────── */
#info-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 10, 20, 0.85);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

[data-theme="light"] #info-overlay {
  background: rgba(200, 215, 235, 0.75);
}

#info-overlay.open {
  opacity: 1;
  pointer-events: all;
}

#info-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 480px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow), 0 0 60px rgba(77, 166, 255, 0.08);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

#info-overlay.open #info-modal {
  transform: translateY(0) scale(1);
}

/* ─── Coursework Modal ──────────────────────────────────────────── */
#coursework-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 10, 20, 0.85);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

[data-theme="light"] #coursework-overlay {
  background: rgba(200, 215, 235, 0.75);
}

#coursework-overlay.open {
  opacity: 1;
  pointer-events: all;
}

#coursework-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow), 0 0 60px rgba(77, 166, 255, 0.08);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

#coursework-overlay.open #coursework-modal {
  transform: translateY(0) scale(1);
}

/* ─── Status Widget ─────────────────────────────────────────────── */
.status-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--accent-glow);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #006e33;
  box-shadow: 0 0 6px #006e33, 0 0 12px #006e33;
  flex-shrink: 0;
  animation: status-pulse 1.8s ease-in-out infinite;
}

[data-theme="dark"] .status-dot {
  background: #00ff88;
  box-shadow: 0 0 6px #00ff88, 0 0 12px #00ff88;
}

.status-dot.offline {
  background: #cc2222;
  box-shadow: 0 0 6px #cc2222, 0 0 12px #cc2222;
}

[data-theme="dark"] .status-dot.offline {
  background: #ff3333;
  box-shadow: 0 0 6px #ff3333, 0 0 12px #ff3333;
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

.status-readout {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.status-line {
  font-family: 'Courier New', monospace;
  font-size: 0.62rem;
  color: #006e33;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

[data-theme="dark"] .status-line {
  color: #00ff88;
}

.status-dot.offline ~ .status-readout .status-line {
  color: #cc2222;
}

[data-theme="dark"] .status-dot.offline ~ .status-readout .status-line {
  color: #ff3333;
}

.status-coords {
  font-family: 'Courier New', monospace;
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

/* ─── Hotspot Image Preview ─────────────────────────────────────── */
#hotspot-preview {
  position: fixed;
  z-index: 150;
  pointer-events: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

#hotspot-preview.visible {
  opacity: 1;
  transform: scale(1);
}

#hotspot-preview-img {
  display: block;
  max-width: 220px;
  max-height: 280px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ─── CV Download Button ────────────────────────────────────────── */
.cv-download {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffffff;
  text-decoration: none;
  background: var(--accent);
  padding: 7px 16px;
  border-radius: 6px;
  transition: opacity 0.2s, transform 0.15s;
  white-space: nowrap;
}

.cv-download:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* ─── Coursework Section ────────────────────────────────────────── */
#coursework {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 100px 40px;
}

.coursework-inner {
  max-width: 900px;
  margin: 0 auto;
}

.course-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.course-filter {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 18px;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.course-filter:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.course-filter.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

[data-theme="light"] .course-filter.active { color: #fff; }

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.course-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  transition: border-color 0.2s, opacity 0.25s, transform 0.25s;
}

.course-card:hover {
  border-color: var(--accent);
}

.course-card.row-hidden {
  display: none;
}

.course-toggle {
  display: block;
  margin: 16px auto 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 24px;
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.course-toggle:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
}

.course-card.hidden {
  display: none;
}

.course-grade {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.course-grade.current {
  color: var(--text-dim);
  font-size: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 4px;
}

.course-name {
  font-size: 0.85rem;
  color: var(--text-bright);
  line-height: 1.3;
  margin-bottom: 2px;
}

.course-code {
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

/* ─── Mobile project grid ───────────────────────────────────────── */
.mobile-project-grid {
  display: none;
}

/* ─── Lightbox ──────────────────────────────────────────────────── */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

#lightbox.open {
  opacity: 1;
  pointer-events: all;
}

#lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

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

#lightbox-close:hover { opacity: 1; }

/* ─── Section Heading ───────────────────────────────────────────── */
.section-heading {
  font-size: 1.8rem;
  color: var(--text-bright);
  margin-bottom: 28px;
}

/* ─── Projects Section ──────────────────────────────────────────── */
#projects {
  position: relative;
  z-index: 1;
  padding: 80px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

/* ─── Skills Section ────────────────────────────────────────────── */
#skills {
  position: relative;
  z-index: 1;
  padding: 80px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

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

.skills-category h3 {
  font-size: 0.85rem;
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 16px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 0.8rem;
  color: var(--text);
}

/* ─── Education & Coursework Section ───────────────────────────── */
#education {
  position: relative;
  z-index: 1;
  padding: 80px 40px;
  max-width: 1100px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
}

.edu-block {
  margin-bottom: 16px;
}

.edu-school {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
  font-family: 'Courier New', monospace;
}

.edu-degrees {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.edu-degrees li {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.5;
}

.edu-degrees li::before {
  content: '→ ';
  color: var(--accent);
}

/* ─── Contact Section ───────────────────────────────────────────── */
#contact {
  position: relative;
  z-index: 1;
  padding: 80px 40px;
  max-width: 1100px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.contact-card:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.contact-label {
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.contact-value {
  font-size: 0.9rem;
  color: var(--text-bright);
}

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 700px) {
  nav {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: auto;
    padding: 8px 20px;
    border-radius: 999px;
    top: 12px;
    border: 1px solid var(--border);
    gap: 16px;
    justify-content: center;
  }

  .nav-logo { display: none; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 0.72rem; }
  .cv-download, #theme-toggle, .status-widget { display: none; }

  #hero { padding: 80px 16px 16px; }
  h1 { font-size: 2.2rem; }

  .blueprint-wrapper { display: none; }
  .hero-instruction { display: none; }

  .mobile-project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 4px;
    margin-top: 16px;
  }

  .mobile-project-card {
    position: relative;
    height: 130px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card) center/cover no-repeat;
    cursor: pointer;
    padding: 0;
  }

  .mobile-project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.72) 50%, rgba(0,0,0,0.1) 100%);
  }

  .mobile-project-card span {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ffffff;
    text-align: left;
    line-height: 1.3;
    z-index: 1;
  }

  #projects, #skills, #education, #contact { padding: 48px 16px; }
  .skills-grid { grid-template-columns: 1fr; gap: 28px; }
  .contact-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .contact-card { padding: 12px 14px; }
  .contact-label { font-size: 0.6rem; }
  .contact-value { font-size: 0.62rem; word-break: break-all; }

  #modal { max-height: 92vh; }
  footer { flex-direction: column; gap: 8px; text-align: center; padding: 20px 16px; }
}