/* ============================================
   PORTFOLIO — CSS
   ============================================ */

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

:root {
  --bg: #ffffff;
  --bg-elevated: #f5f5f3;
  --bg-card: #ffffff;
  --bg-card-hover: #faf8f6;
  --text: #2d2d2d;
  --text-muted: #6b6b6b;
  --accent: #e8650a;
  --accent-glow: rgba(232, 101, 10, 0.2);
  --accent-2: #f59e42;
  --border: rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-body: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; color: inherit; font-family: inherit; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 120px 0;
}

.accent { color: var(--accent); }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 24px var(--accent-glow);
}
.btn-primary:hover {
  background: #d45a08;
  box-shadow: 0 8px 32px var(--accent-glow);
  transform: translateY(-2px);
}

.btn-outline {
  border: 1.5px solid var(--border);
  color: var(--text);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(232, 101, 10, 0.06);
}

/* --- Navigation --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 20px 0;
  transition: var(--transition);
}
.navbar.scrolled {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
  position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: var(--transition);
}
.nav-links a:hover::after { width: 100%; }

.nav-cta {
  padding: 8px 20px !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 50px !important;
  color: var(--text) !important;
}
.nav-cta:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}
.nav-cta::after { display: none !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
}
.nav-toggle span {
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* --- Hero --- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 120px 24px 60px;
  gap: 48px;
  min-height: auto;
}

.hero-left {
  opacity: 0;
  animation: fadeUp 0.8s 0.2s forwards;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 16px;
}

.hero-tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 440px;
  margin-bottom: 28px;
  line-height: 1.6;
}

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

.hero-stats {
  display: flex;
  gap: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.hero-stat {
  display: flex;
  flex-direction: column;
}
.hero-stat-number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.hero-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.02em;
}

.hero-right {
  position: relative;
  opacity: 0;
  animation: fadeUp 0.8s 0.5s forwards;
}

.hero-3d-viewer {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  background: radial-gradient(ellipse at center, #3a3a3a 0%, #2d2d2d 100%);
  overflow: hidden;
  cursor: grab;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}
.hero-3d-viewer:active { cursor: grabbing; }
.hero-3d-viewer canvas {
  width: 100% !important;
  height: 100% !important;
}

/* --- Section Headers --- */
.section-header {
  text-align: center;
  margin-bottom: 72px;
}
.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

/* --- Projects Grid --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  transition: var(--transition);
  opacity: 0;
  transform: translateY(30px);
}
.project-card.visible {
  opacity: 1;
  transform: translateY(0);
}
.project-card:hover {
  border-color: rgba(232, 101, 10, 0.2);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}
.project-card.visible:hover {
  transform: translateY(-4px);
}

.project-card--large {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}
.project-card--large .project-image { min-height: 360px; }

.project-image {
  position: relative;
  overflow: hidden;
  min-height: 240px;
  background: linear-gradient(135deg, #eee 0%, #ddd 100%);
}
.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.project-card:hover .project-image img {
  transform: scale(1.05);
}

.project-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
}
.project-category {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(45, 45, 45, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid rgba(232, 101, 10, 0.2);
}

.project-info {
  padding: 28px;
}
.project-info h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 10px;
}
.project-info p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.project-tags span {
  padding: 4px 12px;
  background: rgba(232, 101, 10, 0.08);
  border: 1px solid rgba(232, 101, 10, 0.15);
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
}

/* --- Custom Software Tools Section --- */
.tools-section {
  position: relative;
  background: #1a1a1c;
  color: #f0f0f2;
  overflow: hidden;
}

.tools-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(232, 101, 10, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 101, 10, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

.tools-section .container { position: relative; z-index: 1; }

.tools-header .section-title { color: #fff; }
.tools-header .section-subtitle { color: #999; }

.tools-label {
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace !important;
  font-size: 0.85rem !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: var(--accent) !important;
}
.terminal-prompt { color: #6c5ce7; margin-right: 6px; }
.terminal-cursor {
  display: inline-block;
  margin-left: 2px;
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

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

.tool-card {
  position: relative;
  display: block;
  background: #0f0f12;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}
.tool-card:hover {
  border-color: rgba(232, 101, 10, 0.5);
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(232, 101, 10, 0.2);
}

.tool-window-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #18181b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tool-window-dots {
  display: flex;
  gap: 6px;
}
.tool-window-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #3a3a3a;
}
.tool-window-dots span:nth-child(1) { background: #ff5f57; }
.tool-window-dots span:nth-child(2) { background: #febc2e; }
.tool-window-dots span:nth-child(3) { background: #28c840; }

.tool-window-url {
  flex: 1;
  text-align: center;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  font-size: 0.78rem;
  color: #888;
  background: #0f0f12;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.tool-window-body {
  padding: 28px 24px 24px;
}

.tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(232, 101, 10, 0.18), rgba(108, 92, 231, 0.12));
  color: var(--accent);
  margin-bottom: 18px;
  border: 1px solid rgba(232, 101, 10, 0.25);
}
.tool-card:hover .tool-icon {
  background: linear-gradient(135deg, rgba(232, 101, 10, 0.3), rgba(108, 92, 231, 0.18));
}

.tool-window-body h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #fff;
}
.tool-window-body p {
  color: #999;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 18px;
}

.tool-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tool-stack span {
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  font-size: 0.72rem;
  color: #ccc;
}

.tool-launch {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(6px);
  transition: var(--transition);
}
.tool-card:hover .tool-launch {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1024px) {
  .tools-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .tools-grid { grid-template-columns: 1fr; }
}

/* --- CAD Viewer Section --- */
.cad-section {
  background: var(--bg-elevated);
}

.cad-viewer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.cad-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.cad-card:hover {
  border-color: rgba(232, 101, 10, 0.2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.cad-viewer {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: radial-gradient(ellipse at center, #3a3a3a 0%, #2d2d2d 100%);
  cursor: grab;
}
.cad-viewer:active { cursor: grabbing; }
.cad-viewer canvas {
  width: 100% !important;
  height: 100% !important;
}

.cad-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.cad-loading.hidden { display: none; }

.spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.cad-info {
  padding: 20px 24px 12px;
}
.cad-info h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.cad-info p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.cad-controls {
  display: flex;
  gap: 8px;
  padding: 12px 24px 20px;
}
.cad-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: var(--transition);
}
.cad-btn:hover {
  background: rgba(232, 101, 10, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}
.cad-btn.active {
  background: rgba(232, 101, 10, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.cad-note {
  text-align: center;
  margin-top: 48px;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.cad-note code {
  background: rgba(232, 101, 10, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--accent);
  font-size: 0.84rem;
}

/* --- Impact / Logo Strip --- */
.impact-strip {
  padding: 48px 0;
  background: #2d2d2d;
  overflow: hidden;
}

.impact-header {
  text-align: center;
  margin-bottom: 28px;
}
.impact-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: #ffffff;
}
.impact-subtitle {
  color: #999;
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto;
}
.impact-strip .section-label {
  color: var(--accent);
}

.logo-marquee-wrapper {
  position: relative;
}
.logo-marquee-wrapper::before,
.logo-marquee-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 120px;
  z-index: 2;
  pointer-events: none;
}
.logo-marquee-wrapper::before {
  left: 0;
  background: linear-gradient(to right, #2d2d2d, transparent);
}
.logo-marquee-wrapper::after {
  right: 0;
  background: linear-gradient(to left, #2d2d2d, transparent);
}

.logo-marquee {
  overflow: hidden;
}

.logo-track {
  display: flex;
  gap: 64px;
  animation: marquee 20s linear infinite;
  width: max-content;
}

.logo-item {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.3s;
  filter: brightness(0) invert(1);
}
.logo-item:hover {
  opacity: 1;
}
.logo-item img {
  height: 44px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}
.logo-item img[alt="Lockheed Martin"] {
  height: auto;
  width: 200px;
}
.logo-item img[alt="Supernal"] {
  height: 64px;
  max-width: 200px;
}
.logo-item img[alt="Penta Machine Co"] {
  height: 70px;
  max-width: 200px;
}
.logo-item img[alt="General Atomics"] {
  height: auto;
  width: 200px;
}

/* --- About Section --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 64px;
  align-items: center;
}

.about-image {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
}
.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.about-image::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.about-content .section-label { margin-bottom: 16px; }
.about-content .section-title {
  text-align: left;
  margin-bottom: 24px;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
}
.about-content p {
  color: var(--text-muted);
  font-size: 1.02rem;
  margin-bottom: 16px;
  line-height: 1.7;
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 36px;
}
.skill-item {
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.skill-item:hover {
  border-color: rgba(232, 101, 10, 0.2);
  background: var(--bg-card-hover);
}
.skill-number {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.skill-item h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin: 8px 0 4px;
}
.skill-item p {
  font-size: 0.85rem !important;
  color: var(--text-muted);
  margin-bottom: 0 !important;
  line-height: 1.4 !important;
}

/* --- Contact --- */
.contact-section {
  background: var(--bg-elevated);
}
.contact-content {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}
.contact-content .section-title {
  margin-bottom: 20px;
}
.contact-content p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 36px;
}
.contact-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Project Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.modal-overlay.open {
  display: flex;
  opacity: 1;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal {
  position: relative;
  background: var(--bg);
  border-radius: var(--radius-lg);
  width: 90vw;
  max-width: 900px;
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.25);
  transform: translateY(24px) scale(0.97);
  transition: transform 0.3s ease;
}
.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #2d2d2d;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.modal-close:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.modal-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(135deg, #eee, #ddd);
}
.modal-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-category {
  position: absolute;
  bottom: 16px;
  left: 20px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
}

.modal-body {
  padding: 32px;
}
.modal-body h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.modal-body > p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 20px;
  white-space: pre-line;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.modal-tags span {
  padding: 4px 12px;
  background: rgba(232, 101, 10, 0.08);
  border: 1px solid rgba(232, 101, 10, 0.15);
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
}

.modal-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}
.modal-detail-item {
  padding: 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.modal-detail-item h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.modal-detail-item p {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.modal-gallery-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.modal-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.modal-gallery img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #eee, #ddd);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.modal-gallery img:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* Lightbox for gallery images */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  cursor: zoom-out;
}
.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

.project-card { cursor: pointer; }

@media (max-width: 768px) {
  .modal { width: 95vw; max-height: 90vh; }
  .modal-body { padding: 20px; }
  .modal-gallery { grid-template-columns: 1fr 1fr; }
  .modal-details { grid-template-columns: 1fr; }
}

/* --- Footer --- */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- Animations --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes scrollPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; padding: 100px 24px 40px; gap: 32px; }
  .hero-right { max-width: 480px; margin: 0 auto; }
  .cad-viewer-grid { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-image { max-width: 400px; margin: 0 auto; }
  .about-content .section-title { text-align: center; }
  .about-content { text-align: center; }
}

@media (max-width: 768px) {
  .section { padding: 80px 0; }

  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 45, 45, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 1.2rem; }
  .nav-toggle { display: flex; z-index: 1001; }

  .projects-grid { grid-template-columns: 1fr; }
  .project-card--large { grid-column: span 1; grid-template-columns: 1fr; }
  .project-card--large .project-image { min-height: 220px; }

  .cad-viewer-grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }

  .hero-stats { gap: 20px; }
  .hero-stat-number { font-size: 1.5rem; }
  .skills-grid { grid-template-columns: 1fr; }
}
