/* ==========================================================================
   Stefan Zwegers Portfolio - Main Stylesheet
   Version: 07 "Full Experience"
   Changes: Page transitions, loading animation, custom cursor, sound toggle,
            micro-interactions, fixed project numbers
   ========================================================================== */

/* Reset & Base Styles
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0a0a0a;
  color: #fafafa;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  cursor: none;
}

/* Custom Cursor
   ========================================================================== */

.cursor {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  mix-blend-mode: difference;
}

.cursor-dot {
  width: 8px;
  height: 8px;
  background: #60faa5;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, width 0.3s ease, height 0.3s ease, background 0.3s ease;
}

.cursor-ring {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(96, 250, 165, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease-out, width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
}

/* Cursor states */
body.cursor-hover .cursor-dot {
  width: 12px;
  height: 12px;
  background: #fff;
}

body.cursor-hover .cursor-ring {
  width: 60px;
  height: 60px;
  border-color: rgba(255, 255, 255, 0.8);
}

body.cursor-click .cursor-dot {
  transform: translate(-50%, -50%) scale(0.5);
}

body.cursor-click .cursor-ring {
  transform: translate(-50%, -50%) scale(0.8);
}

/* Hide custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
  body {
    cursor: auto;
  }
  .cursor {
    display: none;
  }
}

/* Loading Screen - Smart Loading (only shows on slow connections)
   ========================================================================== */

.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  /* Start hidden - JS will show if needed */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

/* Only show loader when explicitly activated by JS */
.loader.loading {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fafafa;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeInUp 0.6s ease 0.2s forwards;
}

.loader-bar-container {
  width: 200px;
  height: 2px;
  background: #262626;
  border-radius: 1px;
  overflow: hidden;
  opacity: 0;
  animation: fadeInUp 0.6s ease 0.4s forwards;
}

.loader-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #60faa5, #6096fa);
  border-radius: 1px;
  animation: loadProgress 1.5s ease-in-out forwards;
}

.loader-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #525252;
  margin-top: 1rem;
  opacity: 0;
  animation: fadeInUp 0.6s ease 0.6s forwards;
}

@keyframes loadProgress {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll Indicator
   ========================================================================== */

.scroll-indicator {
  /* Positioned at bottom center of hero */
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  z-index: 10;
  animation: fadeInUp 1s ease 1.5s both;
}

.scroll-text {
  /* Small text label */
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #737373;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.scroll-line {
  /* Animated vertical line */
  width: 1px;
  height: 40px;
  background: linear-gradient(180deg, #60faa5 0%, transparent 100%);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% {
    opacity: 1;
    transform: scaleY(1);
  }
  50% {
    opacity: 0.5;
    transform: scaleY(0.6);
  }
}

/* Hide scroll indicator on small screens where it might overlap */
@media (max-width: 768px) {
  .scroll-indicator {
    bottom: 1rem;
  }
}

/* Skeleton Loaders for Images
   ========================================================================== */

.project-visual {
  /* Container is already set up, add skeleton background */
  position: relative;
  background: linear-gradient(90deg, #1a1a1a 25%, #252525 50%, #1a1a1a 75%);
  background-size: 200% 100%;
  overflow: hidden;
}

/* Skeleton animation only while image is loading */
.project-visual.loading {
  animation: skeletonShimmer 1.5s ease-in-out infinite;
}

@keyframes skeletonShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Image inside - hidden until loaded */
.project-visual img {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.project-visual img.loaded {
  opacity: 1;
}

/* Page Transitions
   ========================================================================== */

.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0a0a0a;
  z-index: 99998;
  pointer-events: none;
  transform: translateY(100%);
  transition: transform 0.6s cubic-bezier(0.86, 0, 0.07, 1);
}

.page-transition.active {
  transform: translateY(0);
}

.page-transition::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  border: 2px solid transparent;
  border-top-color: #60faa5;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: spin 1s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease 0.3s;
}

.page-transition.active::after {
  opacity: 1;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Sound Toggle
   ========================================================================== */

.sound-toggle {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 48px;
  height: 48px;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(96, 250, 165, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
  z-index: 1000;
  transition: all 0.3s ease;
}

.sound-toggle:hover {
  border-color: #60faa5;
  background: rgba(96, 250, 165, 0.1);
}

.sound-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #60faa5;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sound-toggle .sound-off {
  display: none;
}

.sound-toggle.muted .sound-on {
  display: none;
}

.sound-toggle.muted .sound-off {
  display: block;
}

.sound-toggle.muted {
  border-color: #525252;
}

.sound-toggle.muted svg {
  stroke: #525252;
}

/* Sound wave animation when unmuted */
.sound-toggle:not(.muted)::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(96, 250, 165, 0.5);
  border-radius: 50%;
  animation: soundPulse 2s ease-in-out infinite;
}

@keyframes soundPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.3); opacity: 0; }
}

/* Grain Texture Overlay - Editorial Polish
   ========================================================================== */

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 9998;
}

/* Micro-interactions
   ========================================================================== */

/* Button ripple effect */
.project-link,
.mode-button {
  position: relative;
  overflow: hidden;
}

.project-link::before,
.mode-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.project-link:active::before,
.mode-button:active::before {
  width: 300px;
  height: 300px;
}

/* Magnetic hover effect for buttons */
.magnetic-btn {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Glow pulse on focus */
.project-link:focus,
.mode-button:focus {
  animation: focusPulse 1.5s ease-in-out infinite;
}

@keyframes focusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(96, 250, 165, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(96, 250, 165, 0); }
}

/* Text reveal on scroll */
.reveal-text {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-text.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children animation */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
}

.stagger-children.animate > *:nth-child(1) { animation: staggerIn 0.6s ease 0.1s forwards; }
.stagger-children.animate > *:nth-child(2) { animation: staggerIn 0.6s ease 0.2s forwards; }
.stagger-children.animate > *:nth-child(3) { animation: staggerIn 0.6s ease 0.3s forwards; }
.stagger-children.animate > *:nth-child(4) { animation: staggerIn 0.6s ease 0.4s forwards; }
.stagger-children.animate > *:nth-child(5) { animation: staggerIn 0.6s ease 0.5s forwards; }

@keyframes staggerIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hover tilt effect for cards */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

/* Glitch effect for tech elements */
.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.glitch:hover::before {
  animation: glitch1 0.3s ease;
  color: #60faa5;
  opacity: 0.8;
}

.glitch:hover::after {
  animation: glitch2 0.3s ease;
  color: #6096fa;
  opacity: 0.8;
}

@keyframes glitch1 {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
}

@keyframes glitch2 {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(2px, -2px); }
  40% { transform: translate(2px, 2px); }
  60% { transform: translate(-2px, -2px); }
  80% { transform: translate(-2px, 2px); }
}

/* Skip Link (Accessibility)
   ========================================================================== */

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #60faa5;
  color: #0a0a0a;
  padding: 8px 16px;
  text-decoration: none;
  font-weight: 600;
  z-index: 10000;
}

.skip-link:focus {
  top: 0;
}

/* Hero Section
   ========================================================================== */

.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

@media (max-width: 768px) {
  .hero-section {
    min-height: auto;
    justify-content: flex-start;
    padding-top: 15vh;
  }
}

.hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  width: 90%;
  margin: 0 auto;
  padding: 2rem 0;
  flex-shrink: 0;
}

/* Hero Title
   ========================================================================== */

.hero-title-container {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 4rem;
  align-items: start;
  margin-bottom: 4rem;
}

.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(4rem, 12vw, 10rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #fafafa 0%, #737373 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title-line {
  display: block;
}

.hero-subtitle {
  padding-top: 2rem;
}

.hero-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #60faa5;
  margin-bottom: 2rem;
}

.hero-description {
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1.5;
  color: #d4d4d4;
  max-width: 500px;
}

.hero-description strong {
  font-weight: 600;
  color: #60faa5;
}

/* Path Mode Indicator
   ========================================================================== */

.path-mode-indicator {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(96, 250, 165, 0.3);
  padding: 1.5rem;
  z-index: 100;
  min-width: 320px;
}

/* Mobile: Move indicator below hero instead of overlapping */
@media (max-width: 768px) {
  .hero-section {
    min-height: auto;
    padding-bottom: 0;
  }
  
  .path-mode-indicator {
    position: relative;
    bottom: auto;
    right: auto;
    width: 100%;
    max-width: none;
    min-width: auto;
    margin: 0;
    border-left: none;
    border-right: none;
    border-radius: 0;
  }
}

.project-selector {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(96, 250, 165, 0.2);
}

.project-nav-arrow {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #60faa5;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: none;
  transition: all 0.3s;
  flex-shrink: 0;
  padding: 0;
}

.project-nav-arrow:hover {
  color: #7affbf;
  transform: scale(1.2);
}

.project-nav-arrow:focus {
  outline: 2px solid #60faa5;
  outline-offset: 2px;
}

.project-nav-arrow:active {
  transform: scale(0.9);
}

/* Clickable Project Name */
.project-name-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  cursor: none;
  flex-grow: 1;
  padding: 0.5rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.project-name-link:hover {
  background: rgba(96, 250, 165, 0.1);
}

.project-name-link:hover .project-name {
  color: #7affbf;
}

.project-name-link:hover .project-name-hint {
  background: #fff;
  transform: scale(1.05);
}

.project-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #60faa5;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.project-name-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #0a0a0a;
  background: #ffed47;
  padding: 0.4rem 0.75rem;
  margin-top: 0.5rem;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
}

.mode-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #737373;
  margin-bottom: 0.5rem;
}

.mode-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #60faa5;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.mode-description {
  font-size: 0.875rem;
  color: #a3a3a3;
  line-height: 1.5;
}

.mode-controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(96, 250, 165, 0.2);
}

.mode-button {
  padding: 0.75rem;
  background: rgba(96, 250, 165, 0.1);
  border: 1px solid rgba(96, 250, 165, 0.3);
  color: #60faa5;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}

.mode-button:hover {
  background: rgba(96, 250, 165, 0.2);
  border-color: #60faa5;
}

.mode-button:focus {
  outline: 2px solid #60faa5;
  outline-offset: 2px;
}

.mode-button.active {
  background: #60faa5;
  color: #0a0a0a;
  font-weight: 700;
}

/* Technical Overlay
   ========================================================================== */

.tech-overlay {
  position: fixed;
  top: 2rem;
  right: 2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #525252;
  line-height: 1.8;
  text-align: right;
  z-index: 100;
}

.tech-overlay-line {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.tech-overlay-label {
  opacity: 0.5;
}

.tech-overlay-value {
  color: #60faa5;
  font-weight: 500;
}

/* Content Section
   ========================================================================== */

.content-section {
  position: relative;
  background: #0a0a0a;
  z-index: 10;
  padding: 8rem 5%;
  border-top: 1px solid #262626;
}

.section-container {
  max-width: 1400px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: 4rem;
}

.section-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: #60faa5;
  margin-bottom: 1rem;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
}

.section-description {
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1.6;
  color: #d4d4d4;
  max-width: 800px;
}

/* Projects Grid - Dramatic Cards
   ========================================================================== */

.projects-grid {
  display: grid;
  gap: 4rem;
  counter-reset: project-counter;
}

.project-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  padding: 3rem;
  border: 1px solid #262626;
  background: linear-gradient(135deg, rgba(96, 250, 165, 0.03) 0%, transparent 100%);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  counter-increment: project-counter;
  overflow: visible;
}

/* Overlapping Project Number - Now in FRONT of image */
.project-card::before {
  content: counter(project-counter, decimal-leading-zero);
  position: absolute;
  top: -1.5rem;
  left: 2rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(5rem, 10vw, 8rem);
  font-weight: 700;
  line-height: 1;
  color: rgba(96, 250, 165, 0.08);
  -webkit-text-stroke: 1px rgba(96, 250, 165, 0.25);
  z-index: 10;
  pointer-events: none;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  mix-blend-mode: screen;
}

.project-card:hover::before {
  color: rgba(96, 250, 165, 0.15);
  -webkit-text-stroke: 1px rgba(96, 250, 165, 0.5);
  transform: translateX(0.5rem) translateY(-0.5rem);
  text-shadow: 0 0 30px rgba(96, 250, 165, 0.3);
}

/* Glow effect on hover */
.project-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 1px solid transparent;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.project-card:hover {
  border-color: #60faa5;
  transform: translateX(1rem) translateY(-0.5rem);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 60px rgba(96, 250, 165, 0.1),
    inset 0 1px 0 rgba(96, 250, 165, 0.1);
}

.project-card:hover::after {
  box-shadow: 0 0 30px rgba(96, 250, 165, 0.15);
}

.project-visual {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #171717;
  z-index: 1;
}

.project-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .project-visual img {
  transform: scale(1.08);
}

/* Image overlay on hover */
.project-visual::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(96, 250, 165, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.project-card:hover .project-visual::after {
  opacity: 1;
}

.project-info {
  position: relative;
  padding: 1rem 0;
  z-index: 1;
}

.project-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  color: #60faa5;
  margin-bottom: 1rem;
}

.project-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.project-client {
  font-size: 1.125rem;
  color: #737373;
  margin-bottom: 1.5rem;
}

.project-description {
  font-size: 1rem;
  line-height: 1.6;
  color: #d4d4d4;
  margin-bottom: 2rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: #fafafa;
  text-decoration: none;
  padding: 1rem 2rem;
  border: 1px solid #60faa5;
  background: rgba(96, 250, 165, 0.1);
  transition: all 0.3s ease;
}

.project-link:hover {
  background: #60faa5;
  color: #0a0a0a;
}

.project-link:focus {
  outline: 2px solid #60faa5;
  outline-offset: 2px;
}

/* Responsive Design
   ========================================================================== */

@media (max-width: 1024px) {
  .hero-title-container,
  .project-card {
    grid-template-columns: 1fr;
  }
  
  .path-mode-indicator {
    right: 1rem;
    bottom: 1rem;
    min-width: auto;
    max-width: 320px;
  }
  
  .hero-content {
    width: 85%;
  }
}

@media (max-width: 768px) {
  .tech-overlay {
    display: none;
  }
  
  .mode-controls {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .hero-title {
    font-size: clamp(3rem, 10vw, 6rem);
  }
  
  .hero-description {
    font-size: 1.25rem;
  }
  
  .section-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }
  
  .project-card {
    padding: 2rem;
    gap: 2rem;
  }
  
  .project-card::before {
    font-size: clamp(4rem, 15vw, 6rem);
    top: -1rem;
    left: 1rem;
  }
  
  .content-section {
    padding: 4rem 5%;
  }
}

@media (max-width: 480px) {
  .hero-title-container {
    gap: 2rem;
    margin-bottom: 2rem;
  }
  
  .hero-subtitle {
    padding-top: 1rem;
  }
  
  .path-mode-indicator {
    padding: 1.25rem 5%;
  }
  
  .project-selector {
    gap: 0.5rem;
  }
  
  .project-name {
    font-size: 0.875rem;
  }
  
  .mode-name {
    font-size: 1.25rem;
  }
  
  .mode-description {
    font-size: 0.75rem;
  }
  
  .projects-grid {
    gap: 2rem;
  }
}

/* Reduced Motion (Accessibility)
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .hero-canvas {
    display: none;
  }
  
  .project-card:hover {
    transform: none;
  }
  
  .project-card:hover .project-visual img {
    transform: none;
  }
}

/* High Contrast Mode (Accessibility)
   ========================================================================== */

@media (prefers-contrast: high) {
  body {
    background: #000;
    color: #fff;
  }
  
  .hero-title {
    background: #fff;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  
  .mode-button {
    border-width: 2px;
  }
  
  .project-card {
    border-width: 2px;
  }
}

/* Print Styles
   ========================================================================== */

@media print {
  .hero-canvas,
  .path-mode-indicator,
  .tech-overlay,
  .skip-link,
  .site-footer {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .hero-title {
    background: black;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  
  .project-link {
    page-break-inside: avoid;
  }
}

/* Stats Section - Social Proof
   ========================================================================== */

.stats-section {
  /* Full width section with dark background */
  position: relative;
  padding: 4rem 5%;
  background: linear-gradient(180deg, #0a0a0a 0%, #0f0f0f 50%, #0a0a0a 100%);
  border-top: 1px solid rgba(96, 250, 165, 0.1);
  border-bottom: 1px solid rgba(96, 250, 165, 0.1);
}

.stats-container {
  /* Flexbox container to center and space stats evenly */
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
}

.stat-item {
  /* Each stat is a flex column for stacking number-row and label */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-number-row {
  /* Wrapper to keep number and suffix on same line */
  display: flex;
  align-items: baseline;
  justify-content: center;
}

.stat-number {
  /* Large display number using Space Grotesk for impact */
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(3rem, 8vw, 4.5rem);
  font-weight: 700;
  color: #fafafa;
  line-height: 1;
}

.stat-suffix {
  /* The "+" suffix, slightly smaller, in accent color, right of number */
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: #60faa5;
  margin-left: 0.1em;
}

.stat-label {
  /* Monospace label below the number for tech feel */
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: #737373;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.5rem;
}

.stat-divider {
  /* Vertical line divider between stats */
  width: 1px;
  height: 60px;
  background: linear-gradient(180deg, transparent 0%, rgba(96, 250, 165, 0.3) 50%, transparent 100%);
}

/* Stats responsive - stack on mobile */
@media (max-width: 640px) {
  .stats-container {
    flex-direction: column;
    gap: 2rem;
  }
  
  .stat-divider {
    /* Change from vertical to horizontal line on mobile */
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(96, 250, 165, 0.3) 50%, transparent 100%);
  }
}

/* About Section
   ========================================================================== */

.about-section {
  /* Section container matching stats-section style */
  position: relative;
  padding: 6rem 5%;
  background: linear-gradient(180deg, #0a0a0a 0%, #0f0f0f 50%, #0a0a0a 100%);
  border-top: 1px solid rgba(96, 250, 165, 0.1);
  border-bottom: 1px solid rgba(96, 250, 165, 0.1);
}

.about-container {
  /* Centered container */
  max-width: 1100px;
  margin: 0 auto;
}

.about-content {
  /* Two column grid - tags left, text right */
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 4rem;
  align-items: start;
}

/* About Tags - skill/keyword pills on left */
.about-tags {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.about-tags .tag {
  /* Monospace tags matching site style */
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 0.625rem 1rem;
  border: 1px solid rgba(96, 250, 165, 0.3);
  color: #60faa5;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  transition: all 0.3s ease;
}

.about-tags .tag:hover {
  background: rgba(96, 250, 165, 0.1);
  border-color: #60faa5;
}

.about-tags .tag.blue {
  border-color: rgba(96, 150, 250, 0.3);
  color: #6096fa;
}

.about-tags .tag.blue:hover {
  background: rgba(96, 150, 250, 0.1);
  border-color: #6096fa;
}

.about-tags .tag.yellow {
  border-color: rgba(255, 237, 71, 0.3);
  color: #ffed47;
}

.about-tags .tag.yellow:hover {
  background: rgba(255, 237, 71, 0.1);
  border-color: #ffed47;
}

/* About Text - right column */
.about-text {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about-intro {
  /* Large intro text using Space Grotesk display font */
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
  color: #fafafa;
}

.about-intro .highlight {
  /* Accent color for key phrase */
  color: #60faa5;
}

.about-body {
  /* Body text in Outfit, slightly muted */
  font-size: 1.0625rem;
  line-height: 1.7;
  color: #b0b0b0;
}

.about-body p {
  margin-bottom: 1rem;
}

.about-body p:last-child {
  margin-bottom: 0;
}

.about-body strong {
  /* Emphasized text in white */
  color: #fafafa;
  font-weight: 500;
}

/* About CTA - LinkedIn button */
.about-cta {
  margin-top: 1rem;
}

.about-cta .cta-button {
  /* Button style matching project-link */
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #fafafa;
  text-decoration: none;
  padding: 1rem 2rem;
  border: 1px solid #60faa5;
  background: rgba(96, 250, 165, 0.1);
  transition: all 0.3s ease;
}

.about-cta .cta-button:hover {
  background: #60faa5;
  color: #0a0a0a;
}

.about-cta .cta-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* About Section Responsive */
@media (max-width: 900px) {
  .about-content {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  
  .about-tags {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .about-tags .tag {
    flex: 0 0 auto;
  }
}

@media (max-width: 480px) {
  .about-intro {
    font-size: 1.25rem;
  }
  
  .about-tags .tag {
    font-size: 0.65rem;
    padding: 0.5rem 0.75rem;
  }
  
  .about-cta .cta-button {
    width: 100%;
    justify-content: center;
  }
}

/* Services Section
   ========================================================================== */

.services-section {
  /* Section container */
  position: relative;
  padding: 6rem 5%;
  background: #0a0a0a;
}

.services-container {
  /* Centered container */
  max-width: 1100px;
  margin: 0 auto;
}

/* Services Grid - Three columns */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

/* Service Card with corner accents */
.service-card {
  position: relative;
  padding: 2rem;
  background: rgba(96, 250, 165, 0.02);
  border: 1px solid rgba(96, 250, 165, 0.15);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Corner accent - top left */
.service-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 20px;
  height: 20px;
  border-top: 2px solid #60faa5;
  border-left: 2px solid #60faa5;
  opacity: 0.5;
  transition: all 0.3s ease;
}

/* Corner accent - bottom right */
.service-card::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 20px;
  height: 20px;
  border-bottom: 2px solid #60faa5;
  border-right: 2px solid #60faa5;
  opacity: 0.5;
  transition: all 0.3s ease;
}

.service-card:hover {
  border-color: rgba(96, 250, 165, 0.4);
  background: rgba(96, 250, 165, 0.05);
  transform: translateY(-4px);
  box-shadow: 0 10px 40px rgba(96, 250, 165, 0.1);
}

.service-card:hover::before,
.service-card:hover::after {
  opacity: 1;
  width: 30px;
  height: 30px;
}

/* Blue variant */
.service-card.blue {
  border-color: rgba(96, 150, 250, 0.15);
  background: rgba(96, 150, 250, 0.02);
}
.service-card.blue::before,
.service-card.blue::after {
  border-color: #6096fa;
}
.service-card.blue:hover {
  border-color: rgba(96, 150, 250, 0.4);
  background: rgba(96, 150, 250, 0.05);
  box-shadow: 0 10px 40px rgba(96, 150, 250, 0.1);
}

/* Yellow variant */
.service-card.yellow {
  border-color: rgba(255, 237, 71, 0.15);
  background: rgba(255, 237, 71, 0.02);
}
.service-card.yellow::before,
.service-card.yellow::after {
  border-color: #ffed47;
}
.service-card.yellow:hover {
  border-color: rgba(255, 237, 71, 0.4);
  background: rgba(255, 237, 71, 0.05);
  box-shadow: 0 10px 40px rgba(255, 237, 71, 0.08);
}

/* Service card content */
.service-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  color: #60faa5;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.service-card.blue .service-number { color: #6096fa; }
.service-card.yellow .service-number { color: #ffed47; }

.service-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fafafa;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.service-outcome {
  font-size: 1rem;
  line-height: 1.6;
  color: #d4d4d4;
  margin-bottom: 0.75rem;
}

.service-how {
  font-size: 0.875rem;
  color: #737373;
  font-style: italic;
}

/* Services CTA */
.services-cta {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.services-cta p {
  font-size: 1.125rem;
  color: #b0b0b0;
  margin-bottom: 1.5rem;
}

.services-cta .cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #fafafa;
  text-decoration: none;
  padding: 1rem 2rem;
  border: 1px solid #60faa5;
  background: rgba(96, 250, 165, 0.1);
  transition: all 0.3s ease;
}

.services-cta .cta-button:hover {
  background: #60faa5;
  color: #0a0a0a;
  box-shadow: 0 0 30px rgba(96, 250, 165, 0.3);
}

.services-cta .cta-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Services Section Responsive */
@media (max-width: 900px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  .service-card {
    padding: 1.5rem;
  }
  
  .services-cta .cta-button {
    width: 100%;
    justify-content: center;
  }
}

/* Testimonials Section
   ========================================================================== */

.testimonials-section {
  /* Section container with padding and subtle background */
  position: relative;
  padding: 6rem 5%;
  background: #050505;
  overflow: hidden;
}

/* Geometric pattern background for visual interest */
.testimonials-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    repeating-linear-gradient(45deg, transparent, transparent 80px, rgba(96, 250, 165, 0.015) 80px, rgba(96, 250, 165, 0.015) 160px);
  pointer-events: none;
}

.testimonials-container {
  /* Constrain width and center content */
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
}

.testimonials-grid {
  /* 3-column grid that collapses on smaller screens */
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 3rem;
}

.testimonial-card {
  /* Card styling with subtle gradient and border */
  position: relative;
  background: linear-gradient(135deg, rgba(96, 250, 165, 0.03) 0%, transparent 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 2rem;
  transition: all 0.3s ease;
  overflow: hidden;
}

/* Hover pattern reveal effect */
.testimonial-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    repeating-linear-gradient(45deg, transparent, transparent 20px, rgba(96, 250, 165, 0.02) 20px, rgba(96, 250, 165, 0.02) 40px);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}

.testimonial-card:hover::before {
  opacity: 1;
}

.testimonial-card:hover {
  /* Lift and glow effect on hover */
  transform: translateY(-4px);
  border-color: rgba(96, 250, 165, 0.3);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(96, 250, 165, 0.05);
}

/* Ensure content is above the pseudo-element */
.testimonial-card > * {
  position: relative;
  z-index: 1;
}

.testimonial-category {
  /* Category tag in accent color with mono font */
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: #60faa5;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.testimonial-quote {
  /* Quote styling with left border accent */
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  font-style: italic;
  color: #d4d4d4;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-left: 2px solid rgba(96, 250, 165, 0.3);
}

.testimonial-author {
  /* Author info as a flex column */
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.author-name {
  /* Author name in white for emphasis */
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fafafa;
}

.author-role {
  /* Author role in dimmed gray */
  font-family: 'Outfit', sans-serif;
  font-size: 0.8125rem;
  color: #737373;
}

/* Testimonials responsive - 2 columns on tablet, 1 on mobile */
@media (max-width: 1024px) {
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .testimonials-section {
    padding: 4rem 5%;
  }
  
  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .testimonial-card {
    padding: 1.5rem;
  }
}

/* Final CTA Section
   ========================================================================== */

.final-cta-section {
  position: relative;
  padding: 6rem 5%;
  background: #0a0a0a;
  text-align: center;
}

.final-cta-container {
  max-width: 600px;
  margin: 0 auto;
}

.final-cta-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: #fafafa;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.final-cta-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.125rem;
  color: #a3a3a3;
  margin-bottom: 2rem;
}

.final-cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #0a0a0a;
  text-decoration: none;
  padding: 1rem 2.5rem;
  background: #60faa5;
  border: none;
  transition: all 0.3s ease;
}

.final-cta-button:hover {
  background: #7affbf;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(96, 250, 165, 0.3);
}

.final-cta-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Site Footer - Enhanced
   ========================================================================== */

.site-footer {
  position: relative;
  background: #050505;
  border-top: 1px solid #262626;
  padding: 6rem 5% 4rem;
  overflow: hidden;
}

/* Footer geometric pattern */
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    repeating-linear-gradient(45deg, transparent, transparent 50px, rgba(96, 250, 165, 0.02) 50px, rgba(96, 250, 165, 0.02) 100px),
    repeating-linear-gradient(-45deg, transparent, transparent 50px, rgba(96, 250, 165, 0.015) 50px, rgba(96, 250, 165, 0.015) 100px);
  pointer-events: none;
}

.footer-container {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fafafa;
}

.footer-tagline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  color: #60faa5;
  letter-spacing: 0.05em;
}

.footer-description {
  font-size: 1rem;
  color: #737373;
  line-height: 1.7;
  max-width: 400px;
}

.footer-section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #525252;
  margin-bottom: 1.5rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: #a3a3a3;
  text-decoration: none;
  font-size: 0.9375rem;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: #60faa5;
}

.footer-status {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #60faa5;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(96, 250, 165, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(96, 250, 165, 0); }
}

.status-text {
  font-size: 0.875rem;
  color: #a3a3a3;
}

.status-text strong {
  color: #fafafa;
  font-weight: 500;
}

.footer-coordinates {
  margin-top: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #525252;
}

.footer-bottom {
  position: relative;
  max-width: 1400px;
  margin: 4rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid #262626;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copyright {
  font-size: 0.875rem;
  color: #525252;
}

.footer-signature {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem;
  color: #737373;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-signature span {
  color: #60faa5;
}

/* Footer Responsive */
@media (max-width: 1024px) {
  .footer-container {
    grid-template-columns: 1fr 1fr;
  }
  
  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .site-footer {
    padding: 4rem 5% 3rem;
  }
  
  .footer-container {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* =============================================================
   SECTION 05 — AI-ASSISTED PROTOTYPING
   Three-column approach card grid + single project card override
============================================================= */

/* Default: three equal columns, borders collapse via negative margin */
.ai-approach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 equal columns on desktop */
  gap: 0;                                /* no gap — borders handle separation */
  margin-bottom: 4rem;                   /* space before the project card below */
  overflow: hidden;                      /* clip any bleed from negative margins */
}

/* Collapse to single column on tablet portrait and below */
@media (max-width: 900px) {
  .ai-approach-grid {
    grid-template-columns: 1fr;          /* stack cards vertically */
  }

  /* Reset the negative left margins that collapse borders in multi-col layout */
  .ai-approach-grid > div {
    margin-left: 0 !important;
  }
}

/* Single project card full-width override in the AI section */
/* The .projects-grid normally uses a multi-col layout — override to 1 col here */
#ai-prototyping .projects-grid {
  grid-template-columns: 1fr;            /* force single column */
}
