/* ==========================================================================
   Franco Gneri — Portfolio
   Design system: dark premium glass + game HUD accents
   ========================================================================== */

:root {
  /* Palette */
  --bg: hsl(230 30% 4%);
  --bg-2: hsl(230 28% 7%);
  --surface: hsl(228 30% 10% / 0.55);
  --surface-strong: hsl(228 30% 12% / 0.8);
  --line: hsl(210 40% 80% / 0.09);
  --line-strong: hsl(190 100% 70% / 0.35);

  --text: hsl(220 30% 94%);
  --text-dim: hsl(220 15% 68%);
  --text-faint: hsl(220 12% 48%);

  --cyan: hsl(188 100% 58%);
  --cyan-soft: hsl(188 100% 58% / 0.15);
  --magenta: hsl(318 90% 64%);
  --magenta-soft: hsl(318 90% 64% / 0.15);
  --amber: hsl(40 100% 62%);
  --green: hsl(150 80% 55%);
  --red: hsl(355 90% 64%);

  --grad: linear-gradient(110deg, var(--cyan) 0%, hsl(250 95% 72%) 50%, var(--magenta) 100%);

  /* Type */
  --f-display: "Space Grotesk", system-ui, sans-serif;
  --f-body: "Inter", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Layout */
  --max: 1200px;
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--f-display); margin: 0; line-height: 1.1; letter-spacing: -0.02em; }
p { margin: 0; }

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

/* ---------- Global atmosphere ---------- */

.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}
.bg-orbs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  animation: drift 26s ease-in-out infinite alternate;
}
.bg-orbs span:nth-child(1) { width: 520px; height: 520px; background: hsl(188 100% 45%); top: -160px; left: -120px; }
.bg-orbs span:nth-child(2) { width: 600px; height: 600px; background: hsl(318 85% 45%); bottom: -220px; right: -160px; animation-delay: -8s; opacity: 0.25; }
.bg-orbs span:nth-child(3) { width: 380px; height: 380px; background: hsl(250 90% 55%); top: 45%; left: 55%; animation-delay: -14s; opacity: 0.18; }

@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(80px, 60px) scale(1.15); }
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    hsl(0 0% 0% / 0.18) 3px,
    transparent 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.5;
}

/* Surface Raycast & Border Illumination */
.raycast-card {
  position: relative;
  --mouse-x: -999px;
  --mouse-y: -999px;
  --raycast-opacity: 0;
}

.raycast-border {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    380px circle at var(--mouse-x) var(--mouse-y),
    hsl(188 100% 65% / 0.95) 0%,
    hsl(318 90% 64% / 0.5) 30%,
    transparent 65%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: var(--raycast-opacity, 0);
  transition: opacity 0.35s ease;
  z-index: 5;
}

.raycast-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    480px circle at var(--mouse-x) var(--mouse-y),
    hsl(188 100% 60% / 0.08) 0%,
    transparent 65%
  );
  pointer-events: none;
  opacity: var(--raycast-opacity, 0);
  transition: opacity 0.35s ease;
  z-index: 1;
}

/* ---------- Utilities ---------- */

.container { width: min(var(--max), 100% - 48px); margin-inline: auto; }

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

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.section { padding: 130px 0; position: relative; }

.section-head { max-width: 720px; margin-bottom: 64px; }
.section-head h2 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  margin: 16px 0 18px;
}
.section-head p { color: var(--text-dim); font-size: 1.1rem; }

/* HUD frame: corner brackets */
.hud {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  transform-style: preserve-3d;
  will-change: transform;
}
.hud::before,
.hud::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--cyan);
  opacity: 0.7;
  transition: all 0.4s var(--ease);
  pointer-events: none;
}
.hud::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: var(--radius); }
.hud::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: var(--radius); }

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

/* Buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  font-family: var(--f-mono);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--cyan); box-shadow: 0 0 28px var(--cyan-soft); }
.btn-primary {
  background: var(--grad);
  border-color: transparent;
  color: hsl(230 40% 6%);
  font-weight: 600;
}
.btn-primary:hover { box-shadow: 0 10px 40px hsl(250 95% 65% / 0.4); }
.btn svg { width: 16px; height: 16px; }

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 18px 0;
  transition: background 0.4s, padding 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  padding: 12px 0;
  background: hsl(230 30% 5% / 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: var(--line);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--f-mono);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
}
.logo-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0;
  position: relative;
  background: hsl(188 100% 58% / 0.06);
}
.logo-mark::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 13px;
  border: 1px dashed hsl(188 100% 58% / 0.3);
  animation: spin 18s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  position: relative;
  padding: 8px 14px;
  font-size: 0.9rem;
  color: var(--text-dim);
  border-radius: 8px;
  transition: color 0.25s, background 0.25s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); background: hsl(0 0% 100% / 0.04); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  transform: translateX(-50%);
}

.lang-toggle {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: hsl(0 0% 100% / 0.03);
  font-family: var(--f-mono);
  font-size: 0.75rem;
}
.lang-toggle button {
  border: 0;
  background: transparent;
  color: var(--text-faint);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  letter-spacing: 0.1em;
  transition: all 0.3s var(--ease);
}
.lang-toggle button[aria-pressed="true"] { background: var(--cyan); color: var(--bg); font-weight: 600; }

.nav-burger { display: none; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 130px 0 90px;
  overflow: hidden;
}

/* Perspective grid floor */
.hero-grid {
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: -10%;
  height: 60%;
  z-index: -1;
  background-image:
    linear-gradient(hsl(188 100% 60% / 0.22) 1px, transparent 1px),
    linear-gradient(90deg, hsl(188 100% 60% / 0.22) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(500px) rotateX(62deg);
  transform-origin: top center;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 40%, #000 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 40%, #000 70%, transparent 100%);
  animation: grid-move 4s linear infinite;
}
@keyframes grid-move { to { background-position: 0 64px; } }

.hero .container {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  align-items: center;
  gap: 60px;
}

.hero h1 {
  font-size: clamp(3.2rem, 9vw, 7.2rem);
  font-weight: 700;
  margin: 22px 0 18px;
  letter-spacing: -0.045em;
  line-height: 0.95;
}
.hero h1 .line { display: block; }
.hero h1 .glitch {
  position: relative;
  display: inline-block;
}
.hero h1 .glitch::before,
.hero h1 .glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.hero h1 .glitch::before {
  color: #00ffff;
  mix-blend-mode: screen;
  text-shadow: -2px 0 #00ffff, -4px 0 rgba(0, 255, 255, 0.4);
}

.hero h1 .glitch::after {
  color: #ff0055;
  mix-blend-mode: screen;
  text-shadow: 2px 0 #ff0055, 4px 0 rgba(255, 0, 85, 0.4);
}

.hero h1:hover .glitch {
  animation: glitch-jitter 0.3s infinite;
}

.hero h1:hover .glitch::before {
  opacity: 0.95;
  animation: glitch-slice-cyan 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

.hero h1:hover .glitch::after {
  opacity: 0.95;
  animation: glitch-slice-magenta 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) reverse both infinite;
}

@keyframes glitch-jitter {
  0% { transform: none; }
  20% { transform: skewX(-4deg) scaleY(1.02); }
  40% { transform: skewX(3deg) translate(-2px, 1px); }
  60% { transform: skewX(-2deg) translate(2px, -1px); }
  80% { transform: skewX(5deg) scaleX(1.02); }
  100% { transform: none; }
}

@keyframes glitch-slice-cyan {
  0% {
    clip-path: polygon(0 2%, 100% 2%, 100% 18%, 0 18%);
    transform: translate(-6px, -1px) skewX(-8deg);
  }
  15% {
    clip-path: polygon(0 35%, 100% 35%, 100% 48%, 0 48%);
    transform: translate(5px, 2px) skewX(6deg);
  }
  30% {
    clip-path: polygon(0 62%, 100% 62%, 100% 74%, 0 74%);
    transform: translate(-8px, -1px) skewX(-12deg);
  }
  45% {
    clip-path: polygon(0 12%, 100% 12%, 100% 28%, 0 28%);
    transform: translate(7px, 1px) skewX(10deg);
  }
  60% {
    clip-path: polygon(0 80%, 100% 80%, 100% 95%, 0 95%);
    transform: translate(-4px, 2px) skewX(-6deg);
  }
  75% {
    clip-path: polygon(0 45%, 100% 45%, 100% 58%, 0 58%);
    transform: translate(6px, -2px) skewX(8deg);
  }
  90% {
    clip-path: polygon(0 8%, 100% 8%, 100% 22%, 0 22%);
    transform: translate(-5px, 1px) skewX(-4deg);
  }
  100% {
    clip-path: polygon(0 2%, 100% 2%, 100% 18%, 0 18%);
    transform: translate(-6px, -1px) skewX(-8deg);
  }
}

@keyframes glitch-slice-magenta {
  0% {
    clip-path: polygon(0 50%, 100% 50%, 100% 65%, 0 65%);
    transform: translate(6px, 1px) skewX(8deg);
  }
  18% {
    clip-path: polygon(0 15%, 100% 15%, 100% 32%, 0 32%);
    transform: translate(-7px, -2px) skewX(-10deg);
  }
  35% {
    clip-path: polygon(0 75%, 100% 75%, 100% 88%, 0 88%);
    transform: translate(8px, 1px) skewX(12deg);
  }
  52% {
    clip-path: polygon(0 5%, 100% 5%, 100% 18%, 0 18%);
    transform: translate(-5px, 2px) skewX(-8deg);
  }
  70% {
    clip-path: polygon(0 38%, 100% 38%, 100% 52%, 0 52%);
    transform: translate(7px, -1px) skewX(6deg);
  }
  85% {
    clip-path: polygon(0 85%, 100% 85%, 100% 98%, 0 98%);
    transform: translate(-6px, 1px) skewX(-12deg);
  }
  100% {
    clip-path: polygon(0 50%, 100% 50%, 100% 65%, 0 65%);
    transform: translate(6px, 1px) skewX(8deg);
  }
}

.hero-role {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  font-family: var(--f-display);
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  font-weight: 500;
  margin-bottom: 22px;
}
.hero-role .sep { width: 6px; height: 6px; border-radius: 50%; background: var(--magenta); box-shadow: 0 0 10px var(--magenta); }

.hero-tagline {
  max-width: 560px;
  font-size: 1.15rem;
  color: var(--text-dim);
  margin-bottom: 36px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 56px; }

.stats { display: flex; flex-wrap: wrap; gap: 14px; }
.stat {
  padding: 16px 22px;
  min-width: 140px;
}
.stat-num {
  font-family: var(--f-display);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
}
.stat-label {
  margin-top: 6px;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* Hero HUD panel */
.hud-panel {
  padding: 28px;
  font-family: var(--f-mono);
  font-size: 0.82rem;
  animation: float 7s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-12px); } }

.hud-panel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-faint);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
}
.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.3; } }

.radar {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  max-width: 300px;
  margin: 0 auto 24px;
  border-radius: 50%;
  border: 1px solid hsl(188 100% 60% / 0.35);
  background:
    radial-gradient(circle, transparent 32%, hsl(188 100% 60% / 0.18) 32.5%, transparent 33%),
    radial-gradient(circle, transparent 65%, hsl(188 100% 60% / 0.18) 65.5%, transparent 66%),
    linear-gradient(hsl(188 100% 60% / 0.14), hsl(188 100% 60% / 0.14)) center / 1px 100% no-repeat,
    linear-gradient(90deg, hsl(188 100% 60% / 0.14), hsl(188 100% 60% / 0.14)) center / 100% 1px no-repeat,
    radial-gradient(circle, hsl(188 100% 50% / 0.08), transparent 70%);
  overflow: hidden;
}
.radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, hsl(188 100% 60% / 0.45), transparent 22%);
  animation: spin 4s linear infinite;
}
.radar-blip {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 12px var(--magenta);
  animation: pulse 2s ease-in-out infinite;
}
.radar-blip:nth-child(2) { top: 26%; left: 62%; }
.radar-blip:nth-child(3) { top: 64%; left: 30%; animation-delay: -0.7s; background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.radar-blip:nth-child(4) { top: 58%; left: 72%; animation-delay: -1.3s; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.radar-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 2px solid var(--text);
}

.hud-rows { display: grid; gap: 10px; }
.hud-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}
.hud-row:last-child { border-bottom: 0; padding-bottom: 0; }
.hud-row span:first-child { color: var(--text-faint); letter-spacing: 0.1em; }
.hud-row span:last-child { color: var(--text); text-align: right; }
.hud-row .accent { color: var(--cyan) !important; }

.xp-bar {
  margin-top: 18px;
  height: 6px;
  border-radius: 99px;
  background: hsl(0 0% 100% / 0.06);
  overflow: hidden;
}
.xp-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--grad);
  box-shadow: 0 0 12px hsl(250 95% 65% / 0.6);
  transition: width 2.2s var(--ease) 0.6s;
}
.loaded .xp-bar span { width: 100%; }

.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.scroll-hint i {
  width: 1px;
  height: 40px;
  background: linear-gradient(var(--cyan), transparent);
  animation: scroll-line 2s var(--ease) infinite;
  transform-origin: top;
}
@keyframes scroll-line {
  0% { transform: scaleY(0); }
  50% { transform: scaleY(1); }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ---------- Marquee ---------- */

.marquee {
  position: relative;
  padding: 26px 0;
  border-block: 1px solid var(--line);
  background: hsl(230 30% 6% / 0.6);
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
  display: flex;
  gap: 56px;
  width: max-content;
  animation: marquee 45s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  display: inline-flex;
  align-items: center;
  gap: 56px;
  font-family: var(--f-display);
  font-size: 1.5rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-faint);
  transition: color 0.3s;
}
.marquee-track span:hover { color: var(--text); }
.marquee-track span::after {
  content: "";
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  border: 1px solid var(--cyan);
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Expertise ---------- */

.pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.pillar {
  padding: 32px 26px;
  transition: transform 0.5s var(--ease), border-color 0.4s, box-shadow 0.4s;
  overflow: hidden;
}
.pillar:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  box-shadow: 0 20px 60px -20px hsl(188 100% 50% / 0.35);
}
.pillar:hover::before,
.pillar:hover::after { width: 30px; height: 30px; opacity: 1; }
.pillar-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  margin-bottom: 22px;
  background: var(--cyan-soft);
  color: var(--cyan);
  border: 1px solid hsl(188 100% 60% / 0.3);
}
.pillar:nth-child(2) .pillar-icon { background: var(--magenta-soft); color: var(--magenta); border-color: hsl(318 90% 64% / 0.3); }
.pillar:nth-child(3) .pillar-icon { background: hsl(40 100% 62% / 0.12); color: var(--amber); border-color: hsl(40 100% 62% / 0.3); }
.pillar:nth-child(4) .pillar-icon { background: hsl(150 80% 55% / 0.12); color: var(--green); border-color: hsl(150 80% 55% / 0.3); }
.pillar-icon svg { width: 26px; height: 26px; }
.pillar .idx {
  position: absolute;
  top: 22px;
  right: 24px;
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
}
.pillar h3 { font-size: 1.3rem; margin-bottom: 12px; }
.pillar p { color: var(--text-dim); font-size: 0.95rem; }

/* ---------- Agentic ---------- */

.agentic {
  background:
    radial-gradient(ellipse at 80% 20%, hsl(318 90% 50% / 0.1), transparent 55%),
    radial-gradient(ellipse at 10% 90%, hsl(188 100% 50% / 0.08), transparent 55%);
}
.agentic-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 56px;
  align-items: start;
}
.agentic-points { display: grid; gap: 16px; }
.a-point {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  padding: 22px 24px;
  transition: border-color 0.4s, transform 0.4s var(--ease), background 0.4s;
}
.a-point:hover { border-color: hsl(318 90% 64% / 0.4); transform: translateX(6px); background: var(--surface-strong); }
.a-point::before, .a-point::after { border-color: var(--magenta); }
.a-point .num {
  font-family: var(--f-mono);
  font-size: 0.8rem;
  color: var(--magenta);
  padding-top: 4px;
}
.a-point h3 { font-size: 1.12rem; margin-bottom: 6px; }
.a-point p { color: var(--text-dim); font-size: 0.95rem; }

/* Terminal */
.terminal {
  position: sticky;
  top: 110px;
  overflow: hidden;
  background: hsl(230 35% 5% / 0.85);
  box-shadow: 0 40px 100px -30px hsl(318 90% 50% / 0.35), 0 0 0 1px hsl(318 90% 64% / 0.12);
}
.terminal::before, .terminal::after { border-color: var(--magenta); }
.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: hsl(0 0% 100% / 0.02);
}
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: hsl(0 0% 100% / 0.12); }
.term-bar i:nth-child(1) { background: hsl(355 80% 60%); }
.term-bar i:nth-child(2) { background: hsl(40 90% 58%); }
.term-bar i:nth-child(3) { background: hsl(140 60% 50%); }
.term-bar span {
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  letter-spacing: 0.1em;
}
.term-body {
  padding: 22px 22px 26px;
  min-height: 380px;
  font-family: var(--f-mono);
  font-size: 0.84rem;
  line-height: 1.85;
  white-space: pre-wrap;
  color: var(--text-dim);
}
.term-body .p { color: var(--magenta); }
.term-body .c { color: var(--cyan); }
.term-body .ok { color: var(--green); }
.term-body .no { color: var(--red); }
.term-body .w { color: var(--amber); }
.term-body .t { color: var(--text); }
.term-body .caret {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  vertical-align: -2px;
  background: var(--cyan);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.term-note {
  padding: 0 22px 18px;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  letter-spacing: 0.06em;
}

/* ---------- Case Studies (Featured Works) ---------- */

.case-studies {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.case-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.45s var(--ease), border-color 0.4s, box-shadow 0.4s;
}
.case-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  box-shadow: 0 28px 70px -20px hsl(188 100% 50% / 0.35);
}
.case-media {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  background: hsl(230 30% 8%);
  border-bottom: 1px solid var(--line);
}
.case-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.65s var(--ease), filter 0.5s;
  filter: saturate(95%) brightness(90%);
}
.case-card:hover .case-media img {
  transform: scale(1.05);
  filter: saturate(115%) brightness(100%);
}
.case-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, hsl(230 30% 6% / 0.95) 0%, transparent 50%);
  pointer-events: none;
}
.case-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  background: hsl(230 35% 6% / 0.85);
  border: 1px solid var(--line-strong);
  color: var(--cyan);
  backdrop-filter: blur(8px);
}
.case-engine {
  position: absolute;
  top: 14px;
  right: 14px;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  background: hsl(230 35% 6% / 0.85);
  border: 1px solid var(--line);
  color: var(--text-dim);
  backdrop-filter: blur(8px);
}
.case-body {
  padding: 26px 28px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.case-header {
  margin-bottom: 16px;
}
.case-studio {
  font-family: var(--f-mono);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: block;
  margin-bottom: 4px;
}
.case-title {
  font-size: 1.65rem;
  color: var(--text);
  margin-bottom: 6px;
}
.case-role {
  font-family: var(--f-display);
  font-size: 0.96rem;
  color: var(--cyan);
  font-weight: 500;
}
.case-grid {
  display: grid;
  gap: 12px;
  margin: 14px 0 20px;
  flex: 1;
}
.case-block {
  padding: 12px 14px;
  border-radius: 8px;
  background: hsl(0 0% 100% / 0.025);
  border-left: 2px solid var(--line);
}
.case-block.challenge { border-left-color: var(--amber); }
.case-block.solution { border-left-color: var(--cyan); }
.case-block.takeaway { border-left-color: var(--magenta); background: hsl(318 90% 64% / 0.04); }
.case-block-label {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: block;
  margin-bottom: 4px;
}
.case-block.challenge .case-block-label { color: var(--amber); }
.case-block.solution .case-block-label { color: var(--cyan); }
.case-block.takeaway .case-block-label { color: var(--magenta); }
.case-block p {
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.55;
}
.case-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

@media (max-width: 960px) {
  .case-studies { grid-template-columns: 1fr; }
}

.timeline { position: relative; padding-left: 64px; }
.timeline-rail {
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
  border-radius: 2px;
}
.timeline-progress {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 0;
  background: linear-gradient(var(--cyan), var(--magenta));
  box-shadow: 0 0 14px var(--cyan);
  border-radius: 2px;
}

.era { position: relative; margin-bottom: 72px; }
.era:last-child { margin-bottom: 0; }
.era-node {
  position: absolute;
  left: -55px;
  top: 6px;
  width: 20px;
  height: 20px;
  transform: rotate(45deg);
  border: 2px solid var(--text-faint);
  background: var(--bg);
  transition: all 0.5s var(--ease);
}
.era.active .era-node {
  border-color: var(--cyan);
  background: var(--cyan);
  box-shadow: 0 0 0 6px hsl(188 100% 58% / 0.15), 0 0 24px var(--cyan);
}

.era-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 22px;
}
.era-head h3 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
.era-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 0.95rem;
}
.era-meta .role { color: var(--text); font-weight: 500; }
.era-period {
  font-family: var(--f-mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--cyan);
  padding: 6px 12px;
  border: 1px solid hsl(188 100% 60% / 0.3);
  border-radius: 999px;
  background: var(--cyan-soft);
  white-space: nowrap;
}
.era-period.now { color: var(--green); border-color: hsl(150 80% 55% / 0.35); background: hsl(150 80% 55% / 0.1); }
.era-period.now::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulse 1.6s infinite;
}

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.projects.single { grid-template-columns: 1fr; }
.proj {
  padding: 24px 24px 22px;
  transition: transform 0.45s var(--ease), border-color 0.4s, box-shadow 0.4s;
  transform-style: preserve-3d;
}
.proj:hover {
  border-color: var(--line-strong);
  box-shadow: 0 24px 60px -24px hsl(188 100% 50% / 0.35);
}
.proj:hover::before, .proj:hover::after { width: 26px; height: 26px; opacity: 1; }
.proj h4 {
  font-size: 1.18rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.proj h4 .badge {
  font-family: var(--f-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--amber);
  background: hsl(40 100% 62% / 0.1);
  border: 1px solid hsl(40 100% 62% / 0.3);
}
.proj .desc { color: var(--text-dim); font-size: 0.94rem; margin-bottom: 14px; }
.proj ul { display: grid; gap: 8px; margin-bottom: 16px; }
.proj li {
  position: relative;
  padding-left: 20px;
  font-size: 0.93rem;
  color: var(--text);
}
.proj li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  border: 1.5px solid var(--cyan);
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  padding: 4px 9px;
  border-radius: 6px;
  color: var(--text-dim);
  background: hsl(0 0% 100% / 0.04);
  border: 1px solid var(--line);
}
.tags span.hl { color: var(--magenta); border-color: hsl(318 90% 64% / 0.35); background: var(--magenta-soft); }

.client-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 16px;
}
.client-list span {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: hsl(0 0% 100% / 0.03);
}

/* ---------- Skills ---------- */

.skills-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.8fr;
  gap: 20px;
}
.skill-block { padding: 30px 28px; }
.skill-block h3 {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 22px;
}
.skill-block.k h3 { color: var(--magenta); }
.skill-block.l h3 { color: var(--amber); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 10px 16px;
  border-radius: 10px;
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 0.98rem;
  border: 1px solid var(--line);
  background: hsl(0 0% 100% / 0.03);
  transition: all 0.3s var(--ease);
  cursor: default;
}
.skill-block.e .chip { border-color: hsl(188 100% 60% / 0.25); }
.skill-block.e .chip:hover { background: var(--cyan-soft); border-color: var(--cyan); transform: translateY(-3px); box-shadow: 0 8px 24px -8px var(--cyan); }
.skill-block.k .chip:hover { background: var(--magenta-soft); border-color: var(--magenta); transform: translateY(-3px); }
.lang-item { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.lang-item:last-child { border-bottom: 0; }
.lang-item strong { display: block; font-family: var(--f-display); font-size: 1.1rem; }
.lang-item span { font-family: var(--f-mono); font-size: 0.78rem; color: var(--text-faint); letter-spacing: 0.08em; }

.edu {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.edu-item { padding: 24px 28px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.edu-item h4 { font-size: 1.1rem; }
.edu-item p { color: var(--text-dim); font-size: 0.92rem; }
.edu-item .era-period { font-size: 0.74rem; }

/* ---------- Contact ---------- */

.contact-card {
  padding: clamp(40px, 7vw, 80px);
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, hsl(250 95% 60% / 0.18), transparent 60%),
    var(--surface);
}
.contact-card h2 { font-size: clamp(2.2rem, 6vw, 4.2rem); margin: 18px 0; }
.contact-card > p { color: var(--text-dim); font-size: 1.1rem; max-width: 560px; margin: 0 auto 40px; }
.contact-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; }
.contact-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 26px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: hsl(0 0% 100% / 0.03);
  transition: all 0.35s var(--ease);
  text-align: left;
}
.contact-link:hover { border-color: var(--cyan); transform: translateY(-4px); box-shadow: 0 16px 40px -16px var(--cyan); }
.contact-link svg { width: 24px; height: 24px; color: var(--cyan); flex-shrink: 0; }
.contact-link small { display: block; font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); }
.contact-link span { font-weight: 500; }
.copy-btn {
  border: 0;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.copy-btn:hover { color: var(--cyan); background: var(--cyan-soft); }
.copy-btn svg { width: 16px; height: 16px; color: inherit; }

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 20px);
  padding: 12px 20px;
  border-radius: 10px;
  background: var(--surface-strong);
  border: 1px solid var(--green);
  color: var(--green);
  font-family: var(--f-mono);
  font-size: 0.82rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s var(--ease);
  z-index: 200;
  backdrop-filter: blur(10px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Footer ---------- */

.footer {
  padding: 40px 0;
  border-top: 1px solid var(--line);
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  letter-spacing: 0.06em;
}
.footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .skill-block.l { grid-column: 1 / -1; }
}

@media (max-width: 920px) {
  .hero .container { grid-template-columns: 1fr; }
  .hud-panel { max-width: 440px; }
  .agentic-grid { grid-template-columns: 1fr; }
  .terminal { position: relative; top: 0; }
  .scroll-hint { display: none; }

  .nav-burger {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    cursor: pointer;
  }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border-radius: var(--radius);
    background: hsl(230 30% 6% / 0.96);
    border: 1px solid var(--line);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.3s var(--ease);
  }
  .nav-links.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: 12px 14px; }
  .nav-right { display: flex; align-items: center; gap: 10px; }
}

@media (max-width: 640px) {
  .section { padding: 90px 0; }
  .pillars, .skills-grid, .edu { grid-template-columns: 1fr; }
  .timeline { padding-left: 34px; }
  .timeline-rail { left: 6px; }
  .era-node { left: -36px; width: 16px; height: 16px; }
  .projects { grid-template-columns: 1fr; }
  .stat { min-width: calc(50% - 7px); flex: 1; }
  .logo-text { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
