/* ══════════════════════════════════════════════════════════════════
   SYNTHWAVE PORTFOLIO — styles.css
   ------------------------------------------------------------------
   TABLE OF CONTENTS
   [1] Design tokens (✏️ EDIT ME — colors, fonts, spacing)
   [2] Reset & base
   [3] Utilities (container, section titles, mono, selection, scrollbar)
   [4] Buttons
   [5] CRT scanline overlay
   [6] Nav bar
   [7] Hero (sky, stars, sun, mountains, grid floor, title glitch)
   [8] About
   [9] Projects (filter bar + arcade cards)
   [10] Skills (terminal chips)
   [11] Footer / contact
   [12] Back-to-top
   [13] Scroll reveals
   [14] Responsive breakpoints
   [15] Reduced motion
   ══════════════════════════════════════════════════════════════════ */


/* ═══ [1] DESIGN TOKENS ═════════════════════════════════════════════
   ✏️ EDIT ME: change the whole site's look from this one block. */
:root {
  /* Palette */
  --bg-deepest:    #0d0221;   /* near-black purple — page base */
  --bg-navy:       #1b1140;   /* upper sky */
  --grad-purple:   #541388;   /* mid sky */
  --sunset-pink:   #ff2975;   /* lower sky / sun */
  --sunset-orange: #ff8c42;   /* horizon / sun core */
  --accent-cyan:   #00f0ff;   /* primary neon — links, grid lines */
  --accent-magenta:#f222ff;   /* secondary neon */
  --text-primary:  #f4f4ff;
  --text-muted:    #b8b5d0;

  /* Derived surfaces */
  --surface:       rgba(27, 17, 64, 0.55);      /* card body */
  --surface-line:  rgba(0, 240, 255, 0.22);     /* card border */
  --nav-bg:        rgba(13, 2, 33, 0.82);       /* scrolled nav */

  /* Neon glows (kept subtle — glow is an accent, not wallpaper) */
  --glow-cyan:    0 0 2px var(--accent-cyan),  0 0 10px rgba(0, 240, 255, 0.55),  0 0 32px rgba(0, 240, 255, 0.25);
  --glow-magenta: 0 0 2px var(--accent-magenta),0 0 10px rgba(242, 34, 255, 0.5), 0 0 32px rgba(242, 34, 255, 0.22);
  --glow-pink:    0 0 2px var(--sunset-pink),  0 0 12px rgba(255, 41, 117, 0.5),  0 0 36px rgba(255, 41, 117, 0.22);

  /* Typography — ✏️ EDIT ME: swap font stacks here (see README) */
  --font-display: "Orbitron", "Audiowide", system-ui, sans-serif;
  --font-body:    "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", "VT323", ui-monospace, monospace;

  /* Fluid type scale */
  --fs-hero:  clamp(1.7rem, 7.5vw, 6.5rem); /* scales down far enough for narrow phones */
  --fs-h2:    clamp(1.7rem, 4.5vw, 3rem);
  --fs-h3:    clamp(1.05rem, 2vw, 1.25rem);
  --fs-body:  clamp(1rem, 1.1vw, 1.125rem);
  --fs-small: 0.875rem;

  /* Spacing & shape */
  --space-section: clamp(4.5rem, 12vh, 8rem);
  --space-gutter:  clamp(1.25rem, 5vw, 3rem);
  --radius: 10px;
  --nav-height: 68px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --speed-hover: 220ms;
  --speed-reveal: 700ms;
}


/* ═══ [2] RESET & BASE ═════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg-deepest);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--accent-cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

ul { list-style: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.15;
}

strong { color: var(--text-primary); }

/* Anchored sections stop below the sticky nav */
section[id], footer[id] { scroll-margin-top: calc(var(--nav-height) + 12px); }

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--bg-deepest);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius);
  font-family: var(--font-mono);
}
.skip-link:focus { top: 0.75rem; }


/* ═══ [3] UTILITIES ════════════════════════════════════════════════ */
.container {
  width: min(1120px, 100% - 2 * var(--space-gutter));
  margin-inline: auto;
}

.mono { font-family: var(--font-mono); }

.section { padding-block: var(--space-section); position: relative; }

/* Terminal-style section label: "01 // ABOUT" */
.section-label {
  color: var(--accent-cyan);
  font-size: var(--fs-small);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.section-label::before { content: "▸ "; color: var(--accent-magenta); }

.section-title {
  font-size: var(--fs-h2);
  margin-bottom: 2.5rem;
  text-shadow: var(--glow-cyan);
}

.hl-cyan { color: var(--accent-cyan); }
.hl-pink { color: var(--sunset-pink); }

/* Flair: neon selection color */
::selection { background: var(--accent-magenta); color: var(--bg-deepest); }

/* Flair: styled scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deepest); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--accent-cyan), var(--accent-magenta));
  border-radius: 6px;
  border: 2px solid var(--bg-deepest);
}
* { scrollbar-width: thin; scrollbar-color: var(--grad-purple) var(--bg-deepest); }

/* Social icon rows (icons injected by js/script.js) */
.social-row { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--surface-line);
  border-radius: var(--radius);
  color: var(--accent-cyan);
  background: rgba(13, 2, 33, 0.4);
  transition: transform var(--speed-hover) var(--ease-out),
              box-shadow var(--speed-hover) var(--ease-out),
              color var(--speed-hover) var(--ease-out),
              border-color var(--speed-hover) var(--ease-out);
}
.social-btn:hover, .social-btn:focus-visible {
  color: var(--accent-magenta);
  border-color: var(--accent-magenta);
  box-shadow: var(--glow-magenta);
  transform: translateY(-3px);
  text-decoration: none;
}
.social-btn svg { width: 22px; height: 22px; }


/* ═══ [4] BUTTONS ══════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.9rem;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform var(--speed-hover) var(--ease-out),
              box-shadow var(--speed-hover) var(--ease-out),
              background-color var(--speed-hover) var(--ease-out),
              color var(--speed-hover) var(--ease-out);
}
.btn:hover { text-decoration: none; transform: translateY(-3px); }

.btn--primary {
  background: linear-gradient(120deg, var(--sunset-pink), var(--accent-magenta));
  color: var(--text-primary);
  border: 1px solid transparent;
}
.btn--primary:hover, .btn--primary:focus-visible { box-shadow: var(--glow-pink); }

.btn--ghost {
  background: transparent;
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
}
.btn--ghost:hover, .btn--ghost:focus-visible {
  box-shadow: var(--glow-cyan);
  background: rgba(0, 240, 255, 0.08);
}


/* ═══ [5] CRT SCANLINE OVERLAY ═════════════════════════════════════
   Full-page fixed layer of faint horizontal lines. Very low opacity —
   flavor, not noise. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.5) 0px,
    rgba(255, 255, 255, 0.5) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.045;
  mix-blend-mode: overlay;
}


/* ═══ [6] NAV BAR ══════════════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-height);
  transition: background-color 300ms ease, border-color 300ms ease,
              backdrop-filter 300ms ease;
  border-bottom: 1px solid transparent;
}
/* .is-scrolled is toggled by an IntersectionObserver sentinel */
.nav.is-scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: rgba(0, 240, 255, 0.15);
}

.nav__inner {
  width: min(1120px, 100% - 2 * var(--space-gutter));
  margin-inline: auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav__logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-shadow: var(--glow-cyan);
}
.nav__logo:hover { text-decoration: none; color: var(--accent-cyan); }

.nav__menu { display: flex; gap: 2rem; }

.nav__link {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.35rem 0.1rem;
  position: relative;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 2px;
  background: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
  transition: right var(--speed-hover) var(--ease-out);
}
.nav__link:hover, .nav__link:focus-visible { color: var(--text-primary); text-decoration: none; }
.nav__link:hover::after, .nav__link:focus-visible::after { right: 0; }

/* Hamburger (hidden on desktop) */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 1px solid var(--surface-line);
  border-radius: var(--radius);
  padding: 10px 9px;
  cursor: pointer;
}
.nav__toggle-bar {
  width: 22px; height: 2px;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.7);
  transition: transform 250ms var(--ease-out), opacity 250ms var(--ease-out);
}
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.top-sentinel { position: absolute; top: 120px; height: 1px; width: 1px; }


/* ═══ [7] HERO ═════════════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  /* Sunset sky: navy → purple → hot pink → orange at the horizon */
  background: linear-gradient(
    to bottom,
    var(--bg-deepest) 0%,
    var(--bg-navy) 28%,
    var(--grad-purple) 52%,
    var(--sunset-pink) 72%,
    var(--sunset-orange) 84%,
    var(--bg-deepest) 84.2%
  );
}

.hero__scene { position: absolute; inset: 0; }

/* --- Star field (dots injected by js/script.js) --------------------- */
.hero__stars { position: absolute; inset: 0 0 40% 0; }
.star {
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: var(--text-primary);
  opacity: 0.7;
  animation: star-twinkle 3.5s ease-in-out infinite;
}
.star--big { width: 3px; height: 3px; box-shadow: 0 0 6px rgba(244, 244, 255, 0.9); }
@keyframes star-twinkle {
  0%, 100% { opacity: 0.15; }
  50%      { opacity: 0.9; }
}

/* --- Retro sun: gradient disc with horizontal slits ----------------- */
.hero__sun {
  position: absolute;
  left: 50%;
  bottom: 15%;
  width: clamp(220px, 34vw, 420px);
  aspect-ratio: 1;
  /* --plx is written by the JS parallax (stays 0 when idle / reduced motion) */
  transform: translateX(-50%) translateY(var(--plx, 0px));
  border-radius: 50%;
  background: linear-gradient(
    to bottom,
    #ffd23f 0%,
    var(--sunset-orange) 35%,
    var(--sunset-pink) 68%,
    var(--accent-magenta) 100%
  );
  /* Classic outrun slit lines — solid crown, gaps widening toward the
     bottom. ONE percent-based gradient layer (scales with the sun);
     multi-layer mask compositing renders inconsistently across browsers. */
  -webkit-mask-image: linear-gradient(to bottom,
    #000 0% 55%,        transparent 55% 57%,
    #000 57% 66%,       transparent 66% 68.5%,
    #000 68.5% 76.5%,   transparent 76.5% 79.5%,
    #000 79.5% 86.5%,   transparent 86.5% 90%,
    #000 90% 95.5%,     transparent 95.5% 100%);
  mask-image: linear-gradient(to bottom,
    #000 0% 55%,        transparent 55% 57%,
    #000 57% 66%,       transparent 66% 68.5%,
    #000 68.5% 76.5%,   transparent 76.5% 79.5%,
    #000 79.5% 86.5%,   transparent 86.5% 90%,
    #000 90% 95.5%,     transparent 95.5% 100%);
  filter: drop-shadow(0 0 45px rgba(255, 41, 117, 0.55));
  animation: sun-rise 14s ease-in-out infinite alternate;
}
@keyframes sun-rise {
  /* var(--plx) keeps the rise loop compatible with the scroll parallax */
  from { transform: translateX(-50%) translateY(calc(2.5% + var(--plx, 0px)));  filter: drop-shadow(0 0 35px rgba(255, 41, 117, 0.45)); }
  to   { transform: translateX(-50%) translateY(calc(-2.5% + var(--plx, 0px))); filter: drop-shadow(0 0 60px rgba(255, 41, 117, 0.65)); }
}

/* --- Distant mountain silhouettes -----------------------------------
   Two small jagged ridges hugging the left/right edges of the horizon.
   Drawn with clip-path polygons on width-capped pseudo-elements so they
   stay small silhouettes on any screen (gradient triangles ballooned
   into giant slabs on wide viewports). */
.hero__mountains {
  position: absolute;
  left: 0; right: 0;
  bottom: 15.9%;
  height: 9%;
  pointer-events: none;
}
.hero__mountains::before,
.hero__mountains::after {
  content: "";
  position: absolute;
  bottom: 0;
  height: 100%;
  opacity: 0.9;
}
.hero__mountains::before {
  left: 0;
  width: min(30%, 420px);
  background: #12052b;
  clip-path: polygon(0 100%, 0 30%, 12% 52%, 28% 14%, 45% 60%, 62% 36%, 80% 74%, 100% 100%);
}
.hero__mountains::after {
  right: 0;
  width: min(34%, 460px);
  background: #170733;
  clip-path: polygon(0 100%, 18% 70%, 36% 34%, 52% 62%, 68% 22%, 82% 55%, 100% 26%, 100% 100%);
}

/* --- Perspective grid floor ------------------------------------------
   A tall plane tilted back with rotateX; its background lines scroll
   toward the viewer. Only transform/background-position animate. */
.hero__floor {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 16%;
  perspective: 220px;
  perspective-origin: 50% 0%;
  overflow: hidden;
  transform: translateY(var(--plx, 0px)); /* parallax hook (JS) */
}
.hero__grid {
  position: absolute;
  left: -60%;
  width: 220%;
  height: 320%;
  top: 0;
  transform-origin: top center;
  transform: rotateX(62deg);
  background-image:
    /* vertical lines */
    repeating-linear-gradient(
      to right,
      rgba(0, 240, 255, 0.55) 0 2px,
      transparent 2px 80px
    ),
    /* horizontal lines */
    repeating-linear-gradient(
      to bottom,
      rgba(0, 240, 255, 0.55) 0 2px,
      transparent 2px 80px
    );
  animation: grid-scroll 2.6s linear infinite;
}
@keyframes grid-scroll {
  from { background-position: 0 0,   0 0; }
  to   { background-position: 0 0,   0 80px; }
}
/* Fade the grid into the horizon glow */
.hero__floor::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    var(--sunset-orange) 0%,
    rgba(255, 140, 66, 0) 26%,
    rgba(13, 2, 33, 0) 60%,
    rgba(13, 2, 33, 0.85) 100%
  );
  pointer-events: none;
}

/* Soft haze so hero text stays readable over the scenery */
.hero__haze {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 62% 46% at 50% 46%, rgba(13, 2, 33, 0.55), transparent 70%);
}

/* --- Hero content ---------------------------------------------------- */
.hero__content {
  position: relative;
  z-index: 2;
  width: 100%; /* never let a wide child stretch the box past the viewport */
  text-align: center;
  padding: calc(var(--nav-height) + 2rem) var(--space-gutter) 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
}

.hero__kicker {
  color: var(--accent-cyan);
  font-size: var(--fs-small);
  letter-spacing: 0.2em;
  opacity: 0.85;
}

.hero__title {
  font-size: var(--fs-hero);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  text-shadow: var(--glow-cyan);
  position: relative;
  max-width: 100%;
  overflow-wrap: anywhere; /* extremely long handles wrap instead of overflowing */
}

/* Chromatic aberration: cyan + magenta ghost layers, 1–2px offset.
   Hero title only — everything else stays crisp. */
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.8;
}
.glitch::before {
  color: var(--accent-cyan);
  transform: translate(-2px, 0);
  animation: glitch-a 3.2s steps(2, jump-none) infinite;
}
.glitch::after {
  color: var(--accent-magenta);
  transform: translate(2px, 0);
  animation: glitch-b 3.2s steps(2, jump-none) infinite;
}
@keyframes glitch-a {
  0%, 92%, 100% { transform: translate(-2px, 0); }
  94%           { transform: translate(-3px, 1px); }
  97%           { transform: translate(-1px, -1px); }
}
@keyframes glitch-b {
  0%, 92%, 100% { transform: translate(2px, 0); }
  94%           { transform: translate(3px, -1px); }
  97%           { transform: translate(1px, 1px); }
}

.hero__tagline {
  max-width: 34rem;
  color: var(--text-muted);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
}

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

.hero__scroll-hint {
  position: absolute;
  bottom: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent-cyan);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.8;
}
.hero__chevron {
  width: 10px; height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  animation: chevron-bob 1.8s ease-in-out infinite;
}
@keyframes chevron-bob {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.5; }
  50%      { transform: rotate(45deg) translate(4px, 4px); opacity: 1; }
}

/* --- ✏️ EDIT ME: HERO BACKGROUND IMAGE MODE --------------------------
   The hero currently uses assets/hero-bg.jpg as its backdrop instead of
   the CSS-drawn scene above (which stays in the code, unused).
   · Swap the wallpaper → replace assets/hero-bg.jpg (keep the filename)
   · Back to the CSS-drawn scene → delete this whole block
   The gradient layer on top keeps the title readable and fades the
   image into the page background at the bottom edge. */
.hero {
  background:
    linear-gradient(
      to bottom,
      rgba(13, 2, 33, 0.55) 0%,
      rgba(13, 2, 33, 0.18) 30%,
      rgba(13, 2, 33, 0.18) 68%,
      var(--bg-deepest) 100%
    ),
    url("../assets/hero-bg.jpg") center / cover no-repeat,
    var(--bg-deepest);
}
/* The photo brings its own sun + grid — park the animated CSS versions */
.hero__stars, .hero__sun, .hero__mountains, .hero__floor { display: none; }
/* --------------------------------------------------------------------- */


/* ═══ [8] ABOUT ════════════════════════════════════════════════════ */
.about__grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 3rem;
  align-items: start;
}

.about__portrait { position: relative; }
.about__portrait img {
  border-radius: var(--radius);
  border: 1px solid var(--surface-line);
  filter: saturate(1.05);
}
/* Offset neon frame behind the photo */
.about__portrait-frame {
  position: absolute;
  inset: 14px -14px -14px 14px;
  z-index: -1;
  border: 1px solid var(--accent-magenta);
  border-radius: var(--radius);
  box-shadow: inset 0 0 18px rgba(242, 34, 255, 0.25);
}

.about__body p { color: var(--text-muted); margin-bottom: 1.1rem; max-width: 58ch; }

.about__facts {
  margin: 1.4rem 0 1.6rem;
  display: grid;
  gap: 0.45rem;
  font-size: var(--fs-small);
  color: var(--text-muted);
}
.fact-key { color: var(--accent-cyan); margin-right: 0.5ch; }

/* YouTube gaming heads-up badge */
.yt-badge {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  max-width: 34rem;
  padding: 0.9rem 1.1rem;
  border: 1px dashed var(--sunset-pink);
  border-radius: var(--radius);
  background: rgba(255, 41, 117, 0.07);
}
.yt-badge__icon { font-size: 1.4rem; line-height: 1; }
.yt-badge__text { color: var(--text-muted); font-size: 0.95rem; margin: 0 !important; }
.yt-badge__text a { color: var(--sunset-pink); font-weight: 500; }


/* ═══ [9] PROJECTS ═════════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 2.4rem;
}
.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--surface-line);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  transition: color var(--speed-hover) var(--ease-out),
              border-color var(--speed-hover) var(--ease-out),
              box-shadow var(--speed-hover) var(--ease-out),
              transform var(--speed-hover) var(--ease-out);
}
.filter-btn:hover { color: var(--accent-cyan); border-color: var(--accent-cyan); transform: translateY(-2px); }
.filter-btn.is-active {
  color: var(--bg-deepest);
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
  font-weight: 700;
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.6rem;
}

/* Neon arcade card */
.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--speed-hover) var(--ease-out),
              box-shadow var(--speed-hover) var(--ease-out),
              border-color var(--speed-hover) var(--ease-out);
  animation: card-in 420ms var(--ease-out) both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 240, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.35), 0 8px 34px rgba(0, 240, 255, 0.12);
}
/* Animated border glow sweep on hover */
.project-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-magenta), transparent);
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity var(--speed-hover) ease;
}
.project-card:hover::before { opacity: 1; animation: border-sweep 1.6s linear infinite; }
@keyframes border-sweep {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.project-card__cat {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-magenta);
}
.project-card__title { font-size: var(--fs-h3); color: var(--text-primary); }
.project-card__meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.project-card__desc { color: var(--text-primary); font-size: 0.95rem; }
.project-card__details { color: var(--text-muted); font-size: 0.86rem; flex-grow: 1; }

.project-card__tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 4px;
  padding: 0.18rem 0.55rem;
  background: rgba(0, 240, 255, 0.06);
}

.project-card__links {
  display: flex;
  gap: 1.2rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(184, 181, 208, 0.15);
}
.project-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: color var(--speed-hover) ease, text-shadow var(--speed-hover) ease;
}
.project-card__link:hover, .project-card__link:focus-visible {
  color: var(--accent-cyan);
  text-shadow: var(--glow-cyan);
  text-decoration: none;
}
.project-card__link svg { width: 15px; height: 15px; }
.project-card__status {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Filtered-out cards are removed from flow (JS re-triggers card-in) */
.project-card.is-hidden { display: none; }


/* ═══ [10] SKILLS ══════════════════════════════════════════════════ */
.skills__groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.2rem;
}
.skill-group {
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--surface-line);
  border-radius: var(--radius);
  background: rgba(27, 17, 64, 0.35);
}
.skill-group__title {
  color: var(--accent-magenta);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  margin-bottom: 1rem;
  text-shadow: var(--glow-magenta);
}
.chip-list { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-cyan);
  padding: 0.4rem 0.9rem;
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 6px;
  background: rgba(0, 240, 255, 0.05);
  cursor: default;
  transition: box-shadow var(--speed-hover) ease, transform var(--speed-hover) var(--ease-out),
              background-color var(--speed-hover) ease;
}
.chip:hover {
  box-shadow: var(--glow-cyan);
  background: rgba(0, 240, 255, 0.12);
  transform: translateY(-2px);
}


/* ═══ [11] FOOTER / CONTACT ════════════════════════════════════════ */
.footer {
  position: relative;
  padding-top: var(--space-section);
  overflow: hidden;
  text-align: center;
  border-top: 1px solid rgba(0, 240, 255, 0.12);
}
.footer__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  padding-bottom: 9rem;
}
.footer__note { color: var(--text-muted); max-width: 36rem; }
.footer__mail { font-size: 0.85rem; }
.footer__mail .mono { text-transform: none; letter-spacing: 0.05em; }
.footer__copy {
  margin-top: 2rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.75;
}

/* Fading horizon grid bookending the page */
.footer__horizon {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 190px;
  perspective: 200px;
  perspective-origin: 50% 0%;
  overflow: hidden;
  pointer-events: none;
}
.footer__horizon::before {
  content: "";
  position: absolute;
  inset: -4px 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--sunset-pink), var(--sunset-orange), var(--sunset-pink), transparent);
  filter: blur(1px);
  opacity: 0.8;
  z-index: 2;
}
.footer__grid {
  position: absolute;
  left: -60%;
  width: 220%;
  height: 340%;
  top: 0;
  transform-origin: top center;
  transform: rotateX(62deg);
  background-image:
    repeating-linear-gradient(to right,  rgba(0, 240, 255, 0.4) 0 2px, transparent 2px 80px),
    repeating-linear-gradient(to bottom, rgba(0, 240, 255, 0.4) 0 2px, transparent 2px 80px);
  animation: grid-scroll 3.2s linear infinite;
}
.footer__horizon::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(13, 2, 33, 0.2), var(--bg-deepest) 92%);
}


/* ═══ [12] BACK-TO-TOP ═════════════════════════════════════════════ */
.to-top {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 110;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--accent-cyan);
  background: var(--nav-bg);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius);
  cursor: pointer;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 300ms ease, transform 300ms var(--ease-out),
              box-shadow var(--speed-hover) ease;
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { box-shadow: var(--glow-cyan); }


/* ═══ [13] SCROLL REVEALS (IntersectionObserver adds .is-revealed) ══ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity var(--speed-reveal) var(--ease-out),
              transform var(--speed-reveal) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-revealed { opacity: 1; transform: none; }
/* If JS never runs, content must not stay invisible */
.no-js .reveal { opacity: 1; transform: none; }


/* ═══ [14] RESPONSIVE BREAKPOINTS ══════════════════════════════════ */
/* ≤ 1024px — grid drops to 2 columns */
@media (max-width: 1024px) {
  .projects__grid { grid-template-columns: repeat(2, 1fr); }
}

/* ≤ 768px — hamburger nav, single-column about, simplified effects */
@media (max-width: 768px) {
  .nav__toggle { display: flex; }
  .nav__menu {
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(0, 240, 255, 0.15);
    padding: 0.5rem 0 1rem;
    /* Animate with transform/opacity only */
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 260ms var(--ease-out), opacity 260ms ease, visibility 0s linear 260ms;
  }
  .nav__menu.is-open {
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: transform 260ms var(--ease-out), opacity 260ms ease;
  }
  .nav__link { display: block; padding: 0.9rem var(--space-gutter); }

  .about__grid { grid-template-columns: 1fr; }
  .about__portrait { max-width: 280px; }
  .skills__groups { grid-template-columns: 1fr; }

  /* Simplify heavy effects on small screens */
  .glitch::before, .glitch::after { animation: none; }
  .hero__sun { filter: drop-shadow(0 0 25px rgba(255, 41, 117, 0.4)); }
  .hero__title { letter-spacing: 0.05em; } /* tighter tracking buys room on phones */
  /* Stronger scrim behind hero text — the backdrop's sun fills more of
     a phone screen, so the text needs extra separation */
  .hero__haze {
    background: radial-gradient(ellipse 130% 55% at 50% 42%, rgba(13, 2, 33, 0.68), transparent 78%);
  }
}

/* ≤ 480px — single-column projects, tighter hero */
@media (max-width: 480px) {
  .projects__grid { grid-template-columns: 1fr; }
  .hero__cta { flex-direction: column; width: 100%; }
  .hero__cta .btn { width: 100%; }
  .filter-bar { gap: 0.5rem; }
  .to-top { right: 1rem; bottom: 1rem; }
}


/* ═══ [15] REDUCED MOTION — calm everything down ═══════════════════ */
@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;
  }
  .reveal { opacity: 1; transform: none; }
  .glitch::before, .glitch::after { display: none; }
  .hero__grid, .footer__grid { animation: none; }
  .star { animation: none; opacity: 0.6; }
  [data-parallax] { --plx: 0px !important; } /* freeze parallax, keep centering */
}
