:root {
  --bg: #0c0f14;
  --surface: #121720;
  --surface-2: #171e2a;
  --border: #232c3a;
  --border-strong: #313e52;
  --text: #e6ecf5;
  --text-2: #9aa8bc;
  --text-muted: #6c7b91;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --accent-text: #60a5fa;
  --cad-bg: #ffffff;
  --radius: 6px;
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

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

img, video {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 clamp(20px, 2.5vw, 44px);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(12, 15, 20, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  white-space: nowrap;
}

.brand-name {
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  border-left: 1px solid var(--border-strong);
  padding-left: 12px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-resume-btn {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text) !important;
  background: var(--surface);
  transition: border-color 0.15s ease, background 0.15s ease;
}

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

.menu-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

/* Hero */
.hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 310px);
  gap: 48px;
  align-items: center;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 14px;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.85rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: var(--text);
}

.hero-lead {
  font-size: 1.06rem;
  color: var(--text);
  margin: 0 0 14px;
}

.hero-bio {
  font-size: 0.95rem;
  color: var(--text-2);
  margin: 0 0 22px;
}

.target-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  margin-bottom: 24px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}

.portrait-frame {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0;
}

.portrait-frame img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
}

.portrait-caption {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.71rem;
  white-space: nowrap;
  color: var(--text-muted);
}

/* About / Highlights Strip */
.metrics-strip {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.metric-cell {
  padding: 18px 20px;
  border-right: 1px solid var(--border);
}

.metric-cell:last-child {
  border-right: none;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
}

.metric-label {
  font-size: 0.81rem;
  color: var(--text-2);
  line-height: 1.4;
}

/* Sections */
.section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 6px;
}

.section-title {
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--text);
}

.section-sub {
  font-size: 0.92rem;
  color: var(--text-2);
  margin: 6px 0 0;
}

/* Filter Tabs */
.filter-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 3px;
  gap: 3px;
}

.filter-btn {
  background: transparent;
  border: none;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 7px 12px;
  border-radius: 4px;
  transition: background 0.15s ease, color 0.15s ease;
}

.filter-btn:hover {
  color: var(--text);
}

.filter-btn.active {
  background: var(--accent);
  color: #ffffff;
}

/* Compact Multi-Column CAD Project Cards */
.projects-stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.project-header {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.project-title {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.28;
  margin: 0 0 8px;
  color: var(--text);
}

.project-summary {
  font-size: 0.87rem;
  line-height: 1.48;
  color: var(--text-2);
  margin: 0;
}

/* Media Gallery */
.project-media-band {
  display: grid;
  grid-template-columns: 1fr;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.cad-stage-wrap {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cad-plate {
  position: relative;
  background: var(--cad-bg);
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cad-plate img,
.cad-plate video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  padding: 12px;
}

.cad-plate-bar {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.cad-plate-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #1e293b;
  background: rgba(241, 245, 249, 0.94);
  border: 1px solid #cbd5e1;
  padding: 2px 7px;
  border-radius: 3px;
}

.cad-plate-controls {
  display: flex;
  gap: 5px;
  pointer-events: auto;
}

.plate-btn {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #94a3b8;
  padding: 3px 8px;
  border-radius: 3px;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.plate-btn:hover {
  background: #e2e8f0;
  border-color: #3b82f6;
}

.stage-caption {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-2);
  margin: 0;
  min-height: 2.8em;
}

/* Compact Horizontal View Switcher */
.view-rail {
  padding: 11px 16px 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: var(--surface);
}

.view-rail-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.view-switcher {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 5px;
}

.view-tab {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  padding: 5px 8px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all 0.15s ease;
}

.view-tab:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.view-tab.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-text);
}

/* Compact Tabbed Engineering Breakdown */
.project-details-band {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.details-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.detail-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 12px;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.detail-tab:hover {
  color: var(--text);
}

.detail-tab.active {
  color: var(--accent-text);
  border-bottom-color: var(--accent);
  background: var(--surface);
}

.specs-pane,
.notes-pane {
  display: none;
  padding: 14px 18px 16px;
}

.specs-pane.active,
.notes-pane.active {
  display: block;
}

.pane-heading {
  display: none;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
}

.spec-table tr {
  border-bottom: 1px solid var(--border);
}

.spec-table tr:last-child {
  border-bottom: none;
}

.spec-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 7px 12px 7px 0;
  vertical-align: top;
  white-space: nowrap;
  width: 96px;
}

.spec-table td {
  font-size: 0.82rem;
  color: var(--text);
  padding: 7px 0;
  line-height: 1.38;
}

.notes-list {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.83rem;
  line-height: 1.45;
  color: var(--text-2);
}

.notes-list strong {
  color: var(--text);
  font-weight: 500;
}

/* Supporting Systems Row */
.subsystems-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.subsystem-mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.subsystem-mini h3 {
  font-size: 0.98rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}

.subsystem-mini p {
  font-size: 0.86rem;
  color: var(--text-2);
  margin: 0;
}

/* Experience & Resume */
.exp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.exp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.exp-card.featured {
  border-left: 3px solid var(--accent);
}

.exp-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.exp-role {
  font-size: 1.04rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.exp-date {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--accent-text);
}

.exp-org {
  font-size: 0.88rem;
  color: var(--text-2);
  margin: 0 0 12px;
}

.exp-bullets {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--text-2);
}

.sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.side-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.side-card h3 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-text);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.edu-item {
  margin-bottom: 14px;
}

.edu-item:last-child {
  margin-bottom: 0;
}

.edu-school {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text);
}

.edu-deg {
  font-size: 0.85rem;
  color: var(--text-2);
}

.edu-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.awards-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-2);
}

.awards-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(35, 44, 58, 0.65);
}

.awards-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.award-year {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Skills Matrix */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.skill-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.skill-col h3 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-text);
  margin: 0 0 14px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.skill-tag.subtle {
  color: var(--text-2);
  border-color: var(--border);
}

/* Contact / Footer */
.contact-section {
  padding: 56px 0 64px;
}

.contact-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.contact-box h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.contact-box p {
  font-size: 0.92rem;
  color: var(--text-2);
  margin: 0;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  margin-top: 28px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Lightbox Modal */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 10, 14, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox.open {
  display: flex;
}

.lightbox-inner {
  width: 100%;
  max-width: 960px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.lightbox-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
}

.lightbox-stage {
  background: #ffffff;
  height: min(68vh, 620px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lightbox-stage img,
.lightbox-stage video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  gap: 12px;
}

.lightbox-caption {
  font-size: 0.84rem;
  color: var(--text-2);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 120;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 1040px) {
  .projects-stack {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding-bottom: 10px;
  }
  .project-card {
    flex: 0 0 min(86vw, 430px);
    scroll-snap-align: start;
  }
}

@media (max-width: 920px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .portrait-frame {
    max-width: 280px;
  }
  .exp-grid {
    grid-template-columns: 1fr;
  }
  .subsystems-grid,
  .skills-grid {
    grid-template-columns: 1fr;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric-cell:nth-child(2) {
    border-right: none;
  }
  .metric-cell:nth-child(1),
  .metric-cell:nth-child(2) {
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 680px) {
  .brand-tag {
    display: none;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px;
    gap: 14px;
  }
  .nav-links.open {
    display: flex;
  }
  .cad-plate {
    height: 220px;
  }
  .project-header {
    padding: 16px 18px;
  }
}


.cad-plate.photo-mode {
  background: #0d121a;
  border-color: var(--border-strong);
}
.cad-plate.photo-mode img {
  padding: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.onshape-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.onshape-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 6px 11px;
  border-radius: 4px;
  background: var(--accent-soft);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: var(--accent-text);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.onshape-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
.onshape-btn.secondary {
  background: var(--bg);
  border-color: var(--border-strong);
  color: var(--text-2);
}
.onshape-btn.secondary:hover {
  border-color: var(--accent);
  color: var(--text);
}
