:root {
  --bg: #05060b;
  --bg-deep: #020308;
  --panel: #0e0d15;
  --panel-strong: #14121c;
  --text: #f8f3ee;
  --muted: #a99fa5;
  --hot: oklch(70% 0.3 20);
  --hot-dark: oklch(44% 0.2 20);
  --cyan: oklch(85% 0.28 200);
  --yellow: oklch(91% 0.22 100);
  --green: oklch(87% 0.22 152);
  --neon: oklch(87% 0.22 152);
  --acid: oklch(70% 0.3 140);
  --line: rgba(255, 255, 255, 0.13);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.28);
  --mx: 50%;
  --my: 40%;
  --scroll-depth: 0;
  --font-heading: 'Rajdhani', 'Bahnschrift', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;
}

@property --border-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes spin-card-border {
  to {
    --border-angle: 360deg;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

section {
  scroll-margin-top: 72px;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background-color: var(--bg);
  background:
    radial-gradient(circle at var(--mx) var(--my), oklch(70% 0.3 20 / 0.24), transparent 24rem),
    radial-gradient(circle at 82% 18%, oklch(85% 0.28 200 / 0.15), transparent 28rem),
    radial-gradient(circle at 12% 74%, oklch(87% 0.22 152 / 0.12), transparent 24rem),
    linear-gradient(135deg, #150713 0%, #06070d 42%, #03040a 100%);
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

@media (pointer: fine) {

  html,
  body,
  a,
  button {
    cursor: none;
  }
}

@media (pointer: coarse) {
  .game-cursor {
    display: none;
  }
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 86%);
}

a {
  color: inherit;
  text-decoration: none;
}

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

.noise {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.045;
  background-image:
    radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.16), transparent 2px),
    radial-gradient(circle at 75% 70%, rgba(255, 255, 255, 0.12), transparent 1px),
    repeating-radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 4px);
  background-size: 97px 83px, 131px 109px, 19px 23px;
  mix-blend-mode: screen;
}

/* CRT Scanlines overlay */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 51;
  pointer-events: none;
  background: repeating-linear-gradient(0deg,
      rgba(0, 0, 0, 0.06) 0px,
      rgba(0, 0, 0, 0.06) 1px,
      transparent 1px,
      transparent 3px);
  opacity: 0.55;
  mix-blend-mode: multiply;
}

.progress-bar {
  position: fixed;
  left: 0;
  right: auto;
  top: 0;
  z-index: 80;
  width: 0%;
  height: 2px;
  background: var(--neon);
  box-shadow: 0 0 12px rgba(0, 255, 65, .6), 0 0 40px rgba(0, 255, 65, .2);
}

/* ─── 3-D KUNAI CURSOR ────────────────────────────────────────── */
.game-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 28px;
  height: 66px;
  pointer-events: none;
  opacity: 0;
  /* blade tip = click hotspot */
  transform: translate3d(calc(var(--cursor-x, -200px) - 3px),
      calc(var(--cursor-y, -200px) - 1px),
      0) rotate(-35deg);
  transition: opacity 200ms ease;
  will-change: transform;
}

.game-cursor.is-visible {
  opacity: 1;
}

/* The SVG itself */
.kunai-svg {
  display: block;
  width: 100%;
  height: 100%;
  filter:
    drop-shadow(0 1px 4px rgba(0, 0, 0, .5)) drop-shadow(0 0 6px rgba(53, 216, 230, .25));
  transition: filter 180ms ease, transform 180ms ease;
}

/* ── ARMED state (hovering interactive elements) ── */
.game-cursor.is-armed .kunai-svg {
  filter:
    drop-shadow(0 1px 5px rgba(0, 0, 0, .55)) drop-shadow(0 0 10px rgba(245, 230, 74, .65)) drop-shadow(0 0 20px rgba(255, 10, 91, .35));
  transform: scale(1.1);
}

/* ── CLICK / stab animation ── */
.game-cursor.is-clicking .kunai-svg {
  animation: kunai-stab 0.22s ease-out both;
}

@keyframes kunai-stab {
  0% {
    transform: scale(1) translateY(0);
  }

  50% {
    transform: scale(1.06) translateY(-4px);
  }

  100% {
    transform: scale(1) translateY(0);
  }
}

/* burst rings on click */
.kunai-burst {
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}

.kunai-burst::before,
.kunai-burst::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%) scale(0);
  border-radius: 50%;
  opacity: 0;
}

.kunai-burst::before {
  width: 28px;
  height: 28px;
  border: 1.5px solid rgba(245, 230, 74, .8);
}

.kunai-burst::after {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(53, 216, 230, .55);
}

.game-cursor.is-clicking .kunai-burst::before {
  animation: burst-ring 0.36s ease-out forwards;
}

.game-cursor.is-clicking .kunai-burst::after {
  animation: burst-ring 0.44s 0.04s ease-out forwards;
}

@keyframes burst-ring {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(1.8);
    opacity: 0;
  }
}

/* ─────────────────────────────────────────────────────────────── */

.site-nav {
  position: fixed;
  top: 7px;
  left: clamp(7px, 2vw, 22px);
  right: clamp(7px, 2vw, 22px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 34px;
  padding: 4px 7px 4px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  transition: background 260ms ease, border-color 260ms ease, box-shadow 260ms ease, backdrop-filter 260ms ease;
}

.site-nav.is-scrolled {
  background: transparent;
  border-color: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.brand,
.site-links {
  flex-shrink: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(5, 5, 10, 0.42);
  backdrop-filter: blur(10px);
  font-weight: 900;
  text-transform: uppercase;
}

.brand-copy {
  display: grid;
  gap: 1px;
  line-height: 1;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 21px;
  color: #111;
  background: var(--text);
  clip-path: polygon(0 12%, 88% 0, 100% 80%, 10% 100%);
  font-size: 0.66rem;
  line-height: 1;
}

.brand-word {
  white-space: nowrap;
  font-size: 0.7rem;
}

.brand-subtitle {
  color: rgba(245, 230, 74, 0.82);
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.blink-cursor {
  animation: blink-terminal 1.4s steps(1) infinite;
}

@keyframes blink-terminal {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.site-links {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.4vw, 18px);
  margin-right: auto;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(5, 5, 10, 0.42);
  backdrop-filter: blur(10px);
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.site-links a {
  position: relative;
  padding: 5px 0;
}

.site-links a::after {
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 100%;
  height: 2px;
  content: "";
  background: var(--neon);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 240ms cubic-bezier(.4, 0, .2, 1);
}

.site-links a:hover::after,
.site-links a:focus-visible::after {
  transform: scaleX(1);
}

.site-links a:hover {
  color: var(--neon);
  text-shadow: 0 0 8px rgba(0, 255, 65, .4);
  transition: color 180ms ease, text-shadow 180ms ease;
}

.nav-cta,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 29px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.nav-cta,
.btn-primary {
  color: #000;
  background: var(--neon);
  box-shadow: 0 0 24px rgba(0, 255, 65, .35), inset 0 1px 0 rgba(255, 255, 255, .18);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}

.nav-cta:hover,
.btn-primary:hover {
  background: #33ff66;
  box-shadow: 0 0 36px rgba(0, 255, 65, .55), 0 0 80px rgba(0, 255, 65, .15);
}

.btn-ghost {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.045);
}

.btn-ghost:hover {
  border-color: rgba(0, 255, 65, .35);
  color: var(--neon);
  background: rgba(0, 255, 65, .06);
}

.btn-lg {
  min-height: 44px;
  padding: 0 22px;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
}

.nav-cta:hover,
.nav-cta:focus-visible,
.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
}

.btn:focus-visible,
.text-link:focus-visible,
.site-links a:focus-visible,
.brand:focus-visible {
  outline: 2px solid rgba(53, 216, 230, 0.88);
  outline-offset: 4px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: clamp(26px, 4vw, 72px);
  min-height: 100svh;
  padding: clamp(76px, 10vh, 104px) clamp(20px, 5vw, 82px) clamp(34px, 5vh, 62px);
  background:
    radial-gradient(circle at 68% 34%, #c91312 0%, #9d0a0c 43%, #390509 78%, #08060b 100%);
  overflow: hidden;
  isolation: isolate;
}

.hero-video {
  position: absolute;
  inset: 0;
  z-index: -4;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 34%;
  opacity: 1;
  filter: brightness(1.24) saturate(1.08);
  background: #08060b url("assets/hero-poster.jpg") center / cover no-repeat;
  pointer-events: none;
  transform: none;
}

.depth-canvas {
  position: absolute;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  opacity: 0.34;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(ellipse at 54% 46%, transparent 0 30%, rgba(0, 0, 0, 0.24) 42%, #000 64%);
  mask-image: radial-gradient(ellipse at 54% 46%, transparent 0 30%, rgba(0, 0, 0, 0.24) 42%, #000 64%);
  pointer-events: none;
  transform: translate3d(0, calc(var(--scroll-depth) * -28px), 0);
}

.hero::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    radial-gradient(ellipse at 54% 40%, rgba(255, 180, 130, 0.14), transparent 20rem),
    linear-gradient(90deg, rgba(4, 3, 8, 0.64) 0%, rgba(6, 4, 9, 0.28) 30%, rgba(6, 4, 9, 0) 48%, rgba(6, 4, 9, 0) 100%),
    radial-gradient(circle at 78% 34%, rgba(53, 216, 230, 0.08), transparent 24rem),
    linear-gradient(180deg, rgba(5, 6, 11, 0) 0%, rgba(5, 6, 11, 0.04) 76%, rgba(5, 6, 11, 0.48) 100%);
  -webkit-mask-image: radial-gradient(ellipse at 54% 45%, transparent 0 29%, rgba(0, 0, 0, 0.3) 42%, #000 66%);
  mask-image: radial-gradient(ellipse at 54% 45%, transparent 0 29%, rgba(0, 0, 0, 0.3) 42%, #000 66%);
}

.hero::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    radial-gradient(ellipse at 50% 42%, transparent 0%, transparent 44%, rgba(2, 3, 8, 0.46) 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 9px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.14), transparent 46%, rgba(0, 0, 0, 0.02));
  opacity: 0.46;
  -webkit-mask-image: radial-gradient(ellipse at 54% 45%, transparent 0 32%, rgba(0, 0, 0, 0.18) 44%, #000 66%);
  mask-image: radial-gradient(ellipse at 54% 45%, transparent 0 32%, rgba(0, 0, 0, 0.18) 44%, #000 66%);
}

.hero-grid {
  position: absolute;
  inset: auto 0 0;
  z-index: -1;
  height: 34%;
  background:
    linear-gradient(rgba(245, 230, 74, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 230, 74, 0.08) 1px, transparent 1px);
  background-size: 68px 52px;
  transform: perspective(320px) rotateX(58deg);
  transform-origin: bottom;
  opacity: 0.3;
  -webkit-mask-image: linear-gradient(90deg, #000 0 39%, transparent 45% 64%, #000 74% 100%);
  mask-image: linear-gradient(90deg, #000 0 39%, transparent 45% 64%, #000 74% 100%);
}

.hero-glow {
  position: absolute;
  width: 36vw;
  min-width: 340px;
  aspect-ratio: 1;
  right: 30vw;
  top: 18vh;
  z-index: -2;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 214, 160, 0.24) 0%, rgba(255, 112, 35, 0.16) 38%, rgba(255, 10, 91, 0.04) 66%, transparent 74%);
  filter: blur(22px);
  mix-blend-mode: screen;
  opacity: 0.78;
}

.hero-content {
  width: min(100%, 780px);
  min-width: 0;
  max-width: 780px;
  padding-top: 2vh;
  z-index: 1;
}

.kicker,
.section-kicker,
.card-index {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  color: var(--cyan);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.kicker::before {
  content: '';
  width: 36px;
  height: 2px;
  background: var(--cyan);
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0 0 14px;
  color: var(--cyan);
  font-family: var(--font-heading);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 100%;
  margin-bottom: 18px;
  font-family: var(--font-heading);
  font-size: clamp(3.6rem, 8vw, 8.6rem);
  font-weight: 700;
  line-height: 0.9;
  text-transform: uppercase;
  text-wrap: balance;
  letter-spacing: -0.01em;
}

h1 span {
  display: block;
}

.glitch-title {
  transform: translate3d(calc(var(--tilt-x, 0) * 0.18px), calc(var(--tilt-y, 0) * 0.16px), 0);
  transform-style: preserve-3d;
}

.glitch-title span {
  position: relative;
  width: fit-content;
  max-width: 100%;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 28px rgba(255, 10, 91, 0.18);
}

.glitch-title span::before,
.glitch-title span::after {
  position: absolute;
  inset: 0;
  content: attr(data-text);
  pointer-events: none;
  opacity: 0;
}

.glitch-title span::before {
  color: var(--cyan);
  clip-path: inset(42% 0 29% 0);
  transform: translate3d(-0.035em, 0.015em, 18px);
}

.glitch-title span::after {
  color: var(--hot);
  clip-path: inset(62% 0 11% 0);
  transform: translate3d(0.04em, -0.012em, 28px);
}

.glitch-title.is-glitching span::before,
.glitch-title:hover span::before {
  animation: glitch-cyan 620ms steps(2, end) both;
}

.glitch-title.is-glitching span::after,
.glitch-title:hover span::after {
  animation: glitch-hot 620ms steps(2, end) both;
}

.glitch-title span:nth-child(2)::before {
  clip-path: inset(18% 0 53% 0);
}

.glitch-title span:nth-child(2)::after {
  clip-path: inset(52% 0 22% 0);
}

@keyframes glitch-cyan {

  0%,
  100% {
    opacity: 0;
    transform: translate3d(0, 0, 18px);
  }

  14% {
    opacity: 0.9;
    transform: translate3d(-0.07em, 0.012em, 18px);
  }

  35% {
    opacity: 0.65;
    transform: translate3d(0.04em, -0.018em, 18px);
  }

  56% {
    opacity: 0.88;
    transform: translate3d(-0.025em, 0.025em, 18px);
  }

  75% {
    opacity: 0;
  }
}

@keyframes glitch-hot {

  0%,
  100% {
    opacity: 0;
    transform: translate3d(0, 0, 28px);
  }

  18% {
    opacity: 0.86;
    transform: translate3d(0.08em, -0.014em, 28px);
  }

  42% {
    opacity: 0.7;
    transform: translate3d(-0.035em, 0.02em, 28px);
  }

  64% {
    opacity: 0.86;
    transform: translate3d(0.045em, 0.012em, 28px);
  }

  82% {
    opacity: 0;
  }
}

h2 {
  margin-bottom: 16px;
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 5vw, 5.8rem);
  font-weight: 700;
  line-height: 0.92;
  text-transform: uppercase;
  text-wrap: balance;
}

h3 {
  margin-bottom: 10px;
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 1.8vw, 1.65rem);
  font-weight: 700;
  line-height: 1.05;
  text-transform: uppercase;
}

.hero-stack {
  max-width: 620px;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-heading);
  font-size: clamp(0.82rem, 1.1vw, 0.96rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-location {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  padding: 4px 14px 4px 10px;
  border: 1px solid rgba(0, 255, 65, .25);
  border-radius: 20px;
  background: rgba(0, 255, 65, .06);
  color: var(--neon);
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 6px rgba(0, 255, 65, .7);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 6px rgba(0, 255, 65, .7);
  }

  50% {
    opacity: 0.4;
    box-shadow: 0 0 2px rgba(0, 255, 65, .3);
  }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 700px;
  margin: clamp(28px, 4vh, 44px) 0 0;
}

.hero-metrics div {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid rgba(255, 112, 35, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 112, 35, 0.08), transparent 58%),
    rgba(5, 6, 11, 0.48);
  box-shadow: 0 0 24px rgba(255, 112, 35, 0.1), inset 0 0 18px rgba(53, 216, 230, 0.04);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}

.hero-metrics dt {
  color: var(--cyan);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-metrics dd {
  margin: 6px 0 0;
  color: var(--text);
  font-size: clamp(0.82rem, 1.4vw, 0.95rem);
  line-height: 1.35;
}

.section {
  position: relative;
  padding: clamp(76px, 10vw, 116px) clamp(20px, 5vw, 82px);
  content-visibility: auto;
  contain-intrinsic-size: 900px;
}

.projects-section,
.about-section {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(90deg, rgba(255, 10, 91, 0.06), transparent 36%, rgba(53, 216, 230, 0.035)),
    linear-gradient(180deg, #05060b 0%, #090812 100%);
}

.skills-section,
.contact-section {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(circle at 18% 20%, rgba(53, 216, 230, 0.08), transparent 20rem),
    linear-gradient(180deg, #090812 0%, #05060b 100%);
}

.section-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.section-heading {
  max-width: 760px;
  margin-bottom: clamp(28px, 5vw, 56px);
}

.section-heading p:not(.section-kicker),
.about-copy p:not(.section-kicker),
.contact-panel p:not(.section-kicker) {
  color: var(--muted);
  font-size: clamp(0.98rem, 1.6vw, 1.08rem);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.project-card,
.skill-panel,
.cert-card,
.timeline article,
.contact-panel,
.hero-metrics div {
  --spin-border-opacity: 0;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.026), transparent 38%),
    linear-gradient(135deg, rgba(12, 16, 26, 0.94), rgba(7, 9, 16, 0.92));
  box-shadow: var(--shadow);
  transform:
    perspective(1100px) translate3d(var(--parallax-x, 0px), var(--parallax-y, 0px), var(--parallax-z, 0px)) rotateX(var(--rotate-x, 0deg)) rotateY(var(--rotate-y, 0deg));
  transform-style: preserve-3d;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  will-change: auto;
}

.project-card:hover,
.skill-panel:hover,
.timeline article:hover,
.contact-panel:hover,
.hero-metrics div:hover {
  border-color: rgba(53, 216, 230, 0.42);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 10, 91, 0.13);
  will-change: transform;
}

.project-card:hover,
.project-card:focus-visible,
.skill-panel:hover,
.skill-panel:focus-visible,
.cert-card:hover,
.cert-card:focus-visible {
  --spin-border-opacity: 1;
}

.project-card,
.skill-panel,
.cert-card,
.timeline article {
  background:
    linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.06) 18%, rgba(255, 255, 255, 0.5) 48%, rgba(255, 255, 255, 0.08) 78%, transparent 100%) top / 100% 1px no-repeat,
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.024)),
    radial-gradient(circle at 18% 0%, oklch(85% 0.28 200 / 0.13), transparent 18rem),
    rgba(9, 13, 22, 0.62);
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), var(--shadow);
}

.project-card {
  position: relative;
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

/* ── Featured project: full-width landscape ── */
.project-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

.project-featured .media-frame {
  aspect-ratio: auto;
  border-bottom: 0;
  border-right: 1px solid rgba(255, 255, 255, .08);
}

.featured-badge {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 2;
  padding: 4px 12px;
  border: 1px solid rgba(0, 255, 65, .35);
  border-radius: 3px;
  background: rgba(0, 255, 65, .1);
  color: var(--neon);
  font-family: var(--font-heading);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  box-shadow: 0 0 16px rgba(0, 255, 65, .2);
}

.project-featured .card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 3vw, 40px);
}

/* ── Skill bars ── */
.skill-bar {
  margin-top: 16px;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--neon));
  box-shadow: 0 0 8px rgba(0, 255, 65, .4);
  transition: width 1.2s cubic-bezier(.25, .8, .25, 1);
}

.skill-panel.is-visible .skill-fill {
  width: var(--fill, 0%);
}

/* ── Scroll chevron ── */
.hero-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: clamp(28px, 4vh, 48px);
}

.scroll-chevron {
  width: 20px;
  height: 20px;
  border-right: 2px solid rgba(0, 255, 65, .6);
  border-bottom: 2px solid rgba(0, 255, 65, .6);
  transform: rotate(45deg);
  animation: bounce-chevron 2s ease-in-out infinite;
}

.scroll-label {
  color: rgba(255, 255, 255, .35);
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

@keyframes bounce-chevron {

  0%,
  100% {
    transform: rotate(45deg) translateY(0);
    opacity: 1;
  }

  50% {
    transform: rotate(45deg) translateY(8px);
    opacity: 0.4;
  }
}

/* ── Project overview (featured header) ── */
.project-overview {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.overview-left {
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, .07);
}

.overview-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.overview-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(22px, 3vw, 38px);
}

/* ── Project media list (screenshot rows) ── */
.project-media-list {
  padding: 24px clamp(20px, 3vw, 36px) 8px;
}

.media-list-label {
  margin: 0 0 16px;
  color: var(--cyan);
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.media-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  align-items: start;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  transition: background 180ms ease;
}

.media-item:last-child {
  border-bottom: 0;
}

.media-item:hover {
  background: rgba(255, 255, 255, .02);
}

.media-item img {
  width: 180px;
  height: 118px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .08);
  display: block;
  flex-shrink: 0;
}

.media-info h4 {
  margin: 0 0 6px;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.media-info p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

/* ── Certificates section ── */
.certs-section {
  background: var(--bg);
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}

.cert-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .105), rgba(255, 255, 255, .026)),
    radial-gradient(circle at 18% 0%, oklch(85% 0.28 200 / 0.16), transparent 17rem),
    rgba(9, 13, 22, .58);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 18px 50px rgba(0, 0, 0, .24);
}

.cert-card:hover {
  border-color: oklch(85% 0.28 200 / .42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 0 34px oklch(85% 0.28 200 / .15), 0 18px 46px rgba(0, 0, 0, .34);
  transform: translateY(-3px);
}

.cert-img-wrap {
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .035)),
    rgba(255, 255, 255, .04);
}

.cert-img-wrap img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  display: block;
  padding: 16px;
}

.cert-body {
  padding: 16px 18px 20px;
}

.cert-issuer {
  margin: 0 0 4px;
  color: var(--cyan);
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.cert-name {
  margin: 0 0 4px;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.cert-id {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
}

/* ── Project card clickable ── */
[data-open-project] {
  cursor: pointer;
}

.card-cta {
  display: inline-block;
  margin-top: 14px;
  color: var(--neon);
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ── Project detail panel ── */
.project-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow-y: auto;
  background:
    radial-gradient(circle at 18% 8%, rgba(53, 216, 230, 0.13), transparent 24rem),
    radial-gradient(circle at 88% 0%, rgba(255, 10, 91, 0.12), transparent 26rem),
    linear-gradient(180deg, #06070d 0%, #020308 52%, #05060b 100%);
  transform: translateX(100%);
  transition: transform 380ms cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
}

.project-panel:not([hidden]) {
  transform: translateX(0);
}

.project-panel[hidden] {
  display: block !important;
  pointer-events: none;
}

.panel-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(24px, 4vw, 56px) 96px;
}

.panel-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  background: rgba(5, 6, 11, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.panel-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease, transform 160ms ease;
}

.panel-back:hover {
  border-color: var(--neon);
  color: var(--neon);
  background: rgba(0, 255, 65, .05);
  transform: translateY(-1px);
}

.panel-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.panel-links .text-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid rgba(245, 230, 74, 0.18);
  border-radius: 999px;
  background: rgba(245, 230, 74, 0.065);
  color: var(--yellow);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.panel-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1fr);
  gap: clamp(34px, 5vw, 72px);
  align-items: center;
  padding: clamp(42px, 6vw, 72px) 0 clamp(44px, 6vw, 68px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.panel-hero-img {
  width: 100%;
  max-height: 560px;
  aspect-ratio: 16 / 10.6;
  justify-self: center;
  object-fit: contain;
  padding: clamp(24px, 3.4vw, 42px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.025)),
    radial-gradient(circle at 18% 10%, rgba(95, 240, 166, 0.16), transparent 18rem),
    linear-gradient(135deg, rgba(53, 216, 230, 0.1), rgba(255, 10, 91, 0.045));
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  display: block;
}

.panel-hero-info {
  max-width: 640px;
  min-width: 0;
}

.panel-hero-info h2 {
  max-width: 12.5ch;
  margin: 14px 0 22px;
  font-size: clamp(3.2rem, 6.1vw, 5.8rem);
  line-height: 0.88;
  letter-spacing: 0;
}

.panel-hero-info p {
  max-width: 610px;
  margin-bottom: 16px;
  color: rgba(248, 243, 238, 0.76);
  font-size: clamp(0.98rem, 1.2vw, 1.08rem);
  line-height: 1.72;
}

.panel-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 28px 0 8px;
}

.panel-proof div {
  min-width: 0;
  padding: 15px 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.panel-proof span,
.panel-proof strong {
  display: block;
}

.panel-proof span {
  margin-bottom: 7px;
  color: var(--cyan);
  font-family: var(--font-heading);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.panel-proof strong {
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.35;
}

@media (max-width: 980px) {
  .panel-inner {
    width: 100%;
    padding: 0 18px 64px;
  }

  .panel-header {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 10px;
    margin: 0 -18px;
    padding: 12px 18px 14px;
    background:
      linear-gradient(180deg, rgba(5, 6, 11, 0.97), rgba(5, 6, 11, 0.84));
  }

  .panel-back {
    width: fit-content;
    min-height: 40px;
    padding: 0 14px;
    font-size: 0.68rem;
  }

  .panel-links {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
    overflow: visible;
    padding: 2px 0 0;
  }

  .panel-links .text-link {
    justify-content: center;
    min-width: 0;
    min-height: 34px;
    padding: 0 9px;
    font-size: 0.6rem;
    text-align: center;
  }

  .panel-hero {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 24px 0 34px;
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }

  .panel-hero-img {
    width: 100%;
    max-height: 232px;
    padding: 14px;
    border-radius: 20px;
    box-shadow:
      0 22px 58px rgba(0, 0, 0, 0.44),
      inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }

  .panel-hero-info {
    display: grid;
    gap: 0;
    max-width: none;
  }

  .panel-hero-info .section-kicker {
    margin-bottom: 0;
  }

  .panel-hero-info h2 {
    max-width: none;
    margin: 10px 0 18px;
    font-size: clamp(1.9rem, 7.4vw, 2.35rem);
    line-height: 1.02;
  }

  .panel-hero-info p {
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.98rem;
    line-height: 1.72;
  }

  .panel-hero-info p + p {
    margin-top: 14px;
  }

  .panel-proof {
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 24px 0 10px;
  }

  .panel-proof div {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
  }

  .panel-proof span {
    margin: 0;
    font-size: 0.58rem;
  }

  .panel-proof strong {
    font-size: 0.82rem;
  }

  .panel-hero-info .tag-list {
    margin: 18px 0 0;
  }
}

.panel-screenshots {
  padding-top: 32px;
}

.project-card::before,
.skill-panel::before,
.cert-card::before,
.timeline article::after,
.contact-panel::before,
.hero-metrics div::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background:
    linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.06) 18%, rgba(255, 255, 255, 0.58) 48%, rgba(255, 255, 255, 0.08) 78%, transparent 100%) top / 100% 1px no-repeat,
    radial-gradient(circle at var(--card-x, 50%) var(--card-y, 50%), rgba(255, 255, 255, 0.1), transparent 30%);
  opacity: var(--card-glow, 0);
  pointer-events: none;
  transition: opacity 160ms ease;
}

.project-card::before,
.skill-panel::before,
.cert-card::before {
  opacity: 1;
}

.project-card::after,
.skill-panel::after,
.cert-card::after {
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 2px;
  border-radius: inherit;
  content: "";
  pointer-events: none;
  background: conic-gradient(from var(--border-angle),
      rgba(53, 216, 230, 0.06) 0 16%,
      rgba(53, 216, 230, 0.98) 22%,
      rgba(245, 230, 74, 0.95) 29%,
      rgba(255, 10, 91, 0.98) 38%,
      rgba(53, 216, 230, 0.2) 46%,
      rgba(53, 216, 230, 0.06) 58% 100%);
  filter: drop-shadow(0 0 10px rgba(53, 216, 230, 0.28)) drop-shadow(0 0 16px rgba(255, 10, 91, 0.18));
  opacity: var(--spin-border-opacity);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  transition: opacity 180ms ease;
}

.project-card:hover::after,
.project-card:focus-visible::after,
.skill-panel:hover::after,
.skill-panel:focus-visible::after,
.cert-card:hover::after,
.cert-card:focus-visible::after {
  animation: spin-card-border 1.65s linear infinite;
}

.project-card:hover,
.skill-panel:hover,
.cert-card:hover,
.timeline article:hover,
.contact-panel:hover,
.hero-metrics div:hover {
  --card-glow: 1;
}

.hero-metrics div {
  border-color: rgba(255, 112, 35, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 112, 35, 0.08), transparent 58%),
    rgba(5, 6, 11, 0.48);
  box-shadow: 0 0 24px rgba(255, 112, 35, 0.1), inset 0 0 18px rgba(53, 216, 230, 0.04);
}

.media-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)),
    radial-gradient(circle at 20% 20%, rgba(255, 112, 35, 0.12), transparent 40%),
    rgba(11, 15, 26, 0.56);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

.media-frame::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 50%, rgba(5, 6, 11, 0.4));
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 260ms ease;
}

.project-card:hover .media-frame img {
  transform: scale(1.035);
}

.card-body {
  position: relative;
  z-index: 2;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)),
    rgba(8, 11, 19, 0.32);
}

.card-body p:not(.card-index) {
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 20px 0;
  list-style: none;
}

.tag-list li {
  padding: 6px 9px;
  border: 1px solid rgba(53, 216, 230, 0.3);
  color: rgba(255, 255, 255, 0.82);
  background: rgba(53, 216, 230, 0.08);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.text-link {
  display: inline-flex;
  align-items: center;
  color: var(--yellow);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.project-note {
  margin-bottom: 0;
  color: var(--yellow);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.split-layout,
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.skill-panel,
.timeline article {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border-radius: 4px;
}

.skill-panel span,
.timeline span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.skill-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 24px;
  border: 1px solid rgba(53, 216, 230, 0.32);
  border-radius: 4px;
  color: var(--yellow);
  background: rgba(53, 216, 230, 0.08);
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15em;
  color: var(--yellow);
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1;
  text-transform: none;
}

.contact-logo {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.skill-panel p,
.timeline p {
  margin-bottom: 0;
  color: var(--muted);
}

.about-copy {
  position: sticky;
  top: 118px;
}

.about-copy h2 {
  line-height: 0.88;
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline article {
  position: relative;
  overflow: hidden;
}

.timeline article:last-child {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), var(--shadow);
}

.timeline article::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  content: "";
  background: linear-gradient(180deg, var(--cyan) 0%, var(--neon) 100%);
  border-radius: 2px;
}

.timeline article::after {
  position: absolute;
  top: 22px;
  left: -4px;
  width: 12px;
  height: 12px;
  content: "";
  border-radius: 50%;
  border: 2px solid var(--cyan);
  background: var(--bg);
  box-shadow: 0 0 8px rgba(53, 216, 230, .4);
}

.contact-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(290px, 0.52fr);
  gap: clamp(24px, 4vw, 40px);
  align-items: center;
  padding: clamp(24px, 4vw, 40px);
  border-color: rgba(255, 10, 91, 0.28);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 10, 91, 0.14), rgba(53, 216, 230, 0.08)),
    rgba(14, 13, 21, 0.92);
}

.contact-actions {
  display: grid;
  gap: 12px;
}

.contact-actions .btn-ghost {
  justify-content: center;
  gap: 10px;
  min-height: 40px;
  border-color: rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), rgba(255, 112, 35, 0.035)),
    rgba(8, 11, 20, 0.58);
}

.contact-actions .btn-ghost:hover,
.contact-actions .btn-ghost:focus-visible {
  border-color: rgba(255, 112, 35, 0.42);
  box-shadow: 0 0 24px rgba(255, 112, 35, 0.16);
}

.site-footer {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 0;
  background: linear-gradient(180deg, var(--bg) 0%, #020308 100%);
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, 100%);
  padding: 28px clamp(20px, 5vw, 82px) 34px;
}

.footer-terminal {
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, .4);
  letter-spacing: 0.05em;
}

.status-active {
  color: var(--neon);
  text-shadow: 0 0 8px rgba(0, 255, 65, .5);
  animation: blink-terminal 2s steps(1) infinite;
}

.footer-links {
  display: flex;
  gap: 14px;
}

.footer-links a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  color: rgba(255, 255, 255, .5);
  transition: border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.footer-links a:hover {
  border-color: var(--neon);
  color: var(--neon);
  box-shadow: 0 0 12px rgba(0, 255, 65, .25);
}

.footer-copy {
  color: rgba(255, 255, 255, .3);
  font-size: 0.7rem;
  font-weight: 600;
}

.back-to-top {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 4px;
  color: rgba(255, 255, 255, .4);
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: border-color 180ms ease, color 180ms ease;
}

.back-to-top:hover {
  border-color: var(--neon);
  color: var(--neon);
}

.reveal {
  opacity: 1;
  transform: translateY(0);
}

.motion-ready .reveal {
  opacity: 0;
  transform:
    perspective(1100px) translate3d(var(--parallax-x, 0px), calc(var(--parallax-y, 0px) + 18px), var(--parallax-z, 0px)) rotateX(var(--rotate-x, 0deg)) rotateY(var(--rotate-y, 0deg));
  transition: opacity 520ms ease, transform 520ms ease;
}

.motion-ready .reveal.is-visible {
  opacity: 1;
  transform:
    perspective(1100px) translate3d(var(--parallax-x, 0px), var(--parallax-y, 0px), var(--parallax-z, 0px)) rotateX(var(--rotate-x, 0deg)) rotateY(var(--rotate-y, 0deg));
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}

@media (max-width: 1040px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 780px) {
  section {
    scroll-margin-top: 52px;
  }

  .section {
    content-visibility: visible;
    contain-intrinsic-size: auto;
  }

  .gsap-init .reveal {
    transition: none;
  }

  .site-nav {
    top: 6px;
    left: 6px;
    right: 6px;
    display: grid;
    grid-template-columns: minmax(0, auto) auto;
    min-height: 34px;
    gap: 8px;
    padding: 5px 8px;
    background: transparent;
    backdrop-filter: none;
  }

  .site-links {
    display: none;
  }

  .brand {
    gap: 7px;
  }

  .brand-mark {
    width: 29px;
    height: 22px;
    font-size: 0.68rem;
  }

  .brand-word {
    font-size: 0.68rem;
  }

  .nav-cta {
    position: static;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    display: inline-flex;
    flex-shrink: 0;
    min-width: 74px;
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.56rem;
    width: auto;
    background: var(--neon);
    color: #000;
  }

  .hero {
    align-items: end;
    min-height: 100svh;
    padding: 58px 16px 18px;
  }

  .hero-video {
    width: 100%;
    object-fit: cover;
    object-position: 45% 34%;
  }

  .hero::before {
    background:
      radial-gradient(ellipse at 54% 38%, rgba(255, 180, 130, 0.04), transparent 18rem),
      linear-gradient(180deg, rgba(4, 3, 8, 0) 0%, rgba(4, 3, 8, 0.03) 48%, rgba(4, 3, 8, 0.46) 100%),
      linear-gradient(90deg, rgba(4, 3, 8, 0.42) 0%, rgba(4, 3, 8, 0.16) 48%, rgba(4, 3, 8, 0) 100%),
      radial-gradient(circle at 78% 34%, rgba(53, 216, 230, 0.03), transparent 24rem);
  }

  .hero-glow {
    width: 62vw;
    min-width: 210px;
    right: 13vw;
    top: 22vh;
    background:
      radial-gradient(circle, rgba(255, 214, 160, 0.08) 0%, rgba(255, 112, 35, 0.06) 42%, rgba(255, 10, 91, 0.02) 68%, transparent 76%);
    filter: blur(26px);
    opacity: 0.34;
  }

  .hero-content {
    width: min(100%, 328px);
    max-width: 328px;
    margin-top: auto;
    padding-top: 0;
  }

  .kicker {
    gap: 7px;
    margin-bottom: 7px;
    font-size: 0.58rem;
  }

  .kicker span {
    width: 28px;
  }

  h1 {
    margin-bottom: 9px;
    font-size: clamp(1.72rem, 8.4vw, 2.1rem);
    line-height: 0.95;
  }

  .hero-copy {
    max-width: 286px;
    font-size: 0.76rem;
    line-height: 1.42;
  }

  .hero-stack {
    font-size: 0.62rem;
  }

  .hero-location {
    font-size: 0.6rem;
    margin-bottom: 0;
  }

  .hero-scroll {
    margin-top: 16px;
  }

  .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
  }

  .hero-actions .btn {
    min-height: 34px;
    padding: 0 8px;
    font-size: 0.58rem;
  }

  .hero-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    max-width: 328px;
    margin-top: 12px;
  }

  .hero-metrics div {
    min-height: 52px;
    padding: 8px 7px;
  }

  .hero-metrics dt {
    font-size: 0.56rem;
  }

  .hero-metrics dd {
    margin-top: 3px;
    font-size: 0.6rem;
    line-height: 1.24;
  }

  .project-grid,
  .split-layout,
  .about-grid,
  .contact-panel {
    grid-template-columns: 1fr;
  }

  /* Keep skill cards in 2-col grid on mobile */
  .skill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .skill-panel {
    padding: 16px 14px;
  }

  .skill-panel span {
    font-size: 0.65rem;
    gap: 6px;
    margin-bottom: 8px;
  }

  .skill-panel h3 {
    font-size: 0.85rem;
    margin-bottom: 6px;
  }

  .skill-panel p {
    font-size: 0.75rem;
    line-height: 1.4;
  }

  .skill-icon {
    width: 22px;
    height: 20px;
    font-size: 0.5rem;
  }

  .skill-bar {
    margin-top: 10px;
  }

  .project-featured {
    grid-template-columns: 1fr;
  }

  .project-featured .media-frame {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    aspect-ratio: 16 / 10;
  }

  .footer-inner {
    flex-direction: column;
    gap: 14px;
    text-align: center;
  }

  .footer-terminal {
    font-size: 0.58rem;
  }

  .section {
    padding: 48px 16px;
  }

  .section-heading {
    margin-bottom: 18px;
  }

  h2 {
    margin-bottom: 8px;
    font-size: clamp(1.5rem, 6.5vw, 2rem);
    line-height: 0.96;
  }

  h3 {
    font-size: clamp(0.85rem, 3.5vw, 1rem);
  }

  .section-heading p:not(.section-kicker),
  .about-copy p:not(.section-kicker),
  .contact-panel p:not(.section-kicker) {
    font-size: 0.82rem;
    line-height: 1.45;
  }

  .section-kicker,
  .card-index {
    margin-bottom: 8px;
    font-size: 0.6rem;
  }

  .project-grid {
    gap: 14px;
  }

  .project-card,
  .skill-panel,
  .timeline article,
  .contact-panel {
    box-shadow: var(--shadow-soft);
    transform: none;
  }

  .media-frame {
    aspect-ratio: 16 / 9;
  }

  .card-body,
  .timeline article {
    padding: 14px;
  }

  .card-body p:not(.card-index) {
    font-size: 0.78rem;
    line-height: 1.4;
  }

  .tag-list {
    gap: 5px;
    margin: 10px 0;
  }

  .tag-list li {
    padding: 4px 6px;
    font-size: 0.6rem;
  }

  .project-links {
    gap: 8px 12px;
  }

  .text-link,
  .project-note {
    font-size: 0.68rem;
  }

  .timeline {
    gap: 10px;
  }

  .timeline article {
    padding: 14px 14px 14px 18px;
  }

  .timeline span {
    font-size: 0.6rem;
    margin-bottom: 6px;
  }

  .timeline h3 {
    font-size: 0.88rem;
    margin-bottom: 4px;
  }

  .timeline p {
    font-size: 0.75rem;
    line-height: 1.4;
  }

  .contact-panel {
    gap: 16px;
    padding: 18px;
  }

  .contact-panel h2 {
    font-size: 1.4rem;
  }

  .contact-panel p {
    font-size: 0.78rem;
  }

  .contact-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .contact-actions .btn {
    min-height: 36px;
    font-size: 0.62rem;
  }

  .contact-actions .btn:first-child,
  .contact-actions .btn:last-child {
    grid-column: 1 / -1;
  }

  .about-copy {
    position: static;
  }

  .about-copy h2 {
    font-size: clamp(1.4rem, 6vw, 1.8rem);
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .brand-word {
    max-width: 104px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .site-nav {
    max-width: calc(100vw - 16px);
  }

  .hero-actions,
  .contact-actions {
    align-items: center;
  }

  .hero-content,
  .hero-copy,
  .hero-actions,
  .hero-metrics {
    width: 100%;
    max-width: calc(100vw - 32px);
  }

  .hero-copy {
    overflow-wrap: break-word;
  }

  .contact-actions .btn {
    width: 100%;
  }

  .hero-actions .btn {
    width: auto;
  }

  /* Keep 2 cols for non-featured cards even on small screens */
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  /* Compact card styling for 2-col mobile layout */
  .project-card:not(.project-featured) .card-body {
    padding: 12px 14px;
  }

  .project-card:not(.project-featured) .card-body p:not(.card-index) {
    display: none;
  }

  .project-card:not(.project-featured) .card-body h3 {
    font-size: 0.82rem;
    margin-bottom: 6px;
  }

  .project-card:not(.project-featured) .tag-list {
    margin: 8px 0;
    gap: 4px;
  }

  .project-card:not(.project-featured) .tag-list li {
    padding: 3px 5px;
    font-size: 0.55rem;
  }

  .project-card:not(.project-featured) .card-cta {
    font-size: 0.6rem;
    margin-top: 8px;
  }

  .project-card:not(.project-featured) .media-frame {
    aspect-ratio: 16 / 10;
  }

  .section {
    padding-top: 44px;
    padding-bottom: 44px;
  }

  /* Keep contact actions 2 cols on small mobile */
  .contact-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-actions .btn:first-child {
    grid-column: 1 / -1;
  }

  /* New components mobile */
  .project-overview {
    grid-template-columns: 1fr;
  }

  .overview-left {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    max-height: 220px;
  }

  .media-item {
    grid-template-columns: 120px 1fr;
    gap: 14px;
  }

  .media-item img {
    width: 120px;
    height: 80px;
  }

  .cert-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .cert-img-wrap img {
    height: 100px;
    padding: 8px;
  }

  .cert-body {
    padding: 10px 10px 14px;
  }

  .cert-issuer {
    font-size: 0.55rem;
  }

  .cert-name {
    font-size: 0.78rem;
  }

  .cert-id {
    font-size: 0.6rem;
  }
}

/* ═══════════════════════════════════════════════════════════════
   PREMIUM MOBILE UPGRADE — all new styles below
   ═══════════════════════════════════════════════════════════════ */

/* ── Hamburger button (mobile only) ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  background: rgba(14, 14, 20, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  z-index: 70;
  flex-shrink: 0;
  transition: all 300ms ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-hamburger:hover,
.nav-hamburger:active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.hamburger-line {
  display: block;
  width: 18px;
  height: 1.5px;
  background: #fff;
  border-radius: 2px;
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1),
              opacity 300ms ease,
              width 300ms ease;
  transform-origin: center;
}

/* Animated X when open */
.nav-hamburger[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav-hamburger[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
  width: 0;
}
.nav-hamburger[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ── Backdrop ── */
.mobile-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 149;
  background: rgba(2, 3, 8, 0.72);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms ease;
}

.mobile-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Drawer panel ── */
.mobile-drawer {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 150;
  width: 165px;
  height: auto;
  display: flex;
  flex-direction: column;
  padding: 6px;
  background: rgba(14, 14, 20, 0.65);
  backdrop-filter: blur(32px) saturate(1.2);
  -webkit-backdrop-filter: blur(32px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  box-shadow: 
    0 40px 80px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: scale(0.9) translateY(-10px);
  transform-origin: top right;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 400ms cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.mobile-drawer.is-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 6px;
  border-bottom: none;
}

.drawer-title {
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.drawer-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 250ms ease;
}

.drawer-close:hover,
.drawer-close:active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: scale(1.05);
}

.drawer-links {
  display: flex;
  flex-direction: column;
  padding: 0 6px;
  gap: 4px;
}

.drawer-links a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 12px;
  transition: all 250ms ease;
}

.drawer-link-num {
  color: rgba(255, 255, 255, 0.3);
  font-family: var(--font-body);
  font-size: 0.55rem;
  font-weight: 600;
  min-width: 12px;
  transition: color 250ms ease;
}

.drawer-links a:active {
  color: #fff;
  transform: scale(0.985);
}

@media (hover: hover) and (pointer: fine) {
  .drawer-links a:hover,
  .drawer-links a:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    padding-left: 20px;
  }

  .drawer-links a:hover .drawer-link-num,
  .drawer-links a:focus-visible .drawer-link-num {
    color: var(--neon);
  }
}

.drawer-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 10px 4px 4px;
  padding: 10px 12px;
  background: rgba(0, 255, 65, 0.08);
  border: 1px solid rgba(0, 255, 65, 0.15);
  border-radius: 100px;
  color: var(--neon);
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-cta:hover,
.drawer-cta:active {
  background: var(--neon);
  color: #000;
  box-shadow: 0 8px 24px rgba(0, 255, 65, 0.25);
  transform: translateY(-2px);
}

/* ── Safe area insets (iPhone notch / home bar) ── */
.mobile-drawer {
  padding-bottom: env(safe-area-inset-bottom);
}

.site-footer {
  padding-bottom: env(safe-area-inset-bottom);
}

/* ══════════════════════════════════════════════════════════
   MOBILE BREAKPOINT UPGRADES
   ══════════════════════════════════════════════════════════ */

@media (max-width: 780px) {

  /* Show hamburger, hide desktop resume CTA */
  .nav-hamburger {
    display: flex;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
  }

  /* Hide the old desktop nav CTA */
  .nav-cta-desktop,
  .nav-cta.nav-cta-desktop {
    display: none !important;
  }

  /* Show the backdrop when needed */
  .mobile-drawer-backdrop {
    display: block;
  }

  /* ── Hero section ── */
  .hero {
    padding: 0 20px 36px;
    align-items: flex-end;
    justify-content: flex-start;
  }

  .hero-content {
    width: 100%;
    max-width: 100%;
    padding-top: 0;
    padding-bottom: 0;
  }

  /* h1 scaled properly — no overflow */
  h1 {
    font-size: clamp(2.6rem, 11.5vw, 3.4rem);
    line-height: 0.92;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
  }

  /* Hero scroll indicator — shown on mobile as well */
  .hero-scroll {
    display: flex;
    margin-top: 16px;
  }

  /* ── Touch targets: minimum 44px ── */
  .btn,
  .nav-cta,
  .panel-back,
  .back-to-top,
  .text-link,
  .drawer-links a,
  .project-card,
  [data-open-project] {
    -webkit-tap-highlight-color: transparent;
  }

  .btn-lg {
    min-height: 52px;
    padding: 0 24px;
    font-size: 0.85rem;
  }

  .btn {
    min-height: 44px;
    padding: 0 14px;
  }

  .panel-back {
    min-height: 44px;
  }

  .back-to-top {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 16px;
  }

  /* ── Project cards: premium active state on touch ── */
  [data-open-project]:active {
    border-color: rgba(0, 255, 65, 0.5);
    box-shadow: 0 0 28px rgba(0, 255, 65, 0.18);
    transform: scale(0.985);
    transition: transform 100ms ease;
  }

  /* Featured card: proper image height on mobile */
  .project-featured .media-frame {
    aspect-ratio: 16 / 8;
  }

  /* card-cta as a proper pill chip */
  .card-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid rgba(0, 255, 65, 0.35);
    border-radius: 20px;
    background: rgba(0, 255, 65, 0.06);
    font-size: 0.62rem;
    margin-top: 10px;
  }

  /* ── Certificates: 2-col with first card full-width ── */
  .cert-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .cert-card:first-child {
    grid-column: 1 / -1;
  }

  .cert-card:first-child .cert-img-wrap img {
    height: 160px;
  }

  .cert-img-wrap img {
    height: 120px;
    padding: 12px;
  }

  .cert-body {
    padding: 12px 14px 16px;
  }

  .cert-name {
    font-size: 0.9rem;
  }

  .cert-issuer {
    font-size: 0.6rem;
  }

  /* ── Timeline: fix accent bar visibility ── */
  .timeline article {
    padding-left: 22px;
  }

  .timeline article::before {
    left: 0;
    width: 3px;
    border-radius: 0 2px 2px 0;
  }

  .timeline article::after {
    left: -3px;
    top: 20px;
    width: 10px;
    height: 10px;
  }

  /* ── Contact: premium treatment ── */
  .contact-panel {
    padding: 20px 16px;
    gap: 16px;
    border-radius: 12px;
    background:
      linear-gradient(135deg, rgba(255, 10, 91, 0.12) 0%, rgba(53, 216, 230, 0.06) 100%),
      rgba(14, 13, 21, 0.96);
    border-color: rgba(255, 10, 91, 0.22);
  }

  .contact-actions .btn-primary.btn-lg {
    grid-column: 1 / -1;
    min-height: 44px;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
  }

  .contact-actions .btn-ghost {
    min-height: 36px;
    font-size: 0.65rem;
    padding: 6px 12px;
  }

  /* ── Panel header on mobile ── */
  .panel-header {
    grid-template-columns: 1fr;
    padding: 12px 18px 14px;
    gap: 10px;
  }

  .panel-links {
    gap: 8px;
    flex-wrap: nowrap;
  }

  .text-link {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 4px 0;
  }
}

@media (max-width: 520px) {

  /* Hero: full bleed on tiny screens */
  .hero {
    padding: 0 16px 28px;
  }

  h1 {
    font-size: clamp(2.2rem, 12.5vw, 3rem);
  }

  /* Project featured: even more compact image */
  .project-featured .media-frame {
    aspect-ratio: 16 / 7;
  }

  /* Cert grid: 2-col stays, first full-width stays */
  .cert-card:first-child .cert-img-wrap img {
    height: 130px;
  }

  /* Media items in panel: stack on tiny screens */
  .media-item {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .media-item img {
    width: 100%;
    height: 160px;
  }

  /* Drawer slightly wider on tiny screens */
  .mobile-drawer {
    width: min(90vw, 320px);
  }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE CINEMATIC UPGRADE v2 — all scoped to ≤780px / coarse
   ═══════════════════════════════════════════════════════════════ */

/* Hide loader on desktop — shown only by JS on mobile */
#mobile-loader {
  display: none;
}

/* Touch canvas hidden on desktop */
#touch-canvas {
  display: none;
}

@media (max-width: 780px) {

  /* ── Cinematic Loader ── */
  #mobile-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #c91312;
    overflow: hidden;
  }

  #mobile-loader.loader-hidden {
    pointer-events: none;
    visibility: hidden;
  }

  .loader-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .loader-ak-mark {
    display: grid;
    place-items: center;
    width: 80px;
    height: 60px;
    background: #ffffff;
    color: #c91312;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    clip-path: polygon(0 12%, 88% 0, 100% 80%, 10% 100%);
    transform: scale(0.4);
    opacity: 0;
    will-change: transform, opacity;
    box-shadow: 0 0 40px rgba(255,255,255,0.5), 0 0 80px rgba(255,255,255,0.2);
  }

  .loader-jp {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    min-height: 1.6em;
    opacity: 0;
  }

  .loader-jp-cursor {
    display: inline-block;
    color: rgba(255, 255, 255, 0.6);
    animation: blink-terminal 0.6s steps(1) infinite;
  }

  /* Dark blade that sweeps across the loader */
  .loader-blade {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: var(--bg);
    clip-path: polygon(110% 0, 120% 0, 120% 100%, 110% 100%);
    will-change: clip-path;
  }


  /* ── Touch ember canvas ── */
  #touch-canvas {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 9990;
    pointer-events: none;
  }

  /* ── Skill bar count label ── */
  .skill-bar {
    position: relative;
    margin-top: 14px;
  }

  .skill-pct-label {
    position: absolute;
    right: 0;
    top: -20px;
    color: var(--neon);
    font-family: var(--font-heading);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    opacity: 0;
    transition: opacity 300ms ease;
  }

  .skill-panel.is-counted .skill-pct-label {
    opacity: 1;
  }

  /* ── Terminal Contact heading ── */
  #terminal-heading {
    display: inline;
  }

  .term-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--neon);
    margin-left: 3px;
    vertical-align: text-bottom;
    opacity: 0;
    animation: blink-terminal 0.8s steps(1) infinite;
  }

  .term-cursor.is-active {
    opacity: 1;
  }


  /* ── Tap ripple ring ── */
  .tap-ripple {
    position: fixed;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--hot);
    pointer-events: none;
    z-index: 9989;
    transform: translate(-50%, -50%) scale(0);
    animation: tap-ripple-anim 0.5s ease-out forwards;
  }

  @keyframes tap-ripple-anim {
    0%   { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
  }

  /* ── Button tap spring pulse ── */
  .btn:active,
  .drawer-cta:active {
    animation: btn-spring 0.28s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  }

  @keyframes btn-spring {
    0%   { transform: scale(1); }
    30%  { transform: scale(0.93); }
    70%  { transform: scale(1.05); }
    100% { transform: scale(1); }
  }

}

@media (pointer: coarse) {
  /* Touch-active card glow */
  .project-card:active,
  [data-open-project]:active {
    border-color: rgba(255, 10, 91, 0.65) !important;
    box-shadow: 0 0 36px rgba(255, 10, 91, 0.28), inset 0 0 24px rgba(255, 10, 91, 0.08) !important;
    transition: border-color 80ms ease, box-shadow 80ms ease !important;
  }
}

@media (max-width: 780px) {
  body {
    font-size: 14px;
  }

  .section {
    padding: 44px 16px;
  }

  h1 {
    font-size: clamp(2.05rem, 9vw, 2.45rem);
    line-height: 0.96;
    letter-spacing: 0;
  }

  h2 {
    font-size: clamp(1.35rem, 5.6vw, 1.72rem);
    line-height: 1;
  }

  h3 {
    font-size: clamp(0.88rem, 3.8vw, 1.02rem);
    line-height: 1.08;
  }

  p,
  .hero-copy,
  .section-heading p:not(.section-kicker),
  .about-copy p:not(.section-kicker),
  .contact-panel p:not(.section-kicker),
  .card-body p:not(.card-index),
  .timeline p,
  .skill-panel p,
  .media-info p {
    font-size: 0.8rem;
    line-height: 1.5;
  }

  .kicker,
  .section-kicker,
  .card-index,
  .media-list-label {
    font-size: 0.54rem;
    letter-spacing: 0.16em;
  }

  .btn,
  .btn-lg,
  .text-link,
  .project-note,
  .card-cta,
  .panel-back,
  .panel-links .text-link {
    font-size: 0.58rem;
    letter-spacing: 0.08em;
  }

  .btn-lg {
    min-height: 42px;
    padding: 0 16px;
  }

  .tag-list li {
    font-size: 0.55rem;
    padding: 4px 6px;
  }

  .panel-inner {
    padding: 0 16px 56px;
  }

  .panel-header {
    margin: 0 -16px;
    padding: 10px 16px 12px;
    gap: 8px;
  }

  .panel-back {
    min-height: 38px;
    padding: 0 13px;
  }

  .panel-links {
    gap: 7px;
  }

  .panel-links .text-link {
    min-height: 31px;
    padding: 0 8px;
  }

  .panel-hero {
    gap: 22px;
    padding: 22px 0 30px;
  }

  .panel-hero-img {
    max-height: 218px;
    padding: 12px;
    border-radius: 18px;
  }

  .panel-hero-info h2 {
    margin: 8px 0 14px;
    font-size: clamp(1.58rem, 6.2vw, 2rem);
    line-height: 1.05;
  }

  .panel-hero-info p {
    font-size: 0.82rem;
    line-height: 1.58;
  }

  .panel-hero-info p + p {
    margin-top: 12px;
  }

  .panel-proof {
    margin: 18px 0 8px;
  }

  .panel-proof div {
    grid-template-columns: 74px minmax(0, 1fr);
    padding: 11px 12px;
  }

  .panel-proof span {
    font-size: 0.52rem;
  }

  .panel-proof strong {
    font-size: 0.74rem;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: clamp(1.9rem, 8.5vw, 2.2rem);
  }

  .hero {
    padding: 0 16px 24px;
  }

  .panel-hero-info h2 {
    font-size: clamp(1.48rem, 7vw, 1.82rem);
  }

  .panel-hero-info p {
    font-size: 0.8rem;
  }
}
