/* Root and retro texture */
:root {
  --coal: #0a0908;
  --deep: #22333b;
  --paper: #eae0d5;
  --sand: #c6ac8f;
  --leather: #5e503f;
}

/* Display font (Digital Disco) */
@font-face {
  font-family: 'DigitalDisco';
  src: url('assets/DigitalDisco.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DigitalDisco';
  src: url('assets/DigitalDisco-Thin.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

.display-font {
  font-family: 'DigitalDisco', 'Space Mono', ui-monospace, Menlo, monospace;
  letter-spacing: 0.015em;
}

.vt323 {
  font-family: 'VT323', monospace;
  letter-spacing: 0.02em;
  font-size: 2.2em;
  line-height: 1.3;
}

@media (min-width: 768px) {
  .vt323 {
    font-size: 2.8em; /* larger for desktop */
  }
}

html {
  /* Locomotive handles the smoothness */
  scroll-behavior: auto;
}

/* Background noise removed - clean background */

/* CRT scanlines removed - replaced with matrix rain */

/* Hero glow */
.hero-glow {
  position: absolute;
  inset: -10% -10% auto -10%;
  height: 60vh;
  background: radial-gradient(60% 60% at 20% 20%, rgba(198,172,143,0.12), transparent 60%),
    radial-gradient(50% 50% at 80% 20%, rgba(234,224,213,0.08), transparent 60%);
  filter: blur(30px);
  z-index: 0;
  pointer-events: none; /* do not block clicks */
}

/* Locomotive container */
[data-scroll-container] {
  overflow: hidden; /* required for Locomotive measurements */
  min-height: 100vh;
}

/* Ensure the document always has enough height so footer is visible after load */
html, body {
  min-height: 100%;
}

/* Fix footer visibility with Locomotive by forcing container to encompass sections */
[data-scroll-container] > section,
[data-scroll-container] > header,
[data-scroll-container] > footer {
  will-change: transform;
}

/* Matrix rain */
#matrix-rain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
  opacity: 0.08;
}

/* Cursor follower replaced with Oneko cat */

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(180deg, var(--sand), #b6997c);
  color: var(--coal);
  border: 1px solid rgba(94, 80, 63, 0.6);
  padding: 0.65rem 1rem;
  min-height: 2.75rem;
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 4px 14px rgba(198, 172, 143, 0.25);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
  position: relative;
  overflow: hidden;
}

/* Interactive badge effects */
.interactive-badge {
  position: relative;
  display: inline-block;
  min-height: 100px; /* reserve space so layout is stable before images load */
  line-height: 0;
}

.interactive-badge .img-skeleton {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 140px;
  height: 18px;
  transform: translate(-50%, -50%);
  border-radius: 6px;
  background: linear-gradient(90deg,
    rgba(198,172,143,0.15) 0%,
    rgba(198,172,143,0.35) 50%,
    rgba(198,172,143,0.15) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  filter: blur(0.2px);
}

.interactive-badge img.loaded + .img-skeleton { display: none; }

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

/* Scroll-triggered reveal for lab section */
.reveal-lab {
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition: opacity 900ms ease, transform 900ms ease; /* keep longer for lab profiles */
}

.reveal-lab.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.interactive-badge img {
  transition: transform 240ms ease, filter 240ms ease, box-shadow 240ms ease;
  filter: saturate(90%) contrast(105%);
}

.interactive-badge:hover img {
  transform: scale(1.16) translateY(-4px);
  filter: saturate(130%) contrast(115%);
  box-shadow: 0 20px 60px rgba(0,0,0,0.45), 0 0 0 1px rgba(198,172,143,0.35);
}

.interactive-badge:active img {
  transform: scale(1.04) translateY(0);
}

.interactive-badge::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 240ms ease;
  background: radial-gradient(65% 65% at 50% 40%, rgba(198,172,143,0.15), transparent 70%);
}

.interactive-badge:hover::after {
  opacity: 1;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28) inset, 0 10px 24px rgba(198, 172, 143, 0.35);
  filter: saturate(110%);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:focus-visible {
  outline: 2px dashed var(--sand);
  outline-offset: 3px;
}

/* Button ripple */
.btn-primary .ripple {
  position: absolute;
  width: 14px;
  height: 14px;
  background: rgba(198, 172, 143, 0.45);
  border-radius: 9999px;
  transform: scale(0);
  animation: ripple 700ms ease-out forwards;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(36);
    opacity: 0;
  }
}

/* Typewriter effect */
.typewriter-cursor {
  color: var(--sand);
  animation: blink 1s infinite;
  font-weight: normal;
}

.typewriter-subtitle, .typewriter-button, .scroll-indicator-container {
  transition: opacity 0.35s ease-in-out; /* faster fade for hero elements */
}

.typewriter-subtitle.show, .typewriter-button.show, .scroll-indicator-container.show {
  opacity: 1 !important;
}

/* Socials reveal (with stagger) */
.reveal-social {
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  transition: opacity 800ms ease, transform 800ms ease;
}

.reveal-social.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.delay-1 { transition-delay: 0ms; }
.delay-2 { transition-delay: 150ms; }
.delay-3 { transition-delay: 300ms; }
.delay-4 { transition-delay: 450ms; }

/* Socials directional reveals (left/right) */
.reveal-social-left,
.reveal-social-right {
  opacity: 0;
  transition: opacity 800ms ease, transform 800ms ease;
}

.reveal-social-left { transform: translateX(-28px) scale(0.98); }
.reveal-social-right { transform: translateX(28px) scale(0.98); }

.reveal-social-left.is-visible,
.reveal-social-right.is-visible { opacity: 1; transform: translateX(0) scale(1); }

@media (max-width: 767px) {
  /* On small screens, slide up for both to keep it natural */
  .reveal-social-left,
  .reveal-social-right { transform: translateY(24px) scale(0.98); }
  .reveal-social-left.is-visible,
  .reveal-social-right.is-visible { transform: translateY(0) scale(1); }
}

.typewriter-cursor-block {
  color: var(--sand);
  animation: blink 1s infinite;
  font-weight: normal;
  background: var(--sand);
  color: var(--coal);
  padding: 0 1px;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Scroll down indicator */
.scroll-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sand);
  opacity: 0.7;
  animation: bounceArrow 2s ease-in-out infinite;
}

.scroll-arrow svg {
  filter: drop-shadow(0 0 4px rgba(198, 172, 143, 0.4));
}

@keyframes bounceArrow {
  0%, 100% { 
    transform: translateY(0);
    opacity: 0.7;
  }
  25% { 
    transform: translateY(8px);
    opacity: 1;
  }
  50% { 
    transform: translateY(0);
    opacity: 0.7;
  }
  75% { 
    transform: translateY(4px);
    opacity: 0.9;
  }
}

/* Timeline layout */
.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--sand) 0%, var(--leather) 50%, rgba(94, 80, 63, 0.3) 100%);
  box-shadow: 0 0 0 1px rgba(198, 172, 143, 0.2), 0 0 12px rgba(198, 172, 143, 0.15);
  border-radius: 1.5px;
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  margin-bottom: 4rem;
  display: flex;
  align-items: center;
  width: 100%;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

/* Left side items */
.timeline-item--left {
  justify-content: flex-start;
}

.timeline-item--left .timeline-card {
  margin-right: 3rem; /* closer to the center line */
  max-width: 400px;
}

.timeline-item--left .timeline-marker {
  order: 2;
}

/* Right side items */
.timeline-item--right {
  justify-content: flex-end;
}

.timeline-item--right .timeline-card {
  margin-left: 3rem; /* keep symmetry with left side */
  max-width: 400px;
}

/* Fine-tune: move the first (Portfolio) card 20px closer to the center line */
.timeline > .timeline-item:nth-of-type(1) .timeline-card {
  margin-right: calc(3rem - 20px);
}

.timeline-item--right .timeline-marker {
  order: 1;
}

.timeline-marker {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sand);
  box-shadow: 0 0 0 3px var(--coal);
  animation: glowPulse 2.5s ease-in-out infinite;
  z-index: 10;
  transition: all 0.3s ease;
}

.timeline-marker::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(198, 172, 143, 0.4) 0%, transparent 70%);
  animation: glowRing 2.5s ease-in-out infinite;
  z-index: -1;
}

.timeline-marker::after {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(198, 172, 143, 0.2) 0%, transparent 70%);
  animation: glowRing 2.5s ease-in-out infinite 0.3s;
  z-index: -2;
}

@keyframes glowPulse {
  0%, 100% { 
    filter: brightness(1) drop-shadow(0 0 8px rgba(198, 172, 143, 0.6));
    transform: translateX(-50%) scale(1);
  }
  50% { 
    filter: brightness(1.3) drop-shadow(0 0 20px rgba(198, 172, 143, 0.9));
    transform: translateX(-50%) scale(1.1);
  }
}

@keyframes glowRing {
  0%, 100% { 
    opacity: 0.3;
    transform: scale(1);
  }
  50% { 
    opacity: 0.8;
    transform: scale(1.5);
  }
}

.timeline-card {
  background: linear-gradient(135deg, 
    rgba(34, 51, 59, 0.8) 0%, 
    rgba(22, 32, 38, 0.9) 50%,
    rgba(10, 9, 8, 0.95) 100%);
  border: 1px solid rgba(94, 80, 63, 0.4);
  border-radius: 16px;
  padding: 1.4rem 1.5rem 1.6rem 1.5rem; /* tighter vertical spacing */
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 
              0 0 0 1px rgba(234, 224, 213, 0.03) inset,
              0 1px 0 rgba(234, 224, 213, 0.08) inset;
  transition: all 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .timeline-card {
    padding: 1.6rem 1.75rem 1.8rem 1.75rem;
  }
}

.timeline-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sand), transparent);
  opacity: 0.6;
}

.timeline-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5), 
              0 0 0 1px rgba(234, 224, 213, 0.05) inset,
              0 1px 0 rgba(234, 224, 213, 0.12) inset;
  border-color: rgba(198, 172, 143, 0.6);
}

.timeline-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.5rem; /* reduce gap under title */
  color: var(--sand);
  letter-spacing: -0.01em;
}

.timeline-body {
  color: rgba(234, 224, 213, 0.9);
  line-height: 1.55;
  font-size: 1rem;
  margin-top: 0.25rem; /* tighten overall vertical rhythm */
}

/* Reveal on scroll with staggered animations */
.reveal {
  opacity: 0;
  transition: opacity 600ms ease, transform 600ms ease; /* normal */
}

.timeline-item--left.reveal {
  transform: translateX(-40px) translateY(20px) scale(0.95);
}

.timeline-item--right.reveal {
  transform: translateX(40px) translateY(20px) scale(0.95);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateX(0) translateY(0) scale(1);
}

/* Timeline card enhanced animations - merged with main definition above */

.timeline-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(198, 172, 143, 0.1), transparent);
  transition: left 0.6s ease;
}

.timeline-card:hover::after {
  left: 100%;
}

/* Staggered reveal delays */
.timeline-item:nth-child(1).reveal {
  transition-delay: 0ms;
}

.timeline-item:nth-child(2).reveal {
  transition-delay: 200ms;
}

.timeline-item:nth-child(3).reveal {
  transition-delay: 400ms;
}

/* Enhanced hover animations */
.timeline-item:hover .timeline-marker {
  animation-duration: 1.5s;
  transform: translateX(-50%) scale(1.2);
}

.timeline-item:hover .timeline-card {
  transform: translateY(-4px) scale(1.02);
}

/* Utilities */
.container {
  max-width: 1100px;
}

/* Comic boom callout */
.boom-callout {
  display: grid;
  place-items: center;
  padding: 2.5rem 1rem;
  position: relative;
}

.boom-inner {
  display: inline-block;
  padding: 1rem 1.25rem;
  color: var(--coal);
  background: var(--sand);
  border: 2px solid var(--leather);
  border-radius: 10px;
  text-align: center;
  transform: rotate(-2deg) scale(1);
  box-shadow: 0 12px 40px rgba(0,0,0,0.35), 0 0 0 4px rgba(198,172,143,0.25);
  transition: transform 250ms ease, box-shadow 250ms ease;
}

.boom-inner:hover {
  transform: rotate(0.5deg) scale(1.04);
  box-shadow: 0 18px 60px rgba(0,0,0,0.45), 0 0 0 6px rgba(198,172,143,0.35);
}

/* Remove decorative rays to avoid stray block on some browsers */
.boom-callout::before,
.boom-callout::after { content: none; }


