/* =========================================================
   Thomas Louvet — Portfolio
   HTML/CSS/JS only · GitHub Pages ready
   ========================================================= */

:root {
  --bg: #05060a;
  --bg-2: #0a0c14;
  --fg: #e8ecf4;
  --muted: #8b93a7;
  --accent: #00f0ff;       /* cyan */
  --accent-2: #ff2bd6;     /* magenta */
  --accent-3: #b14bff;     /* violet */
  --accent-4: #5cff9d;     /* green */
  --line: rgba(255, 255, 255, 0.08);
  --card: rgba(255, 255, 255, 0.03);
  --maxw: 1200px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-sans: "Space Grotesk", system-ui, sans-serif;
  --font-display: "Orbitron", "Syne", "Space Grotesk", sans-serif; /* futuristic */
  --font-mono: "JetBrains Mono", monospace;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
}
@media (pointer: coarse) { body { cursor: auto; } }

a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-2); color: #05060a; }

/* Scrollbar */
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--accent), var(--accent-3)); border-radius: 9px; }

/* ===== BACKGROUND CANVAS ===== */
#bg-canvas {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  z-index: 0; pointer-events: none;
}

main { position: relative; z-index: 2; }

/* ===== LOW-PERF MODE (low-end devices) — drop the expensive effects ===== */
/* backdrop-filter blur is one of the heaviest things to composite */
.low-perf .skill-cluster,
.low-perf .about-card-inner,
.low-perf #nav,
.low-perf .sound-toggle { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.low-perf .grain { display: none; }                 /* full-screen animated noise */
.low-perf #cursor-light { display: none; }           /* full-screen plus-lighter spotlight */
.low-perf .ufo-craft { animation: none; }
.low-perf .marquee { box-shadow: none; }
/* dives: drop the expensive blend/blur/glow during the heaviest transitions */
.low-perf .dive-vortex { display: none !important; }              /* screen-blend conic gradient */
.low-perf .flight-rocket, .low-perf .dive-ufo { filter: none; }   /* drop-shadow on a huge scaled element */
.low-perf .dive-flash { filter: none; }
.low-perf .dive-portal-ring { box-shadow: none !important; }
.low-perf .dive-ring { box-shadow: 0 0 12px var(--accent); }

/* ===== READABILITY SCRIM =====
   Dims the busy 3D background (sun glare, particles) so text stays legible.
   z-index 1 = above the canvas (0), below the content (2) — so it never
   touches the text itself, only what's behind it. */
.readability-scrim {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 50% at 18% 20%, rgba(5,6,10,.72), rgba(5,6,10,.3) 55%, transparent 78%),
    linear-gradient(180deg, rgba(5,6,10,.45) 0%, rgba(5,6,10,.15) 22%, rgba(5,6,10,.12) 70%, rgba(5,6,10,.5) 100%);
}
/* keep big text crisp over anything that still bleeds through */
.hero-title, .section-title, .about-lead, .contact-big, .hero-sub, .hero-eyebrow {
  text-shadow: 0 2px 24px rgba(5,6,10,.85), 0 0 2px rgba(5,6,10,.6);
}
.hero-title .outline { text-shadow: none; }

/* ===== GRAIN OVERLAY ===== */
.grain {
  position: fixed; inset: -50%; z-index: 3; pointer-events: none; opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 0.6s steps(3) infinite;
}
@keyframes grainShift {
  0%{transform:translate(0,0)} 33%{transform:translate(-3%,2%)} 66%{transform:translate(2%,-3%)} 100%{transform:translate(0,0)}
}

/* ===== CURSOR LIGHT PROJECTION ===== */
/* A big soft light that follows the cursor and lightens everything beneath it.
   plus-lighter additively brightens content + the WebGL canvas under it. */
.cursor-light {
  position: fixed; top: 0; left: 0; z-index: 5; pointer-events: none;
  width: 640px; height: 640px;
  opacity: 0; transition: opacity .5s ease;
}
.cursor-light.on { opacity: 1; }
/* visual lives on the pseudo so JS can own the wrapper's transform */
.cursor-light::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle,
    rgba(0,240,255,.20) 0%,
    rgba(177,75,255,.13) 28%,
    rgba(255,43,214,.07) 50%,
    transparent 70%);
  mix-blend-mode: plus-lighter; filter: blur(8px);
  animation: lightBreathe 4s ease-in-out infinite;
}
.cursor-light.click::before { animation: lightFlash .5s var(--ease); }
@keyframes lightBreathe { 0%,100% { transform: scale(.92); opacity: .85; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes lightFlash { 0% { transform: scale(1.7); opacity: 1; } 100% { transform: scale(1); opacity: .9; } }
@media (pointer: coarse) { .cursor-light { display: none; } }

/* ===== CUSTOM CURSOR (glowing twinkle-star) ===== */
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; }
/* JS sets transform: translate(x,y) translate(-50%,-50%) on these wrappers,
   so all visual motion (spin/pulse) lives on the ::before pseudo to avoid clashing. */

/* the sparkle star itself */
.cursor-dot { width: 22px; height: 22px; }
.cursor-dot::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, #ffffff 0%, var(--accent) 45%, var(--accent-3) 100%);
  /* 4-point twinkle */
  clip-path: polygon(50% 0%, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0% 50%, 42% 42%);
  filter: drop-shadow(0 0 6px var(--accent)) drop-shadow(0 0 12px var(--accent-3));
  animation: starSpin 6s linear infinite, starPulse 1.6s ease-in-out infinite;
}
@keyframes starSpin { to { transform: rotate(360deg); } }
@keyframes starPulse { 0%,100% { transform: scale(0.8); opacity: .85; } 50% { transform: scale(1.15); opacity: 1; } }

/* soft glowing halo that lags behind */
.cursor-ring { width: 46px; height: 46px; }
.cursor-ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,240,255,.25) 0%, rgba(177,75,255,.12) 45%, transparent 70%);
  filter: blur(2px);
  transition: transform .3s var(--ease), opacity .3s;
}
.cursor-ring.hover::before {
  transform: scale(2.1);
  background: radial-gradient(circle, rgba(255,43,214,.35) 0%, rgba(0,240,255,.18) 50%, transparent 72%);
}
.cursor-dot.click::before { animation: starSpin 6s linear infinite, starBurst .4s var(--ease); }
@keyframes starBurst { 0% { transform: scale(2.4); } 100% { transform: scale(1); } }

/* fading sparkle trail particles */
.spark { position: fixed; z-index: 9998; pointer-events: none; width: 10px; height: 10px;
  background: radial-gradient(circle, #fff 0%, var(--accent) 60%, transparent 75%);
  clip-path: polygon(50% 0%, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0% 50%, 42% 42%);
  transform: translate(-50%, -50%); will-change: transform, opacity; }

@media (pointer: coarse) { .cursor-dot, .cursor-ring { display: none; } }

/* ===== SCROLL PROGRESS ===== */
.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0%; z-index: 9000;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3)); box-shadow: 0 0 14px var(--accent); }

/* ===== SPACE INTRO GATE ===== */
.space-intro {
  position: fixed; inset: 0; z-index: 9500; pointer-events: none;
  display: flex; align-items: center; justify-content: center; text-align: center;
  /* faint center vignette so the title reads over the travelling stars */
  background: radial-gradient(ellipse at center, rgba(5,6,10,.55) 0%, rgba(5,6,10,.25) 35%, transparent 70%);
  transition: opacity .8s var(--ease);
}
.si-inner { transform: translateZ(0); }
.si-kicker { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .35em; color: var(--accent); margin-bottom: 1rem; opacity: .9; }
.si-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.8rem, 7vw, 4.5rem); letter-spacing: .04em; text-transform: uppercase;
  background: linear-gradient(90deg, var(--accent), #fff, var(--accent-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: siFloat 3s ease-in-out infinite; }
.si-sub { font-family: var(--font-mono); font-size: clamp(.8rem, 2.4vw, 1.05rem); color: var(--muted); margin-top: .8rem; }
.si-meter { width: min(360px, 70vw); height: 2px; margin: 2rem auto .9rem; background: rgba(255,255,255,.12); overflow: hidden; }
.si-meter span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 14px var(--accent); transition: width .15s linear; }
.si-hint { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .25em; color: var(--accent-4); animation: siBlink 1.6s ease-in-out infinite; }
.si-skip { pointer-events: auto; margin-top: 2.2rem; color: #05060a; font-weight: 700;
  background: linear-gradient(90deg, var(--accent), var(--accent-3)); border: none;
  padding: .9rem 1.8rem; border-radius: 50px; font-family: var(--font-mono); font-size: .82rem; letter-spacing: .05em;
  cursor: none; transition: transform .3s var(--ease), box-shadow .3s;
  box-shadow: 0 0 0 rgba(0,240,255,.6); animation: siPulse 2s ease-in-out infinite; }
.si-skip:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 0 30px rgba(0,240,255,.6); }
.si-skip:disabled { opacity: .7; animation: none; cursor: none; }
@keyframes siPulse { 0%,100% { box-shadow: 0 0 0 rgba(0,240,255,.0); } 50% { box-shadow: 0 0 26px rgba(0,240,255,.55); } }
@media (pointer: coarse) { .si-skip { cursor: pointer; } }
@keyframes siFloat { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-8px) scale(1.02); } }
@keyframes siBlink { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

/* while the intro plays, hide the actual site + chrome (stars stay visible) */
.intro-active main { opacity: 0; pointer-events: none; }
.intro-active #nav, .intro-active .sound-toggle, .intro-active .scroll-progress { opacity: 0; pointer-events: none; }
.intro-active #nav, .intro-active .sound-toggle { transition: opacity .6s ease; }
body:not(.intro-active) main { transition: opacity 1s var(--ease); }
/* lock scrolling during the gate */
.intro-lock, .intro-lock body { overflow: hidden !important; height: 100%; }

/* ===== SOUND TOGGLE ===== */
.sound-toggle {
  position: fixed; bottom: 1.4rem; right: 1.4rem; z-index: 8500;
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .9rem; border: 1px solid var(--line); border-radius: 50px;
  background: rgba(10,12,20,.6); backdrop-filter: blur(8px);
  color: var(--fg); font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em;
  cursor: none; transition: border-color .3s, box-shadow .3s, transform .3s var(--ease);
}
@media (pointer: coarse) { .sound-toggle { cursor: pointer; } }
.sound-toggle:hover { border-color: var(--accent); box-shadow: 0 0 20px rgba(0,240,255,.25); transform: translateY(-2px); }
.sound-toggle .eq { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.sound-toggle .eq i { width: 3px; height: 100%; background: linear-gradient(var(--accent), var(--accent-3)); border-radius: 2px; transform-origin: bottom; transform: scaleY(.3); }
.sound-toggle.playing .eq i { animation: eq .9s ease-in-out infinite; }
.sound-toggle.playing .eq i:nth-child(2) { animation-delay: .2s; }
.sound-toggle.playing .eq i:nth-child(3) { animation-delay: .4s; }
.sound-toggle.playing .eq i:nth-child(4) { animation-delay: .1s; }
@keyframes eq { 0%,100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

/* ===== PRELOADER ===== */
#preloader { position: fixed; inset: 0; z-index: 10000; background: var(--bg);
  display: flex; align-items: center; justify-content: center; flex-direction: column; }
.preloader-inner { text-align: center; width: min(420px, 80vw); }
.preloader-glitch { font-family: var(--font-display); font-size: clamp(2.4rem, 9vw, 5rem); font-weight: 800; letter-spacing: .1em; position: relative; color: var(--fg); }
.preloader-glitch::before, .preloader-glitch::after { content: attr(data-text); position: absolute; inset: 0; }
.preloader-glitch::before { color: var(--accent); animation: glitchA 2s infinite linear alternate; }
.preloader-glitch::after { color: var(--accent-2); animation: glitchB 1.6s infinite linear alternate; }
.preloader-bar { margin: 1.6rem 0 .6rem; height: 2px; width: 100%; background: var(--line); overflow: hidden; }
.preloader-bar span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 12px var(--accent); }
.preloader-percent { font-family: var(--font-mono); font-size: .9rem; color: var(--muted); }
.preloader-status { font-family: var(--font-mono); font-size: .72rem; color: var(--accent); margin-top: .4rem; letter-spacing: .15em; }
#preloader.done { transform: translateY(-100%); transition: transform 1s var(--ease); }

@keyframes glitchA { 0%{clip-path:inset(0 0 80% 0);transform:translate(-2px,-1px)} 50%{clip-path:inset(50% 0 30% 0);transform:translate(2px,1px)} 100%{clip-path:inset(80% 0 0 0);transform:translate(-1px,1px)} }
@keyframes glitchB { 0%{clip-path:inset(70% 0 10% 0);transform:translate(2px,1px)} 50%{clip-path:inset(20% 0 60% 0);transform:translate(-2px,-1px)} 100%{clip-path:inset(0 0 75% 0);transform:translate(1px,-1px)} }

/* ===== NAV ===== */
#nav { position: fixed; top: 0; left: 0; width: 100%; z-index: 8000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem clamp(1.2rem, 5vw, 4rem); mix-blend-mode: difference; }
.nav-logo { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; letter-spacing: .05em; }
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 1.8rem; list-style: none; font-family: var(--font-mono); font-size: .85rem; }
.nav-links a { position: relative; opacity: .8; transition: opacity .3s; }
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: -4px; height: 1px; width: 0; background: currentColor; transition: width .3s var(--ease); }
.nav-links a:hover { opacity: 1; }
.nav-links a:hover::after { width: 100%; }
.nav-burger { display: none; background: none; border: none; flex-direction: column; gap: 5px; cursor: pointer; }
.nav-burger span { width: 26px; height: 2px; background: var(--fg); display: block; transition: .3s; }

@media (max-width: 760px) {
  .nav-links { position: fixed; inset: 0; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(5,6,10,.96); gap: 2.2rem; font-size: 1.4rem; transform: translateY(-100%); transition: transform .6s var(--ease); mix-blend-mode: normal; }
  .nav-links.open { transform: translateY(0); }
  .nav-burger { display: flex; }
  .nav-burger.open span:first-child { transform: rotate(45deg) translate(5px, 5px); }
  .nav-burger.open span:last-child { transform: rotate(-45deg) translate(5px, -5px); }
}

/* ===== SECTION LAYOUT ===== */
.section { position: relative; max-width: var(--maxw); margin: 0 auto; padding: clamp(6rem, 14vh, 12rem) clamp(1.2rem, 5vw, 2.5rem); }
.section-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 3.5rem; }
.section-index { font-family: var(--font-mono); color: var(--accent); font-size: .9rem; }
.section-title { position: relative; font-family: var(--font-display); font-weight: 800; font-size: clamp(2.4rem, 8vw, 5.5rem); line-height: 1; text-transform: uppercase; }
/* RGB-glitch bands — same look as the hero title, switched on while the
   section is in view (.glitch-on toggled by ScrollTrigger) */
.section-title.glitch::before, .section-title.glitch::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.section-title.glitch.glitch-on::before { color: var(--accent); opacity: .9; animation: glitchA 3s infinite linear alternate; }
.section-title.glitch.glitch-on::after { color: var(--accent-2); opacity: .9; animation: glitchB 2.4s infinite linear alternate; }

/* ===== HERO ===== */
/* leave room for the news ticker so it lands on the first screen */
.hero { min-height: calc(100vh - 4rem); min-height: calc(100svh - 4rem);
  display: flex; flex-direction: column; justify-content: center; max-width: none;
  padding-top: clamp(4rem, 10vh, 7rem); padding-bottom: clamp(2rem, 5vh, 4rem);
  padding-left: clamp(1.2rem, 8vw, 6rem); padding-right: clamp(1.2rem, 8vw, 6rem); overflow: hidden; }
.hero-bg-text { position: absolute; top: 50%; left: 0; transform: translateY(-50%); white-space: nowrap;
  font-family: var(--font-display); font-weight: 800; font-size: 16vw; color: rgba(255,255,255,.02);
  letter-spacing: .02em; pointer-events: none; animation: heroScroll 30s linear infinite; }
@keyframes heroScroll { to { transform: translate(-50%, -50%); } }
.hero-content { position: relative; z-index: 2; }
.hero-eyebrow { font-family: var(--font-mono); color: var(--accent); font-size: clamp(.8rem, 2vw, 1rem); letter-spacing: .1em; margin-bottom: 1rem; }
.hero-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.6rem, 13vw, 10.5rem); line-height: .92; letter-spacing: -0.01em; text-transform: uppercase; perspective: 900px; }
.hero-title .line { display: block; overflow: visible; }
.hero-title .word { display: inline-block; transform-origin: center center; will-change: transform, filter, opacity; }
.hero-title .outline { color: transparent; -webkit-text-stroke: 2px var(--fg); text-stroke: 2px var(--fg); }
.hero-sub { font-family: var(--font-mono); color: var(--muted); font-size: clamp(.95rem, 2.4vw, 1.3rem); margin-top: 1.6rem; min-height: 1.6em; }
.caret { color: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-cta { display: flex; gap: 1rem; margin-top: 2.4rem; flex-wrap: wrap; }
.scroll-hint { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: .5rem; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .2em; color: var(--muted); }
.scroll-line { width: 1px; height: 50px; background: linear-gradient(var(--accent), transparent); animation: scrollPulse 2s ease infinite; }
@keyframes scrollPulse { 0%,100%{opacity:.3; transform:scaleY(.6)} 50%{opacity:1; transform:scaleY(1)} }

/* Glitch text */
.glitch { position: relative; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; }
.glitch::before { color: var(--accent); animation: glitchA 3s infinite linear alternate; opacity: .9; }
.glitch::after { color: var(--accent-2); animation: glitchB 2.4s infinite linear alternate; opacity: .9; }

/* ===== BUTTONS ===== */
.btn { position: relative; display: inline-flex; align-items: center; gap: .5rem; padding: .95rem 1.8rem;
  font-family: var(--font-mono); font-size: .9rem; letter-spacing: .05em; border-radius: 50px; overflow: hidden;
  border: 1px solid var(--line); transition: transform .3s var(--ease), border-color .3s; will-change: transform; }
.btn span { position: relative; z-index: 2; }
.btn::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--accent), var(--accent-3));
  transform: translateY(101%); transition: transform .4s var(--ease); z-index: 1; }
.btn:hover::before { transform: translateY(0); }
.btn:hover { color: #05060a; border-color: transparent; }
.btn-primary { background: linear-gradient(90deg, var(--accent), var(--accent-3)); color: #05060a; border-color: transparent; }
.btn-primary::before { background: var(--fg); }
.btn-ghost { background: transparent; }

/* ===== MARQUEE / GALACTIC NEWS TICKER ===== */
.marquee { position: relative; z-index: 2; overflow: hidden;
  border-top: 1px solid rgba(0,240,255,.22); border-bottom: 1px solid rgba(255,43,214,.22);
  background: linear-gradient(90deg, rgba(0,240,255,.05), rgba(177,75,255,.04), rgba(255,43,214,.05));
  box-shadow: inset 0 0 32px rgba(0,240,255,.06); }
.marquee-track { display: flex; white-space: nowrap; animation: marquee 28s linear infinite; padding: 0.95rem 0; }
@keyframes marquee { to { transform: translateX(-50%); } }
.mq-set { display: flex; align-items: center; flex: 0 0 auto; }
.mq-item { font-family: var(--font-display); font-weight: 700; font-size: clamp(.95rem, 2.6vw, 1.4rem);
  text-transform: uppercase; letter-spacing: .04em; padding: 0 1rem; color: #eaf6ff; text-shadow: 0 0 12px rgba(0,240,255,.4); }
.mq-sep { font-style: normal; font-size: 1.05em; color: var(--accent); text-shadow: 0 0 12px var(--accent);
  animation: sepTwinkle 2.2s ease-in-out infinite; }
.mq-sep:nth-of-type(3n+2) { color: var(--accent-2); text-shadow: 0 0 12px var(--accent-2); }
.mq-sep:nth-of-type(3n) { color: var(--accent-3); text-shadow: 0 0 12px var(--accent-3); }
@keyframes sepTwinkle { 0%,100% { opacity: .55; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.2); } }

/* pinned "LIVE" badge — text scrolls under it */
.marquee-badge { position: absolute; left: 0; top: 0; bottom: 0; z-index: 3; display: flex; align-items: center; gap: .55rem;
  padding: 0 1.8rem 0 clamp(1.2rem, 5vw, 2.5rem); font-family: var(--font-mono); font-weight: 700; font-size: .78rem;
  letter-spacing: .18em; text-transform: uppercase; color: #05060a; white-space: nowrap;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 100%, 0 100%);
  box-shadow: 0 0 26px rgba(0,240,255,.4); }
.mq-live { width: 8px; height: 8px; border-radius: 50%; background: #ff3b4e; box-shadow: 0 0 10px #ff3b4e, 0 0 4px #fff;
  animation: blink 1s steps(1) infinite; }
@media (max-width: 600px) { .marquee-badge { font-size: .68rem; padding-right: 1.2rem; } }

/* ===== ABOUT (ultra dynamic) ===== */
.about-grid { display: grid; grid-template-columns: 1.4fr .9fr; gap: 3rem; align-items: start; }
.about-lead { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.4rem, 4vw, 2.4rem); line-height: 1.25; margin-bottom: 1.6rem; perspective: 600px; }
.about-lead .word-r { display: inline-block; transform-origin: 50% 100%; will-change: transform, opacity;
  background: linear-gradient(90deg, var(--fg), var(--accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.about-lead .word-r.hot { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.about-text p.about-p { color: var(--muted); margin-bottom: 1.1rem; max-width: 60ch; }

.about-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 2.4rem; }
.stat { position: relative; display: flex; flex-direction: column; gap: .2rem; padding: 1.1rem 1.2rem;
  border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.02); overflow: hidden;
  transition: transform .4s var(--ease), border-color .4s, background .4s; }
.stat::before { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(0,240,255,.08), transparent 70%);
  transform: translateX(-100%); transition: transform .7s var(--ease); }
.stat:hover { transform: translateY(-5px); border-color: var(--accent); background: rgba(0,240,255,.04); }
.stat:hover::before { transform: translateX(100%); }
.stat-top { display: flex; align-items: baseline; gap: .15rem; }
.stat-num { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 6vw, 3.2rem); color: var(--accent); line-height: 1; }
.stat-plus { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; color: var(--accent-2); }
.stat-label { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); }
.stat-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; transform: scaleX(0); transform-origin: left;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 10px var(--accent); }

/* ---- holographic ID card ---- */
.about-card { perspective: 1000px; animation: cardFloat 6s ease-in-out infinite; }
@keyframes cardFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.about-card-inner { position: relative; padding: 2rem; border-radius: 18px;
  background: linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.012));
  backdrop-filter: blur(6px); transform-style: preserve-3d; transition: transform .15s ease-out; overflow: hidden; }
/* rotating conic-gradient glow border */
.about-card-inner::before { content: ""; position: absolute; inset: 0; border-radius: 18px; padding: 1px; pointer-events: none;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-3), var(--accent-2), var(--accent), var(--accent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: .6; animation: borderSpin 5s linear infinite; }
@keyframes borderSpin { to { transform: rotate(360deg); } }
/* holographic scan sweep */
.about-card-scan { position: absolute; left: 0; right: 0; top: 0; height: 38%; pointer-events: none; z-index: 1;
  background: linear-gradient(180deg, rgba(0,240,255,.14), transparent);
  animation: scanSweep 3.4s ease-in-out infinite; }
@keyframes scanSweep { 0% { transform: translateY(-40%); opacity: 0; } 25% { opacity: 1; } 60% { transform: translateY(230%); opacity: 0; } 100% { opacity: 0; } }
.about-card-badge { position: absolute; top: 1.2rem; right: 1.3rem; font-family: var(--font-mono); font-weight: 700; font-size: 1.1rem;
  color: var(--accent); opacity: .5; animation: blink 2.2s infinite; z-index: 2; }
.about-card-line { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: .85rem; }
.about-card-line:last-of-type { border-bottom: none; }
.about-card-line span { color: var(--muted); }
.about-card-line b { color: var(--fg); }
.status-dot { color: var(--accent-4) !important; }
.status-dot::before { content: "●"; margin-right: .4rem; animation: blink 1.4s infinite; }
.about-card-glow { position: absolute; width: 300px; height: 300px; background: radial-gradient(circle, var(--accent-3), transparent 70%); opacity: .3; filter: blur(40px); top: -100px; right: -100px; pointer-events: none;
  animation: glowDrift 7s ease-in-out infinite; }
@keyframes glowDrift { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-60px, 80px); } }

/* ===== SKILLS ===== */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.4rem; }
/* glassy, glowing cards — each with its own colour theme (--c solid, --cg glow) */
.skill-cluster { position: relative; isolation: isolate; padding: 1.8rem; border-radius: 16px;
  --c: var(--accent); --cg: rgba(0,240,255,.5);
  background: linear-gradient(160deg, rgba(255,255,255,.065), rgba(255,255,255,.015));
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 34px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
  transform-style: preserve-3d; transition: box-shadow .45s var(--ease); }
.skill-cluster:nth-child(2) { --c: var(--accent-2); --cg: rgba(255,43,214,.5); }
.skill-cluster:nth-child(3) { --c: var(--accent-3); --cg: rgba(177,75,255,.5); }
.skill-cluster:nth-child(4) { --c: var(--accent-4); --cg: rgba(92,255,157,.5); }
.skill-cluster:nth-child(5) { --c: var(--accent);   --cg: rgba(0,240,255,.5); }
.skill-cluster:nth-child(6) { --c: var(--accent-2); --cg: rgba(255,43,214,.5); }
/* glowing gradient border (masked so only the 1px frame shows) */
.skill-cluster::before { content: ""; position: absolute; inset: 0; border-radius: 16px; padding: 1px; pointer-events: none; z-index: -1;
  background: linear-gradient(140deg, var(--c), rgba(255,255,255,.28) 48%, var(--c));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: .55; transition: opacity .4s; }
/* glassy top sheen */
.skill-cluster::after { content: ""; position: absolute; inset: 0; border-radius: 16px; pointer-events: none; z-index: -1;
  background: radial-gradient(130% 70% at 50% -20%, rgba(255,255,255,.12), transparent 55%); }
/* Hover promotes the card to screen-centre (movement + spin + lean + scale are all
   driven by GSAP in main.js so it can fly above its neighbours instead of colliding). */
.skill-cluster:hover::before, .skill-cluster.featured::before { opacity: 1; }
.skill-cluster:hover { box-shadow: 0 22px 60px -12px var(--cg), inset 0 1px 0 rgba(255,255,255,.1); }
.skill-cluster.featured { box-shadow: 0 40px 130px -24px var(--cg), 0 0 28px -6px var(--cg), inset 0 1px 0 rgba(255,255,255,.14); }
.skill-cluster h3 { position: relative; font-family: var(--font-mono); font-size: .85rem; color: #fff; letter-spacing: .1em;
  text-transform: uppercase; margin-bottom: 1.3rem; padding-bottom: .7rem; }
.skill-cluster h3::after { content: ""; position: absolute; left: 0; bottom: 0; width: 32px; height: 2px; border-radius: 2px;
  background: var(--c); box-shadow: 0 0 12px var(--c); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem; }
.chips li { font-family: var(--font-mono); font-size: .82rem; padding: .4rem .9rem; border-radius: 50px;
  border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.03); color: var(--fg);
  transition: transform .3s var(--ease), border-color .3s, background .3s, box-shadow .3s; }
.chips li:hover { border-color: var(--c); color: #fff; background: rgba(255,255,255,.07);
  transform: translateY(-3px); box-shadow: 0 8px 22px -6px var(--cg); }
.skills-hint { text-align: center; margin-top: 2.5rem; font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }

/* ===== DIVE / COLLISION INTERSTITIAL ===== */
.dive { position: relative; height: 230vh; }
.dive-stage { position: fixed; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.dive-dark { position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(circle at 50% 50%, #05060a 0%, #010104 65%, #000 100%); }
/* meteor heads (currentColor powers the glow + tail) */
.dive-meteor { position: absolute; top: 50%; left: 50%; width: 20px; height: 20px; border-radius: 50%; opacity: 0;
  transform: translate(-50%, -50%); }
.dive-meteor::after { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, currentColor 45%, transparent 72%); box-shadow: 0 0 26px 5px currentColor; }
.dive-meteor::before { content: ""; position: absolute; top: 50%; width: 240px; height: 4px; transform: translateY(-50%);
  border-radius: 4px; opacity: .85; filter: blur(.3px); }
.dive-meteor-a { color: var(--accent); }
.dive-meteor-a::before { right: 50%; background: linear-gradient(90deg, transparent, currentColor); }
.dive-meteor-b { color: var(--accent-2); }
.dive-meteor-b::before { left: 50%; background: linear-gradient(270deg, transparent, currentColor); }
/* collision flash + shockwave ring + shards */
.dive-flash { position: absolute; top: 50%; left: 50%; width: 64px; height: 64px; border-radius: 50%; opacity: 0;
  transform: translate(-50%,-50%) scale(0); filter: blur(1px);
  background: radial-gradient(circle, #fff 0%, var(--accent) 24%, var(--accent-2) 50%, transparent 72%); }
.dive-ring { position: absolute; top: 50%; left: 50%; width: 60px; height: 60px; border-radius: 50%; opacity: 0;
  transform: translate(-50%,-50%) scale(0); border: 2px solid var(--accent); box-shadow: 0 0 30px var(--accent); }
.dive-shards { position: absolute; top: 50%; left: 50%; width: 0; height: 0; }
.dive-shard { position: absolute; top: 0; left: 0; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, #fff, var(--accent-3) 55%, transparent); }
.dive-title { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); opacity: 0; z-index: 6;
  font-family: var(--font-display); font-weight: 800; font-size: clamp(2.2rem, 10vw, 6.5rem); letter-spacing: .14em;
  text-transform: uppercase; color: #fff; text-shadow: 0 0 40px var(--accent), 0 0 90px var(--accent-3); white-space: nowrap; }
/* supernova core (skills intro) */
.dive-core { position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; border-radius: 50%; opacity: 0;
  transform: translate(-50%,-50%) scale(0);
  background: radial-gradient(circle, #fff 0%, var(--accent) 38%, var(--accent-3) 70%, transparent 80%);
  box-shadow: 0 0 70px 24px rgba(0,240,255,.55); }
/* wormhole rings (projects intro) */
.dive-portal-ring { position: absolute; top: 50%; left: 50%; width: 120px; height: 120px; border-radius: 50%; opacity: 0;
  transform: translate(-50%,-50%) scale(0);
  border: 2px solid var(--accent); box-shadow: 0 0 30px var(--accent), inset 0 0 34px var(--accent-2); }
/* lightspeed star streaks (contact intro) */
.ls-streak { position: absolute; top: 50%; left: 50%; height: 2px; width: 220px; transform-origin: 0% 50%; opacity: 0;
  background: linear-gradient(90deg, rgba(150,210,255,0) 0%, rgba(150,210,255,.5) 60%, #fff 100%);
  border-radius: 2px; pointer-events: none; }
/* UFO that jumps to lightspeed (contact intro) */
.dive-ufo { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); opacity: 0; z-index: 5;
  font-size: 2.4rem; line-height: 1; pointer-events: none; filter: drop-shadow(0 0 16px var(--accent-4)); will-change: transform; }
/* swirling wormhole throat (clear centre, colourful rotating swirl) */
.dive-vortex { position: absolute; top: 50%; left: 50%; width: 150vmax; height: 150vmax; border-radius: 50%; opacity: 0;
  transform: translate(-50%,-50%) scale(0.25); pointer-events: none; mix-blend-mode: screen;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(0,240,255,.13) 45deg, transparent 110deg,
    rgba(177,75,255,.13) 180deg, transparent 250deg, rgba(0,240,255,.1) 310deg, transparent 350deg);
  -webkit-mask: radial-gradient(circle, transparent 0 13%, #000 34% 68%, transparent 100%);
          mask: radial-gradient(circle, transparent 0 13%, #000 34% 68%, transparent 100%); }

/* ===== EXPERIENCE / TIMELINE (rocket ride) ===== */
.timeline { position: relative; margin-left: 1rem; }
/* dim background track */
.timeline::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.12); }
/* glowing beam that the rocket leaves behind as it descends (JS scrubs scaleY) */
.tl-beam { position: absolute; left: 0; top: 0; width: 3px; height: 100%; transform: translateX(-50%) scaleY(0); transform-origin: top center;
  background: linear-gradient(var(--accent), var(--accent-2)); box-shadow: 0 0 14px var(--accent); border-radius: 3px; pointer-events: none; z-index: 1; }
/* one persistent rocket, fixed to the viewport, driven across Experience + the Projects dive */
.flight-rocket { position: fixed; top: 0; left: 0; font-size: 2rem; line-height: 1; z-index: 7; opacity: 0;
  pointer-events: none; filter: drop-shadow(0 0 14px var(--accent)); will-change: transform; }
.tl-item { position: relative; padding: 0 0 3rem 2.4rem; transition: transform .4s var(--ease); }
.tl-item:hover { transform: translateX(8px); }
.tl-dot { position: absolute; left: -6px; top: 4px; width: 13px; height: 13px; border-radius: 50%; z-index: 2;
  background: radial-gradient(circle at 35% 30%, #fff, var(--accent) 60%); box-shadow: 0 0 0 4px rgba(0,240,255,.12);
  transition: transform .4s var(--ease), box-shadow .4s; }
/* ignite when the rocket passes (JS toggles .lit) or on hover */
.tl-dot.lit, .tl-item:hover .tl-dot { transform: scale(1.7);
  box-shadow: 0 0 0 6px rgba(0,240,255,.2), 0 0 24px var(--accent), 0 0 40px var(--accent-2); }
.tl-when { font-family: var(--font-mono); font-size: .8rem; color: var(--accent-2); margin-bottom: .4rem; }
.tl-body h3 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.2rem, 3vw, 1.6rem); transition: color .3s; }
.tl-item:hover .tl-body h3 { color: var(--accent); }
.tl-org { font-family: var(--font-mono); font-size: .85rem; color: var(--accent); }
.tl-body p { color: var(--muted); margin-top: .6rem; max-width: 60ch; }

/* ===== PROJECTS ===== */
.projects-subhead { font-family: var(--font-mono); color: var(--accent-2); letter-spacing: .1em; text-transform: uppercase; font-size: .9rem; margin: 1rem 0 1.6rem; }

/* UFO scanner — idles, then beams the hovered project */
.ufo { position: absolute; top: 0; left: 0; z-index: 5; pointer-events: none; will-change: transform; }
.ufo-craft { display: block; font-size: 2rem; line-height: 1; filter: drop-shadow(0 0 12px var(--accent-4)); animation: ufoBob 3s ease-in-out infinite; }
@keyframes ufoBob { 0%,100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-6px) rotate(5deg); } }
.ufo-beam { position: absolute; top: 88%; left: 50%; width: 78px; height: 64px; transform: translateX(-50%);
  background: linear-gradient(rgba(92,255,157,.45), rgba(92,255,157,0));
  clip-path: polygon(34% 0, 66% 0, 100% 100%, 0 100%); filter: blur(1px); opacity: 0; transition: opacity .3s; }
.ufo.scanning .ufo-beam { opacity: 1; animation: beamPulse 1.1s ease-in-out infinite; }
@keyframes beamPulse { 0%,100% { opacity: .45; } 50% { opacity: .9; } }
.ufo-label { position: absolute; top: -2px; left: 116%; white-space: nowrap; font-family: var(--font-mono); font-size: .6rem;
  letter-spacing: .1em; color: var(--accent-4); text-shadow: 0 0 8px var(--accent-4); opacity: 0; transition: opacity .3s; }
.ufo.scanning .ufo-label { opacity: 1; animation: blink 1.1s steps(1) infinite; }
/* rising abduction particles */
.abduct { position: absolute; width: 6px; height: 6px; border-radius: 50%; pointer-events: none; z-index: 4; transform: translate(-50%,-50%);
  background: radial-gradient(circle, #fff, var(--accent-4) 60%, transparent); box-shadow: 0 0 8px var(--accent-4); }
/* project being abducted: lifts into the beam, glows green, floats weightlessly */
.project.scanned { animation: weightless 1.5s ease-in-out infinite; }
@keyframes weightless { 0%,100% { transform: translateY(-6px) rotate(-0.4deg); } 50% { transform: translateY(-11px) rotate(0.5deg); } }
.project.scanned h4 { color: var(--accent-4); text-shadow: 0 0 20px rgba(92,255,157,.5); }
.project.scanned .project-no { color: var(--accent-4); }
@media (pointer: coarse) { .ufo { display: none; } }
.project-list { border-top: 1px solid var(--line); margin-bottom: 4rem; }
.project { display: grid; grid-template-columns: auto 1fr auto; gap: 1.5rem; align-items: center;
  padding: 2rem 1rem; border-bottom: 1px solid var(--line); position: relative; transition: padding .4s var(--ease); overflow: hidden; }
.project::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,240,255,.06), transparent); transform: translateX(-100%); transition: transform .5s var(--ease); }
.project:hover::before { transform: translateX(0); }
.project:hover { padding-left: 2rem; }
.project-meta { display: flex; flex-direction: column; gap: .3rem; font-family: var(--font-mono); font-size: .75rem; }
.project-no { color: var(--accent); }
.project-period { color: var(--muted); }
.project h4 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.3rem, 4vw, 2.2rem); }
.project p { color: var(--muted); font-size: .95rem; margin-top: .3rem; grid-column: 2; max-width: 55ch; }
.project-stack { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.project-stack span { font-family: var(--font-mono); font-size: .72rem; padding: .25rem .7rem; border: 1px solid var(--line); border-radius: 50px; color: var(--muted); }

/* ===== CONTACT (lands on the 3D solar system) ===== */
.contact { text-align: center; position: relative; padding-bottom: clamp(1.5rem, 4vh, 3rem); }
.contact-inner { display: flex; flex-direction: column; align-items: center; gap: 1.8rem; }
.contact-big { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.4rem, 9vw, 6rem); line-height: 1.05; text-transform: uppercase;
  overflow-wrap: normal; word-break: keep-all; } /* never break a word mid-letter */
.contact-mail { font-family: var(--font-mono); font-size: clamp(1rem, 4vw, 1.8rem); color: var(--accent); position: relative; }
.contact-mail::after { content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 2px; background: var(--accent); transition: width .4s var(--ease); }
.contact-mail:hover::after { width: 100%; }
.contact-socials { display: flex; gap: 2rem; font-family: var(--font-mono); font-size: 1rem; flex-wrap: wrap; justify-content: center; }
.contact-socials a { color: var(--muted); transition: color .3s; }
.contact-socials a:hover { color: var(--accent-2); }
.footer { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 3.5rem;
  padding-top: 1.6rem; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: .75rem; color: var(--muted); }

/* ===== REVEAL ANIMATION HOOKS ===== */
.reveal-up { opacity: 0; transform: translateY(40px); }
.split-char { display: inline-block; }
/* group chars per word so lines wrap between words only — never mid-word */
.split-word { display: inline-block; white-space: nowrap; }

/* ===== RESPONSIVE ===== */
@media (max-width: 880px) {
  .about-grid { grid-template-columns: 1fr; }
  .project { grid-template-columns: 1fr; gap: .6rem; }
  .project p { grid-column: 1; }
  .project-stack { justify-content: flex-start; }
  .project-meta { flex-direction: row; gap: 1rem; }
}
