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

:root {
  --bg-primary: #050505;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #111111;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.3);
  --accent: #ffffff;
  --accent-glow: rgba(255, 255, 255, 0.15);
  --border-subtle: rgba(255, 255, 255, 0.08);
}

html {
  scroll-behavior: auto;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.mono {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
}

/* ============================================
   RECAP BANNER
   ============================================ */

.recap-banner {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  text-decoration: none;
  color: var(--text-primary);
  z-index: 100;
  transition: all 0.3s ease;
}

.recap-banner:hover {
  border-color: var(--text-muted);
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.recap-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  background: var(--text-primary);
  color: var(--bg-primary);
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.recap-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.recap-banner:hover .recap-text {
  color: var(--text-primary);
}

.recap-arrow {
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  transition: transform 0.3s ease, stroke 0.3s ease;
}

.recap-banner:hover .recap-arrow {
  stroke: var(--text-primary);
  transform: translateX(3px);
}

.recap-banner.hidden {
  display: none;
}

/* ============================================
   PRELOADER
   ============================================ */

.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.preloader-logo {
  height: 80px;
  filter: invert(1);
}

.preloader-bar {
  width: 200px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 1px;
  overflow: hidden;
}

.preloader-progress {
  height: 100%;
  width: 0%;
  background: var(--text-primary);
}

.preloader-text {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.2em;
}

/* ============================================
   SECTIONS BASE
   ============================================ */

section {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.section-label {
  position: absolute;
  top: 2rem;
  left: 2rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
}

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

.hero {
  height: 100vh;
  background: var(--bg-primary);
  perspective: 1000px;
}

.hero-content {
  text-align: center;
  z-index: 2;
}

.hero-title {
  font-size: clamp(3rem, 12vw, 10rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.hero-title .char {
  display: inline-block;
}

.hero-subtitle {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.hero-tagline {
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  font-style: italic;
  color: var(--text-muted);
  margin-top: -1.5rem;
  margin-bottom: 2rem;
}

.scroll-indicator {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

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

.scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--text-primary), transparent);
}

/* ============================================
   HORIZONTAL SCROLL SECTION
   ============================================ */

.horizontal-section {
  height: 100vh;
  background: var(--bg-secondary);
  overflow: hidden;
  justify-content: flex-start;
  align-items: stretch;
}

.horizontal-container {
  display: flex;
  height: 100%;
  width: fit-content;
  will-change: transform;
  transform: translateX(0);
}

.horizontal-panel {
  width: 100vw;
  height: 100vh;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
}

.panel-content {
  max-width: 600px;
  text-align: center;
}

.panel-number {
  font-family: 'Space Mono', monospace;
  font-size: 8rem;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
  margin-bottom: 1rem;
}

.panel-title {
  font-size: 2.5rem;
  font-weight: 400;
  margin-bottom: 1rem;
}

.panel-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* ============================================
   STAGGER GRID SECTION
   ============================================ */

.stagger-section {
  background: var(--bg-primary);
  padding: 4rem 2rem;
  min-height: 100vh;
  flex-direction: column;
}

.stagger-title {
  text-align: center;
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
}

.stagger-subtitle {
  text-align: center;
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  font-style: italic;
}

.stagger-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 1200px;
  height: 60vh;
}

.grid-item {
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

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

/* Portfolio logos inside the grid - same size as grid cells */
.grid-logo {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--accent);
  border-radius: 4px;
  text-decoration: none;
  display: grid;
  place-items: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.grid-logo:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
  z-index: 2;
}

.logo-letter {
  font-family: 'Space Mono', monospace;
  font-size: clamp(0.5rem, 1vw, 0.75rem);
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

.grid-logo:hover .logo-letter {
  color: #fff;
}

/* ============================================
   WORK SECTION - PROJECT SHOWCASE
   ============================================ */

.work-section {
  background: var(--bg-primary);
  padding: 6rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.work-header {
  text-align: center;
  margin-bottom: 3rem;
}

.work-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.work-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Stats Display */
.work-stats {
  display: flex;
  justify-content: center;
  gap: 4rem;
  margin-bottom: 4rem;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  display: block;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.5rem;
  display: block;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  width: 100%;
  max-width: 1200px;
}

.project-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

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

.project-type {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 0.75rem;
  display: block;
}

.project-name {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.project-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-tag {
  font-size: 0.7rem;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  color: var(--text-secondary);
}

.project-arrow {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: grid;
  place-items: center;
  transition: all 0.3s ease;
}

.project-arrow svg {
  width: 14px;
  height: 14px;
  stroke: var(--text-muted);
  transition: stroke 0.3s ease;
}

.project-card:hover .project-arrow {
  background: var(--text-primary);
}

.project-card:hover .project-arrow svg {
  stroke: var(--bg-primary);
}

/* ============================================
   SVG PATH SECTION
   ============================================ */

.svg-section {
  background: var(--bg-secondary);
  flex-direction: column;
  gap: 2rem;
}

.svg-container {
  width: 80%;
  max-width: 800px;
}

.svg-path {
  stroke: var(--text-primary);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.path-dot {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ============================================
   TEXT EFFECTS SECTION
   ============================================ */

.text-section {
  background: var(--bg-secondary);
  flex-direction: column;
  gap: 4rem;
  padding: 6rem 2rem;
}

.text-effect {
  text-align: center;
  max-width: 900px;
}

.text-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.typewriter-text {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-style: italic;
  color: var(--text-secondary);
  min-height: 4rem;
}

.scramble-text {
  font-family: 'Space Mono', monospace;
  font-size: clamp(1.2rem, 3vw, 2rem);
  letter-spacing: 0.1em;
}

.word-reveal {
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 400;
  overflow: hidden;
}

.word-reveal .word {
  display: inline-block;
  margin: 0 0.2em;
}

/* ============================================
   PARALLAX SECTION
   ============================================ */

.parallax-section {
  height: 200vh;
  background: var(--bg-primary);
  position: relative;
}

.parallax-container {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.parallax-layer {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
}

.parallax-text {
  font-size: clamp(4rem, 15vw, 12rem);
  font-weight: 400;
  white-space: nowrap;
}

.parallax-text.outline {
  -webkit-text-stroke: 1px var(--text-muted);
  color: transparent;
}

.parallax-text.filled {
  color: var(--text-primary);
}

.parallax-shape {
  width: 300px;
  height: 300px;
  border: 1px solid var(--text-muted);
  border-radius: 50%;
}

/* ============================================
   EASING SHOWCASE SECTION
   ============================================ */

.easing-section {
  background: var(--bg-secondary);
  flex-direction: column;
  padding: 4rem 2rem;
  gap: 2rem;
}

.easing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  width: 100%;
  max-width: 1000px;
}

.easing-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.easing-track {
  width: 100%;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  position: relative;
}

.easing-ball {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
}

.easing-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-transform: lowercase;
}

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

.footer-section {
  background: var(--bg-primary);
  min-height: 50vh;
  flex-direction: column;
  gap: 3rem;
  padding: 6rem 2rem;
}

.footer-title {
  font-size: clamp(2rem, 6vw, 4rem);
  text-align: center;
}

.footer-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: -1rem;
}

.footer-links {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link {
  font-size: 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  position: relative;
  transition: color 0.3s ease;
}

.footer-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--text-primary);
  transition: width 0.3s ease;
}

.footer-link:hover {
  color: var(--text-primary);
}

.footer-link:hover::after {
  width: 100%;
}

.magnetic-btn {
  padding: 1.25rem 3rem;
  background: transparent;
  border: 1px solid var(--text-primary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: color 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.magnetic-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--text-primary);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: -1;
}

.magnetic-btn:hover {
  color: var(--bg-primary);
}

.magnetic-btn:hover::before {
  transform: translateY(0);
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--accent);
  z-index: 1000;
}

/* ============================================
   NAV DOTS
   ============================================ */

.nav-dots {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 100;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-dot:hover,
.nav-dot.active {
  background: var(--text-primary);
  transform: scale(1.5);
}

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

@media (max-width: 768px) {
  .section-label {
    top: 1rem;
    left: 1rem;
    font-size: 0.6rem;
  }

  .stagger-grid {
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(6, 1fr);
    height: 50vh;
  }

  .nav-dots {
    right: 1rem;
  }

  .timeline-buttons {
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }

  .easing-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .work-stats {
    gap: 2rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    padding: 1.5rem;
  }

  .recap-banner {
    bottom: 1rem;
    padding: 0.6rem 1rem;
    gap: 0.5rem;
  }

  .recap-text {
    font-size: 0.8rem;
  }
}
