/* ============================================================
   VARIABLES
   ============================================================ */
:root {
  --bg: #04040a;
  --bg2: #070710;
  --bg3: #0c0c1a;
  --cyan: #0ff0fc;
  --purple: #b537f2;
  --pink: #ff2d78;
  --text: #e2e2f0;
  --text-mid: #9898b8;
  --text-dim: #555570;
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(15, 240, 252, 0.1);
  /* Apple's curve — used everywhere */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --trans: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --fh: 'Orbitron', sans-serif;
  --fb: 'Sora', sans-serif;
  --fm: 'JetBrains Mono', monospace;
  --max: 1200px;
}

/* ============================================================
   TEXT SELECTION
   ============================================================ */
::selection {
  background: rgba(15, 240, 252, 0.2);
  color: #0ff0fc;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 62px;
  font-feature-settings: "kern" 1, "liga" 1;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--fb);
  line-height: 1.7;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: var(--fh);
  line-height: 1.15;
  letter-spacing: 0.02em;
}

/* ============================================================
   SCROLL PROGRESS BAR
   ============================================================ */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  z-index: 1001;
  background: linear-gradient(90deg, var(--cyan), var(--purple), var(--pink));
  pointer-events: none;
  will-change: width;
}

/* ============================================================
   CURSOR TRAIL DOTS
   ============================================================ */
.trail-dot {
  position: fixed;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  will-change: left, top, opacity;
}

/* ============================================================
   ANIMATED BACKGROUND
   Layer 1: canvas neural mesh (JS driven)
   Layer 2: aurora bands (CSS keyframes)
   Layer 3: grain noise (SVG filter)
   ============================================================ */
#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* bubble canvas — z-index 2: above #bg(0) and body, below sections(3) */
#bubble-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* canvas covers the entire fixed bg */
#bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* aurora bands — slow horizontal color sweeps */
#bg-aurora {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.aband {
  position: absolute;
  left: 0;
  right: 0;
  height: 200px;
  border-radius: 50%;
  filter: blur(60px);
  mix-blend-mode: screen;
}

.ab1 {
  top: 8%;
  background: linear-gradient(90deg, transparent 10%, rgba(15, 240, 252, 0.07) 50%, transparent 90%);
  animation: auroraFloat 22s ease-in-out infinite;
  opacity: 0.8;
}

.ab2 {
  top: 42%;
  background: linear-gradient(90deg, transparent 10%, rgba(181, 55, 242, 0.065) 50%, transparent 90%);
  animation: auroraFloat 28s ease-in-out infinite 5s reverse;
  opacity: 0.8;
}

.ab3 {
  top: 72%;
  background: linear-gradient(90deg, transparent 10%, rgba(255, 45, 120, 0.05) 50%, transparent 90%);
  animation: auroraFloat 18s ease-in-out infinite 10s;
  opacity: 0.7;
}

@keyframes auroraFloat {

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

  33% {
    transform: translateY(-30px) scaleX(1.08);
  }

  66% {
    transform: translateY(20px) scaleX(0.95);
  }
}

/* SVG grain overlay */
#bg-grain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.04;
  mix-blend-mode: overlay;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
  /* Apple depth parallax — JS sets --par on parent section */
  transform: translateY(calc(var(--par, 0) * 1px));
  will-change: transform;
}

/* sections z-index:3 — above bubble canvas(2), below nav(1000) */
section {
  padding: 140px 0;
  position: relative;
  z-index: 3;
}

/* frosted blur layer sits behind section content but over bubble canvas.
   Hero is excluded — bubbles show there at full clarity. */
section:not(#hero)::before {
  content: '';
  position: absolute;
  inset: 0;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 0;
  pointer-events: none;
}

/* push all section content above the blur layer */
section:not(#hero) .container {
  position: relative;
  z-index: 1;
}

/* ============================================================
   TYPOGRAPHY HELPERS
   ============================================================ */
.sec-title {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* chapter marker line above section labels */
.sec-sub {
  text-align: center;
  color: var(--text-dim);
  font-family: var(--fm);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 72px;
  position: relative;
  padding-top: 16px;
}

.sec-sub::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--cyan);
  margin: 0 auto 12px;
  opacity: 0.5;
}

.sec-sub::after {
  content: '// ';
  color: var(--cyan);
}

/* ============================================================
   SCROLL REVEAL — simple: hidden by default, .on makes visible
   ============================================================ */
.fi {
  opacity: 0;
  transform: translateY(52px) scale(0.96);
  filter: blur(6px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), filter 0.8s var(--ease);
}

.fil {
  opacity: 0;
  transform: translateX(-60px) scale(0.97);
  filter: blur(5px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), filter 0.8s var(--ease);
}

.fir {
  opacity: 0;
  transform: translateX(60px) scale(0.97);
  filter: blur(5px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), filter 0.8s var(--ease);
}

.fi.on,
.fil.on,
.fir.on {
  opacity: 1;
  transform: none;
  filter: blur(0);
}

/* stagger delays for grid children */
.fi.d1 {
  transition-delay: 0.08s;
}

.fi.d2 {
  transition-delay: 0.16s;
}

.fi.d3 {
  transition-delay: 0.24s;
}

.fi.d4 {
  transition-delay: 0.32s;
}

.fi.d5 {
  transition-delay: 0.40s;
}

.pcard {
  opacity: 0;
  transform: translateY(32px) scale(0.97);
  filter: blur(4px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), filter 0.7s var(--ease),
    border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.pcard.on {
  opacity: 1;
  transform: none;
  filter: blur(0);
}


.d1 {
  transition-delay: 0.1s;
}

.d2 {
  transition-delay: 0.2s;
}

.d3 {
  transition-delay: 0.3s;
}

.d4 {
  transition-delay: 0.4s;
}

.d5 {
  transition-delay: 0.5s;
}

/* word-split title animation */
.word-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.word-span {
  display: inline-block;
  transform: translateY(100%);
  transition: transform 0.65s var(--ease);
}

.sec-title.on .word-span {
  transform: translateY(0);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-block;
  padding: 13px 32px;
  border-radius: 6px;
  font-family: var(--fm);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--trans), transform 0.2s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform;
  letter-spacing: 0.07em;
  cursor: pointer;
  border: none;
  will-change: transform;
}

.btn-p {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: var(--bg);
  font-weight: 700;
}

.btn-p:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 36px rgba(15, 240, 252, 0.32);
}

.btn-s {
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--cyan);
}

.btn-s:hover {
  background: rgba(15, 240, 252, 0.07);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(15, 240, 252, 0.18);
}

.btn-g {
  background: transparent;
  color: var(--text-mid);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-g:hover {
  color: var(--purple);
  border-color: var(--purple);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 7px 18px;
  font-size: 0.76rem;
}

/* ============================================================
   NAV
   ============================================================ */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 18px 32px;
  background: rgba(4, 4, 10, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: background var(--trans), box-shadow var(--trans);
}

#nav.scrolled {
  background: rgba(4, 4, 10, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 1px 0 rgba(15, 240, 252, 0.07);
}

.nav-c {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--fh);
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--cyan);
  text-decoration: none;
  letter-spacing: 0.14em;
  text-shadow: 0 0 20px rgba(15, 240, 252, 0.65);
  transition: var(--trans);
}

.nav-logo:hover {
  text-shadow: 0 0 40px var(--cyan), 0 0 80px rgba(15, 240, 252, 0.35);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
  align-items: center;
}

.nav-links a {
  font-family: var(--fm);
  font-size: 0.8rem;
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 4px;
  transition: color var(--trans);
  letter-spacing: 0.06em;
  position: relative;
}

/* glowing gradient underline */
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 14px;
  width: 0%;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  box-shadow: 0 0 6px rgba(15, 240, 252, 0.7);
  transition: width 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: calc(100% - 28px);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.hbg {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.hbg span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--cyan);
  border-radius: 2px;
  transition: var(--trans);
}

.hbg.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hbg.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hbg.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================================
   HERO
   Sticky so about section slides over it.
   Dark bg ensures no empty gap visible when hero content fades.
   ============================================================ */
#hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 32px 60px;
  position: relative;
  z-index: 3;
  /* no background — body+#bg fills dark, bubble canvas shows through */
}

.hero-wrap {
  text-align: center;
  max-width: 860px;
  will-change: transform, opacity;
  /* fade out slowly — fully gone only when about is well on screen */
  transform:
    scale(calc(1 - var(--hero-scroll, 0) * 0.12)) translateY(calc(var(--hero-scroll, 0) * -30px));
  opacity: calc(1 - var(--hero-scroll, 0) * 1.4);
}

/* ── Apple scroll parallax on sections ──
   Titles slide in via IO (.on) — no JS-driven opacity so no flicker */
.sec-title {
  will-change: transform;
}

.sec-title.on {
  opacity: 1;
  transform: none;
}

/* expanding glow line under title on reveal */
.sec-title::after {
  content: '';
  display: block;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  margin: 10px auto 0;
  border-radius: 2px;
  transition: width 0.9s var(--ease);
  box-shadow: 0 0 12px rgba(15, 240, 252, 0.5);
}

.sec-title.on::after {
  width: 64px;
}

/* subtitle same - just standard fi reveal */
.sec-sub {
  will-change: transform;
}

/* about columns — slide from sides, driven by IO .on */
.about-vis {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  will-change: transform, opacity;
}

.about-vis.on {
  opacity: 1;
  transform: none;
}

#about .fir {
  will-change: transform;
}

/* Hero elements — always visible, just animate in on load */
.hero-greet,
.hero-name-l1,
.hero-name-l2,
.hero-type-line,
.hero-sub,
.hero-rule,
.hero-cta,
.hero-socials {
  opacity: 0;
  transform: translateY(40px) scale(0.97);
  filter: blur(8px);
  transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease);
}

body.loaded .hero-greet {
  opacity: 1;
  transform: none;
  filter: blur(0);
  transition-delay: 0ms;
}

body.loaded .hero-name-l1 {
  opacity: 1;
  transform: none;
  filter: blur(0);
  transition-delay: 160ms;
}

body.loaded .hero-name-l2 {
  opacity: 1;
  transform: none;
  filter: blur(0);
  transition-delay: 320ms;
}

body.loaded .hero-type-line {
  opacity: 1;
  transform: none;
  filter: blur(0);
  transition-delay: 480ms;
}

body.loaded .hero-sub {
  opacity: 1;
  transform: none;
  filter: blur(0);
  transition-delay: 600ms;
}

body.loaded .hero-rule {
  opacity: 1;
  transform: none;
  filter: blur(0);
  transition-delay: 700ms;
}

body.loaded .hero-cta {
  opacity: 1;
  transform: none;
  filter: blur(0);
  transition-delay: 800ms;
}

body.loaded .hero-socials {
  opacity: 1;
  transform: none;
  filter: blur(0);
  transition-delay: 940ms;
}

.hero-greet {
  font-family: var(--fm);
  color: var(--cyan);
  font-size: 0.88rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

/* large cinematic name */
.hero-name {
  font-size: clamp(2.8rem, 8vw, 6rem);
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1.08;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: letterSpacingBreath 10s ease-in-out infinite;
}

@keyframes letterSpacingBreath {

  0%,
  100% {
    letter-spacing: 0.01em;
  }

  50% {
    letter-spacing: 0.03em;
  }
}

.hero-name-l1 {
  display: block;
  color: var(--text);
}

.hero-name-l2 {
  display: block;
  background: linear-gradient(135deg, #ffffff 20%, var(--cyan) 55%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px rgba(15, 240, 252, 0.25));
}

.hero-type-line {
  font-size: clamp(1.05rem, 2.5vw, 1.45rem);
  font-family: var(--fm);
  color: var(--text-mid);
  margin-bottom: 28px;
  min-height: 2rem;
}

.hero-type-text {
  color: var(--purple);
  font-weight: 500;
}

.tcursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--cyan);
  vertical-align: middle;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-mid);
  max-width: 560px;
  margin: 0 auto 28px;
  line-height: 1.85;
}

/* chapter-marker rule — width animates from 0 on load */
.hero-rule {
  width: 44px;
  height: 1px;
  background: var(--cyan);
  margin: 0 auto 32px;
  opacity: 0.45;
}

.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.hero-socials {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* social icon buttons */
.hsoc {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  will-change: transform;
}

.hsoc svg {
  width: 20px;
  height: 20px;
  transition: transform 0.2s var(--ease);
}

.hsoc:hover svg {
  transform: scale(1.12);
}

/* CSS tooltip on hover */
.hsoc::after {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(6, 6, 18, 0.92);
  color: var(--text);
  font-family: var(--fm);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.hsoc:hover::after {
  opacity: 1;
}

.hsoc-gh {
  color: var(--cyan);
  background: rgba(15, 240, 252, 0.06);
  border: 1px solid rgba(15, 240, 252, 0.25);
}

.hsoc-gh:hover {
  background: rgba(15, 240, 252, 0.15);
  box-shadow: 0 0 22px rgba(15, 240, 252, 0.32);
  transform: translateY(-3px);
}

.hsoc-li {
  color: var(--purple);
  background: rgba(181, 55, 242, 0.06);
  border: 1px solid rgba(181, 55, 242, 0.25);
}

.hsoc-li:hover {
  background: rgba(181, 55, 242, 0.15);
  box-shadow: 0 0 22px rgba(181, 55, 242, 0.32);
  transform: translateY(-3px);
}

.hsoc-em {
  color: var(--pink);
  background: rgba(255, 45, 120, 0.06);
  border: 1px solid rgba(255, 45, 120, 0.25);
}

.hsoc-em:hover {
  background: rgba(255, 45, 120, 0.15);
  box-shadow: 0 0 22px rgba(255, 45, 120, 0.32);
  transform: translateY(-3px);
}

/* scroll hint */
.scroll-dots {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.sdot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  opacity: 0.45;
  animation: sdot 1.6s ease-in-out infinite;
}

.sdot:nth-child(2) {
  animation-delay: 0.2s;
}

.sdot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes sdot {

  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.22;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================================================
   ABOUT
   Slides over the sticky hero — z-index above hero's 0.
   Semi-transparent so canvas bubbles show through.
   ============================================================ */
#about {
  background: rgba(7, 7, 16, 0.82);
  padding-top: 8rem;
  position: relative;
  z-index: 3;
  margin-top: -2px;
}

/* diagonal cut — tall enough to fully cover any gap */
#about::before {
  content: '';
  position: absolute;
  top: -80px;
  left: 0;
  right: 0;
  height: 160px;
  background: rgba(7, 7, 16, 0.91);
  clip-path: polygon(0 80px, 100% 0, 100% 100%, 0 100%);
  z-index: 0;
  pointer-events: none;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: 70px;
  align-items: center;
}

/* left column slides in from left when --p increases */
.about-vis {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  will-change: transform, opacity;
}

/* after .on is applied, transition hands off to the --p parallax */
.about-vis.on {
  transform: none;
  opacity: 1;
}

.about-avatar {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--cyan);
  box-shadow: 0 0 32px rgba(15, 240, 252, 0.18), 0 0 80px rgba(15, 240, 252, 0.07);
  transition: var(--trans);
}

.about-avatar:hover {
  box-shadow: 0 0 55px rgba(15, 240, 252, 0.42), 0 0 100px rgba(15, 240, 252, 0.16);
}

.about-ext {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.alink {
  font-family: var(--fm);
  font-size: 0.74rem;
  color: var(--text-dim);
  text-decoration: none;
  padding: 5px 14px;
  border: 1px solid var(--card-border);
  border-radius: 4px;
  transition: var(--trans);
  background: var(--card-bg);
}

.alink:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}

.about-tag {
  font-family: var(--fm);
  font-size: 0.78rem;
  color: var(--cyan);
  letter-spacing: 0.14em;
  margin-bottom: 7px;
}

.about-n {
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 7px;
}

.about-role {
  font-family: var(--fm);
  color: var(--purple);
  font-size: 0.88rem;
  margin-bottom: 24px;
}

.about-bio {
  color: var(--text-mid);
  line-height: 1.85;
  margin-bottom: 20px;
  font-size: 0.94rem;
}

.about-dets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.adet-label {
  font-family: var(--fm);
  font-size: 0.67rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.adet-val {
  font-size: 0.87rem;
  color: var(--text);
}

.adet-val a {
  color: var(--cyan);
  text-decoration: none;
}

/* ============================================================
   SKILLS
   ============================================================ */
#skills {
  background: rgba(4, 4, 10, 0.80);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}

.sk-cat {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 28px;
  backdrop-filter: blur(14px);
  transition: var(--trans);
}

.sk-cat:hover {
  border-color: rgba(15, 240, 252, 0.28);
  box-shadow: 0 10px 40px rgba(15, 240, 252, 0.06);
}

.sk-cat-title {
  font-family: var(--fm);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sk-cat-title::before {
  content: '';
  width: 18px;
  height: 1px;
  background: currentColor;
}

.cc .sk-cat-title {
  color: var(--cyan);
}

.cp .sk-cat-title {
  color: var(--purple);
}

.ck .sk-cat-title {
  color: var(--pink);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.badge {
  font-family: var(--fm);
  font-size: 0.73rem;
  padding: 4px 11px;
  border-radius: 4px;
  border: 1px solid;
  transition: var(--trans);
  cursor: default;
}

.cc .badge {
  color: var(--cyan);
  border-color: rgba(15, 240, 252, 0.28);
  background: rgba(15, 240, 252, 0.05);
}

.cp .badge {
  color: var(--purple);
  border-color: rgba(181, 55, 242, 0.28);
  background: rgba(181, 55, 242, 0.05);
}

.ck .badge {
  color: var(--pink);
  border-color: rgba(255, 45, 120, 0.28);
  background: rgba(255, 45, 120, 0.05);
}

.cc .badge:hover {
  background: rgba(15, 240, 252, 0.14);
  box-shadow: 0 0 10px rgba(15, 240, 252, 0.2);
}

.cp .badge:hover {
  background: rgba(181, 55, 242, 0.14);
  box-shadow: 0 0 10px rgba(181, 55, 242, 0.2);
}

.ck .badge:hover {
  background: rgba(255, 45, 120, 0.14);
  box-shadow: 0 0 10px rgba(255, 45, 120, 0.2);
}

/* devicon skill tiles */
.badges.skill-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
}

.skill-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  cursor: default;
  transition: transform 0.22s var(--ease), border-color 0.22s ease, filter 0.22s ease;
  text-align: center;
  will-change: transform;
}

.skill-tile i {
  font-size: 30px;
  line-height: 1;
}

.skill-tile span {
  font-family: var(--fm);
  font-size: 0.58rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  line-height: 1.2;
  word-break: break-word;
}

.skill-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(15, 240, 252, 0.28);
  filter: drop-shadow(0 0 7px rgba(15, 240, 252, 0.3));
}

.skill-tile.no-icon {
  justify-content: center;
}

.skill-tile.no-icon span {
  color: var(--text-mid);
  font-size: 0.62rem;
}

/* ============================================================
   PROJECTS
   Each card gets --p from JS for its cascade entrance.
   ============================================================ */
#projects {
  background: rgba(7, 7, 16, 0.82);
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 28px;
}

/* @property for animated conic border */
@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.pcard {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 32px;
  backdrop-filter: blur(14px);
  position: relative;
  display: flex;
  flex-direction: column;
  will-change: transform, opacity;
  transition:
    opacity 0.6s var(--ease),
    transform 0.6s var(--ease),
    border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease),
    background 0.3s var(--ease);
}

/* spinning neon border on hover */
.pcard::before {
  content: '';
  position: absolute;
  inset: -1.5px;
  border-radius: 15px;
  background: conic-gradient(from var(--border-angle),
      transparent 0%,
      transparent 62%,
      rgba(15, 240, 252, 0.55) 72%,
      rgba(181, 55, 242, 0.45) 76%,
      rgba(255, 45, 120, 0.38) 80%,
      transparent 90%,
      transparent 100%);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  padding: 1.5px;
}

/* shimmer top line */
.pcard::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--purple), var(--pink), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: 14px 14px 0 0;
}

.pcard:hover {
  background: rgba(7, 7, 16, 0.97);
  border-color: transparent;
  transform: translateY(-6px) scale(1.012);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(15, 240, 252, 0.08);
}

.pcard:hover::before {
  opacity: 1;
  animation: borderSpin 2.5s linear infinite;
}

.pcard:hover::after {
  opacity: 1;
}

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

/* category-matched glow on hover */
.pcard.cat-prod:hover {
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6), 0 0 36px rgba(15, 240, 252, 0.12), inset 0 0 44px rgba(15, 240, 252, 0.03);
}

.pcard.cat-ml:hover {
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6), 0 0 36px rgba(181, 55, 242, 0.12), inset 0 0 44px rgba(181, 55, 242, 0.03);
}

.pcard.cat-fs:hover {
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6), 0 0 36px rgba(255, 45, 120, 0.12), inset 0 0 44px rgba(255, 45, 120, 0.03);
}

.pcard.cat-fin:hover {
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6), 0 0 36px rgba(245, 158, 11, 0.12), inset 0 0 44px rgba(245, 158, 11, 0.03);
}

.pcard.cat-mob:hover {
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6), 0 0 36px rgba(16, 185, 129, 0.12), inset 0 0 44px rgba(16, 185, 129, 0.03);
}

.pcard:hover .pcard-title {
  color: #fff;
  text-shadow: 0 0 22px rgba(15, 240, 252, 0.28);
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

/* left accent bars */
.pcard.cat-prod {
  border-left: 3px solid #0ff0fc;
}

.pcard.cat-ml {
  border-left: 3px solid #b537f2;
}

.pcard.cat-fs {
  border-left: 3px solid #ff2d78;
}

.pcard.cat-fin {
  border-left: 3px solid #f59e0b;
}

.pcard.cat-mob {
  border-left: 3px solid #10b981;
}

/* category tag pills */
.pcard-cat {
  display: inline-block;
  font-family: var(--fm);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.22rem 0.8rem;
  border-radius: 100px;
  margin-bottom: 1rem;
  border: 1px solid;
}

.cat-prod {
  color: #0ff0fc;
  border-color: rgba(15, 240, 252, .28);
  background: rgba(15, 240, 252, .06);
}

.cat-ml {
  color: #b537f2;
  border-color: rgba(181, 55, 242, .28);
  background: rgba(181, 55, 242, .06);
}

.cat-fs {
  color: #ff2d78;
  border-color: rgba(255, 45, 120, .28);
  background: rgba(255, 45, 120, .06);
}

.cat-fin {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, .28);
  background: rgba(245, 158, 11, .06);
}

.cat-mob {
  color: #10b981;
  border-color: rgba(16, 185, 129, .28);
  background: rgba(16, 185, 129, .06);
}

.pcard-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.3;
}

.tech-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.tbadge {
  font-family: var(--fm);
  font-size: 0.68rem;
  padding: 3px 9px;
  border-radius: 3px;
  background: rgba(181, 55, 242, 0.1);
  color: var(--purple);
  border: 1px solid rgba(181, 55, 242, 0.2);
}

.pach {
  list-style: none;
  margin-bottom: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pach li {
  font-size: 0.87rem;
  color: var(--text-mid);
  padding-left: 16px;
  position: relative;
  line-height: 1.55;
}

.pach li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--cyan);
  font-size: 0.7rem;
  top: 3px;
}

.pcard-foot {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: auto;
}

/* ============================================================
   STATS — Apple spec-sheet layout
   Full-width rows: big number left, description right.
   JS sequential highlight activates .active on each .scard.
   ============================================================ */
.stats-sticky-wrap {
  position: relative;
  z-index: 3;
}

#stats {
  background: rgba(4, 4, 10, 0.80);
  padding-top: 7rem;
  position: relative;
}

#stats::before {
  content: '';
  position: absolute;
  top: -44px;
  left: 0;
  right: 0;
  height: 88px;
  background: rgba(4, 4, 10, 0.75);
  clip-path: polygon(0 44px, 100% 0, 100% 100%, 0 100%);
  z-index: 0;
  pointer-events: none;
}

/* spec-sheet container */
.stats-spec {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* each stat row */
.spec-row {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 36px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  opacity: 0.3;
  transform: translateX(-6px);
}

.spec-row:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

/* active row brightens and shifts into place */
.spec-row.active {
  opacity: 1;
  transform: translateX(0);
}

.spec-num {
  font-family: var(--fh);
  font-size: clamp(3rem, 6.5vw, 5rem);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 180px;
  text-align: right;
  /* each row gets a different color via nth-child */
}

.spec-row:nth-child(1) .spec-num {
  color: var(--cyan);
  text-shadow: 0 0 30px rgba(15, 240, 252, 0.4);
}

.spec-row:nth-child(2) .spec-num {
  color: var(--purple);
  text-shadow: 0 0 30px rgba(181, 55, 242, 0.4);
}

.spec-row:nth-child(3) .spec-num {
  color: var(--pink);
  text-shadow: 0 0 30px rgba(255, 45, 120, 0.4);
}

.spec-row:nth-child(4) .spec-num {
  color: var(--cyan);
  text-shadow: 0 0 30px rgba(15, 240, 252, 0.4);
}

.spec-label {
  font-family: var(--fb);
  font-size: 1.05rem;
  color: var(--text-mid);
  line-height: 1.6;
  flex: 1;
}

.spec-row.active .spec-label {
  color: var(--text);
}

/* ============================================================
   EDUCATION — timeline
   ============================================================ */
#education {
  background: rgba(7, 7, 16, 0.82);
}

.edu-line {
  max-width: 740px;
  margin: 0 auto;
  position: relative;
}

.edu-line::before {
  content: '';
  position: absolute;
  left: 23px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--cyan), var(--purple), transparent);
}

.edu-item {
  padding-left: 70px;
  padding-bottom: 48px;
  position: relative;
}

.edu-item:last-child {
  padding-bottom: 0;
}

.edu-dot {
  position: absolute;
  left: 15px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 14px rgba(15, 240, 252, 0.38);
  transition: var(--trans);
}

.edu-item:hover .edu-dot {
  background: var(--cyan);
  box-shadow: 0 0 26px rgba(15, 240, 252, 0.7);
}

.edu-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 24px 28px;
  backdrop-filter: blur(14px);
  transition: var(--trans);
}

.edu-item:hover .edu-card {
  border-color: rgba(15, 240, 252, 0.24);
  box-shadow: 0 10px 32px rgba(15, 240, 252, 0.07);
}

.edu-period {
  font-family: var(--fm);
  font-size: 0.72rem;
  color: var(--cyan);
  letter-spacing: 0.1em;
  margin-bottom: 5px;
}

.edu-degree {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.edu-school {
  font-size: 0.87rem;
  color: var(--text-mid);
}

.edu-loc {
  font-family: var(--fm);
  font-size: 0.73rem;
  color: var(--text-dim);
  margin-top: 5px;
}

/* ============================================================
   CONTACT
   ============================================================ */
#contact {
  background: rgba(4, 4, 10, 0.80);
  padding-top: 7rem;
  position: relative;
}

#contact::before {
  content: '';
  position: absolute;
  top: -44px;
  left: 0;
  right: 0;
  height: 88px;
  background: rgba(4, 4, 10, 0.72);
  clip-path: polygon(0 44px, 100% 0, 100% 100%, 0 100%);
  z-index: 0;
  pointer-events: none;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 60px;
  align-items: start;
}

.ci h3 {
  font-size: 1.6rem;
  color: var(--text);
  margin-bottom: 12px;
}

.ci p {
  color: var(--text-mid);
  line-height: 1.8;
  margin-bottom: 32px;
  font-size: 0.93rem;
}

.citems {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.citem {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cicon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.ctext-lbl {
  font-family: var(--fm);
  font-size: 0.67rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.ctext-val {
  font-size: 0.87rem;
  color: var(--text);
}

.ctext-val a {
  color: var(--cyan);
  text-decoration: none;
  transition: var(--trans);
}

.ctext-val a:hover {
  text-shadow: 0 0 12px var(--cyan);
}

.cform {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 36px;
  backdrop-filter: blur(16px);
}

.fg {
  margin-bottom: 20px;
}

.flbl {
  display: block;
  font-family: var(--fm);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.finp,
.ftxt {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  padding: 12px 15px;
  color: var(--text);
  font-family: var(--fb);
  font-size: 0.87rem;
  transition: var(--trans);
  outline: none;
}

.finp:focus,
.ftxt:focus {
  border-color: var(--cyan);
  background: rgba(15, 240, 252, 0.03);
  box-shadow: 0 0 0 3px rgba(15, 240, 252, 0.09);
}

.ftxt {
  resize: vertical;
  min-height: 120px;
}

.fsub {
  width: 100%;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: var(--bg);
  font-family: var(--fm);
  font-size: 0.87rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 14px;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: var(--trans);
  text-transform: uppercase;
  will-change: transform;
}

.fsub:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(15, 240, 252, 0.28);
  opacity: 0.92;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: #070710;
  border-top: 1px solid var(--card-border);
  padding: 30px 32px;
  position: relative;
  z-index: 3;
}

.foot-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.foot-brand {
  font-family: var(--fh);
  font-size: 0.93rem;
  color: var(--cyan);
  letter-spacing: 0.14em;
}

.foot-copy {
  font-family: var(--fm);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.foot-links {
  display: flex;
  gap: 18px;
}

.foot-links a {
  font-family: var(--fm);
  font-size: 0.72rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: var(--trans);
}

.foot-links a:hover {
  color: var(--cyan);
}

/* ============================================================
   SCROLL-TO-TOP
   ============================================================ */
#st {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  background: var(--bg2);
  border: 1px solid var(--card-border);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  text-decoration: none;
  font-size: 1.1rem;
  transition: var(--trans);
  opacity: 0;
  visibility: hidden;
  z-index: 100;
  backdrop-filter: blur(12px);
}

#st.show {
  opacity: 1;
  visibility: visible;
}

#st:hover {
  background: var(--cyan);
  color: var(--bg);
  box-shadow: 0 0 20px rgba(15, 240, 252, 0.38);
  transform: translateY(-3px);
}

/* ============================================================
   MOBILE BOTTOM NAV
   ============================================================ */
#mob-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(4, 4, 10, 0.95);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-top: 1px solid rgba(15, 240, 252, 0.08);
  z-index: 999;
  align-items: center;
  justify-content: space-around;
}

.mbn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-dim);
  font-family: var(--fm);
  transition: color 0.2s ease, filter 0.2s ease;
}

.mbn-icon {
  font-size: 1.1rem;
}

.mbn-lbl {
  font-size: 0.57rem;
  letter-spacing: 0.05em;
}

.mbn-item.active,
.mbn-item:hover {
  color: var(--cyan);
  filter: drop-shadow(0 0 6px #0ff0fc);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  section {
    padding: 80px 0;
  }

  .hbg {
    display: none;
  }

  body {
    padding-bottom: 60px;
  }

  #st {
    bottom: 76px;
  }

  #mob-nav {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 270px;
    height: 100vh;
    background: rgba(4, 4, 10, 0.97);
    backdrop-filter: blur(22px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    transition: right 0.35s var(--ease);
    border-left: 1px solid var(--card-border);
  }

  .nav-links.open {
    right: 0;
  }

  .nav-links a {
    font-size: 0.9rem;
    padding: 12px 22px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .about-dets {
    grid-template-columns: 1fr;
  }

  .about-ext {
    justify-content: center;
  }

  .proj-grid {
    grid-template-columns: 1fr;
  }

  .contact-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .foot-inner {
    flex-direction: column;
    text-align: center;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  /* spec stats stack on mobile */
  .spec-row {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .spec-num {
    min-width: auto;
    text-align: center;
    font-size: clamp(2.5rem, 12vw, 3.5rem);
  }

  .spec-label {
    text-align: center;
    font-size: 0.88rem;
  }
}

@media (max-width: 480px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 20px;
  }
}

@media (min-width: 1400px) {
  .container {
    max-width: 1280px;
  }
}

/* ============================================================
   PREFERS REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .trail-dot {
    display: none;
  }

  #progress-bar {
    display: none;
  }

  #bg-aurora {
    display: none;
  }

  #bg-canvas {
    display: none;
  }
}