:root {
  --eclipse: #1a1a1a;
  --bone: #f5f5f7;
  --signature-silver: #e0e0e0;
  --logic-blue: #0055ff;
  --background: #0a0a0b;
  --on-background: #e2e2e4;
  --outline-variant: #333536;
  --secondary: #a3b5ff;
}

html {
  overflow-x: hidden;
  max-width: 100%;
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

.noise-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 50;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

#shader-bg {
  position: fixed;
  /* Taller than viewport so scroll-parallax never shows empty edges */
  top: -15vh;
  left: 0;
  width: 100vw;
  height: 130vh;
  z-index: -1;
  pointer-events: none;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

/* Floating code rain — also scroll-linked (see main.js) */
#code-layer {
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.glass-panel {
  background-color: rgba(10, 10, 11, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.scan-line {
  position: absolute;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: scan 3s linear infinite;
}

@keyframes scan {
  0% {
    top: 0;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(30px);
    transition:
      opacity 1s cubic-bezier(0.22, 1, 0.36, 1),
      transform 1s cubic-bezier(0.22, 1, 0.36, 1);
  }

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

  .stagger-1 {
    transition-delay: 0.1s;
  }
  .stagger-2 {
    transition-delay: 0.2s;
  }
  .stagger-3 {
    transition-delay: 0.3s;
  }

  .glitch-text {
    position: relative;
    display: inline-block;
  }

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

  .glitch-text:hover::before {
    left: 2px;
    text-shadow: -1px 0 red;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
  }

  .glitch-text:hover::after {
    left: -2px;
    text-shadow: -1px 0 blue;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
  }

  @keyframes glitch-anim {
    0% {
      clip: rect(74px, 9999px, 86px, 0);
    }
    20% {
      clip: rect(93px, 9999px, 34px, 0);
    }
    40% {
      clip: rect(38px, 9999px, 25px, 0);
    }
    60% {
      clip: rect(44px, 9999px, 46px, 0);
    }
    80% {
      clip: rect(78px, 9999px, 99px, 0);
    }
    100% {
      clip: rect(74px, 9999px, 14px, 0);
    }
  }

  @keyframes glitch-anim-2 {
    0% {
      clip: rect(32px, 9999px, 24px, 0);
    }
    25% {
      clip: rect(81px, 9999px, 1px, 0);
    }
    50% {
      clip: rect(78px, 9999px, 39px, 0);
    }
    75% {
      clip: rect(20px, 9999px, 93px, 0);
    }
    100% {
      clip: rect(76px, 9999px, 22px, 0);
    }
  }
}

.floating-code {
  position: absolute;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.05);
  pointer-events: none;
  white-space: pre;
  z-index: 0;
  will-change: transform;
}

.parallax-section {
  overflow: hidden;
}

.parallax-inner {
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.parallax-media {
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

/*
 * Hero is full viewport width. Atmosphere owns the right half inside that box.
 * overflow:hidden clips parallax drift — never creates horizontal page scroll.
 */
.hero-section,
#hero.parallax-section {
  overflow: hidden;
}

#hero.parallax-section > .parallax-inner {
  position: relative;
  width: 100%;
  min-height: 75vh;
}

.hero-atmosphere {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 50%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.4;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    rgba(0, 0, 0, 0.4) 14%,
    #000 40%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    rgba(0, 0, 0, 0.4) 14%,
    #000 40%
  );
}

@media (min-width: 768px) {
  .hero-atmosphere {
    opacity: 0.7;
  }
}

.hero-atmosphere__img {
  position: absolute;
  top: -6%;
  left: -10%;
  width: 120%;
  height: 112%;
  max-width: none;
  object-fit: cover;
  object-position: 28% center;
  mix-blend-mode: screen;
  filter: brightness(0.7) contrast(1.05) saturate(0.8);
  user-select: none;
}

.hero-atmosphere__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to right,
      #0a0a0b 0%,
      rgba(10, 10, 11, 0.5) 16%,
      rgba(10, 10, 11, 0.1) 45%,
      transparent 70%
    ),
    linear-gradient(to top, #0a0a0b 0%, transparent 30%),
    linear-gradient(to bottom, #0a0a0b 0%, transparent 20%);
  pointer-events: none;
}

/* Form states */
.form-status {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
  min-height: 1.25rem;
}

.form-status[data-state="success"] {
  color: #6ee7b7;
}

.form-status[data-state="error"] {
  color: #fca5a5;
}

.form-status[data-state="sending"] {
  color: var(--secondary);
}

#contact-form button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Mobile nav */
.mobile-nav {
  display: none;
}

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

@media (max-width: 767px) {
  .mobile-nav.open {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem 1.5rem 2rem;
    border-top: 0.5px solid var(--outline-variant);
  }
}

/* Lightbox: click-to-enlarge for figures, background blurred behind it */
body.lightbox-open {
  overflow: hidden;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 6vw;
  background: rgba(10, 10, 11, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  background: #ffffff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transform: scale(0.96);
  transition: transform 0.3s ease;
}

.lightbox-overlay.active .lightbox-img {
  transform: scale(1);
}

.lightbox-close {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--on-background);
  background: rgba(10, 10, 11, 0.6);
  border: 0.5px solid var(--outline-variant);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.lightbox-close:hover {
  color: #ffffff;
  border-color: var(--on-background);
}
