/* ── 1. CSS VARIABLES (THEME TOKENS) ─────────────────────────── */
:root {
  /* Brand */
  --clr-primary: #38bdf8;
  --clr-primary-dark: #0ea5e9;
  --clr-primary-glow: rgba(56, 189, 248, 0.18);
  --clr-accent: #818cf8;

  /* Dark theme (default) */
  --clr-bg: #0f172a;
  --clr-bg-alt: #0b1120;
  --clr-surface: #1e293b;
  --clr-surface-2: #273549;
  --clr-border: rgba(148, 163, 184, 0.12);
  --clr-border-hover: rgba(56, 189, 248, 0.35);
  --clr-text: #f8fafc;
  --clr-text-muted: #94a3b8;
  --clr-text-faint: #475569;
  --clr-white: #fff;
  --clr-black: #000;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 40px rgba(56, 189, 248, 0.15);

  /* Layout */
  --max-w: 1200px;
  --section-gap: 90px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  /* Typography */
  --font-main: sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 160ms;
  --dur-mid: 280ms;
  --dur-slow: 480ms;

  /* Navbar */
  --navbar-h: 72px;
}

/* Light theme overrides */
[data-theme="light"] {
  --clr-bg: #f0f6ff;
  --clr-bg-alt: #e8f0fe;
  --clr-surface: #ffffff;
  --clr-surface-2: #ebf2ff;
  --clr-border: rgba(30, 41, 59, 0.1);
  --clr-border-hover: rgba(14, 165, 233, 0.4);
  --clr-text: #0f172a;
  --clr-text-muted: #475569;
  --clr-text-faint: #94a3b8;
  --shadow-sm: 0 2px 8px rgba(14, 165, 233, 0.08);
  --shadow-md: 0 8px 32px rgba(14, 165, 233, 0.12);
  --shadow-lg: 0 20px 60px rgba(14, 165, 233, 0.16);
  --shadow-glow: 0 0 40px rgba(14, 165, 233, 0.12);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--navbar-h);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.7;
  overflow-x: hidden;
  cursor: none;
  transition:
    background-color var(--dur-slow) var(--ease),
    color var(--dur-slow) var(--ease);
}

img,
svg {
  display: block;
  max-width: 100%;
}
a,
button,
input,
textarea,
select,
label {
  cursor: none;
}
a {
  color: inherit;
  text-decoration: none;
}
ul,
ol {
  list-style: none;
}
button {
  font-family: inherit;
  border: none;
  background: none;
}
input,
textarea,
select {
  font-family: inherit;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--clr-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--clr-primary-dark);
  border-radius: var(--radius-full);
}

/* Selection */
::selection {
  background: var(--clr-primary);
  color: #0f172a;
}

/* ── 3. CUSTOM CURSOR ────────────────────────────────────────── */
.cursor-arrow {
  position: fixed;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(248, 248, 248, 0.95);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.65),
    0 0 18px rgba(148, 163, 184, 0.16);
  transition:
    transform var(--dur-fast) var(--ease),
    background var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
  will-change: transform, box-shadow;
}

.cursor-arrow.is-hovering {
  transform: translate(-50%, -50%) scale(1.55);
  background: rgba(255, 255, 255, 1);
  box-shadow:
    0 0 0 3px rgba(56, 189, 248, 0.22),
    0 0 24px rgba(148, 163, 184, 0.28);
}

[data-theme="light"] .cursor-arrow {
  background: var(--clr-primary);
  box-shadow:
    0 0 0 2px rgba(56, 189, 248, 0.65),
    0 0 18px rgba(56, 189, 248, 0.24);
}

[data-theme="light"] .cursor-arrow.is-hovering {
  background: var(--clr-primary);
  box-shadow:
    0 0 0 3px rgba(56, 189, 248, 0.22),
    0 0 24px rgba(56, 189, 248, 0.35);
}

[data-theme="light"] .cursor-trail-dot {
  background: rgba(56, 189, 248, 0.28);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.38);
}

/* Trail dots */
.cursor-trail {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 99998;
}

.cursor-trail-dot {
  position: absolute;
  border-radius: 50%;
  width: inherit;
  height: inherit;
  background: rgba(226, 232, 240, 0.28);
  box-shadow: 0 0 16px rgba(148, 163, 184, 0.22);
  transform: translate(-50%, -50%);
  animation: trailFade 0.7s var(--ease) forwards;
}

@keyframes trailFade {
  0% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.1);
  }
}

/* ── 4. UTILITY CLASSES ──────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 60px);
}

.section {
  padding-block: var(--section-gap);
}

.highlight {
  color: var(--clr-primary);
}

/* ── 5. REVEAL ANIMATIONS ────────────────────────────────────── */
.reveal-up {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity var(--dur-slow) var(--ease),
    transform var(--dur-slow) var(--ease);
  transition-delay: var(--delay, 0s);
}

.reveal-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── 6. BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-full);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all var(--dur-mid) var(--ease);
  white-space: nowrap;
}

.btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn--primary {
  background: var(--clr-primary);
  color: #0f172a;
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.3);
}
.btn--primary:hover {
  background: #7dd3fc;
  box-shadow: 0 6px 28px rgba(56, 189, 248, 0.45);
  transform: translateY(-2px);
}
.btn--primary:active {
  transform: translateY(0);
}

.btn--outline {
  background: transparent;
  color: var(--clr-primary);
  border: 2px solid var(--clr-primary);
}
.btn--outline:hover {
  background: var(--clr-primary-glow);
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  color: var(--clr-text-muted);
  border: 2px solid var(--clr-border);
}
.btn--ghost:hover {
  border-color: var(--clr-border-hover);
  color: var(--clr-text);
  transform: translateY(-2px);
}

.btn--sm {
  padding: 9px 20px;
  font-size: 0.85rem;
}

.btn--full {
  width: 100%;
  justify-content: center;
}

/* ── 7. SECTION HEADER ───────────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clr-primary);
  background: var(--clr-primary-glow);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 5px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--clr-text);
}

/* ── 8. SOCIAL LINKS ─────────────────────────────────────────── */
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  color: var(--clr-text-muted);
  transition: all var(--dur-mid) var(--ease);
}
.social-link svg {
  width: 18px;
  height: 18px;
}
.social-link:hover {
  border-color: var(--clr-primary);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.2);
}

.github:hover {
  color: var(--clr-white);
  background: var(--clr-black);
}

.linkedin:hover {
  color: var(--clr-white);
  background: #0a66c2;
}

.instagram:hover {
  color: var(--clr-white);
  background: radial-gradient(
    circle at 30% 107%,
    #fdf497 0%,
    #fdf497 5%,
    #fd5949 45%,
    #d6249f 60%,
    #285aeb 90%
  );
}

.mail:hover {
  background: #fd5949;
  color: var(--clr-white);
}

/* ── 9. LOADING SCREEN ───────────────────────────────────────── */
.loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--clr-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.6s var(--ease),
    visibility 0.6s;
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.loader-brand {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.loader-bracket {
  color: var(--clr-primary);
}
.loader-name {
  color: var(--clr-text);
}

.loader-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--clr-text-muted);
  letter-spacing: 0.1em;
}

.loader-bar-wrap {
  width: 260px;
  height: 6px;
  background: var(--clr-surface);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.loader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    var(--clr-primary-dark),
    var(--clr-primary)
  );
  border-radius: var(--radius-full);
  transition: width 0.05s linear;
  box-shadow: 0 0 12px var(--clr-primary);
}

.loader-percent {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--clr-primary);
  min-width: 3ch;
  text-align: center;
}

/* ── 10. NAVBAR ──────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--navbar-h);
  display: flex;
  align-items: center;
  background: transparent;
  transition:
    background var(--dur-mid) var(--ease),
    box-shadow var(--dur-mid) var(--ease),
    backdrop-filter var(--dur-mid) var(--ease);
}

.navbar.is-scrolled {
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow:
    0 1px 0 var(--clr-border),
    var(--shadow-sm);
}

[data-theme="light"] .navbar.is-scrolled {
  background: rgba(240, 246, 255, 0.85);
}

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

/* Logo */
.navbar-logo {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 2px;
  transition: transform var(--dur-mid) var(--ease-spring);
}
.navbar-logo:hover {
  transform: scale(1.06);
}
.navbar-logo-bracket {
  color: var(--clr-primary);
}
.navbar-logo-text {
  color: var(--clr-text);
}

/* Nav list */
.navbar-nav {
  display: flex;
}
.navbar-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.navbar-link {
  position: relative;
  padding: 8px 14px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--clr-text-muted);
  border-radius: var(--radius-sm);
  transition:
    color var(--dur-fast),
    background var(--dur-fast);
}
.navbar-link::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 20px;
  height: 2px;
  background: var(--clr-primary);
  border-radius: var(--radius-full);
  transition: transform var(--dur-mid) var(--ease-spring);
}
.navbar-link:hover,
.navbar-link.is-active {
  color: var(--clr-text);
  background: var(--clr-surface);
}
.navbar-link.is-active::after,
.navbar-link:hover::after {
  transform: translateX(-50%) scaleX(1);
}

/* Controls */
.navbar-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  color: var(--clr-text-muted);
  transition: all var(--dur-mid) var(--ease);
}
.theme-toggle:hover {
  border-color: var(--clr-primary);
  color: var(--clr-primary);
  background: var(--clr-primary-glow);
}
.theme-toggle-icon {
  width: 18px;
  height: 18px;
}
[data-theme="dark"] .theme-toggle-sun {
  display: block;
}
[data-theme="dark"] .theme-toggle-moon {
  display: none;
}
[data-theme="light"] .theme-toggle-sun {
  display: none;
}
[data-theme="light"] .theme-toggle-moon {
  display: block;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  padding: 8px;
}
.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--clr-text-muted);
  border-radius: 2px;
  transition: all var(--dur-mid) var(--ease);
  transform-origin: center;
}
.hamburger.is-open .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.is-open .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.is-open .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ── 11. HERO ────────────────────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: calc(var(--navbar-h) + 40px);
  padding-bottom: 80px;
  position: relative;
  overflow: hidden;
}

/* Subtle grid background */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--clr-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--clr-border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.4;
  pointer-events: none;
}

/* Radial glow */
.hero::after {
  content: "";
  position: absolute;
  top: -20%;
  left: -10%;
  width: 60%;
  height: 80%;
  background: radial-gradient(
    ellipse,
    rgba(56, 189, 248, 0.08) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 60px;
  position: relative;
  z-index: 1;
}

/* Greeting */
.hero-greeting {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--clr-text-muted);
}
.hero-wave {
  display: inline-block;
  animation: wave 2.4s ease-in-out infinite;
  transform-origin: 70% 70%;
}
@keyframes wave {
  0%,
  60%,
  100% {
    transform: rotate(0deg);
  }
  10%,
  30% {
    transform: rotate(20deg);
  }
  20% {
    transform: rotate(-8deg);
  }
  40% {
    transform: rotate(14deg);
  }
}

/* Name */
.hero-name {
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}
.hero-name-highlight {
  color: var(--clr-primary);
  position: relative;
}
.hero-name-highlight::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--clr-primary), transparent);
  border-radius: var(--radius-full);
  opacity: 0.5;
}

/* Typewriter role */
.hero-role {
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  font-weight: 600;
  color: var(--clr-text-muted);
  margin-bottom: 16px;
  min-height: 2.2em;
  line-height: 28px;
}
.hero-role-static {
  color: var(--clr-text-muted);
}
.hero-typewriter {
  color: var(--clr-primary);
}
.hero-cursor-blink {
  color: var(--clr-primary);
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* Bio */
.hero-bio {
  font-size: 1.05rem;
  color: var(--clr-text-muted);
  line-height: 1.8;
  max-width: 480px;
  margin-bottom: 24px;
}

/* CTAs */
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

/* Socials */
.hero-socials {
  display: flex;
  gap: 12px;
}

/* ── Right: Avatar Visual ── */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-blob-wrap {
  position: relative;
  width: clamp(280px, 35vw, 420px);
  height: clamp(280px, 35vw, 420px);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Animated blob */
.hero-blob {
  position: absolute;
  inset: -10%;
  background: radial-gradient(
    ellipse at 40% 40%,
    rgba(56, 189, 248, 0.22) 0%,
    rgba(129, 140, 248, 0.12) 50%,
    transparent 70%
  );
  border-radius: 60% 40% 55% 45% / 45% 55% 40% 60%;
  animation: blobFloat 8s ease-in-out infinite;
  filter: blur(1px);
}
@keyframes blobFloat {
  0%,
  100% {
    border-radius: 60% 40% 55% 45% / 45% 55% 40% 60%;
    transform: rotate(0deg) scale(1);
  }
  33% {
    border-radius: 40% 60% 45% 55% / 60% 40% 55% 45%;
    transform: rotate(3deg) scale(1.02);
  }
  66% {
    border-radius: 55% 45% 60% 40% / 40% 60% 45% 55%;
    transform: rotate(-3deg) scale(0.98);
  }
}

/* Outer ring */
.hero-avatar-ring {
  position: absolute;
  inset: 2%;
  border-radius: 50%;
  border: 2px dashed rgba(56, 189, 248, 0.3);
  animation: ringRotate 18s linear infinite;
  z-index: 1;
  transition: inset 0.1s ease;
}
.hero-blob-wrap:hover .hero-avatar-ring {
  inset: 0%;
}
@keyframes ringRotate {
  to {
    transform: rotate(360deg);
  }
}
.hero-avatar {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--clr-primary);
  box-shadow:
    0 0 0 8px var(--clr-primary-glow),
    var(--shadow-glow);
  transition:
    transform var(--dur-slow) var(--ease-spring),
    box-shadow var(--dur-slow) var(--ease);
}
.hero-blob-wrap:hover .hero-avatar {
  transform: scale(1.04);
  box-shadow:
    0 0 0 12px var(--clr-primary-glow),
    0 0 60px rgba(56, 189, 248, 0.25);
}
.hero-avatar-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform var(--dur-slow) var(--ease-spring);
  position: absolute;
  bottom: 0;
}
.hero-avatar-overflow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: auto;
  z-index: 4;
  transform: translateY(-24%);
  clip-path: inset(0 0 74% 0);
  pointer-events: none;
  transition: transform var(--dur-slow) var(--ease-spring);
}

.hero-blob-wrap:hover .hero-avatar-overflow {
  transform: translateY(-25.5%);
}
/* Floating badges */
.hero-badge {
  position: absolute;
  z-index: 3;
  padding: 8px 14px;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--clr-text);
  box-shadow: var(--shadow-md);
  animation: badgeFloat 4s ease-in-out infinite;
  white-space: nowrap;
}
.hero-badge--tl {
  top: 10%;
  left: -8%;
  animation-delay: 0s;
}
.hero-badge--br {
  bottom: 10%;
  right: -8%;
  animation-delay: 2s;
}
.hero-badge--tr {
  top: 10%;
  right: -8%;
  animation-delay: 1s;
}
.hero-badge--bl {
  bottom: 10%;
  left: -8%;
  animation-delay: 3s;
}

@keyframes badgeFloat {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* Scroll hint */
.hero-scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.hero-scroll-dot {
  width: 6px;
  height: 28px;
  border: 2px solid var(--clr-border);
  border-radius: var(--radius-full);
  position: relative;
  overflow: hidden;
}
.hero-scroll-dot::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 6px;
  background: var(--clr-primary);
  border-radius: var(--radius-full);
  animation: scrollDot 1.8s ease-in-out infinite;
}
@keyframes scrollDot {
  0% {
    top: 4px;
    opacity: 1;
  }
  80% {
    top: 14px;
    opacity: 0;
  }
  100% {
    top: 4px;
    opacity: 0;
  }
}

/* ── 12. ABOUT ───────────────────────────────────────────────── */
.about {
  background: var(--clr-bg-alt);
}

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

/* Content */
.about-text {
  font-size: 1.02rem;
  color: var(--clr-text-muted);
  line-height: 1.65;
  margin-bottom: 24px;
  text-align: justify;
}
.about-text strong {
  color: var(--clr-text);
  font-weight: 700;
}

/* Info list */
.about-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-block: 28px;
}
.about-info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
}
.about-info-label {
  width: 90px;
  font-weight: 600;
  color: var(--clr-text-muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.about-info-value {
  color: var(--clr-text);
  font-weight: 500;
}
.about-available {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4ade80;
}

/* Pulse dot */
.pulse-dot {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(74, 222, 128, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
  }
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.stat-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  transition: all var(--dur-mid) var(--ease);
}
.stat-card:hover {
  border-color: var(--clr-border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.stat-card-number,
.stat-card-percent {
  display: block;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  color: var(--clr-primary);
  line-height: 1;
  margin-bottom: 8px;
}
.stat-card-number::after {
  content: "+";
}
.stat-card-percent::after {
  content: "%";
}
.stat-card-label {
  font-size: 0.88rem;
  color: var(--clr-text-muted);
  font-weight: 500;
  line-height: 1.4;
}

/* ── 13. SKILLS ──────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 24px;
}

.skill-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  transition: all var(--dur-mid) var(--ease);
  position: relative;
  overflow: hidden;
}
.skill-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--clr-primary-glow), transparent);
  opacity: 0;
  transition: opacity var(--dur-mid);
}
.skill-card:hover {
  border-color: var(--clr-border-hover);
  transform: translateY(-6px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}
.skill-card:hover::before {
  opacity: 1;
}

/* Logo 3D rotation */
.skill-card-logo-wrap {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 400px;
}
.skill-card-logo {
  width: 52px;
  height: 52px;
  animation: logoRotateY 5s ease-in-out infinite;
  will-change: transform;
}
@keyframes logoRotateY {
  0%,
  100% {
    transform: rotateY(0deg);
  }
  50% {
    transform: rotateY(20deg);
  }
}
.skill-card:hover .skill-card-logo {
  animation: logoRotateYFast 2s ease-in-out infinite;
}
@keyframes logoRotateYFast {
  0%,
  100% {
    transform: rotateY(0deg);
  }
  50% {
    transform: rotateY(360deg);
  }
}

.spec-logo path {
  fill: var(--clr-text);
}

.skill-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--clr-text);
  letter-spacing: -0.01em;
}

.skill-card.is-visible .skill-card-bar {
  width: var(--pct);
}

.skill-card-pct {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--clr-primary);
}

/* ── 14. EDUCATION / TIMELINE ────────────────────────────────── */
.education {
  background: var(--clr-bg-alt);
}

.timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 60px;
}

/* Vertical line */
.timeline::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--clr-primary) 10%,
    var(--clr-primary) 90%,
    transparent 100%
  );
  opacity: 0.4;
}

.timeline-item {
  position: relative;
  padding-bottom: 48px;
}
.timeline-item:last-child {
  padding-bottom: 0;
}

/* Dot */
.timeline-dot {
  position: absolute;
  left: -48px;
  top: 20px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--clr-surface);
  border: 3px solid var(--clr-primary-dark);
  z-index: 1;
  transition: all var(--dur-mid) var(--ease);
}
.timeline-dot--active {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 6px var(--clr-primary-glow);
}
.timeline-item:hover .timeline-dot {
  transform: scale(1.3);
  background: var(--clr-primary);
}

/* Card */
.timeline-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  transition: all var(--dur-mid) var(--ease);
}
.timeline-card:hover {
  border-color: var(--clr-border-hover);
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}
.timeline-card--active {
  border-color: rgba(56, 189, 248, 0.3);
  background: linear-gradient(
    135deg,
    var(--clr-surface),
    rgba(56, 189, 248, 0.04)
  );
}

.timeline-year {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--clr-primary);
  background: var(--clr-primary-glow);
  padding: 3px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}
.timeline-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: 6px;
}
.timeline-inst {
  font-size: 0.9rem;
  color: var(--clr-primary);
  font-weight: 500;
  margin-bottom: 12px;
}
.timeline-desc {
  font-size: 0.95rem;
  color: var(--clr-text-muted);
  line-height: 1.75;
  margin-bottom: 16px;
}
.timeline-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--clr-surface-2);
  color: var(--clr-text-muted);
  border: 1px solid var(--clr-border);
}
.timeline-badge--active {
  background: var(--clr-primary-glow);
  color: var(--clr-primary);
  border-color: rgba(56, 189, 248, 0.3);
}

/* ── 15. SERVICES ────────────────────────────────────────────── */
.services {
  background: var(--clr-bg-alt);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* 5th card: center it */
.services-grid .service-card:last-child:nth-child(3n + 2) {
  grid-column: 2;
}
/* When 5 items: row 1 = 3 items, row 2 = 2 items centered */
.services-grid .service-card:nth-child(4) {
  grid-column: 1;
}
.services-grid .service-card:nth-child(5) {
  grid-column: 2;
}

.service-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all var(--dur-mid) var(--ease);
  position: relative;
  overflow: hidden;
}
.service-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--clr-primary-dark),
    var(--clr-primary)
  );
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  transition: width var(--dur-slow) var(--ease);
}
.service-card:hover {
  border-color: var(--clr-border-hover);
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}
.service-card:hover::after {
  width: 100%;
}

.service-card-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-primary-glow);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  color: var(--clr-primary);
  transition: all var(--dur-mid) var(--ease);
}
.service-card-icon svg {
  width: 26px;
  height: 26px;
}
.service-card:hover .service-card-icon {
  background: var(--clr-primary);
  color: #0f172a;
  transform: scale(1.1) rotate(-5deg);
}

.service-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--clr-text);
}
.service-card-desc {
  font-size: 0.92rem;
  color: var(--clr-text-muted);
  line-height: 1.75;
}

/* ── 16. PROJECTS ────────────────────────────────────────────── */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.project-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--dur-mid) var(--ease);
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  border-color: var(--clr-border-hover);
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.project-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-title-wrap span {
  font-size: 14px;
  color: rgb(233, 64, 64);
}

/* Thumbnail */
.project-card-thumb {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}
.project-card-img {
  width: 100%;
  height: 100%;
  transition: transform var(--dur-slow) var(--ease);
}
.project-card:hover .project-card-img {
  transform: scale(1.07);
}

.project-light-img {
  display: none;
}

[data-theme="dark"] .project-dark-img {
  display: none;
}

[data-theme="dark"] .project-light-img {
  display: block;
}

/* Overlay */
.project-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  transition: opacity var(--dur-mid) var(--ease);
}
.project-card:hover .project-card-overlay {
  opacity: 1;
}

/* Body */
.project-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.project-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--clr-text);
}
.project-card-desc {
  font-size: 0.9rem;
  color: var(--clr-text-muted);
  line-height: 1.7;
}

/* Tags */
.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--clr-primary-glow);
  color: var(--clr-primary);
  border: 1px solid rgba(56, 189, 248, 0.2);
  transition: all var(--dur-fast);
}
.tag:hover {
  background: var(--clr-primary);
  color: #0f172a;
  transform: scale(1.05);
}

/* ── 17. CONTACT ─────────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 60px;
  align-items: start;
}

.contact-info-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--clr-text);
  margin-bottom: 16px;
}
.contact-info-text {
  font-size: 0.98rem;
  color: var(--clr-text-muted);
  line-height: 1.8;
  margin-bottom: 36px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.contact-detail {
  display: flex;
  align-items: center;
  gap: 16px;
}
.contact-detail-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-primary-glow);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  color: var(--clr-primary);
}
.contact-detail-icon svg {
  width: 22px;
  height: 22px;
}
.contact-detail-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clr-text-faint);
  margin-bottom: 2px;
}
.contact-detail-value {
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--clr-text);
  transition: color var(--dur-fast);
}
a.contact-detail-value:hover {
  color: var(--clr-primary);
}

/* Form */
.contact-form-wrap {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Floating label inputs */
.form-group {
  position: relative;
}
.form-input {
  width: 100%;
  padding: 18px 16px 8px;
  background: var(--clr-bg);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-md);
  color: var(--clr-text);
  font-size: 0.98rem;
  font-family: var(--font-main);
  outline: none;
  transition:
    border-color var(--dur-fast),
    box-shadow var(--dur-fast);
  appearance: none;
  -webkit-appearance: none;
}
.form-input:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px var(--clr-primary-glow);
}
.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
  top: 6px;
  font-size: 0.72rem;
  color: var(--clr-primary);
}

.form-label {
  position: absolute;
  top: 14px;
  left: 16px;
  font-size: 0.95rem;
  color: var(--clr-text-faint);
  pointer-events: none;
  transition: all var(--dur-fast) var(--ease);
}
.form-label--select {
  /* Shown statically for select */
  top: 6px;
  font-size: 0.72rem;
  color: var(--clr-primary);
}

.form-select {
  padding-top: 24px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: none;
}
.form-select option {
  background: var(--clr-surface);
}

.form-textarea {
  padding-top: 22px;
  resize: vertical;
  min-height: 120px;
}

.form-success,
.form-error {
  display: none;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 500;
  text-align: center;
}
.form-success.is-visible {
  display: block;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #4ade80;
}
.form-error.is-visible {
  display: block;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #f87171;
}

/* ── 18. FOOTER ──────────────────────────────────────────────── */
.footer {
  background: var(--clr-bg-alt);
  border-top: 1px solid var(--clr-border);
  padding-top: 64px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
}

.footer-tagline {
  margin-top: 12px;
  font-size: 0.92rem;
  color: var(--clr-text-muted);
  line-height: 1.6;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-link {
  font-size: 0.92rem;
  color: var(--clr-text-muted);
  transition: color var(--dur-fast);
}
.footer-link:hover {
  color: var(--clr-primary);
}

.footer-socials {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-content: flex-start;
}

.footer-bottom {
  border-top: 1px solid var(--clr-border);
  padding-block: 20px;
}
.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-bottom p {
  font-size: 0.85rem;
  color: var(--clr-text-muted) !important;
}

.footer-credit strong {
  color: var(--clr-primary);
}

/* ── 19. SCROLL TO TOP ───────────────────────────────────────── */
.scroll-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 900;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-full);
  background: var(--clr-primary);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--dur-mid) var(--ease);
}
.scroll-top svg {
  width: 20px;
  height: 20px;
}
.scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.scroll-top:hover {
  background: #7dd3fc;
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(56, 189, 248, 0.45);
}

.grid-two {
  display: flex;
  gap: 24px;
  justify-content: center;
}
.grid-two .skill-card {
  width: 250px;
}

/* ── 20. RESPONSIVE ──────────────────────────────────────────── */

/* Tablet: ≤ 1024px */
@media (max-width: 1024px) {
  :root {
    --section-gap: 60px;
  }

  .navbar-link {
    padding: 8px 10px;
  }
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 48px;
  }
  .hero-bio {
    margin-inline: auto;
  }
  .hero-ctas {
    justify-content: center;
  }
  .hero-socials {
    justify-content: center;
  }
  .hero-visual {
    order: -1;
  }
  .hero-blob-wrap {
    width: clamp(220px, 50vw, 320px);
    height: clamp(220px, 50vw, 320px);
  }
  .hero-avatar-overflow {
    transform: translateY(-23.7%);
  }
  .hero-blob-wrap:hover .hero-avatar-overflow {
    transform: translateY(-25.2%);
  }
  .hero-badge--tl {
    left: 0;
  }
  .hero-badge--br {
    right: 0;
  }

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

  .stats-grid {
    grid-template-columns: repeat(1, 1fr);
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .services-grid .service-card:nth-child(4),
  .services-grid .service-card:nth-child(5) {
    grid-column: auto;
  }
  .services-grid .service-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: 400px;
    margin-inline: auto;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

/* Mobile: ≤ 768px */
@media (max-width: 768px) {
  :root {
    --section-gap: 64px;
    --navbar-h: 64px;
  }

  /* Navbar mobile */
  .navbar-nav {
    position: absolute;
    top: var(--navbar-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--clr-bg);
    border-top: 1px solid var(--clr-border);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    transform: translateX(100%);
    transition: transform var(--dur-slow) var(--ease);
    z-index: 999;
    padding: 32px;
    height: 100vh;
  }
  .navbar-nav.is-open {
    transform: translateX(0);
  }
  .navbar-list {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  .navbar-link {
    display: block;
    text-align: center;
    font-size: 1.2rem;
    padding: 14px 24px;
  }
  .navbar-controls .btn--sm {
    display: none;
  }
  .hamburger {
    display: flex;
  }

  /* Hero */
  .hero-name {
    font-size: 2rem;
  }
  .hero-badge {
    display: none;
  }

  /* Grids */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .about-info {
    align-items: center;
  }
  .about-info-item {
    justify-content: center;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .services-grid {
    grid-template-columns: 1fr;
  }
  .services-grid .service-card:last-child:nth-child(odd) {
    grid-column: auto;
    max-width: none;
  }
  .grid-two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
    gap: 24px;
  }
  .grid-two .skill-card {
    width: auto;
  }

  /* Timeline */
  .timeline {
    padding-left: 44px;
  }
  .timeline-dot {
    left: -38px;
  }
  .timeline-card {
    padding: 20px;
  }

  /* Footer */
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
  }

  /* Contact form */
  .contact-form-wrap {
    padding: 28px 20px;
  }

  /* Scroll top */
  .scroll-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }

  /* About image */
  .about-image-frame {
    width: 220px;
  }
}

/* Small mobile: ≤ 480px */
@media (max-width: 480px) {
  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }
  .hero-ctas .btn {
    width: 100%;
    justify-content: center;
  }
  .hero-avatar-overflow {
    transform: translateY(-23%);
  }
  .hero-blob-wrap:hover .hero-avatar-overflow {
    transform: translateY(-24.4%);
  }
  .about-info {
    align-items: flex-start;
  }
  .about-info-item {
    gap: 10px;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── 21. FOCUS VISIBLE (ACCESSIBILITY) ───────────────────────── */
:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
