*, *::before, *::after {
  box-sizing: border-box; margin: 0; padding: 0;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
}

:root {
  --font-display: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --font-body: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --font-jakarta: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --font-serif: "Palatino Linotype", "Book Antiqua", Palatino, serif;

  --space-2: .5rem; --space-3: .75rem; --space-4: 1rem; --space-5: 1.25rem;
  --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem; --space-16: 4rem;
  --r-sm: .375rem; --r-md: .5rem; --r-lg: .75rem; --r-xl: 1rem; --r-full: 9999px;

  --text-xs: clamp(.75rem,.7rem + .25vw,.875rem);
  --text-sm: clamp(.875rem,.8rem + .35vw,1rem);
  --text-base: clamp(1rem,.95rem + .25vw,1.125rem);
  --text-lg: clamp(1.125rem,1rem + .75vw,1.5rem);
  --text-xl: clamp(1.5rem,1.2rem + 1.25vw,2.25rem);
  --text-hero: clamp(2.6rem,1rem + 4.5vw,5rem);

  --jhu-heritage: #002D72;
  --jhu-spirit: #68ACE5;
  --jhu-gold: #CBA052;
}

/* ── THEME A — JHU HERITAGE DARK (default) ── */
[data-theme="dark"] {
  --bg: #0e1520;
  --bg-elevated: #131c2b;
  --text: #c5d4e8;
  --text-dim: #8ea2ba;
  --text-faint: #5a6b80;
  --headline: #e8f0f8;
  --headline-font: var(--font-display);
  --headline-style: normal;
  --headline-weight: 800;
  --body-font: var(--font-body);
  --accent: var(--jhu-heritage);
  --accent-bright: var(--jhu-spirit);
  --cta-bg: var(--jhu-heritage);
  --cta-text: var(--jhu-spirit);
  --border: rgba(255,255,255,.08);
  --chip-bg: #16243a;
  --chip-text: #73B0E4;
  --glow: radial-gradient(ellipse 70% 60% at 80% 0%, rgba(104,172,229,.12) 0%, transparent 70%);
}

/* ── THEME B — JHU SPIRIT LIGHT (same format as Theme A, colors only) ── */
[data-theme="light"] {
  --bg: #F2F5F8;
  --bg-elevated: #ffffff;
  --text: #1a2535;
  --text-dim: #3a4c5c;
  --text-faint: #5a7080;
  --headline: #0d1829;
  --headline-font: var(--font-display);
  --headline-style: normal;
  --headline-weight: 800;
  --body-font: var(--font-body);
  --accent: var(--jhu-heritage);
  --accent-bright: var(--jhu-spirit);
  --cta-bg: var(--jhu-heritage);
  --cta-text: #ffffff;
  --border: rgba(0,0,0,.1);
  --chip-bg: #dbe6f2;
  --chip-text: var(--jhu-heritage);
  --glow: radial-gradient(ellipse 60% 80% at 90% 0%, rgba(104,172,229,.15) 0%, transparent 60%);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--body-font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  transition: background 250ms ease, color 250ms ease;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: var(--glow);
}

a { color: inherit; text-decoration: none; }

/* ── MASTHEAD ── */
.masthead {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.giant-name {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.4rem, 11vw, 9.5rem);
  line-height: .84; letter-spacing: -.01em;
  color: var(--headline); text-transform: uppercase;
  padding: var(--space-6) var(--space-6) var(--space-4);
}

.pill-nav {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6) var(--space-5);
}
.pill-links { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.pill {
  font-size: var(--text-sm); font-weight: 600; padding: .55em 1.4em;
  border-radius: var(--r-full); border: 1px solid var(--border); color: var(--text-dim);
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}
.pill.active, .pill:hover { background: var(--headline); color: var(--bg); border-color: var(--headline); }

.pill-right { display: flex; align-items: center; gap: var(--space-4); }
.pill-right .label {
  font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .1em; color: var(--text-faint);
}
.clock { font-size: var(--text-sm); color: var(--text-dim); font-variant-numeric: tabular-nums; min-width: 5.5em; }

.theme-toggle {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cta-bg), var(--accent-bright));
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .8rem; flex-shrink: 0;
}

@media (max-width: 720px) {
  .pill-nav { justify-content: flex-start; }
}

/* ── HERO BANNER (mechanical blueprint) ── */
[data-theme="dark"] {
  --bp-bg: #0a1628;
  --bp-bg-2: #0d1d34;
  --bp-line: #5a8fc2;
  --bp-line-strong: #8fb8e0;
}
[data-theme="light"] {
  --bp-bg: #eef2f6;
  --bp-bg-2: #e3eaf2;
  --bp-line: #1f3f66;
  --bp-line-strong: #0d1829;
}

.hero-banner {
  position: relative; min-height: 56vh;
  display: flex; align-items: flex-end; overflow: hidden;
  background: linear-gradient(165deg, var(--bp-bg-2), var(--bp-bg) 70%);
}
.blueprint-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.blueprint-svg .bp-grid { stroke: var(--bp-line); opacity: .14; }
.blueprint-svg .bp-center { stroke: var(--bp-line); opacity: .4; stroke-dasharray: 18 5 3 5; }
.blueprint-svg .bp-part { stroke: var(--bp-line-strong); opacity: .55; }
.blueprint-svg .bp-part-fine { stroke: var(--bp-line); opacity: .4; }
.blueprint-svg .bp-dim { stroke: var(--bp-line); fill: var(--bp-line); opacity: .55; }
.blueprint-svg .bp-text { fill: var(--bp-line-strong); opacity: .65; font-family: 'Satoshi', monospace; }
.blueprint-svg .bp-hatch { stroke: var(--bp-line); opacity: .35; }

.hero-banner-text {
  position: relative; z-index: 1; max-width: 640px;
  padding: var(--space-10) var(--space-8) 7rem;
  font-size: var(--text-lg); line-height: 1.5; color: var(--bp-line-strong);
}
.hero-banner-text strong { color: var(--jhu-gold); font-weight: 700; }
.hero-banner-text .hl { color: var(--accent-bright); font-weight: 600; }

/* ── SECTIONS ── */
.section {
  max-width: 1200px; margin: 0 auto; padding: var(--space-16) var(--space-8); position: relative; z-index: 1;
}
.section h2 {
  font-family: var(--headline-font); font-weight: var(--headline-weight); font-style: var(--headline-style);
  font-size: var(--text-xl); color: var(--headline); margin-bottom: var(--space-6); line-height: 1.15;
}
.section-eyebrow {
  font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .14em; color: var(--accent-bright);
  margin-bottom: var(--space-2); font-weight: 700;
}

/* ── PROJECTS + SKILLS (bubble field) ── */
.projects-skills {
  display: grid; grid-template-columns: 1fr 230px; gap: var(--space-10);
  align-items: stretch;
}
.bubble-field {
  display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr;
  gap: var(--space-5);
  padding-top: var(--space-3);
}

/* Project button anchor wrappers */
.bubble-field > a {
  text-decoration: none;
  color: inherit;
  display: contents;
}

.bubble {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  text-align: center; flex-shrink: 0;
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-dim);
  font-size: .72rem; font-weight: 600; line-height: 1.25; padding: var(--space-3);
  font-family: inherit; cursor: pointer; appearance: none;
  transform: translateY(var(--bob, 0px)) scale(var(--bscale, 1));
  transition: transform 240ms ease, opacity 240ms ease, border-color 240ms ease,
              background 240ms ease, color 240ms ease, box-shadow 240ms ease;
}
.bubble.rectangle {
  border-radius: var(--r-lg);
  width: 100%; aspect-ratio: 4 / 3;
  font-size: var(--text-sm);
}
.bubble:focus-visible {
  outline: 2px solid var(--accent-bright); outline-offset: 3px;
}
.bubble:hover {
  --bscale: 1.05;
  border-color: var(--accent-bright);
  background: var(--chip-bg);
  color: var(--headline);
  box-shadow: 0 0 0 1px var(--accent-bright), 0 10px 26px -10px var(--accent-bright);
}

.bubble.dim:hover {
  opacity: 1;
}

.bubble.highlight {
  --bscale: 1.05;
  border-color: var(--accent-bright); background: var(--chip-bg); color: var(--headline);
  box-shadow: 0 0 0 1px var(--accent-bright), 0 10px 26px -10px var(--accent-bright);
}
.bubble.dim { opacity: .2; }

/* ── INTERACTIVE SKILLS BOXES ── */
/* SKILLS SECTION */

/* ===== SKILLS SECTION ===== */
.skills-section {
  padding: var(--space-10) var(--space-8);
  max-width: 1000px;
  margin: 0 auto;
}

.skills-section .section-title {
  text-align: center;
  font-family: var(--headline-font);
  font-weight: var(--headline-weight);
  font-size: var(--text-xl);
  color: var(--headline);
  margin-bottom: var(--space-8);
}

/* Container with grid layout */
.skills-container {
  display: grid;
  grid-template-columns: 140px 1fr 140px;
  grid-template-rows: auto 1fr auto;
  gap: var(--space-4);
  min-height: 380px;
  padding: var(--space-4);
  border: 2px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--bg);
}

/* Corner Category Buttons */
.skill-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-4);
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all 0.3s ease;
}

.skill-box:hover,
.skill-box.active {
  border-color: var(--accent-bright);
  background: rgba(104, 172, 229, 0.15);
  transform: scale(1.03);
  box-shadow: 0 0 20px rgba(104, 172, 229, 0.2);
}

.skill-box .box-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  transition: color 0.3s ease;
}

.skill-box:hover .box-label,
.skill-box.active .box-label {
  color: var(--accent-bright);
}

/* Corner Positioning */
.skill-box.top-left { grid-column: 1; grid-row: 1; }
.skill-box.top-right { grid-column: 3; grid-row: 1; }
.skill-box.bottom-left { grid-column: 1; grid-row: 3; }
.skill-box.bottom-right { grid-column: 3; grid-row: 3; }

/* Center Display Area */
.skills-center-display {
  grid-column: 2;
  grid-row: 1 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  min-height: 280px;
}

.current-category-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--accent-bright);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.skills-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 320px;
  align-content: flex-start;
  overflow: hidden;
}

/* Skill Tags/Chips */
.skill-tag {
  display: inline-block;
  padding: 6px 14px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: var(--text-xs);
  color: var(--text-dim);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(8px);
  transition: all 1s ease;
}

.skill-tag.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  .skills-container {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: var(--space-3);
    min-height: auto;
  }
  
  .skill-box.top-left { grid-column: 1; grid-row: 1; }
  .skill-box.top-right { grid-column: 2; grid-row: 1; }
  .skills-center-display { grid-column: 1 / 3; grid-row: 2; min-height: 220px; }
  .skill-box.bottom-left { grid-column: 1; grid-row: 3; }
  .skill-box.bottom-right { grid-column: 2; grid-row: 3; }
  
  .skill-box {
    padding: var(--space-2) var(--space-3);
  }
  
  .skill-box .box-label {
    font-size: 10px;
  }
}

/* ===== DOMAIN CHIPS (Projects Section) ===== */
.skills-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 10px;
  margin-top: 200px;
  align-self: start;
}

.chip {
  display: inline-block;
  padding: 15px 20px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--chip-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
}

.chip:hover {
  background: rgba(104, 172, 229, 0.2);
  border-color: var(--accent-bright);
  color: var(--accent-bright);
  transform: translateX(-4px);
}

.chip.active {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
  color: var(--bg);
  box-shadow: 0 4px 16px -4px rgba(104, 172, 229, 0.4);
}

/* ── PROJECT SUB-PAGE COMPONENTS ── */
.back-link {
  display: inline-block; font-size: var(--text-sm); color: var(--text-dim);
  margin-bottom: var(--space-4);
}
.back-link:hover { color: var(--accent-bright); }

.stat-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4);
  margin-bottom: var(--space-8);
}
.stat-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-1);
}
.stat-value {
  font-family: var(--headline-font); font-weight: 800; font-size: var(--text-xl); color: var(--headline);
  line-height: 1;
}
.stat-unit { font-size: var(--text-xs); color: var(--accent-bright); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.stat-label { font-size: var(--text-xs); color: var(--text-dim); margin-top: var(--space-2); line-height: 1.4; }

/* ── PROJECT HERO ── */
.project-hero {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-10);
  padding-bottom: var(--space-6); margin-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}
.project-hero-text { flex: 1 1 420px; min-width: 0; }
.project-hero h2 {
  font-size: clamp(1.8rem, 1.4rem + 2vw, 2.6rem); margin: var(--space-2) 0 var(--space-3);
  color: var(--headline); font-family: var(--headline-font); font-weight: 800; line-height: 1.05;
}
.project-hero-meta {
  font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint);
}

.spec-ribbon {
  display: flex; flex-wrap: wrap; gap: var(--space-5); margin-top: var(--space-6);
}
.dim-tag { display: flex; flex-direction: column; }
.dim-tag .dim-value {
  font-family: var(--headline-font); font-weight: 800; font-size: var(--text-lg); color: var(--headline);
  line-height: 1;
}
.dim-tag .dim-label {
  font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-bright);
  font-weight: 700; margin-top: var(--space-1); position: relative; padding-top: 6px;
}
.dim-tag .dim-label::before {
  content: ""; position: absolute; top: 0; left: 0; width: 18px; height: 1px; background: var(--border);
}

.bar-chart { display: flex; flex-direction: column; gap: var(--space-3); }
.bar-row { display: grid; grid-template-columns: 60px 1fr 50px; align-items: center; gap: var(--space-3); }
.bar-track { background: var(--bg); border-radius: var(--r-full); height: 12px; overflow: hidden; border: 1px solid var(--border); }
.bar-fill { height: 100%; background: var(--chip-text); border-radius: var(--r-full); }
.bar-fill-highlight { background: var(--accent-bright); }
.bar-name { font-size: var(--text-xs); font-weight: 700; color: var(--text-dim); }
.bar-row-highlight .bar-name { color: var(--headline); }
.bar-val { font-size: var(--text-xs); color: var(--text-dim); text-align: right; font-variant-numeric: tabular-nums; }
.bar-row-highlight .bar-val { color: var(--headline); font-weight: 700; }
.bar-chart-caption { font-size: var(--text-xs); color: var(--text-faint); margin-top: var(--space-4); }

.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.gallery-item { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); }
.gallery-item img { width: 100%; height: 180px; object-fit: cover; display: block; }
.gallery-item figcaption { font-size: var(--text-xs); color: var(--text-dim); padding: var(--space-3); }

.schematic-wrap { display: flex; justify-content: center; padding: var(--space-4) 0; }
.blueprint-svg-inline { width: 100%; max-width: 340px; }
.blueprint-svg-inline .bp-part { stroke: var(--bp-line-strong, var(--accent-bright)); opacity: .6; }
.blueprint-svg-inline .bp-part-fine { stroke: var(--bp-line, var(--text-faint)); opacity: .45; }
.blueprint-svg-inline .bp-text { fill: var(--text-dim); }

@media (max-width: 800px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: 1fr; }
}

/* ── PROJECT SIDEBAR LAYOUT ── */
.project-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: var(--space-8);
  align-items: start;
}

.project-sidebar {
  position: sticky;
  top: 140px;
  order: 2;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  padding: var(--space-5);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.project-sidebar::-webkit-scrollbar {
  width: 6px;
}

.project-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.project-sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.project-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* "On This Page" header */
.sidebar-header {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.sidebar-link {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-dim);
  padding: .55em .9em;
  border-radius: var(--r-md);
  border-left: 3px solid transparent;
  transition: all 180ms ease;
  text-decoration: none;
}

.sidebar-link:hover {
  color: var(--headline);
  background: rgba(255,255,255,.04);
}

.sidebar-link.active {
  color: var(--accent-bright);
  background: var(--chip-bg);
  border-left-color: var(--accent-bright);
}

.sidebar-sublink {
  margin-left: var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  padding-left: var(--space-4);
}

.project-content {
  order: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  min-width: 0;
}

.project-block, .project-subblock {
  scroll-margin-top: 160px;
}

.project-subblock {
  margin-left: var(--space-6);
  padding-left: var(--space-5);
  border-left: 1px solid var(--border);
}

/* ── Sidebar Back to Top Button ── */
.sidebar-top-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: auto;
  padding: .6em 1em;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 180ms ease;
}

.sidebar-top-btn:hover {
  color: var(--accent-bright);
  border-color: var(--accent-bright);
  background: var(--chip-bg);
}

.sidebar-top-btn:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

/* Hide on mobile horizontal layout */
@media (max-width: 900px) {
  .sidebar-top-btn {
    display: none;
  }
}

.project-content ul.bullet-list {
  list-style: none; padding: 0; margin: var(--space-3) 0 var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-2);
}
.project-content ul.bullet-list li {
  color: var(--text); font-size: var(--text-sm); padding-left: var(--space-5); position: relative;
}
.project-content ul.bullet-list li::before {
  content: "—"; position: absolute; left: 0; color: var(--accent-bright); font-weight: 700;
}
.project-content ul.bullet-list li strong { color: var(--headline); }

/* Mobile: horizontal scrollable tabs */
@media (max-width: 900px) {
  .project-layout {
    grid-template-columns: 1fr;
  }
  
  .project-sidebar {
    position: sticky;
    top: 0;
    order: -1;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: var(--space-2);
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    padding: var(--space-3) var(--space-4);
    margin: 0 calc(-1 * var(--space-8));
    width: calc(100% + var(--space-8) * 2);
    border-radius: 0;
    border-left: none;
    border-right: none;
    z-index: 40;
    -webkit-overflow-scrolling: touch;
  }
  
  .sidebar-header {
    display: none;
  }
  
  .sidebar-link {
    flex-shrink: 0;
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: .5em .8em;
    font-size: var(--text-xs);
    white-space: nowrap;
  }
  
  .sidebar-link.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent-bright);
  }
  
  .sidebar-sublink {
    margin-left: 0;
    padding-left: var(--space-3);
  }
  
  .project-block, .project-subblock {
    scroll-margin-top: 80px;
  }
}

/* ── GALLERY SECTION (inside project layout) ── */
.gallery-section {
  scroll-margin-top: 160px;
}

@media (max-width: 900px) {
  .gallery-section {
    scroll-margin-top: 80px;
  }
}

/* ── MEDIA CAROUSEL (FULL IMAGE, NO CROP) ── */
.carousel {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.carousel-viewport {
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform 320ms ease;
}

.carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

/* FULL IMAGE - no cropping */
.carousel-slide img,
.carousel-slide video {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  display: block;
  background: var(--bg);
}

.carousel-slide figcaption {
  font-size: var(--text-sm);
  color: var(--text-dim);
  padding: var(--space-4);
  text-align: center;
  background: var(--bg-elevated);
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(calc(-50% - 30px));
  width: 48px;
  height: 48px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 180ms ease;
  z-index: 10;
}

.carousel-prev {
  left: var(--space-4);
}

.carousel-next {
  right: var(--space-4);
}

.carousel-arrow:hover {
  background: var(--accent-bright);
  color: #fff;
  border-color: var(--accent-bright);
}

.carousel-arrow:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--border);
  padding: 0;
  background: var(--bg);
  cursor: pointer;
  transition: all 180ms ease;
}

.carousel-dot:hover {
  border-color: var(--accent-bright);
}

.carousel-dot.active {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
}

@media (max-width: 600px) {
  .carousel-slide img,
  .carousel-slide video {
    max-height: 300px;
  }
  
  .carousel-arrow {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }
  
  .carousel-prev {
    left: var(--space-2);
  }
  
  .carousel-next {
    right: var(--space-2);
  }
}

/* ── RESUME CARD ── */
.resume-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: var(--space-8);
}
.pdf-wrapper {
  width: 100%; height: 70vh; max-height: 760px; min-height: 420px;
  border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border);
  margin-bottom: var(--space-6); background: #fff;
}
.pdf-wrapper iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ── PROCESS STEPPER ── */
.process-stepper {
  display: flex; align-items: center; gap: 0; margin: var(--space-8) 0;
  overflow-x: auto;
}
.process-step {
  display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0;
  font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-faint); padding: var(--space-2) var(--space-3);
  border-radius: var(--r-full); border: 1px solid transparent;
}
.process-step:hover { color: var(--headline); }
.process-step .step-num {
  width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: .65rem; color: var(--text-dim);
  flex-shrink: 0;
}
.process-connector { flex: 0 0 28px; height: 1px; background: var(--border); }

/* ── ELEGANT DETAIL TOGGLE (collapsible sections) ── */
.detail-toggle {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-elevated);
  margin: var(--space-5) 0;
  overflow: hidden;
  transition: border-color 280ms ease, box-shadow 280ms ease;
}

.detail-toggle:hover {
  border-color: rgba(104, 172, 229, 0.4);
}

.detail-toggle[open] {
  border-color: var(--accent-bright);
  box-shadow: 0 4px 24px -8px rgba(104, 172, 229, 0.2);
}

.detail-toggle summary {
  cursor: pointer;
  list-style: none;
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  transition: color 200ms ease, background 200ms ease;
  position: relative;
  user-select: none;
}

.detail-toggle summary::-webkit-details-marker { display: none; }

/* Chevron icon */
.detail-toggle summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--accent-bright);
  border-bottom: 2px solid var(--accent-bright);
  transform: rotate(-45deg);
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: auto;
  flex-shrink: 0;
}

.detail-toggle[open] summary::after {
  transform: rotate(45deg);
}

.detail-toggle summary:hover {
  color: var(--headline);
  background: rgba(104, 172, 229, 0.05);
}

.detail-toggle summary:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: -2px;
  border-radius: var(--r-md);
}

/* Label badge */
.detail-toggle summary .detail-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent-bright);
  background: rgba(104, 172, 229, 0.12);
  padding: .3em .7em;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

/* Summary text */
.detail-toggle summary .detail-title {
  flex: 1;
}

/* Animated body wrapper */
.detail-toggle .detail-body {
  padding: 0 var(--space-5) var(--space-5);
  color: var(--text);
  font-size: var(--text-sm);
  line-height: 1.7;
  animation: detailSlideIn 320ms cubic-bezier(0.4, 0, 0.2, 1);
  border-top: 1px solid var(--border);
  margin-top: 0;
  padding-top: var(--space-4);
}

@keyframes detailSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Nested list styling inside details */
.detail-body ul.bullet-list {
  margin: var(--space-3) 0 0;
}

.detail-body ul.bullet-list li {
  padding-left: var(--space-4);
}

.detail-body ul.bullet-list li::before {
  content: "›";
  font-weight: 400;
}

/* ── ALTERNATE STYLE: Blueprint Note (dashed) ── */
.detail-toggle.note-style {
  border-style: dashed;
  background: transparent;
}

.detail-toggle.note-style:hover {
  background: rgba(104, 172, 229, 0.03);
}

.detail-toggle.note-style summary .detail-label {
  background: transparent;
  border: 1px dashed var(--accent-bright);
}

.detail-toggle.note-style .detail-body {
  border-top-style: dashed;
}

/* ── ALTERNATE STYLE: Compact Inline ── */
.detail-toggle.compact {
  border-radius: var(--r-md);
  margin: var(--space-3) 0;
}

.detail-toggle.compact summary {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
}

.detail-toggle.compact summary .detail-label {
  font-size: .6rem;
  padding: .2em .5em;
}

.detail-toggle.compact .detail-body {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
}

/* ── ALTERNATE STYLE: Card Highlight ── */
.detail-toggle.highlight-style {
  background: linear-gradient(
    135deg,
    rgba(104, 172, 229, 0.08),
    var(--bg-elevated)
  );
  border-color: rgba(104, 172, 229, 0.3);
}

.detail-toggle.highlight-style:hover {
  border-color: rgba(104, 172, 229, 0.5);
}

.detail-toggle.highlight-style[open] {
  background: linear-gradient(
    135deg,
    rgba(104, 172, 229, 0.12),
    var(--bg-elevated)
  );
}

.detail-toggle.highlight-style summary .detail-label {
  background: var(--accent-bright);
  color: var(--bg);
}

/* ── ALTERNATE STYLE: Minimal ── */
.detail-toggle.minimal {
  border: none;
  background: transparent;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  margin: 0;
}

.detail-toggle.minimal:hover {
  background: transparent;
}

.detail-toggle.minimal[open] {
  box-shadow: none;
  border-bottom-color: var(--accent-bright);
}

.detail-toggle.minimal summary {
  padding: var(--space-4) 0;
}

.detail-toggle.minimal .detail-body {
  border-top: none;
  padding: 0 0 var(--space-5);
}

/* ── ANNOTATED FIGURES ── */
.project-content figure { margin: 0; }
.project-content figcaption {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint);
  padding-top: var(--space-2); margin-top: var(--space-2); border-top: 1px solid var(--border);
}

/* ── CONTACT ── */
.contact { text-align: center; padding-bottom: var(--space-16); }
.contact h2 { margin-bottom: var(--space-3); }
.contact p.lead { color: var(--text-dim); margin-bottom: var(--space-8); }
.contact-emails { display: flex; justify-content: center; gap: var(--space-6); flex-wrap: wrap; margin-bottom: var(--space-8); }
.contact-emails a { font-size: var(--text-lg); font-family: var(--headline-font); font-style: var(--headline-style); color: var(--accent-bright); border-bottom: 1px solid transparent; }
.contact-emails a:hover { border-bottom-color: var(--accent-bright); }
.social-links { display: flex; justify-content: center; gap: var(--space-5); }
.social-links a {
  font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em; font-weight: 700;
  color: var(--text-dim); padding: .6em 1.3em; border: 1px solid var(--border); border-radius: var(--r-full);
  transition: color 180ms, border-color 180ms;
}
.social-links a:hover { color: var(--accent-bright); border-color: var(--accent-bright); }

/* ── FOOTER ── */
.footer {
  max-width: 1200px; margin: 0 auto; padding: var(--space-8); border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-3);
  color: var(--text-faint); font-size: var(--text-xs); position: relative; z-index: 1;
}