:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Colors — deep dark with neon accents */
  --color-bg: #06060a;
  --color-surface: #0d0d14;
  --color-surface-2: #13131e;
  --color-border: #1e1e2e;
  --color-text: #e0dfe6;
  --color-text-muted: #6b6a7a;
  --color-text-faint: #3d3c4a;
  --color-accent: #00e0d0;
  --color-accent-2: #8b5cf6;
  --color-accent-3: #f472b6;

  /* Fonts */
  --font-display: 'Clash Display', 'Inter', sans-serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-full: 9999px;
}

/* ============================================
   INDEX PAGE — Full-screen canvas
   ============================================ */

body {
  overflow: hidden;
  background: var(--color-bg);
}

#flowCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  max-width: none;
  z-index: 0;
}

/* Overlay content */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  padding: 0 var(--space-4);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.logo-mark {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-6);
  color: var(--color-accent);
  opacity: 0.7;
}

.logo-mark svg {
  width: 80px;
  height: auto;
}

/* ---- Futuristic title ---- */
.site-title {
  position: relative;
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-3);
  background: linear-gradient(
    90deg,
    var(--color-accent) 0%,
    #6ee7b7 25%,
    var(--color-accent-2) 55%,
    var(--color-accent-3) 80%,
    var(--color-accent) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 8s ease 1.8s infinite;
  opacity: 0;
}

/* Glow layer behind the title */
.site-title-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 140px;
  background: radial-gradient(
    ellipse at center,
    oklch(0.55 0.15 180 / 0.35) 0%,
    oklch(0.45 0.13 260 / 0.15) 35%,
    oklch(0.35 0.1 300 / 0.06) 55%,
    transparent 75%
  );
  filter: blur(35px);
  pointer-events: none;
  z-index: -1;
  animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.title-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Glow text duplicate — blurred colored text behind the gradient title */
.title-glow-text {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: center;
  color: var(--color-accent);
  filter: blur(18px);
  opacity: 0;
  pointer-events: none;
}

@keyframes glowTextPulse {
  0%, 100% { opacity: 0.4; filter: blur(18px); }
  50% { opacity: 0.6; filter: blur(22px); }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Glitch pseudo-layers */
.site-title::before,
.site-title::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  overflow: hidden;
  background: linear-gradient(
    90deg,
    var(--color-accent) 0%,
    var(--color-accent-2) 50%,
    var(--color-accent-3) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.1em;
}

.site-title::before {
  animation: glitchTop 4s ease-in-out infinite;
  clip-path: inset(0 0 65% 0);
  opacity: 0.8;
}

.site-title::after {
  animation: glitchBottom 4s ease-in-out infinite;
  clip-path: inset(65% 0 0 0);
  opacity: 0.8;
}

@keyframes glitchTop {
  0%, 94%, 100% { transform: translate(0); opacity: 0; }
  95% { transform: translate(-4px, -1px); opacity: 0.7; }
  96% { transform: translate(4px, 1px); opacity: 0.6; }
  97% { transform: translate(-2px, 0); opacity: 0; }
}

@keyframes glitchBottom {
  0%, 93%, 100% { transform: translate(0); opacity: 0; }
  94% { transform: translate(3px, 1px); opacity: 0.6; }
  95.5% { transform: translate(-4px, 0); opacity: 0.7; }
  97% { transform: translate(2px, -1px); opacity: 0; }
}

/* Subtitle */
.site-subtitle {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-text-faint);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  animation: subtitleReveal 1s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 1.2s;
}

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

/* Bottom navigation */
.bottom-nav {
  position: fixed;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  opacity: 0;
  animation: fadeInNav 0.8s cubic-bezier(0.16, 1, 0.3, 1) 2s both;
}

@keyframes fadeInNav {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  backdrop-filter: blur(12px);
  background: oklch(0.1 0.01 260 / 0.5);
  transition:
    color var(--transition-interactive),
    border-color var(--transition-interactive),
    background var(--transition-interactive),
    transform var(--transition-interactive);
}

.nav-link:hover {
  color: var(--color-accent);
  border-color: rgba(0, 224, 208, 0.4);
  border-color: oklch(from var(--color-accent) l c h / 0.4);
  background: oklch(0.1 0.01 260 / 0.7);
  transform: translateY(-1px);
}

.nav-link:active {
  transform: translateY(0);
}

.nav-link svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-interactive);
}

.nav-link:hover svg {
  transform: translate(2px, -2px);
}

/* Controls */
.controls {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 10;
  display: flex;
  gap: var(--space-2);
  opacity: 0;
  animation: fadeInNav 0.8s cubic-bezier(0.16, 1, 0.3, 1) 2.2s both;
}

.ctrl-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  background: oklch(0.1 0.01 260 / 0.4);
  transition:
    color var(--transition-interactive),
    border-color var(--transition-interactive),
    background var(--transition-interactive);
}

.ctrl-btn:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
  background: oklch(0.1 0.01 260 / 0.6);
}

/* ============================================
   ABOUT PAGE
   ============================================ */

body.about-page {
  overflow: auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.about-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  max-width: none;
  z-index: 0;
  opacity: 0.15;
}

.about-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: var(--space-4) var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(12px);
  background: oklch(0.04 0.01 260 / 0.8);
  border-bottom: 1px solid var(--color-border);
}

.about-header .back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  transition: color var(--transition-interactive);
}

.about-header .back-link:hover {
  color: var(--color-accent);
}

.about-header .header-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}

.about-content {
  position: relative;
  z-index: 10;
  max-width: 640px;
  margin: 0 auto;
  padding: calc(80px + var(--space-16)) var(--space-8) var(--space-16);
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.2s;
}

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

.about-greeting {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-8);
}

.about-greeting .accent {
  color: var(--color-accent);
}

.about-bio {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-12);
}

.about-bio p + p {
  margin-top: var(--space-4);
}

.section-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-faint);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-12);
}

.tech-tag {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: oklch(0.1 0.01 260 / 0.3);
}

.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.contact-item a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--transition-interactive);
}

.contact-item a:hover {
  color: var(--color-accent);
}

.contact-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.6;
}

.divider {
  width: 40px;
  height: 1px;
  background: var(--color-border);
  margin: var(--space-12) 0;
}

/* Footer */
.about-footer {
  position: relative;
  z-index: 10;
  padding: var(--space-8);
  text-align: center;
  margin-top: auto;
}

.about-footer p {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  max-width: none;
}

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

@media (max-width: 640px) {
  .site-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .bottom-nav {
    bottom: var(--space-6);
  }

  .about-header {
    padding: var(--space-3) var(--space-4);
  }

  .about-content {
    padding: calc(70px + var(--space-8)) var(--space-4) var(--space-8);
  }

  .about-greeting {
    font-size: var(--text-xl);
  }
}
