/* ============================================================================
   GLOBAL STYLES
   ============================================================================ */

:root {
  --current-playhead-color: #000000;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Merriweather', serif;
  background: #ffffff;
  color: #000000;
  line-height: 1.6;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

h1, h2, h3 {
  font-family: 'Merriweather', serif;
  font-weight: 400;
  line-height: 1.2;
}

/* ============================================================================
   HEADER & NAVIGATION
   ============================================================================ */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 24px 48px;
  background: #ffffff;
  border-bottom: 1px solid #000000;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
}

.logo-letter {
  display: inline-block;
  transition: transform 0.3s ease;
}

.logo:hover .logo-letter:nth-child(1) {
  animation: bounce 0.6s ease;
}

.logo:hover .logo-letter:nth-child(2) {
  animation: bounce 0.6s ease 0.1s;
}

.logo-dot {
  font-size: 24px;
  display: inline-block;
  transition: transform 0.3s ease;
}

.logo:hover .logo-dot {
  animation: pulse 0.6s ease;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-8px);
  }
  50% {
    transform: translateY(0);
  }
  75% {
    transform: translateY(-4px);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1) translateY(0) rotate(0deg);
    color: #000000;
  }
  25% {
    transform: scale(1.3) translateY(-10px) rotate(90deg);
    color: #FF6B6B;
  }
  50% {
    transform: scale(1.5) translateY(-15px) rotate(180deg);
    color: #4ECDC4;
  }
  75% {
    transform: scale(1.3) translateY(-10px) rotate(270deg);
    color: #FFE66D;
  }
  100% {
    transform: scale(1) translateY(0) rotate(360deg);
    color: #000000;
  }
}

nav {
  display: flex;
  gap: 48px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 1px;
  position: relative;
}

.nav-playhead {
  position: absolute;
  top: -8px;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--playhead-color, #000000);
  border-radius: 2px;
  transition: left 0.3s ease, width 0.3s ease, background-color 0.3s ease;
  pointer-events: none;
  --playhead-color: #000000;
}

.nav-playhead::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--playhead-color, #000000);
}

nav a {
  text-decoration: none;
  color: #000000;
  text-transform: uppercase;
  transition: opacity 0.2s;
  position: relative;
}

nav a:hover {
  opacity: 0.6;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--current-playhead-color);
  transition: width 0.3s, background-color 0.3s;
}

nav a:hover::after {
  width: 100%;
}

/* ============================================================================
   MOBILE NAVIGATION DOTS
   ============================================================================ */

.mobile-nav-dots {
  display: none; /* Hidden on desktop */
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  right: 24px;
  z-index: 150;
  flex-direction: column;
  gap: 20px;
  pointer-events: all;
}

/* Toggle button */
.nav-dots-toggle {
  width: 28px;
  height: 28px;
  border: 2px solid #000000;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s ease, background-color 0.2s ease;
  margin-bottom: 12px;
  align-self: center;
  padding: 0;
}

.nav-dots-toggle:active {
  transform: scale(0.9);
}

.nav-dots-toggle svg {
  width: 12px;
  height: 12px;
  transition: transform 0.3s ease;
}

/* Rotate arrow when expanded */
.mobile-nav-dots.expanded .nav-dots-toggle svg {
  transform: rotate(180deg);
}

.nav-dot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

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

/* Inner dot circle */
.dot-inner {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid #000000;
  border-radius: 50%;
  background: #ffffff;
  transition: all 0.3s ease;
  pointer-events: none;
}

/* Active state - matches playhead color */
.nav-dot.active .dot-inner {
  width: 16px;
  height: 16px;
  border: none;
  background: var(--current-playhead-color, #000000);
  box-shadow: 0 0 12px var(--current-playhead-color, #000000);
}

/* Ripple effect container */
.nav-dot::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--current-playhead-color, #000000);
  opacity: 0;
  transform: scale(0.5);
  pointer-events: none;
}

/* Ripple animation on tap */
.nav-dot.ripple::before {
  animation: dot-ripple 0.6s ease-out;
}

@keyframes dot-ripple {
  0% {
    opacity: 0.3;
    transform: scale(0.5);
  }
  100% {
    opacity: 0;
    transform: scale(2.5);
  }
}

/* Label tooltip */
.dot-label {
  position: absolute;
  right: 56px;
  background: #ffffff;
  color: #000000;
  padding: 6px 12px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(8px);
  transition: all 0.3s ease;
  border: 1px solid #000000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  visibility: hidden;
}

/* Show labels when expanded */
.mobile-nav-dots.expanded .dot-label {
  opacity: 1;
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

/* Active dot label color accent when expanded */
.mobile-nav-dots.expanded .nav-dot.active .dot-label {
  border-color: var(--current-playhead-color, #000000);
}

/* Small device adjustments */
@media (max-width: 375px) {
  .mobile-nav-dots {
    right: 16px;
    gap: 16px;
  }

  .nav-dot {
    width: 44px;
    height: 44px;
  }
}

/* Accessibility: Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .nav-dot,
  .dot-inner,
  .dot-label {
    transition: none !important;
  }

  .nav-dot.ripple::before {
    animation: none !important;
  }
}

/* ============================================================================
   MAIN CONTENT
   ============================================================================ */

main {
  margin-top: 80px;
}

/* ============================================================================
   HERO SECTION
   ============================================================================ */

.hero {
  padding: 80px 48px;
  border-bottom: 1px solid #000000;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.hero-text h1 {
  font-size: 72px;
  margin-bottom: 24px;
  letter-spacing: -1px;
}

.hero-text .headline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 32px;
  font-weight: 500;
}

.hero-text .description {
  font-size: 18px;
  line-height: 1.8;
  margin-bottom: 64px;
  max-width: 500px;
  color: #333333;
}

.hero-cta {
  cursor: pointer;
  display: inline-block;
  transition: color 0.2s ease, opacity 0.3s ease;
  position: relative;
}

.hero-cta:hover {
  color: #000000;
}

.hero-cta:active {
  transform: scale(0.98);
}

.scroll-line {
  position: fixed;
  width: 2px;
  height: 50px;
  background: linear-gradient(to bottom, rgba(102, 102, 102, 0), rgba(102, 102, 102, 0.8), rgba(102, 102, 102, 0));
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  animation: line-fall-new 1.8s ease-out forwards;
}

@keyframes line-fall-new {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  15% {
    opacity: 0.8;
  }
  85% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(600px);
    opacity: 0;
  }
}

.speed-line {
  position: fixed;
  width: 2px;
  height: 80px;
  background: linear-gradient(to bottom, rgba(102, 102, 102, 0), rgba(102, 102, 102, 0.5), rgba(102, 102, 102, 0));
  opacity: 0;
  pointer-events: none;
  z-index: 50;
}

.speed-line.scroll-down {
  animation: speed-line-down 0.6s ease-out forwards;
}

.speed-line.scroll-up {
  animation: speed-line-up 0.6s ease-out forwards;
}

.speed-line.scroll-fast {
  animation-duration: 0.4s;
}

.speed-line.fade-out {
  animation: speed-line-fade 0.5s ease-out forwards !important;
}

@keyframes speed-line-down {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  20% {
    opacity: 0.7;
  }
  80% {
    opacity: 0.4;
  }
  100% {
    transform: translateY(-200px);
    opacity: 0;
  }
}

@keyframes speed-line-up {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  20% {
    opacity: 0.7;
  }
  80% {
    opacity: 0.4;
  }
  100% {
    transform: translateY(200px);
    opacity: 0;
  }
}

@keyframes speed-line-fade {
  0% {
    opacity: 0.5;
  }
  100% {
    opacity: 0;
  }
}

.hero-image {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #000000;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f5f5f5;
  padding: 12px;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================================
   ABOUT SECTION
   ============================================================================ */

.about {
  padding: 120px 48px;
  border-bottom: 1px solid #000000;
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 48px;
  opacity: 0.7;
  margin-top: 0;
  transition: text-shadow 0.3s ease;
  cursor: default;
}

.section-label:hover {
  text-shadow: 0 0 12px var(--current-playhead-color);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.about-text-column {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.about-text-column .section-label {
  margin-bottom: 0;
}

.about-text-column #about-text-content {
  margin-top: auto;
}

.about-text h2 {
  font-size: 48px;
  margin-bottom: 32px;
}

.about-text p {
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 24px;
  color: #333333;
}

#about-text-content p {
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 24px;
  color: #333333;
}

.about-image {
  border: 1px solid #000000;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: #f5f5f5;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================================
   WORKING ON SECTION
   ============================================================================ */

.working-on {
  padding: 120px 48px;
  border-bottom: 1px solid #000000;
  max-width: 1200px;
  margin: 0 auto;
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
}

.project-card {
  display: flex;
  flex-direction: column;
}

.project-logo {
  width: 80px;
  height: 80px;
  border: 1px solid #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  background: #000000;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-align: center;
  padding: 12px;
  font-weight: 600;
  cursor: pointer;
}

.project-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease-out;
  pointer-events: none; /* Allow clicks/touches to pass through to container */
}

.project-logo:hover img {
  animation: logo-spin-slow 8s linear infinite;
}

.project-logo img.whiplash {
  animation: logo-whiplash 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.project-logo.cooldown {
  pointer-events: none;
}

@keyframes logo-spin-slow {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes logo-whiplash {
  0% {
    transform: rotate(var(--current-rotation, 0deg));
  }
  40% {
    transform: rotate(calc(0deg - var(--overshoot-angle, 15deg)));
  }
  65% {
    transform: rotate(calc(0deg + var(--overshoot-angle, 15deg) * 0.4));
  }
  85% {
    transform: rotate(calc(0deg - var(--overshoot-angle, 15deg) * 0.15));
  }
  100% {
    transform: rotate(0deg);
  }
}

.project-card h3 {
  font-size: 36px;
  margin-bottom: 24px;
  position: relative;
  width: fit-content;
}

.project-card h3::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--current-playhead-color);
  transition: width 0.5s ease;
}

.project-card:hover h3::after {
  width: 100%;
}

.project-card p {
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 24px;
  color: #333333;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #000000;
  text-decoration: none;
  margin-top: auto;
  transition: opacity 0.2s;
}

.project-link:hover {
  opacity: 0.6;
}

.project-link::after {
  content: '→';
  transition: transform 0.3s, color 0.3s;
}

.project-link:hover::after {
  transform: translateX(4px);
  color: var(--current-playhead-color);
}

/* ============================================================================
   CONTACT SECTION
   ============================================================================ */

.contact {
  padding: 120px 48px;
  max-width: 1200px;
  margin: 0 auto;
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.contact-text-column {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.contact-text-column .section-label {
  margin-bottom: 0;
}

.contact-text-wrapper {
  margin-top: auto;
  margin-bottom: 20px;
}

.contact-text h2 {
  font-size: 48px;
  margin-bottom: 32px;
}

.contact-text p {
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 16px;
  color: #333333;
}

.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 48px;
}

.contact-method {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-method label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.7;
}

.contact-method a {
  font-size: 18px;
  color: #000000;
  text-decoration: none;
  transition: background-color 0.3s ease;
  padding: 4px 8px;
  margin-left: -8px;
  border-radius: 4px;
  display: inline;
  align-self: flex-start;
  width: fit-content;
}

.contact-method a:hover {
  background-color: rgba(255, 107, 107, 0.25); /* Fallback color */
  background-color: color-mix(in srgb, var(--current-playhead-color) 25%, transparent);
}

.contact-buttons {
  display: flex;
  gap: 16px;
  margin-top: 48px;
  flex-wrap: wrap;
}

.contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  border: 1px solid #000000;
  background: #000000;
  color: #ffffff;
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.3s;
  cursor: pointer;
}

.contact-button:hover {
  background: #ffffff;
  color: #000000;
}

.contact-button.secondary {
  background: #ffffff;
  color: #000000;
}

.contact-button.secondary:hover {
  background: #000000;
  color: #ffffff;
}

.whatsapp-button {
  position: relative;
  overflow: hidden;
}

.whatsapp-button:hover {
  background: #25D366;
  border-color: #25D366;
  color: #ffffff;
  animation: whatsapp-bounce 0.6s ease;
}

@keyframes whatsapp-bounce {
  0%, 100% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.1) rotate(-3deg);
  }
  50% {
    transform: scale(1.05) rotate(3deg);
  }
  75% {
    transform: scale(1.1) rotate(-3deg);
  }
}

.contact-visual {
  border: 1px solid #000000;
  aspect-ratio: 3/4;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: #999999;
  padding: 12px;
  overflow: hidden;
}

.contact-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

footer {
  padding: 48px;
  border-top: 1px solid #000000;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 1px;
  color: #999999;
}

footer a {
  color: #999999;
  text-decoration: none;
  transition: opacity 0.2s;
}

footer a:hover {
  opacity: 0.6;
}

/* ============================================================================
   LEGAL PAGE
   ============================================================================ */

.legal-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 80px 48px;
}

.legal-container h1 {
  font-size: 56px;
  margin-bottom: 64px;
}

.legal-section {
  margin-bottom: 64px;
}

.legal-section h2 {
  font-size: 28px;
  margin-bottom: 24px;
  border-bottom: 1px solid #000000;
  padding-bottom: 16px;
}

.legal-section p {
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 16px;
  color: #333333;
}

.back-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #000000;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 48px;
  transition: opacity 0.2s;
}

.back-link:hover {
  opacity: 0.6;
}

.back-link::before {
  content: '←';
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 1024px) {
  header {
    padding: 20px 32px;
  }

  nav {
    gap: 24px;
  }

  main {
    margin-top: 70px;
  }

  .hero {
    padding: 60px 32px;
    min-height: auto;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-text h1 {
    font-size: 48px;
  }

  .about, .working-on, .contact {
    padding: 80px 32px;
  }

  .about-grid, .projects-grid, .contact-content {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .project-card h3 {
    font-size: 28px;
  }

  .legal-container {
    padding: 60px 32px;
  }
}

@media (max-width: 640px) {
  header {
    padding: 16px 24px;
    border-bottom: none;
  }

  nav {
    display: none;
  }

  /* Show mobile dot navigation */
  .mobile-nav-dots {
    display: flex;
  }

  /* White scroll lines on mobile */
  .scroll-line {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
  }

  .hero {
    padding: 40px 24px;
  }

  .hero-text h1 {
    font-size: 36px;
  }

  .hero-image {
    aspect-ratio: auto;
    min-height: 300px;
  }

  .about, .working-on {
    padding: 60px 24px;
  }

  /* Contact section with extra top padding for better anchor positioning */
  .contact {
    padding: 120px 24px 60px 24px;
  }

  /* Ensure consistent alignment in working-on section */
  .working-on {
    padding: 60px 24px;
  }

  /* Add vertical padding to images for consistent framing */
  .hero-image img,
  .about-image img,
  .contact-visual img {
    padding: 24px 0;
  }

  /* Add right padding to body text only (not headings or images) to avoid nav dots */
  .hero-text p,
  #about-text-content p,
  .project-card p,
  #contact-description,
  .contact-method {
    padding-right: 28px;
  }

  /* Move working-on section content 50px to the right */
  .working-on .section-label,
  .working-on .projects-grid {
    padding-left: 50px;
  }

  .about-text h2, .contact-text h2 {
    font-size: 32px;
  }

  .project-card h3 {
    font-size: 24px;
  }

  .contact-buttons {
    flex-direction: column;
  }

  .contact-button {
    width: 100%;
  }

  footer {
    padding: 32px 24px 80px 24px;
  }

  .legal-container {
    padding: 40px 24px;
    margin-top: 20px;
  }

  .legal-container h1 {
    font-size: 32px;
  }

  .legal-section h2 {
    font-size: 20px;
  }
}

/* ============================================================================
   SCROLL REVEAL ANIMATIONS
   ============================================================================ */

.reveal {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: none !important;
}

.section-label.reveal {
  transform: translateY(15px);
}

h1.reveal, h2.reveal {
  transform: scale(0.95);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#about-text-content.reveal,
.contact-text-wrapper.reveal {
  transform: none;
}

.project-card.reveal {
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-image.reveal,
.about-image.reveal,
.contact-visual.reveal {
  transform: scale(0.98);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ============================================================================
   MOBILE COLOR HIGHLIGHT ANIMATION
   ============================================================================ */

/* Text shadow glow animation for section labels and headings */
@keyframes text-glow {
  0% {
    text-shadow: none;
  }
  15% {
    text-shadow: 0 0 12px var(--current-playhead-color);
  }
  100% {
    text-shadow: none;
  }
}

/* Underline animation for h3 company names */
@keyframes underline-sweep {
  0% {
    width: 0;
  }
  15%, 85% {
    width: 100%;
  }
  100% {
    width: 0;
  }
}

/* Mobile-only: Apply color effects to headings on reveal */
@media (max-width: 640px) {
  /* Text glow for headline and section labels - repeatable */
  .headline.heading-highlight.highlight-revealed,
  .section-label.heading-highlight.highlight-revealed {
    animation: text-glow 1.5s ease-out forwards;
  }

  /* Underline animation for h3 company names on scroll */
  .project-card h3.heading-highlight {
    position: relative;
    width: fit-content;
  }

  .project-card h3.heading-highlight::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--current-playhead-color);
  }

  .project-card h3.heading-highlight.highlight-revealed::after {
    animation: underline-sweep 1.5s ease-out forwards;
  }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .heading-highlight.highlight-revealed {
    animation: none !important;
  }
}

/* ============================================================================
   READING TEXT SPOTLIGHT
   ============================================================================ */

.spotlight-word {
  display: inline;
  transition: color 0.2s ease, text-shadow 0.2s ease;
  cursor: default;
}

.spotlight-word.spotlight-active {
  color: #FFD93D;
  text-shadow: 0 0 8px rgba(255, 217, 61, 0.3);
}

.spotlight-word:hover {
  color: #FFC312;
}

/* Disable hover effect during animation */
.spotlight-animating .spotlight-word:hover {
  color: inherit;
}

@media (max-width: 1024px) {
  .spotlight-word {
    pointer-events: none;
  }
}

/* ============================================================================
   CUSTOM MODAL
   ============================================================================ */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  animation: modal-fade-in 0.3s ease;
}

.modal-content {
  position: relative;
  background: #ffffff;
  border: 2px solid #000000;
  padding: 48px;
  max-width: 500px;
  width: 90%;
  z-index: 10001;
  animation: modal-slide-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-content h2 {
  font-family: 'Merriweather', serif;
  font-size: 36px;
  margin-bottom: 24px;
  font-weight: 400;
}

.modal-content p {
  font-size: 16px;
  line-height: 1.8;
  color: #333333;
  margin-bottom: 16px;
}

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

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  color: #000000;
  padding: 8px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.modal-close:hover {
  transform: scale(1.2) rotate(90deg);
  color: var(--current-playhead-color);
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-slide-up {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 640px) {
  .modal-content {
    padding: 32px 24px;
  }

  .modal-content h2 {
    font-size: 28px;
  }
}
