/* ============================================
AESTHETIC MINIMALISM / CLEAN BRUTALISM
With Glowing ASCII, Random Typography,
GSAP Animations, Dark Mode, Custom Cursor
OPTIMIZED FOR LIGHTHOUSE 100/100
============================================ */

:root {
  --bg: #0a0a0a;
  --bg-elevated: #111111;
  --bg-card: #141414;
  --fg: #f5f5f5;
  --fg-muted: #a0a0a0; /* Improved contrast: 7.5:1 */
  --fg-dim: #707070; /* Improved contrast: 4.6:1 */
  --accent: #00ff88;
  --accent-glow: rgba(0, 255, 136, 0.3);
  --accent-dim: #00cc6a;
  --border: #222222;
  --radius: 16px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, sans-serif;
  --font-mono: 'Space Mono', monospace;
  --cursor-size: 8px;
  --cursor-ring: 40px;
  --space-xl: 8rem;
  --space-lg: 4rem;
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* ============================================
KEYBOARD FOCUS VISIBILITY (a11y)
============================================ */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Custom cursor is hidden until JS confirms pointer support,
   so default cursors/focus rings always work if JS fails */
.js-ready .cursor-dot,
.js-ready .cursor-ring,
.js-ready .cursor-trail {
  display: block;
}
.cursor-dot,
.cursor-ring,
.cursor-trail {
  display: none;
}

/* ============================================
MOBILE SUGGESTION POPUP
============================================ */
.mobile-suggest {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-suggest.active {
  opacity: 1;
  pointer-events: all;
}

.suggest-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.suggest-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem;
  max-width: 380px;
  width: 90%;
  text-align: center;
  transform: translateY(30px) scale(0.95);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
}

.mobile-suggest.active .suggest-card {
  transform: translateY(0) scale(1);
}

/* Phone visual */
.suggest-visual {
  position: relative;
  width: 80px;
  height: 140px;
  margin: 0 auto 1.5rem;
}

.suggest-phone {
  width: 100%;
  height: 100%;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 4px;
  position: relative;
  z-index: 2;
  animation: phoneFloat 3s ease-in-out infinite;
}

@keyframes phoneFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--bg);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30%;
  height: 8px;
  background: var(--border);
  border-radius: 0 0 6px 6px;
}

.phone-ascii {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
}

.phone-text {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: var(--fg-muted);
  letter-spacing: 0.1em;
}

/* Signal waves */
.suggest-signal {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
}

.suggest-signal::before,
.suggest-signal::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: signalWave 2s ease-out infinite;
}

.suggest-signal::after {
  animation-delay: 1s;
}

@keyframes signalWave {
  0% { transform: scale(0.5); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* Text content */
.suggest-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--fg);
}

.suggest-desc {
  font-size: 0.85rem;
  color: var(--fg-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* Buttons */
.suggest-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.suggest-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: none;
  min-height: 48px; /* Touch target size */
}

.suggest-primary {
  background: var(--accent);
  color: var(--bg);
}

.suggest-primary:hover {
  box-shadow: 0 0 30px var(--accent-glow);
  transform: translateY(-2px);
}

.suggest-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
}

.suggest-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Close button */
.suggest-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
  transition: all 0.2s;
}

.suggest-close:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(90deg);
}

/* Hide on desktop */
@media (min-width: 769px) {
  .mobile-suggest {
    display: none !important;
  }
}

/* Show popup styles on mobile */
@media (max-width: 768px) {
  .cursor-dot,
  .cursor-ring,
  .cursor-trail {
    display: none !important;
  }
  body {
    cursor: auto;
  }
  .suggest-btn {
    cursor: pointer;
  }
}

[data-theme="light"] {
  --bg: #f5f5f5;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --fg: #0a0a0a;
  --fg-muted: #555555; /* Improved contrast for light mode */
  --fg-dim: #666666;
  --accent: #0066ff;
  --accent-glow: rgba(0, 102, 255, 0.3);
  --accent-dim: #0052cc;
  --border: #e0e0e0;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  overflow-x: hidden;
}

/* Only hide the native cursor once JS confirms the custom cursor is active.
   Prevents a missing cursor if scripts fail to load. */
body.js-ready {
  cursor: none;
}

/* ============================================
CUSTOM CURSOR
============================================ */
.cursor-dot,
.cursor-ring,
.cursor-trail {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.cursor-dot {
  width: var(--cursor-size);
  height: var(--cursor-size);
  background: var(--accent);
  mix-blend-mode: difference;
}

.cursor-ring {
  width: var(--cursor-ring);
  height: var(--cursor-ring);
  border: 1px solid var(--accent);
  opacity: 0.5;
  transition: width 0.3s, height 0.3s, border-color 0.3s;
}

.cursor-trail {
  width: 4px;
  height: 4px;
  background: var(--accent);
  opacity: 0.3;
}

body:hover .cursor-dot,
body:hover .cursor-ring {
  opacity: 1;
}

/* Cursor states */
.cursor-project .cursor-ring {
  width: 80px;
  height: 80px;
  background: var(--accent-glow);
  border-color: transparent;
}

.cursor-magnetic .cursor-ring {
  width: 60px;
  height: 60px;
  border-color: var(--accent);
  opacity: 0.8;
}

/* ============================================
ASCII VIDEO BACKGROUND
============================================ */
.ascii-video-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

#asciiVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.15;
}

.ascii-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    var(--bg) 0%,
    transparent 30%,
    transparent 70%,
    var(--bg) 100%
  );
}

/* ============================================
FLOATING RANDOM TYPOGRAPHY
============================================ */
.floating-text-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.floating-text {
  position: absolute;
  font-family: var(--font-mono);
  color: var(--accent);
  opacity: 0.06;
  white-space: nowrap;
  user-select: none;
  animation: floatDrift 20s ease-in-out infinite;
}

@keyframes floatDrift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(20px, -30px) rotate(2deg); }
  50% { transform: translate(-10px, 20px) rotate(-1deg); }
  75% { transform: translate(15px, 10px) rotate(1deg); }
}

/* ============================================
THEME TOGGLE
============================================ */
.theme-toggle {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 100;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ============================================
NAVIGATION
============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 3rem;
  z-index: 50;
  mix-blend-mode: difference;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  letter-spacing: -0.02em;
}

.logo-reg {
  font-size: 0.5em;
  vertical-align: super;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-link {
  font-size: 0.9rem;
  text-decoration: none;
  color: #fff;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
  padding: 0.5rem 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: #fff;
  transition: width 0.3s ease;
}

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

.nav-menu {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: none;
  padding: 0.5rem;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.nav-menu span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: #fff;
  transition: all 0.3s;
}

/* ============================================
HERO
============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 2;
  padding: 0 3rem;
}

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

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.5rem 1rem;
  margin-bottom: 2rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.badge-pulse {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

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

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

.title-line {
  display: block;
}

.title-outline {
  -webkit-text-stroke: 2px var(--fg);
  color: transparent;
  font-weight: 800;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--fg-muted);
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: all 0.3s ease;
  cursor: none;
  min-height: 48px;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border: none;
}

.btn-primary:hover {
  box-shadow: 0 0 30px var(--accent-glow);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

.scroll-text {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-dim);
  writing-mode: vertical-rl;
}

.scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--fg-dim), transparent);
  animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
  0%, 100% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ============================================
SECTIONS COMMON
============================================ */
.section-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 700;
}

.section-name {
  font-size: 0.75rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.text-glow {
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent-glow);
}

/* ============================================
ABOUT
============================================ */
.about {
  position: relative;
  z-index: 2;
  padding: var(--space-xl) 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

.about-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 4rem;
}

.about-label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: sticky;
  top: 100px;
  height: fit-content;
}

.about-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.about-text {
  font-size: 1.1rem;
  color: var(--fg-muted);
  line-height: 1.7;
  max-width: 600px;
  margin-bottom: 3rem;
}

.about-stats {
  display: flex;
  gap: 3rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.stat-num {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--accent);
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ============================================
PROJECTS
============================================ */
.projects {
  position: relative;
  z-index: 2;
  padding: var(--space-xl) 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

.projects-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4rem;
}

.projects-label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.projects-title {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.project-card {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: none;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 40px var(--accent-glow);
  transform: translateY(-4px);
}

.project-visual {
  position: relative;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  min-height: 300px;
  overflow: hidden;
}

.project-ascii {
  position: relative;
  z-index: 2;
}

.project-ascii pre {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  line-height: 1.2;
  color: var(--accent);
  opacity: 0.8;
  transition: all 0.3s;
}

.project-card:hover .project-ascii pre {
  opacity: 1;
  text-shadow: 0 0 20px var(--accent-glow);
}

.project-glitch {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    var(--accent-glow) 2px,
    var(--accent-glow) 4px
  );
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.project-card:hover .project-glitch {
  opacity: 0.1;
  animation: glitchMove 0.3s linear infinite;
}

@keyframes glitchMove {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}

.project-info {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-meta {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  letter-spacing: 0.05em;
}

.project-year {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-dim);
  margin-left: auto;
}

.project-name {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.project-desc {
  font-size: 1rem;
  color: var(--fg-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.project-hover {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}

.project-card:hover .project-hover {
  opacity: 1;
  transform: translateX(0);
}

/* ============================================
ARSENAL
============================================ */
.arsenal {
  position: relative;
  z-index: 2;
  padding: var(--space-xl) 3rem;
  max-width: 1400px;
  margin: 0 auto;
}

.arsenal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4rem;
}

.arsenal-label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.arsenal-title {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.arsenal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.arsenal-category {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all 0.3s ease;
}

.arsenal-category:hover {
  border-color: var(--accent);
  box-shadow: 0 0 30px var(--accent-glow);
}

.arsenal-cat-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.arsenal-items {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.arsenal-item {
  font-size: 0.95rem;
  color: var(--fg-muted);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  transition: all 0.2s;
  cursor: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.arsenal-item::before {
  content: '▸';
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
}

.arsenal-item:hover {
  color: var(--fg);
  padding-left: 0.5rem;
}

.arsenal-item:hover::before {
  opacity: 1;
}

/* ============================================
CONTACT
============================================ */
.contact {
  position: relative;
  z-index: 2;
  padding: var(--space-xl) 3rem;
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
}

.contact-content {
  max-width: 700px;
  margin: 0 auto;
}

.contact-label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 2rem;
}

.contact-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.contact-text {
  font-size: 1.05rem;
  color: var(--fg-muted);
  margin-bottom: 3rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.contact-link {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 1.2rem 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--fg);
  transition: all 0.3s ease;
  cursor: none;
  min-height: 48px;
}

.contact-link:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
  transform: translateX(10px);
}

.link-name {
  font-size: 0.95rem;
  font-weight: 600;
}

.link-handle {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--fg-muted);
  text-align: right;
}

.contact-link:hover .link-handle {
  color: var(--accent);
}

/* ============================================
FOOTER
============================================ */
.footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 3rem;
  border-top: 1px solid var(--border);
  max-width: 1400px;
  margin: 0 auto;
}

.footer-left {
  display: flex;
  gap: 2rem;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.footer-status {
  color: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

.footer-ascii pre {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  line-height: 1;
  color: var(--fg-dim);
  opacity: 0.5;
}

.footer-back {
  font-size: 0.85rem;
  color: var(--fg-muted);
  cursor: none;
  transition: color 0.2s;
}

.footer-back:hover {
  color: var(--accent);
}

/* ============================================
MODAL
============================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 800px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
  z-index: 10;
  transition: all 0.2s;
}

.modal-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.modal-body {
  padding: 3rem;
}

.modal-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.modal-desc {
  color: var(--fg-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.modal-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.modal-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  color: var(--fg-muted);
}

.modal-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s;
  min-height: 48px;
}

.modal-link:hover {
  box-shadow: 0 0 30px var(--accent-glow);
}

/* ============================================
RESPONSIVE
============================================ */
@media (max-width: 1024px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-label {
    position: static;
    flex-direction: row;
    align-items: center;
  }
  .project-card {
    grid-template-columns: 1fr;
  }
  .project-visual {
    min-height: 200px;
  }
  .arsenal-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    inset: 0 0 0 30%;
    top: 0;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    padding: 2rem;
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 60;
    display: flex;
  }
  .nav-links.open {
    transform: translateX(0);
  }
  .nav-link {
    color: var(--fg);
    font-size: 1.1rem;
  }
  .nav-link::after {
    background: var(--accent);
  }
  .nav-menu {
    display: flex;
    position: relative;
    z-index: 70;
  }
  .nav-menu span {
    background: #fff;
  }
  .nav.menu-open {
    mix-blend-mode: normal;
  }
  .nav-menu.active span:first-child {
    transform: translateY(3px) rotate(45deg);
  }
  .nav-menu.active span:last-child {
    transform: translateY(-3px) rotate(-45deg);
  }
  .hero {
    padding: 0 1.5rem;
  }
  .about,
  .projects,
  .arsenal,
  .contact {
    padding: var(--space-lg) 1.5rem;
  }
  .about-stats {
    flex-direction: column;
    gap: 1.5rem;
  }
  .arsenal-grid {
    grid-template-columns: 1fr;
  }
  .projects-header,
  .arsenal-header {
    flex-direction: column;
    gap: 1rem;
  }
  .contact-link {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
  .link-handle {
    text-align: left;
  }
  .footer {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  .cursor-dot,
  .cursor-ring,
  .cursor-trail {
    display: none;
  }
  body {
    cursor: auto;
  }
  .btn-primary,
  .btn-ghost,
  .nav-link,
  .project-card,
  .arsenal-item,
  .contact-link,
  .modal-close,
  .footer-back,
  .theme-toggle {
    cursor: pointer;
  }
}

/* ============================================
SCROLLBAR
============================================ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--fg-dim);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ============================================
MOBILE PERFORMANCE FIXES
============================================ */
@media (max-width: 768px) {
  .ascii-video-container,
  .floating-text-container {
    display: none !important;
  }
  .grain,
  .vignette {
    display: none;
  }
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.2s !important;
  }
  .m-pulse,
  .badge-pulse {
    animation-duration: 2s !important;
  }
}

/* Fallback: if JS never initializes the custom cursor, keep normal
   pointer/text cursors everywhere instead of an invisible one */
body:not(.js-ready) .btn-primary,
body:not(.js-ready) .btn-ghost,
body:not(.js-ready) .nav-link,
body:not(.js-ready) .project-card,
body:not(.js-ready) .arsenal-item,
body:not(.js-ready) .contact-link,
body:not(.js-ready) .modal-close,
body:not(.js-ready) .footer-back,
body:not(.js-ready) .theme-toggle,
body:not(.js-ready) .nav-menu,
body:not(.js-ready) .nav-logo {
  cursor: pointer;
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
