/* ===== Variables ===== */
:root {
  --bg: #0a0a0f;
  --bg-card: rgba(18, 18, 28, 0.7);
  --bg-card-hover: rgba(28, 28, 42, 0.8);
  --text: #e8e8ef;
  --text-muted: #8a8a9a;
  --accent: #00d4aa;
  --accent-dim: rgba(0, 212, 170, 0.15);
  --accent-glow: rgba(0, 212, 170, 0.25);
  --border: rgba(255, 255, 255, 0.06);
  --header-bg: rgba(10, 10, 15, 0.8);
  --header-bg-scroll: rgba(10, 10, 15, 0.95);
  --font: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 72px;
  --container: min(1120px, 92vw);
}

/* Light theme */
body.theme-light {
  --bg: #f5f5f9;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --text: #1a1a24;
  --text-muted: #5a5a6e;
  --accent: #00997a;
  --accent-dim: rgba(0, 153, 122, 0.12);
  --accent-glow: rgba(0, 153, 122, 0.2);
  --border: rgba(0, 0, 0, 0.08);
  --header-bg: rgba(245, 245, 249, 0.9);
  --header-bg-scroll: rgba(245, 245, 249, 0.98);
}

body.theme-light .hero-title {
  background: linear-gradient(135deg, #1a1a24 0%, #5a5a6e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.theme-light .noise {
  opacity: 0.02;
}

body.theme-light .grid-overlay {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}

body.theme-light .consent-banner {
  background: rgba(255, 255, 255, 0.98);
  border-top-color: var(--border);
}

body.theme-light .theme-icon-moon {
  display: none;
}

body.theme-light .theme-icon-sun {
  display: inline;
}

body.theme-dark .theme-icon-sun {
  display: none;
}

body.theme-dark .theme-icon-moon {
  display: inline;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #00f5c4;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul {
  list-style: none;
}

/* ===== Noise overlay ===== */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== Consent banner ===== */
.consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  background: rgba(18, 18, 28, 0.98);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.consent-banner.is-hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.consent-text {
  flex: 1;
  min-width: 200px;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

.consent-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

/* ===== Splash / welcome screen ===== */
.splash {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #050508;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

body.splash-welcome .splash {
  display: flex;
}

.splash.splash-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 40%, rgba(0, 212, 170, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(99, 102, 241, 0.08) 0%, transparent 45%);
  pointer-events: none;
}

.splash-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 360px;
}

.splash-logo {
  font-size: 3rem;
  font-weight: 700;
  color: #00d4aa;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  animation: splashFade 0.8s ease-out;
}

.splash-title {
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 8px;
  animation: splashFade 0.8s ease-out 0.15s both;
}

.splash-subtitle {
  font-size: 1rem;
  color: #8a8a9a;
  margin-bottom: 0;
  animation: splashFade 0.8s ease-out 0.3s both;
}

@keyframes splashFade {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .splash-content {
    max-width: 100%;
  }

  .splash-logo {
    font-size: 2.5rem;
  }

  .splash-title {
    font-size: 1.75rem;
  }

  .splash-subtitle {
    font-size: 0.95rem;
  }
}

/* ===== Snow effect ===== */
.snow {
  position: fixed;
  inset: 0;
  z-index: 5000;
  pointer-events: none;
  overflow: hidden;
  display: none;
}

body.snow-on .snow {
  display: block;
}

.snowflake {
  position: absolute;
  top: -10px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  user-select: none;
  animation: snowFall linear infinite;
  --drift: 0px;
}

.snowflake.snowflake-sm {
  font-size: 0.65rem;
  opacity: 0.7;
}

.snowflake.snowflake-lg {
  font-size: 1.25rem;
  opacity: 0.95;
}

@keyframes snowFall {
  0% {
    transform: translateY(-10px) translateX(0);
  }

  100% {
    transform: translateY(100vh) translateX(var(--drift, 0));
  }
}

@media (max-width: 768px) {
  .snowflake.snowflake-lg {
    font-size: 1rem;
  }
}

/* Snow toggle button */
.snow-toggle {
  font-size: 1.15rem;
  opacity: 0.9;
}

.snow-toggle:hover {
  opacity: 1;
}

body.snow-on .snow-toggle {
  color: #00d4aa;
  box-shadow: 0 0 0 1px rgba(0, 212, 170, 0.3);
}

/* ===== 3D tilt (mouse/touch follow + idle animation) ===== */
.tilt-3d {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  transition: transform 0.25s ease-out;
}

/* Subtle "breathing" 3D when not interacting – visible even without mouse */
.card.tilt-3d:not(.tilt-active),
.blog-card.tilt-3d:not(.tilt-active) {
  animation: tiltIdle 6s ease-in-out infinite;
}

@keyframes tiltIdle {

  0%,
  100% {
    transform: rotateX(0deg) rotateY(0deg);
  }

  25% {
    transform: rotateX(2deg) rotateY(-2deg);
  }

  50% {
    transform: rotateX(-1deg) rotateY(2deg);
  }

  75% {
    transform: rotateX(1.5deg) rotateY(1deg);
  }
}

.card.tilt-3d.tilt-active,
.blog-card.tilt-3d.tilt-active {
  animation: none;
}

/* ===== Layout ===== */
.container {
  width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, color 0.2s;
}

.header.is-scrolled {
  background: var(--header-bg-scroll);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--text);
  transition: transform 0.25s ease, color 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.logo:hover {
  color: var(--accent);
  transform: scale(1.05);
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.12) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1px solid rgba(0, 212, 170, 0.25);
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.logo-mark.tilt-3d {
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
}

.logo-mark:hover {
  color: #00d4aa;
  border-color: rgba(0, 212, 170, 0.5);
  box-shadow: 0 0 20px rgba(0, 212, 170, 0.2);
}

.logo-mark.tilt-3d:hover {
  transform: scale(1.05) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  color: #00d4aa;
  border-color: rgba(0, 212, 170, 0.5);
  box-shadow: 0 0 20px rgba(0, 212, 170, 0.2);
}

body.theme-light .logo-mark {
  background: linear-gradient(135deg, rgba(0, 153, 122, 0.1) 0%, rgba(99, 102, 241, 0.06) 100%);
  border-color: rgba(0, 153, 122, 0.3);
}

body.theme-light .logo-mark:hover,
body.theme-light .logo-mark.tilt-3d:hover {
  color: #00997a;
  border-color: rgba(0, 153, 122, 0.5);
  box-shadow: 0 0 16px rgba(0, 153, 122, 0.15);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1.2rem;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  transform: rotate(15deg) scale(1.05);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.theme-toggle:active {
  transform: rotate(15deg) scale(0.98);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding-top: var(--header-h);
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* Photo-style: deep blue gradient on left, fading to dark */
.hero-gradient-left {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(15, 25, 55, 0.85) 0%, rgba(15, 25, 55, 0.4) 35%, transparent 55%);
  pointer-events: none;
}

@media (max-width: 768px) {
  .hero-gradient-left {
    background: linear-gradient(160deg, rgba(15, 25, 55, 0.7) 0%, rgba(15, 25, 55, 0.25) 40%, transparent 65%);
  }
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 12s ease-in-out infinite;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--accent);
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: #6366f1;
  bottom: -50px;
  left: -50px;
  animation-delay: -6s;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 170, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 170, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(30px, -30px) scale(1.05);
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

/* Hero entrance animation */
.hero-reveal .hero-label {
  animation: heroFadeUp 0.8s ease-out 0.1s both;
}

.hero-reveal .hero-title {
  animation: heroFadeUp 0.8s ease-out 0.25s both;
}

.hero-reveal .hero-subtitle {
  animation: heroFadeUp 0.8s ease-out 0.4s both;
}

.hero-reveal .hero-cta {
  animation: heroFadeUp 0.8s ease-out 0.55s both;
}

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-label {
  font-size: 0.9rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 14px;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #fff 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  line-height: 1.5;
}

.hero-cta {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}

.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  border-radius: 2px;
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {

  0%,
  100% {
    opacity: 0.3;
    transform: scaleY(0.8);
  }

  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

/* ===== PC / large screen polish ===== */
@media (min-width: 1024px) {
  .hero-content {
    max-width: 560px;
    padding: 0 24px;
  }

  .hero-label {
    font-size: 0.85rem;
    letter-spacing: 0.25em;
    margin-bottom: 16px;
  }

  .hero-title {
    font-size: clamp(3.25rem, 5vw, 4.5rem);
    margin-bottom: 20px;
  }

  .hero-subtitle {
    font-size: 1.35rem;
    margin-bottom: 40px;
  }

  .hero-cta {
    gap: 20px;
  }

  .hero-cta .btn {
    min-width: 140px;
  }

  .scroll-hint {
    bottom: 48px;
  }

  .nav-links {
    gap: 36px;
  }

  .nav-links a {
    font-size: 1rem;
  }
}

/* ===== Buttons (3D hover – strong) ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, background 0.2s, border-color 0.2s, color 0.2s;
  transform-style: preserve-3d;
  perspective: 600px;
}

.btn.tilt-3d {
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
}

.btn:hover {
  transform: translateY(-6px) translateZ(16px) scale(1.02);
}

.btn.tilt-3d:hover {
  transform: translateY(-6px) translateZ(16px) scale(1.02) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
}

.btn:active {
  transform: translateY(-2px) translateZ(4px) scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 6px 20px var(--accent-glow), 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  background: #00f5c4;
  box-shadow: 0 14px 40px var(--accent-glow), 0 6px 16px rgba(0, 0, 0, 0.25);
}

.btn-ghost {
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 8px 24px var(--accent-glow), 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ===== Sections ===== */
.section {
  padding: 100px 0;
  position: relative;
}

.section-alt {
  background: rgba(255, 255, 255, 0.02);
}

.section-label {
  display: block;
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.section-lead {
  max-width: 640px;
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 40px;
}

/* ===== Scroll reveal ===== */
.reveal-section {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-section .card,
.reveal-section .work-stack span,
.reveal-section .blog-card,
.reveal-section .about-content p,
.reveal-section .timeline-item,
.reveal-section .contact-layout>* {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 48px auto 0;
  padding: 20px 0;
}

.timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--accent), transparent);
  transform: translateX(-50%);
  opacity: 0.3;
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: 0 40px;
  margin-bottom: 48px;
}

.timeline-item:nth-child(even) {
  left: 0;
  text-align: right;
}

.timeline-item:nth-child(odd) {
  left: 50%;
}

.timeline-dot {
  position: absolute;
  top: 24px;
  width: 16px;
  height: 16px;
  background: var(--bg);
  border: 3px solid var(--accent);
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 0 12px var(--accent-glow);
  transition: background 0.3s;
}

.timeline-item:nth-child(even) .timeline-dot {
  right: -8px;
}

.timeline-item:nth-child(odd) .timeline-dot {
  left: -8px;
}

.timeline-item:hover .timeline-dot {
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent);
}

.timeline-date {
  display: inline-block;
  padding: 6px 14px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
  border: 1px solid rgba(0, 212, 170, 0.2);
}

body.theme-light .timeline-date {
  border-color: rgba(0, 153, 122, 0.2);
}

.timeline-content {
  padding: 24px;
}

/* ===== Intro cards (3D hover – strong) ===== */
.intro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 40px;
  perspective: 1200px;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s, border-color 0.3s, box-shadow 0.45s;
  transform-style: preserve-3d;
  perspective: 1200px;
  will-change: transform;
}

.card.tilt-3d {
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 212, 170, 0.3);
  transform: translateY(-14px) rotateX(6deg) rotateY(-4deg) translateZ(20px) scale(1.02);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.35), 0 12px 24px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 212, 170, 0.15);
}

.card.tilt-3d:hover {
  transform: translateY(-14px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateZ(20px) scale(1.02);
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.35), 0 12px 24px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 212, 170, 0.15);
}

@media (hover: none) {

  .card:hover,
  .card.tilt-3d:hover {
    transform: none;
    box-shadow: none;
    background: var(--bg-card);
    border-color: var(--border);
  }
}

.card-featured {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--accent-dim) 100%);
  border-color: rgba(0, 212, 170, 0.2);
}

.card-icon {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 16px;
}

.card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ===== Work stack ===== */
.work-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.work-stack span {
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all 0.2s;
}

.work-stack span.tilt-3d {
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
}

.work-stack span:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.work-stack span.tilt-3d:hover {
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) scale(1.05);
}

/* ===== About ===== */
.about-content {
  max-width: 100%;
  margin-top: 24px;
}

.about-content p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 1.05rem;
}

/* ===== Background Particle Canvas ===== */
.bg-particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* ===== 3D Canvas Particle Sphere ===== */
.canvas-sphere-wrap {
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1;
  margin: 40px auto 0;
  position: relative;
  cursor: grab;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-sphere-wrap:active {
  cursor: grabbing;
}

.canvas-sphere-small {
  max-width: 280px;
  margin: 32px auto 0;
}

.canvas-sphere-contact {
  max-width: 350px;
  margin: 40px auto 0;
}

.sphere-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ===== Contact Layout ===== */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 40px;
  align-items: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

body.theme-light .bg-particles-canvas {
  mix-blend-mode: multiply;
  opacity: 0.6;
}

@media (max-width: 768px) {
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ===== Blog ===== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 40px;
  perspective: 1200px;
}

.blog-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s, box-shadow 0.45s;
  transform-style: preserve-3d;
  perspective: 1200px;
}

.blog-card.tilt-3d {
  transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
}

.blog-card:hover {
  border-color: rgba(0, 212, 170, 0.3);
  transform: translateY(-12px) rotateX(5deg) rotateY(-3deg) translateZ(16px) scale(1.02);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3), 0 8px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 212, 170, 0.15);
}

.blog-card.tilt-3d:hover {
  transform: translateY(-12px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateZ(16px) scale(1.02);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3), 0 8px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 212, 170, 0.15);
}

@media (hover: none) {

  .blog-card:hover,
  .blog-card.tilt-3d:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border);
  }
}

.blog-card-link {
  display: block;
  padding: 28px;
  color: inherit;
}

.blog-card-link:hover {
  color: inherit;
}

.blog-date {
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.blog-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.blog-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===== Contact ===== */
.contact-section {
  padding-bottom: 120px;
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  margin-top: 40px;
}

@media (max-width: 768px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

.contact-info p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.social-links {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap;
  gap: 14px;
  align-items: center;
  flex-flow: row nowrap;
}

@media (max-width: 380px) {
  .social-links {
    flex-wrap: wrap;
  }
}

.contact-info .social-links .social-icon {
  display: inline-flex;
  flex-shrink: 0;
  flex-basis: auto;
}

.social-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  max-width: 48px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}

.social-icon:hover {
  color: var(--accent);
  border-color: rgba(0, 212, 170, 0.4);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.social-icon .icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

body.theme-light .social-icon:hover {
  color: var(--accent);
  border-color: rgba(0, 153, 122, 0.4);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form .btn {
  align-self: flex-start;
}

/* ===== Footer ===== */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.footer p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--accent);
}

/* ===== Mobile ===== */
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

  .hero-reveal .hero-label,
  .hero-reveal .hero-title,
  .hero-reveal .hero-subtitle,
  .hero-reveal .hero-cta {
    animation: none;
  }

  .card.tilt-3d:not(.tilt-active),
  .blog-card.tilt-3d:not(.tilt-active) {
    animation: none;
  }

  .reveal-section {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .reveal-section.is-visible {
    transform: none;
  }

  .card:hover,
  .blog-card:hover {
    transform: translateY(-4px);
  }

  .btn:hover {
    transform: translateY(-1px);
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
    z-index: 1001;
  }

  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    gap: 32px;
    border-bottom: none;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
  }

  body.theme-light .nav-links {
    background: rgba(245, 245, 249, 0.98);
  }

  .nav-links.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links li {
    width: 100%;
    text-align: center;
  }

  .nav-links a {
    font-size: 1.5rem;
    font-weight: 600;
    display: block;
    padding: 10px;
  }

  .section {
    padding: 64px 0;
  }

  .section-title {
    font-size: 2.25rem;
  }

  .hero-cta {
    flex-direction: column;
    width: 100%;
    gap: 16px;
  }

  .hero-cta .btn {
    width: 100%;
    max-width: 320px;
  }

  .contact-layout {
    gap: 32px;
  }

  .intro-grid,
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .timeline-line {
    left: 20px;
  }

  .timeline-item {
    width: 100%;
    padding: 0 0 0 48px;
  }

  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    left: 0;
    text-align: left;
  }

  .timeline-item:nth-child(odd) .timeline-dot,
  .timeline-item:nth-child(even) .timeline-dot {
    left: 12px;
  }

  /* Disable 3D tilt on mobile for better scrolling */
  .tilt-3d {
    transform: none !important;
    transition: none;
  }
}

/* ===== Glitch Hint (Easter Egg) ===== */
.pulse-hint {
  position: absolute;
  right: -50px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: var(--accent);
  opacity: 0.7;
  pointer-events: none;
  animation: pulse-op 2s infinite ease-in-out;
  white-space: nowrap;
}

@keyframes pulse-op {

  0%,
  100% {
    opacity: 0.3;
  }

  50% {
    opacity: 1;
  }
}

.cyber-card:hover .glitch-hint {
  position: relative;
  display: inline-block;
  animation: glitch-anim 2s infinite linear alternate-reverse;
  color: #0f0;
  text-shadow: 2px 0 var(--accent), -2px 0 var(--text);
}

.glitch-hint {
  transition: all 0.3s ease;
}

.glitch-hint::before,
.glitch-hint::after {
  content: "Cybersecurity";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.cyber-card:hover .glitch-hint::before {
  left: 2px;
  text-shadow: -1px 0 red;
  animation: glitch-anim-2 3s infinite linear alternate-reverse;
  opacity: 0.8;
}

.cyber-card:hover .glitch-hint::after {
  left: -2px;
  text-shadow: -1px 0 blue;
  animation: glitch-anim 2.5s infinite linear alternate-reverse;
  opacity: 0.8;
}

@keyframes glitch-anim {
  0% {
    clip-path: inset(20% 0 80% 0);
  }

  20% {
    clip-path: inset(60% 0 10% 0);
  }

  40% {
    clip-path: inset(40% 0 50% 0);
  }

  60% {
    clip-path: inset(80% 0 5% 0);
  }

  80% {
    clip-path: inset(10% 0 70% 0);
  }

  100% {
    clip-path: inset(30% 0 20% 0);
  }
}

@keyframes glitch-anim-2 {
  0% {
    clip-path: inset(10% 0 60% 0);
  }

  20% {
    clip-path: inset(30% 0 20% 0);
  }

  40% {
    clip-path: inset(70% 0 10% 0);
  }

  60% {
    clip-path: inset(20% 0 50% 0);
  }

  80% {
    clip-path: inset(50% 0 30% 0);
  }

  100% {
    clip-path: inset(5% 0 80% 0);
  }
}

/* ===== Scroll Progress ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #6366f1);
  width: 0%;
  z-index: 10001;
  transition: width 0.1s ease-out;
}

/* ===== Custom Cursor ===== */
@media (prefers-reduced-motion: no-preference) {

  body.has-custom-cursor,
  body.has-custom-cursor a,
  body.has-custom-cursor button,
  body.has-custom-cursor .btn,
  body.has-custom-cursor .theme-toggle,
  body.has-custom-cursor .nav-toggle,
  body.has-custom-cursor .tilt-3d,
  body.has-custom-cursor .card,
  body.has-custom-cursor .blog-card {
    cursor: none !important;
  }

  body.has-custom-cursor input,
  body.has-custom-cursor textarea {
    cursor: text !important;
  }
}

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 12000;
  transform: translate(-50%, -50%);
  transition: background-color 0.2s, width 0.2s, height 0.2s;
}

.custom-cursor-follower {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(0, 212, 170, 0.5);
  background-color: rgba(0, 212, 170, 0.05);
  border-radius: 50%;
  pointer-events: none;
  z-index: 11999;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, background-color 0.2s, border-color 0.2s;
}

body.theme-light .custom-cursor-follower {
  border-color: rgba(0, 153, 122, 0.5);
  background-color: rgba(0, 153, 122, 0.05);
}

.custom-cursor.cursor-hover {
  background-color: transparent;
}

.custom-cursor-follower.cursor-hover {
  width: 60px;
  height: 60px;
  background-color: rgba(0, 212, 170, 0.15);
  border-color: transparent;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

body.theme-light .custom-cursor-follower.cursor-hover {
  background-color: rgba(0, 153, 122, 0.15);
}

/* ===== Typewriter ===== */
.typewriter-text {
  border-right: 2px solid var(--accent);
  padding-right: 4px;
  animation: blinkCursor 0.75s step-end infinite;
  white-space: nowrap;
  display: inline-block;
  min-height: 1.5em;
  /* Prevent layout jump if empty */
}

@keyframes blinkCursor {

  from,
  to {
    border-color: transparent;
  }

  50% {
    border-color: var(--accent);
  }
}

/* ===== Easter Egg Terminal ===== */
.easter-egg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.terminal-container {
  width: 100%;
  max-width: 800px;
  height: 60vh;
  background: #0d0d0d;
  border: 1px solid #333;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 212, 170, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: termPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes termPop {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.terminal-header {
  height: 38px;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  padding: 0 16px;
  position: relative;
}

.terminal-buttons {
  display: flex;
  gap: 8px;
}

.term-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.term-btn.close {
  background: #ff5f56;
  cursor: pointer;
}

.term-btn.close:hover {
  filter: brightness(1.2);
}

.term-btn.min {
  background: #ffbd2e;
}

.term-btn.max {
  background: #27c93f;
}

.terminal-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: #888;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.terminal-output {
  padding: 24px;
  font-family: var(--font-mono);
  color: #0c0;
  /* Hacker green */
  font-size: 0.95rem;
  line-height: 1.6;
  flex: 1;
  overflow-y: auto;
  text-shadow: 0 0 5px rgba(0, 204, 0, 0.4);
}

.terminal-output p {
  margin-bottom: 8px;
  margin-top: 0;
}

.terminal-output .error {
  color: #f33;
  text-shadow: 0 0 5px rgba(255, 51, 51, 0.4);
  background: rgba(255, 0, 0, 0.1);
  display: inline-block;
}

.terminal-output .success {
  color: #0f0;
}

.terminal-output .system {
  color: #0aa;
}

.terminal-output .cursor-blink {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: #0c0;
  vertical-align: middle;
  animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
  50% {
    opacity: 0;
  }
}

/* ===== Mobile Responsive for 3D Spheres ===== */
@media (max-width: 768px) {
  .canvas-sphere-wrap {
    max-width: 320px;
    margin: 24px auto 0;
  }

  .canvas-sphere-small {
    max-width: 240px;
    margin: 20px auto 0;
  }

  .canvas-sphere-contact {
    max-width: 260px;
    margin: 24px auto 0;
  }

  .terminal-container {
    width: 95vw;
    height: 70vh;
  }

  .terminal-output {
    font-size: 0.8rem;
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .canvas-sphere-wrap {
    max-width: 260px;
  }

  .canvas-sphere-small {
    max-width: 200px;
  }

  .terminal-container {
    width: 98vw;
    height: 65vh;
  }

  .terminal-output {
    font-size: 0.75rem;
    padding: 12px;
  }
}