/* =============================================================
   Aihem Geswila — Portfolio
   Premium dark cyber theme: glass panels, soft glows, 3D console,
   scroll-reveal animation system (.reveal / .fade-up / .scale-in).
   ============================================================= */

/* -------------------------------------------------------------
   1. Design tokens
   ------------------------------------------------------------- */
:root {
  /* Palette */
  --bg-0: #05070d;
  --bg-1: #080b14;
  --bg-2: #0d1220;
  --bg-3: #131a2c;
  --graphite: #1a2238;
  --line:        rgba(120, 160, 220, 0.10);
  --line-strong: rgba(140, 180, 255, 0.22);
  --line-hot:    rgba(0, 229, 255, 0.45);

  --text-0: #f1f4ff;
  --text-1: #b6bfd4;
  --text-2: #7684a0;
  --text-3: #4a5470;

  --cyan:    #00e5ff;
  --cyan-2:  #22d3ee;
  --violet:  #a855f7;
  --violet-2:#7c3aed;
  --green:   #22ff9c;
  --amber:   #ffb547;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #00e5ff 0%, #a855f7 100%);
  --grad-primary-hover: linear-gradient(135deg, #33ecff 0%, #bb70ff 100%);
  --grad-text:    linear-gradient(135deg, #7dfaff 0%, #c4a3ff 100%);

  /* Radii */
  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;
  --r-xl: 28px;

  /* Motion */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --dur:  360ms;
  --reveal-dur: 800ms; /* matches the 0.8s reveal spec */

  /* Type */
  --font-display: 'Sora', 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout */
  --container: 1200px;
  --nav-h: 72px;
}

/* -------------------------------------------------------------
   2. Base
   ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text-0);
  background: var(--bg-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

::selection { background: rgba(0, 229, 255, 0.3); color: #fff; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

/* Reusable frosted-glass surface with a soft gradient border */
.glass {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015)) padding-box,
    linear-gradient(140deg, rgba(120,180,255,0.22), rgba(168,85,247,0.10) 40%, rgba(0,229,255,0.08)) border-box;
  border: 1px solid transparent;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 24px 60px -30px rgba(0,0,0,0.6);
}

/* Blinking status dot */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
  animation: pulse 1.8s infinite;
}
.dot--sm { width: 6px; height: 6px; }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.8); }
}

/* -------------------------------------------------------------
   3. ANIMATION SYSTEM
   .reveal   — fade in + rise            (JS adds .active on view)
   .fade-up  — same motion, alias class for cards
   .scale-in — fade in + slight zoom
   .reveal-delay-1/2/3 — staggered transition delays
   Hero uses .stagger (plays once on page load via animation).
   ------------------------------------------------------------- */
/* Reveal: fade in + rise from 30px (exact values per design spec) */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  will-change: opacity, transform;
}

/* Card alias — same motion as .reveal, kept as a separate hook */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  will-change: opacity, transform;
}

/* Scale-in: fade + zoom from 92% (photo, project cards, contact panel) */
.scale-in {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.8s ease, transform 0.8s ease;
  will-change: opacity, transform;
}

/* Active (visible) state — added by IntersectionObserver in script.js */
.reveal.active,
.fade-up.active {
  opacity: 1;
  transform: translateY(0);
}
.scale-in.active {
  opacity: 1;
  transform: scale(1);
}

/* Once revealed, release the GPU layer — holding ~50 will-change
   layers open at once causes jank and flashes on phones */
.reveal.active,
.fade-up.active,
.scale-in.active { will-change: auto; }

/* Staggered delays — used on TEXT only (heading -> paragraph -> CTA).
   Cards are staggered from JS by batch index instead, so they never
   carry transition-delay (which would also delay their hover effects). */
.reveal-delay-1 { transition-delay: 0.15s; }
.reveal-delay-2 { transition-delay: 0.3s; }
.reveal-delay-3 { transition-delay: 0.45s; }

/* Hero page-load stagger (CSS animation, fires once on load) */
.stagger {
  opacity: 0;
  transform: translateY(18px);
  animation: staggerIn 0.8s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 120ms + 150ms);
}
@keyframes staggerIn {
  to { opacity: 1; transform: translateY(0); }
}
/* Opacity-only variant used under prefers-reduced-motion */
@keyframes staggerFade {
  to { opacity: 1; }
}

/* -------------------------------------------------------------
   4. Background layer
   ------------------------------------------------------------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(20, 30, 60, 0.6), transparent 70%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
}

.bg__grid {
  position: absolute;
  inset: -2px;
  background-image:
    linear-gradient(rgba(120, 180, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 180, 255, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 20%, #000 40%, transparent 80%);
          mask-image: radial-gradient(ellipse at 50% 20%, #000 40%, transparent 80%);
}

.bg__glow {
  position: absolute;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.45;
  animation: drift 22s var(--ease) infinite alternate;
  pointer-events: none;
}
.bg__glow--cyan {
  background: radial-gradient(circle, rgba(0, 229, 255, 0.42), transparent 60%);
  top: -220px;
  left: -160px;
}
.bg__glow--violet {
  background: radial-gradient(circle, rgba(168, 85, 247, 0.30), transparent 60%);
  top: 30%;
  right: -220px;
  animation-delay: -8s;
}
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 80px) scale(1.08); }
}

.bg__particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
}

/* Cursor-following glow (desktop only; positioned from JS) */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.10), transparent 60%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 400ms var(--ease);
  will-change: transform;
  z-index: 0;
  mix-blend-mode: screen;
}
.cursor-glow.is-on { opacity: 1; }

/* -------------------------------------------------------------
   5. Navbar
   ------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background var(--dur) var(--ease),
              backdrop-filter var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(8, 11, 20, 0.72);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom-color: var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--text-0);
}
.nav__logo-text { line-height: 1; letter-spacing: -0.01em; }
/* Email-style "@" — mono face + accent colour, sits between name and city */
.nav__logo-at {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.92em;
  color: var(--cyan);
  margin: 0 1px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
}
/* Nav links: soft background + animated underline on hover */
.nav__link {
  position: relative;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-1);
  border-radius: 8px;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.nav__link:hover { color: var(--text-0); background: rgba(120, 180, 255, 0.06); }
.nav__link:hover::after { transform: scaleX(1); }
.nav__link.is-active { color: var(--text-0); }
.nav__link.is-active::after {
  transform: scaleX(1);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
}

.nav__actions { display: flex; align-items: center; gap: 10px; }

.lang {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
  transition: border-color var(--dur) var(--ease);
}
.lang:hover { border-color: var(--line-strong); }
.lang__item {
  padding: 2px 4px;
  border-radius: 4px;
  transition: color var(--dur) var(--ease);
}
.lang__item.is-active { color: var(--cyan); }
.lang__sep { color: var(--text-3); }

.nav__cta {
  padding: 9px 16px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-0);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
  transition: border-color var(--dur) var(--ease),
              background var(--dur) var(--ease),
              color var(--dur) var(--ease);
}
.nav__cta:hover {
  border-color: var(--cyan);
  background: rgba(0, 229, 255, 0.08);
  color: #fff;
}

.nav__burger {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  position: relative;
}
.nav__burger span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--text-0);
  border-radius: 2px;
  transition: transform var(--dur) var(--ease),
              opacity var(--dur) var(--ease),
              top var(--dur) var(--ease);
}
.nav__burger span:nth-child(1) { top: 13px; }
.nav__burger span:nth-child(2) { top: 19px; }
.nav__burger span:nth-child(3) { top: 25px; }
.nav__burger.is-open span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { opacity: 0; }
.nav__burger.is-open span:nth-child(3) { top: 19px; transform: rotate(-45deg); }

/* -------------------------------------------------------------
   6. Buttons — smooth gradient hover via layered backgrounds
   ------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 999px;
  overflow: hidden;
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              background var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              color var(--dur) var(--ease);
  will-change: transform;
}
.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
/* While the contact form is sending */
.btn[disabled] { opacity: 0.6; pointer-events: none; }

.btn--primary {
  color: #051022;
  background: var(--grad-primary);
  box-shadow:
    0 10px 30px -6px rgba(0, 229, 255, 0.4),
    0 4px 12px -4px rgba(168, 85, 247, 0.35);
}
/* A brighter gradient layer fades in on hover (gradients can't transition,
   so we crossfade a ::before overlay instead). */
.btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad-primary-hover);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.btn--primary:hover::before { opacity: 1; }
.btn--primary > * { position: relative; z-index: 1; }
.btn--primary:hover {
  box-shadow:
    0 16px 42px -6px rgba(0, 229, 255, 0.55),
    0 6px 18px -4px rgba(168, 85, 247, 0.5);
}

.btn--ghost {
  color: var(--text-0);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line-strong);
}
.btn--ghost:hover {
  background: rgba(120, 180, 255, 0.07);
  border-color: var(--cyan);
  color: #fff;
}

/* -------------------------------------------------------------
   7. Hero
   ------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  padding: calc(var(--nav-h) + 40px) 0 80px;
  display: flex;
  align-items: center;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  width: 100%;
}

.hero__copy { min-width: 0; }

.hero__status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-1);
  background: rgba(0, 229, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.8vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 24px 0 16px;
}

/* One-glance positioning line under the headline */
.hero__position {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-2);
  letter-spacing: 0.02em;
  margin: 0 0 18px;
}

.hero__subtitle {
  font-size: clamp(0.98rem, 1.25vw, 1.08rem);
  color: var(--text-1);
  max-width: 580px;
  margin: 0 0 30px;
}
.hero__subtitle strong { color: var(--text-0); font-weight: 600; }

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
}

/* Mini brand cards — 2x2 grid of quick facts */
.hero__cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 560px;
}
.mini {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  border-radius: var(--r);
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.mini:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 50px -24px rgba(0, 229, 255, 0.3);
}
.mini__label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.mini__value {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-0);
  line-height: 1.35;
}

/* Right column: 3D console ---------------------------------- */
.hero__visual {
  position: relative;
  height: 480px;
  perspective: 1400px;
}

.chip {
  position: absolute;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-0);
  background: rgba(15, 22, 40, 0.7);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px -12px rgba(0, 229, 255, 0.35);
  z-index: 3;
  white-space: nowrap;
}
.chip--1 { top: 4%;  left: -6%;  color: var(--cyan);   border-color: rgba(0,229,255,0.35); }
.chip--2 { top: 18%; right: -4%; color: var(--violet); border-color: rgba(168,85,247,0.35); }
.chip--3 { top: 60%; left: -8%;  color: var(--green);  border-color: rgba(34,255,156,0.30); }
.chip--4 { bottom: 6%; right: 6%; color: var(--cyan);  border-color: rgba(0,229,255,0.35); }
.chip--5 { bottom: 40%; left: 42%; color: var(--text-0); border-color: var(--line-strong); }

.float { animation: float 6s ease-in-out infinite; }
.chip--1 { animation-delay: -0.5s; }
.chip--2 { animation-delay: -2.5s; }
.chip--3 { animation-delay: -4.5s; }
.chip--4 { animation-delay: -1.5s; }
.chip--5 { animation-delay: -3.5s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.console {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateY(-8deg) rotateX(6deg);
  animation: consoleFloat 8s ease-in-out infinite;
}
@keyframes consoleFloat {
  0%, 100% { transform: rotateY(-8deg) rotateX(6deg) translateY(0); }
  50%      { transform: rotateY(-6deg) rotateX(4deg) translateY(-8px); }
}

.panel {
  position: absolute;
  border-radius: var(--r-lg);
  padding: 18px;
  color: var(--text-0);
  transform-style: preserve-3d;
}

.panel--terminal {
  top: 8%;
  left: 4%;
  right: 4%;
  height: 320px;
  padding: 0;
  overflow: hidden;
  z-index: 2;
  transform: translateZ(30px);
}
.panel__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}
.dots { display: inline-flex; gap: 6px; }
.dots i {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
}
.dots i:nth-child(1) { background: rgba(255, 90, 90, 0.6); }
.dots i:nth-child(2) { background: rgba(255, 181, 71, 0.6); }
.dots i:nth-child(3) { background: rgba(34, 255, 156, 0.6); }
.panel__title {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-2);
  text-align: center;
}
.panel__mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-2);
}

.term {
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-1);
  height: calc(320px - 46px);
  overflow: hidden;
}
.term__line { opacity: 0; animation: termIn 0.35s var(--ease) forwards; }
.term__line--ok    { color: var(--text-0); }
.term__line--warn  { color: var(--amber); }
.term__prompt      { color: var(--cyan); margin-right: 8px; }
.term__tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  margin-right: 8px;
  letter-spacing: 0.04em;
}
.term__tag--ok   { background: rgba(34,255,156,0.14); color: var(--green);  border: 1px solid rgba(34,255,156,0.3); }
.term__tag--warn { background: rgba(255,181,71,0.14); color: var(--amber); border: 1px solid rgba(255,181,71,0.3); }
.term__cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--cyan);
  vertical-align: -2px;
  animation: blink 1.1s step-end infinite;
}
@keyframes termIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes blink { 50% { opacity: 0; } }

.panel--status {
  top: -6%;
  right: -6%;
  width: 240px;
  padding: 16px;
  z-index: 3;
  transform: translateZ(60px) rotateY(-4deg);
}
.panel__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.panel__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.panel__pill--green {
  color: var(--green);
  background: rgba(34,255,156,0.10);
  border: 1px solid rgba(34,255,156,0.28);
}
.panel__pill--violet {
  color: var(--violet);
  background: rgba(168,85,247,0.10);
  border: 1px solid rgba(168,85,247,0.30);
}
.panel__stat { display: flex; flex-direction: column; margin-bottom: 12px; }
.panel__stat-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--grad-text);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  line-height: 1;
}
.panel__stat-lbl {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-2);
  margin-top: 4px;
}
.spark {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 40px;
}
.spark span {
  flex: 1;
  height: var(--h, 40%);
  background: var(--grad-primary);
  border-radius: 2px;
  opacity: 0.85;
}

.panel--threats {
  bottom: -8%;
  left: -6%;
  width: 260px;
  padding: 14px;
  z-index: 4;
  transform: translateZ(90px) rotateY(6deg);
}
.nodes { height: 60px; margin-top: 8px; }
.nodes svg { width: 100%; height: 100%; }

.hero__scroll {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 40px;
  border: 2px solid var(--text-3);
  border-radius: 12px;
  opacity: 0.7;
}
.hero__scroll span {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: var(--cyan);
  border-radius: 2px;
  animation: scrollHint 1.6s var(--ease) infinite;
}
@keyframes scrollHint {
  0%   { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, 18px); opacity: 0; }
}

/* -------------------------------------------------------------
   8. Section shared styles
   ------------------------------------------------------------- */
.section { padding: 120px 0; position: relative; }
.section__head {
  max-width: 720px;
  margin-bottom: 56px;
}
.section__eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--cyan);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 12px;
}
.section__sub {
  font-size: 1.02rem;
  color: var(--text-1);
  margin: 0;
  max-width: 620px;
}

/* -------------------------------------------------------------
   9. About
   ------------------------------------------------------------- */
.about {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.about__text p {
  font-size: 1.02rem;
  color: var(--text-1);
  margin: 0 0 18px;
  max-width: 580px;
}
/* Info cards form a full-width row of three below text + photo */
.about__cards {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

/* Event photo: glass frame + soft dual glow + floating labels */
.about__photo {
  position: relative;
  justify-self: center;
  width: min(100%, 380px);
}
.about__photo.is-missing { display: none; } /* image file not present yet */
.about__photo::before {
  content: "";
  position: absolute;
  inset: -28px;
  background:
    radial-gradient(circle at 28% 18%, rgba(0, 229, 255, 0.20), transparent 60%),
    radial-gradient(circle at 76% 84%, rgba(168, 85, 247, 0.20), transparent 60%);
  filter: blur(28px);
  z-index: -1;
  pointer-events: none;
}
.photo {
  padding: 10px;                 /* visible glass frame around the image */
  border-radius: var(--r-lg);
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.photo img,
.profile-photo {
  width: 100%;
  display: block;
  border-radius: calc(var(--r-lg) - 8px);
}
/* Slight 3D lean on hover — same family as the project-card tilt */
.photo:hover {
  transform: perspective(900px) rotateY(-4deg) rotateX(3deg) translateY(-4px);
  box-shadow:
    0 40px 80px -30px rgba(0, 229, 255, 0.35),
    0 20px 40px -20px rgba(168, 85, 247, 0.30);
}
/* Floating labels — reuse .chip base (already position: absolute) */
.photo-chip--1 { top: 6%;    left: -9%;  color: var(--cyan);   border-color: rgba(0,229,255,0.35);  animation-delay: -1s; }
.photo-chip--2 { top: 26%;   right: -10%; color: var(--violet); border-color: rgba(168,85,247,0.35); animation-delay: -3s; }
.photo-chip--3 { bottom: 32%; left: -12%; color: var(--green);  border-color: rgba(34,255,156,0.30); animation-delay: -5s; }
.photo-chip--4 { bottom: 10%; right: -7%; color: var(--cyan);   border-color: rgba(0,229,255,0.35);  animation-delay: -2s; }
.photo-chip--5 { bottom: -5%; left: 10%;  animation-delay: -4s; }
.info {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 16px;
  padding: 18px 22px;
  border-radius: var(--r);
  /* Includes opacity/transform so the reveal fade survives this shorthand
     (same reason as .skill above). */
  transition: opacity 0.8s ease,
              transform 0.8s ease,
              box-shadow 400ms var(--ease);
}
.info:hover {
  transform: translateY(-3px);
  box-shadow: 0 30px 60px -20px rgba(0, 229, 255, 0.15);
}
.info__icon {
  grid-row: 1 / 3;
  align-self: center;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.20);
}
.info__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.info__value { font-size: 0.98rem; font-weight: 500; color: var(--text-0); }

/* -------------------------------------------------------------
   10. Skills — soft glow on hover
   ------------------------------------------------------------- */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.skill {
  padding: 18px 20px;
  border-radius: var(--r);
  /* opacity + transform must be listed here too: this shorthand overrides
     the .fade-up transition (same specificity, declared later), and without
     opacity the reveal would snap instead of fading. */
  transition: opacity 0.8s ease,
              transform 0.8s ease,
              box-shadow 400ms var(--ease);
}
.skill:hover {
  transform: translateY(-4px);
  box-shadow:
    0 0 0 1px rgba(0, 229, 255, 0.25),
    0 24px 50px -20px rgba(0, 229, 255, 0.30),
    0 10px 24px -12px rgba(168, 85, 247, 0.22);
}
.skill__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.skill__name { font-weight: 500; font-size: 0.98rem; color: var(--text-0); }
.skill__lvl {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.skill__bar {
  position: relative;
  width: 100%;
  height: 6px;
  background: rgba(120,180,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.skill__bar span {
  position: absolute;
  inset: 0;
  width: 0;
  border-radius: 3px;
  background: var(--grad-primary);
  transition: width 1.2s var(--ease) 200ms;
}
/* Bar fills once the card becomes .active (set by the observer) */
.skill.active .skill__bar span { width: var(--level, 0%); }

/* -------------------------------------------------------------
   11. Projects — lift + spotlight + (JS) 3D tilt
   ------------------------------------------------------------- */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
}
.project {
  position: relative;
  padding: 28px;
  border-radius: var(--r-lg);
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              opacity var(--reveal-dur) var(--ease);
  transform-style: preserve-3d;
  will-change: transform;
}
.project:hover {
  box-shadow:
    0 40px 80px -30px rgba(0, 229, 255, 0.35),
    0 20px 40px -20px rgba(168, 85, 247, 0.28);
}
/* Radial "spotlight" following the mouse (--mx/--my set from JS) */
.project::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    240px circle at var(--mx, 50%) var(--my, 50%),
    rgba(0, 229, 255, 0.10),
    transparent 60%
  );
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  pointer-events: none;
}
.project:hover::before { opacity: 1; }

/* Featured project spans the full grid width for prominence */
.project--featured { grid-column: 1 / -1; }

.project__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
/* Multiple badges on one card (e.g. Featured + In Progress) */
.project__badges {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.project__id {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-3);
  letter-spacing: 0.06em;
}
.project__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.project__desc {
  color: var(--text-1);
  font-size: 0.96rem;
  margin: 0 0 20px;
  line-height: 1.65;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--text-1);
  background: rgba(120, 180, 255, 0.06);
  border: 1px solid var(--line);
}

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.badge--ok {
  color: var(--green);
  background: rgba(34,255,156,0.08);
  border: 1px solid rgba(34,255,156,0.28);
}
.badge--ok::before { background: var(--green); box-shadow: 0 0 8px var(--green); }
.badge--warn {
  color: var(--amber);
  background: rgba(255,181,71,0.08);
  border: 1px solid rgba(255,181,71,0.28);
}
.badge--warn::before { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.badge--featured {
  color: var(--violet);
  background: rgba(168,85,247,0.08);
  border: 1px solid rgba(168,85,247,0.28);
}
.badge--featured::before { background: var(--violet); box-shadow: 0 0 8px var(--violet); }

/* -------------------------------------------------------------
   12. Certificates
   ------------------------------------------------------------- */
.certs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}
.cert {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border-radius: var(--r);
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              opacity var(--reveal-dur) var(--ease);
}
.cert:hover {
  transform: translateY(-3px);
  box-shadow: 0 30px 60px -25px rgba(168, 85, 247, 0.35);
}
.cert__icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--violet);
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.20);
}
.cert__body { flex: 1; min-width: 0; }
.cert__title { font-size: 1rem; font-weight: 500; margin: 0 0 4px; }
.cert__issuer { font-size: 0.85rem; color: var(--text-2); margin: 0; }

/* -------------------------------------------------------------
   13. Contact
   ------------------------------------------------------------- */
.section--contact { padding-bottom: 140px; }
.contact {
  padding: 56px;
  border-radius: var(--r-xl);
  text-align: left;
}
.contact__title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 12px 0 14px;
}
.contact__lead {
  font-size: 1.06rem;
  color: var(--text-1);
  max-width: 620px;
  margin: 0 0 36px;
}
.contact__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}
.contact__card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(255,255,255,0.02);
  transition: border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease),
              background var(--dur) var(--ease),
              opacity var(--reveal-dur) var(--ease);
}
.contact__card:hover {
  border-color: var(--cyan);
  transform: translateY(-3px);
  background: rgba(0, 229, 255, 0.05);
}
.contact__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.contact__value { font-size: 0.98rem; color: var(--text-0); word-break: break-word; }
.contact__arrow {
  position: absolute;
  right: 20px;
  top: 20px;
  color: var(--text-2);
  transition: color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.contact__card:hover .contact__arrow {
  color: var(--cyan);
  transform: translate(4px, -4px);
}
/* CTA row: email (primary) + LinkedIn + GitHub buttons */
.contact__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* -------------------------------------------------------------
   13b. Contact modal — opened by the "Email Me" button
   ------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;                    /* above the navbar (z 50) */
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 7, 13, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;              /* keeps it out of tab order when closed */
  transition: opacity 300ms var(--ease), visibility 0s linear 300ms;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 300ms var(--ease);
}

.contact-modal {
  position: relative;
  width: min(540px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 32px;
  border-radius: var(--r-lg);
  /* Cyan/violet glow ring on top of the shared .glass surface */
  box-shadow:
    0 0 0 1px rgba(0, 229, 255, 0.15),
    0 30px 90px -20px rgba(0, 229, 255, 0.25),
    0 20px 60px -20px rgba(168, 85, 247, 0.25);
  transform: scale(0.94) translateY(12px);
  transition: transform 300ms var(--ease);
}
.modal-overlay.active .contact-modal { transform: scale(1) translateY(0); }

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-2);
  transition: color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}
.modal-close:hover { color: #fff; border-color: var(--cyan); transform: rotate(90deg); }

.modal-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  padding-right: 44px;             /* keep clear of the close button */
}
.modal-sub {
  font-size: 0.92rem;
  color: var(--text-2);
  margin: 0 0 22px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.form-group label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.form-group input,
.form-group textarea {
  font: inherit;
  color: var(--text-0);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
  resize: vertical;
  min-width: 0;
  transition: border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15);
}

.form-error,
.form-success {
  font-size: 0.88rem;
  padding: 10px 14px;
  border-radius: 10px;
  margin: 0 0 14px;
}
.form-error {
  color: #ff8f8f;
  background: rgba(255, 90, 90, 0.08);
  border: 1px solid rgba(255, 90, 90, 0.30);
}
.form-success {
  color: var(--green);
  background: rgba(34, 255, 156, 0.08);
  border: 1px solid rgba(34, 255, 156, 0.28);
}

.modal-actions { display: flex; justify-content: flex-end; }

/* Lock page scroll while the modal is open (set from script.js) */
body.modal-open { overflow: hidden; }

/* -------------------------------------------------------------
   14. Footer
   ------------------------------------------------------------- */
.footer {
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.footer__text, .footer__meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-2);
  margin: 0;
}
.footer__meta { display: inline-flex; align-items: center; gap: 8px; }

/* -------------------------------------------------------------
   15. Reduced motion — fade-only mode.
   The guideline asks to avoid MOVEMENT (translate/scale/parallax),
   not all animation. So reveals still play, but as gentle opacity
   fades with zero motion — the page feels alive either way.
   Note: Windows "Animation effects" (Accessibility settings) being
   off makes every browser on the machine report reduced motion.
   ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  /* Scroll reveals: keep the fade, drop translate/scale movement.
     Longhands on purpose — the shorthand would reset transition-delay
     and erase the .reveal-delay-* stagger. */
  .reveal, .fade-up, .scale-in {
    transform: none;
    filter: none;
    transition-property: opacity;
    transition-duration: 0.8s;
    transition-timing-function: ease;
  }
  .reveal.active, .fade-up.active, .scale-in.active {
    transform: none;
    filter: none;
  }

  /* Hero entrance: same stagger timing, opacity only */
  .stagger {
    transform: none;
    animation: staggerFade 0.7s ease forwards;
    animation-delay: calc(var(--i, 0) * 100ms + 100ms);
  }

  /* Modal: pure fade, no scale movement */
  .contact-modal { transform: none; transition: none; }
  .modal-overlay { transition: opacity 400ms ease; }

  /* Continuous / decorative movement stays off */
  .bg__glow, .dot, .hero__scroll span, .float, .console, .term__cursor { animation: none; }
  .skill.active .skill__bar span { transition: none; }
  .cursor-glow { display: none; }
  .btn:hover, .photo:hover, .project:hover,
  .skill:hover, .cert:hover, .info:hover, .mini:hover,
  .contact__card:hover, .stat:hover { transform: none; }
}

/* Print: reveal everything — otherwise elements that were still
   hidden (opacity: 0) when printing would be blank in the PDF. */
@media print {
  .reveal, .fade-up, .scale-in, .stagger {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    animation: none !important;
    transition: none !important;
  }
  .bg, .cursor-glow { display: none; }
}

/* -------------------------------------------------------------
   16. Responsive
   ------------------------------------------------------------- */
@media (max-width: 1080px) {
  .hero__inner { gap: 40px; }
  .hero__visual { height: 440px; }
}

@media (max-width: 960px) {
  .hero { padding-top: calc(var(--nav-h) + 60px); }
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .hero__visual {
    height: 420px;
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
  }
  .about {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .section { padding: 90px 0; }
  .contact { padding: 40px; }
}

@media (max-width: 720px) {
  /* Mobile nav */
  .nav__links {
    position: fixed;
    top: calc(var(--nav-h) + 6px);
    left: 16px;
    right: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px;
    background: rgba(8, 11, 20, 0.95);
    border: 1px solid var(--line);
    border-radius: var(--r);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  }
  .nav__links.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav__link { padding: 12px 14px; }
  .nav__link.is-active::after,
  .nav__link:hover::after { display: none; }
  .nav__burger { display: block; }
  .nav__cta { display: none; }

  .hero__cards { grid-template-columns: 1fr; max-width: none; }

  .hero__visual { height: 380px; }
  .chip { font-size: 0.72rem; padding: 6px 12px; }
  .chip--1 { left: 2%;  top: -2%; }
  .chip--2 { right: 2%; top: 8%; }
  .chip--3 { left: 0%;  top: 65%; }
  .chip--4 { right: 4%; bottom: 2%; }
  .chip--5 { display: none; }

  /* Photo labels: pull the negative offsets in so nothing overflows */
  .photo-chip--1 { left: 2%; }
  .photo-chip--2 { right: 2%; }
  .photo-chip--3 { left: 0; }
  .photo-chip--4 { right: 2%; }
  .photo-chip--5 { left: 8%; bottom: -4%; }

  .panel--terminal { height: 260px; left: 0; right: 0; }
  .term { height: calc(260px - 46px); font-size: 0.76rem; }
  .panel--status { width: 200px; top: -2%; right: -4%; }
  .panel--threats { width: 210px; bottom: -4%; left: -4%; }

  .footer__inner { justify-content: center; text-align: center; }
  .hero__scroll { display: none; }

  .contact { padding: 32px 24px; }

  /* Modal on small screens: single-column name fields, tighter padding */
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .contact-modal { padding: 24px 20px; }
}

@media (max-width: 420px) {
  .container { padding: 0 18px; }
  .btn { padding: 12px 18px; font-size: 0.9rem; }
  .section__head { margin-bottom: 40px; }
}

/* -------------------------------------------------------------
   17. Mobile performance mode
   backdrop-filter (frosted glass) and large animated blurs are
   the main sources of scroll lag on phones. Below 760px we keep
   the same look using near-opaque gradients instead of live blur,
   shrink the decorative glows, and turn the particle canvas off.
   ------------------------------------------------------------- */
@media (max-width: 760px) {
  /* Glass surfaces: same tint + gradient border, no live blur */
  .glass {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background:
      linear-gradient(180deg, rgba(19, 27, 45, 0.96), rgba(12, 17, 30, 0.96)) padding-box,
      linear-gradient(140deg, rgba(120, 180, 255, 0.22), rgba(168, 85, 247, 0.10) 40%, rgba(0, 229, 255, 0.08)) border-box;
  }
  .nav.is-scrolled {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(8, 11, 20, 0.94);
  }
  .nav__links,
  .hero__status,
  .chip,
  .modal-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .nav__links   { background: rgba(8, 11, 20, 0.97); }
  .chip         { background: rgba(15, 22, 40, 0.92); }
  .hero__status { background: rgba(15, 22, 40, 0.85); }

  /* Decorative background: smaller, static, canvas off */
  .bg__glow { width: 380px; height: 380px; filter: blur(70px); animation: none; }
  .bg__particles { display: none; }

  /* Don't pre-reserve GPU layers for reveals on phones */
  .reveal, .fade-up, .scale-in { will-change: auto; }
}
