/* ============================================
   LUIS F. MASIERI — Personal Website
   Design System & Styles
   ============================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&family=Space+Mono:wght@400;700&display=swap');

/* ---------- Custom Properties (Dark — default) ---------- */
:root {
  /* Backgrounds */
  --bg-primary:    #0a0e1a;
  --bg-secondary:  #111827;
  --bg-tertiary:   #1a2332;

  /* Accent blues */
  --accent:        #3b82f6;
  --accent-light:  #60a5fa;
  --accent-dim:    #1e40af;
  --accent-glow:   rgba(59, 130, 246, 0.12);

  /* Text */
  --text-primary:  #f1f5f9;
  --text-body:     #cbd5e1;
  --text-muted:    #64748b;

  /* Structural */
  --border:        #1e293b;
  --border-accent: rgba(37, 99, 235, 0.2);

  /* Utility */
  --white:         #ffffff;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;
  --space-section: clamp(6rem, 14vw, 10rem);

  /* Layout */
  --container-width: 1100px;
  --container-padding: clamp(1.5rem, 5vw, 3rem);

  /* Radius */
  --radius: 12px;
  --radius-sm: 8px;

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* Color scheme */
  color-scheme: dark;
}

/* ---------- Light Mode ---------- */
/* System preference (only when no manual override to dark) */
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) {
    --bg-primary:    #f8fafc;
    --bg-secondary:  #f1f5f9;
    --bg-tertiary:   #e2e8f0;

    --accent:        #2563eb;
    --accent-light:  #1d4ed8;
    --accent-dim:    #3b82f6;
    --accent-glow:   rgba(37, 99, 235, 0.08);

    --text-primary:  #0f172a;
    --text-body:     #334155;
    --text-muted:    #64748b;

    --border:        #e2e8f0;
    --border-accent: rgba(37, 99, 235, 0.15);

    --white:         #ffffff;

    color-scheme: light;
  }
}

/* Manual light override */
html[data-theme="light"] {
  --bg-primary:    #f8fafc;
  --bg-secondary:  #f1f5f9;
  --bg-tertiary:   #e2e8f0;

  --accent:        #2563eb;
  --accent-light:  #1d4ed8;
  --accent-dim:    #3b82f6;
  --accent-glow:   rgba(37, 99, 235, 0.08);

  --text-primary:  #0f172a;
  --text-body:     #334155;
  --text-muted:    #64748b;

  --border:        #e2e8f0;
  --border-accent: rgba(37, 99, 235, 0.15);

  --white:         #ffffff;

  color-scheme: light;
}

/* Manual dark override (re-state dark vars to override system light preference) */
html[data-theme="dark"] {
  --bg-primary:    #0a0e1a;
  --bg-secondary:  #111827;
  --bg-tertiary:   #1a2332;

  --accent:        #3b82f6;
  --accent-light:  #60a5fa;
  --accent-dim:    #1e40af;
  --accent-glow:   rgba(59, 130, 246, 0.12);

  --text-primary:  #f1f5f9;
  --text-body:     #cbd5e1;
  --text-muted:    #64748b;

  --border:        #1e293b;
  --border-accent: rgba(37, 99, 235, 0.2);

  --white:         #ffffff;

  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--text-body);
  background: var(--bg-primary);
  overflow-x: hidden;
}

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

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

a:hover {
  color: var(--text-primary);
}

ul, ol {
  list-style: none;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text-primary);
  line-height: 1.2;
}

h2 {
  font-weight: 700;
  font-size: clamp(2rem, 3.5vw, 3rem);
  letter-spacing: -0.02em;
}

h3 {
  font-weight: 500;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

.label {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}

.mono {
  font-family: 'Space Mono', monospace;
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

section {
  padding: var(--space-section) 0;
}

/* No divider between sections */

/* ---------- Section Label ---------- */
.section-label {
  font-family: 'Space Mono', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-lg);
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.25rem 0;
  background: transparent;
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(10, 14, 26, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}

@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) .nav.scrolled {
    background: rgba(248, 250, 252, 0.88);
  }
}

html[data-theme="light"] .nav.scrolled {
  background: rgba(248, 250, 252, 0.88);
}

.nav-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-decoration: none;
}

.nav-logo:hover {
  color: var(--accent-light);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.3s var(--ease);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

/* Portfolio toggle */
[data-show-portfolio="false"] .nav-portfolio {
  display: none;
}

/* Language toggle */
.lang-toggle {
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-muted);
  padding: 3px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-family: var(--font-mono);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
  flex-shrink: 0;
  line-height: 1;
}

.lang-toggle:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.3s var(--ease);
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--accent);
}

/* Show sun in dark, moon in light */
.icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="light"] .icon-moon { display: flex; }

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.nav-hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile overlay */
.nav-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
}

@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) .nav-mobile-overlay {
    background: rgba(248, 250, 252, 0.96);
  }
}

html[data-theme="light"] .nav-mobile-overlay {
  background: rgba(248, 250, 252, 0.96);
}

.nav-mobile-overlay.open {
  display: flex;
}

.nav-mobile-overlay .nav-link {
  font-size: 1.5rem;
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }
}

/* ---------- Hero A: Interactive Gradient Orbs ---------- */
/* Hero always sits over a dark video — lock to dark-mode colours regardless of theme */
.hero-a {
  --text-primary:  #f1f5f9;
  --text-body:     #cbd5e1;
  --text-muted:    #94a3b8;
  --accent:        #3b82f6;
  --accent-light:  #60a5fa;
  --border:        #1e293b;

  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 6rem 0 4rem;
}

/* Subtle ambient glow behind text */
.hero-a::before {
  content: '';
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(59, 130, 246, 0.06), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
}


.hero-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 1.5rem;
}

.hero-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(2.75rem, 6.5vw, 5.5rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 1.25rem;
  /* Animated gradient text */
  background: linear-gradient(
    90deg,
    var(--text-primary) 0%,
    var(--text-primary) 25%,
    var(--accent-light) 45%,
    #a78bfa 50%,
    var(--accent-light) 55%,
    var(--text-primary) 75%,
    var(--text-primary) 100%
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientSweep 6s ease-in-out infinite;
}

@keyframes gradientSweep {
  0% { background-position: 100% 50%; }
  50% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.hero-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
  z-index: 0;
}

.hero-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 14, 26, 0.93) 0%,
    rgba(10, 14, 26, 0.80) 50%,
    rgba(10, 14, 26, 0.95) 100%
  );
  z-index: 0;
}

.hero-headline {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 0.75rem;
}

.hero-location {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.1em;
  margin-bottom: 2.5rem;
}

/* Nav links when floating over the hero video (not yet scrolled) — white in both themes */
.nav:not(.scrolled) .nav-link,
.nav:not(.scrolled) .theme-toggle {
  color: rgba(255, 255, 255, 0.75);
}

.nav:not(.scrolled) .nav-link:hover {
  color: #ffffff;
}

.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.6;
  transition: opacity 0.3s var(--ease);
}

.scroll-indicator span {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-body);
}

.scroll-indicator .scroll-arrow {
  color: var(--text-body);
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { opacity: 0.3; transform: translateY(-4px); }
  50% { opacity: 1; transform: translateY(4px); }
}

/* ---------- Buttons ---------- */
.btn {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  border: none;
}

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

.btn-primary:hover {
  background: var(--accent-light);
  color: var(--white);
  box-shadow: 0 0 30px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-ghost:hover {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 0 25px var(--accent-glow);
}

/* ---------- Stats Strip ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

.stat-number {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 3.5vw, 3rem);
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.4;
}

@media (max-width: 768px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- About ---------- */
.about-row {
  display: flex;
  gap: var(--space-lg);
  align-items: center;
}

.about-content {
  flex: 1;
  min-width: 0;
}

.about-photo {
  flex-shrink: 0;
  width: 300px;
  position: relative;
}

.about-photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

@media (max-width: 768px) {
  .about-row {
    flex-direction: column-reverse;
    gap: var(--space-md);
  }

  .about-photo {
    width: 200px;
  }
}

.about-content h2 {
  font-size: clamp(1.5rem, 2.4vw, 2.2rem);
}

.about-content p {
  margin-bottom: 1.25rem;
}

.about-content p:last-of-type {
  margin-bottom: 0;
}

/* ---------- Experience ---------- */
.experience-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.experience-card {
  border-left: 2px solid var(--accent-dim);
  padding-left: var(--space-md);
  transition: border-color 0.3s var(--ease);
}

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

.experience-role {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.experience-meta {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.experience-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.experience-bullets li {
  padding-left: 1.25rem;
  position: relative;
  font-size: 1rem;
  line-height: 1.65;
}

.experience-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-dim);
}

/* ---------- Leadership ---------- */
.leadership-single {
  max-width: 700px;
}

.leadership-roles {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  line-height: 1.6;
}

/* ---------- Education ---------- */
.education-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.education-item {
  padding: 1.25rem;
  border-left: 2px solid var(--accent-dim);
  transition: border-color 0.3s var(--ease);
}

.education-item:hover {
  border-left-color: var(--accent);
}

.education-item h3 {
  margin-bottom: 0.25rem;
}

.education-item .experience-meta {
  margin-bottom: 0.5rem;
}

.education-detail {
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.education-certs {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.05em;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.education-certs-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

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

/* ---------- Speaking Carousel — Continuous Scroll ---------- */
.speaking-carousel {
  position: relative;
  overflow: hidden;
}

.speaking-items {
  overflow: hidden;
  padding: 0.5rem 0;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.speaking-items.dragging {
  cursor: grabbing;
}

.speaking-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  will-change: transform;
}

.speaking-item {
  flex: 0 0 320px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.speaking-item:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 25px var(--accent-glow);
}

.speaking-item h3 {
  margin-bottom: 0.35rem;
}

.speaking-item .experience-meta {
  margin-bottom: 0.75rem;
}

.speaking-item a {
  display: inline-block;
  margin-top: 0.75rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.2s var(--ease), opacity 0.2s var(--ease);
}

.speaking-item a:hover {
  color: var(--accent-light);
  opacity: 0.9;
}

@media (max-width: 768px) {
  .speaking-item {
    flex: 0 0 280px;
  }
}

/* ---------- Expertise / Superpowers ---------- */
.superpowers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.superpower {
  text-align: center;
  padding: var(--space-md);
}

.superpower-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
  display: block;
}

.superpower h3 {
  font-size: 1.1rem;
  color: var(--accent-light);
  margin-bottom: 0.5rem;
  font-family: 'Space Mono', monospace;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.superpower p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

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

/* ---------- Contact ---------- */
.contact {
  padding-bottom: var(--space-xl);
}

.contact .section-label {
  /* No special overrides needed */
}

.contact-closing {
  font-style: italic;
  color: var(--text-body);
  max-width: 600px;
  font-size: 1.1rem;
  margin-bottom: var(--space-lg);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: start;
}

.contact-social {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  transition: color 0.3s var(--ease);
  text-decoration: none;
}

.social-link:hover {
  color: var(--accent);
}

.social-link svg {
  flex-shrink: 0;
  color: var(--accent-dim);
  transition: color 0.3s var(--ease);
}

.social-link:hover svg {
  color: var(--accent);
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form input,
.contact-form textarea {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: border-color 0.3s var(--ease);
  outline: none;
  width: 100%;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-muted);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
}

.contact-form textarea {
  resize: none;
  min-height: 120px;
}

.contact-form .btn {
  align-self: flex-start;
}

/* Form submission states */
.form-success {
  text-align: center;
  padding: var(--space-md);
  color: var(--accent);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 500;
}

.form-error {
  color: #ef4444;
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--space-md) 0;
}

.footer-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.footer-top {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
}

.footer-top:hover {
  color: var(--accent-light);
}

/* ---------- Scroll Animations ---------- */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.stagger.visible > *:nth-child(1) { transition-delay: 0ms; opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(2) { transition-delay: 80ms; opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(3) { transition-delay: 160ms; opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(4) { transition-delay: 240ms; opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(5) { transition-delay: 320ms; opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(6) { transition-delay: 400ms; opacity: 1; transform: translateY(0); }

/* ---------- Portfolio Page ---------- */
.portfolio-hero {
  padding: 10rem 0 4rem;
  text-align: center;
}

.portfolio-hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.portfolio-hero p {
  font-style: italic;
  color: var(--text-body);
  font-size: 1.15rem;
}

/* Portfolio tabs */
.portfolio-tabs {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.portfolio-tab {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.6rem 1.5rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.portfolio-tab:hover {
  border-color: var(--accent-dim);
  color: var(--text-primary);
}

.portfolio-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

/* Project sections */
.project {
  display: none;
}

.project.active {
  display: block;
}

.project-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--space-md);
}

.project-image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-tertiary), var(--accent-dim));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.project-section {
  margin-bottom: var(--space-md);
}

.project-section h3 {
  font-size: 0.85rem;
  font-family: 'Space Mono', monospace;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.project-meta-item {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.project-meta-item strong {
  color: var(--text-body);
  display: block;
  margin-bottom: 0.25rem;
}

/* ---------- Scroll margin for fixed nav ---------- */
section[id] {
  scroll-margin-top: 5rem;
}
