/* ============================================================
   SANJAY SARASWAT — PORTFOLIO DESIGN SYSTEM
   Modern Cyber-Glass Aesthetics & Full Dynamic Animations
   ============================================================ */

/* ============ TOKENS ============ */
:root {
  --bg: #07090e;
  --bg-translucent: rgba(7, 9, 14, 0.75);
  --bg-elevated: #0e131f;
  --bg-elevated-2: #141c2e;
  --bg-glass: rgba(18, 24, 38, 0.58);
  --bg-glass-hover: rgba(26, 36, 56, 0.75);

  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent: #ff3838;
  --accent-glow: rgba(255, 56, 56, 0.35);
  --accent-cyan: #38bdf8;
  --accent-cyan-glow: rgba(56, 189, 248, 0.3);
  --accent-purple: #818cf8;
  --accent-emerald: #10b981;

  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --line-accent: rgba(255, 56, 56, 0.4);

  --f-display: 'Plus Jakarta Sans', sans-serif;
  --f-body: 'Space Grotesk', sans-serif;
  --f-mono: 'JetBrains Mono', monospace;

  --container: 1200px;
  --pad: clamp(20px, 4vw, 64px);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  cursor: default;
}

@media (min-width: 861px) {
  body {
    cursor: none;
  }
}

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

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

ul {
  list-style: none;
}

section {
  position: relative;
  z-index: 2;
  width: 100%;
  overflow-x: clip;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* ============ FULL-PAGE ANIMATED BACKGROUND ============ */
#bgField {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.75;
}

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.07) 0%, rgba(255, 56, 56, 0.04) 40%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: opacity 0.4s ease;
  will-change: transform;
}

/* Grain overlay */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  opacity: 0.028;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============ PRELOADER ============ */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}

.preloader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.preloader-spinner {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-right-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.preloader-word {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(22px, 3.5vw, 32px);
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, #fff 30%, var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.preloader-sub {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}

/* ============ CUSTOM CURSOR ============ */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9998;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease), height 0.3s var(--ease), border-color 0.3s, background 0.3s, transform 0.08s linear;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--accent);
}

.cursor span {
  font-family: var(--f-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
  white-space: nowrap;
}

.cursor.hover {
  width: 68px;
  height: 68px;
  border-color: var(--accent);
  background: rgba(255, 56, 56, 0.15);
  backdrop-filter: blur(4px);
}

.cursor.hover span {
  opacity: 1;
}

@media (max-width: 860px) {

  .cursor,
  .cursor-dot,
  .cursor-glow {
    display: none !important;
  }
}

/* ============ GLASS PANEL SYSTEM ============ */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transform: translateZ(0);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.glass-panel:hover {
  border-color: var(--line-strong);
  background: var(--bg-glass-hover);
  box-shadow: 0 12px 36px -10px rgba(0, 0, 0, 0.45);
}

/* ============ NAVIGATION ============ */
.nav-wrapper {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  justify-content: center;
  padding: 0 var(--pad);
  pointer-events: none;
}

.nav {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--container);
  padding: 12px 24px;
  background: rgba(11, 15, 25, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: all 0.35s var(--ease);
}

.nav-wrapper.scrolled .nav {
  background: rgba(7, 9, 14, 0.9);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 56, 56, 0.08);
}

.nav-mark {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.mark-gradient {
  background: linear-gradient(135deg, #fff, var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mark-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  transition: color 0.25s var(--ease);
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-cyan));
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width 0.25s var(--ease);
}

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

.nav-links a:hover::after {
  width: 100%;
}

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

.nav-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-full);
}

.status-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulseDot 2s ease infinite;
}

@keyframes pulseDot {

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

  50% {
    opacity: 0.4;
    transform: scale(0.85);
  }
}

.status-text {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  color: #34d399;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  transition: all 0.25s var(--ease);
}

.nav-cta:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-1px);
}

.nav-burger {
  display: none;
  background: none;
  border: none;
  width: 32px;
  height: 24px;
  position: relative;
  cursor: pointer;
  padding: 0;
}

.nav-burger span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease), top 0.3s;
}

.nav-burger span:nth-child(1) {
  top: 3px;
}

.nav-burger span:nth-child(2) {
  top: 11px;
}

.nav-burger span:nth-child(3) {
  top: 19px;
}

.nav-burger.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-burger.open span:nth-child(2) {
  opacity: 0;
}

.nav-burger.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 900px) {

  .nav-links,
  .nav-status-pill {
    display: none;
  }

  .nav-burger {
    display: block;
  }
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 490;
  background: rgba(7, 9, 14, 0.96);
  backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-100%);
  transition: transform 0.45s var(--ease);
}

.mobile-menu.open {
  transform: translateY(0);
}

.mobile-menu-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.mob-link {
  font-family: var(--f-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s, transform 0.2s;
}

.mob-link:hover {
  color: var(--text);
  transform: scale(1.05);
}

.mob-divider {
  width: 60px;
  height: 1px;
  background: var(--line-strong);
  margin: 10px 0;
}

.mob-cta {
  font-size: 16px;
  font-weight: 600;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-full);
}

/* ============ HERO SECTION ============ */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px var(--pad) 80px;
  position: relative;
  overflow: hidden;
  max-width: var(--container);
  margin: 0 auto;
}

#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s var(--ease);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 820px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--accent-cyan);
  margin-bottom: 24px;
}

.badge-icon {
  font-size: 14px;
}

.hero-name {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(48px, 8.5vw, 108px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.hero-name span {
  display: block;
}

.gradient-text {
  background: linear-gradient(135deg, #ffffff 10%, var(--accent-cyan) 60%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-statement {
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

/* Button System */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: var(--radius-full);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.28s var(--ease);
  position: relative;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
  background: #ff4d4d;
}

.btn-glass {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line-strong);
  color: var(--text);
  backdrop-filter: blur(10px);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-2px);
}

.btn-icon-copy {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-family: var(--f-mono);
  font-size: 12px;
  padding: 12px 18px;
}

.btn-icon-copy:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
}

/* Hero Stats Bar */
.hero-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 28px;
  background: rgba(14, 19, 31, 0.6);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  backdrop-filter: blur(16px);
  flex-wrap: wrap;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-num {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 20px;
  color: #fff;
}

.stat-label {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--line);
}

@media (max-width: 680px) {
  .hero-stats {
    gap: 16px;
    padding: 16px;
  }

  .stat-divider {
    display: none;
  }
}

/* Scroll Hint */
.hero-scroll-hint {
  position: absolute;
  bottom: 24px;
  left: var(--pad);
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.scroll-mouse {
  width: 18px;
  height: 28px;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  position: relative;
  display: flex;
  justify-content: center;
}

.scroll-wheel {
  width: 3px;
  height: 6px;
  background: var(--accent);
  border-radius: 2px;
  position: absolute;
  top: 5px;
  animation: scrollWheel 2s ease infinite;
}

@keyframes scrollWheel {
  0% {
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateY(12px);
  }
}

.reveal-up {
  opacity: 0;
  transform: translateY(28px);
}

/* ============ MARQUEE TICKER ============ */
.marquee-wrap {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  overflow: hidden;
  background: rgba(7, 9, 14, 0.4);
  backdrop-filter: blur(12px);
}

.marquee {
  display: flex;
}

.marquee-track {
  display: flex;
  flex-shrink: 0;
  gap: 24px;
  padding-right: 24px;
  animation: marquee 38s linear infinite;
  font-family: var(--f-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.marquee-track span.sep {
  color: var(--accent);
  opacity: 0.7;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

/* ============ SECTION HEADER UTILITIES ============ */
.section-header {
  margin-bottom: 48px;
}

.section-tag-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: rgba(255, 56, 56, 0.08);
  border: 1px solid rgba(255, 56, 56, 0.2);
  border-radius: var(--radius-full);
  margin-bottom: 18px;
}

.tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.section-tag {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(30px, 4.5vw, 48px);
  line-height: 1.15;
  color: var(--text);
}

.bg-ghost {
  position: absolute;
  top: 40%;
  left: 0;
  right: 0;
  z-index: 0;
  transform: translate3d(0, -50%, 0);
  will-change: transform;
  backface-visibility: hidden;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(100px, 20vw, 300px);
  letter-spacing: -0.04em;
  color: transparent;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 70%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.035);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

/* ============ ABOUT SECTION ============ */
.about {
  padding: 140px var(--pad);
  max-width: var(--container);
  margin: 0 auto;
}

.about-headline {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.35;
  color: var(--text);
  max-width: 960px;
}

.highlight-text {
  background: linear-gradient(120deg, #fff, var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 40px;
  perspective: 1200px;
}

.about-card {
  padding: 36px;
  position: relative;
  overflow: hidden;
  transition: transform 0.28s var(--ease), border-color 0.28s var(--ease), box-shadow 0.28s var(--ease);
}

.about-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  opacity: 0.5;
  transition: opacity 0.3s, height 0.3s;
}

.about-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.6), 0 0 24px rgba(56, 189, 248, 0.1);
}

.about-card:hover::before {
  opacity: 1;
  height: 3px;
}

.card-icon {
  font-size: 28px;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  transition: transform 0.3s var(--ease), background 0.3s;
}

.about-card:hover .card-icon {
  transform: scale(1.1) rotate(6deg);
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
}

.about-card h3 {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 14px;
  color: #fff;
}

.about-card p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.75;
}

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

/* ============ WORK / PROJECTS SECTION ============ */
.work {
  padding: 60px var(--pad) 140px;
  max-width: var(--container);
  margin: 0 auto;
}

.work-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}

.work-headline {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 44px);
  color: var(--text);
}

.work-subtitle {
  color: var(--text-muted);
  font-size: 15px;
}

.projects {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 40px;
  perspective: 1200px;
}

/* Interactive Project Card */
.project-card {
  padding: 32px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 24px;
  transition: transform 0.28s var(--ease), border-color 0.28s var(--ease), box-shadow 0.28s var(--ease);
  position: relative;
  overflow: hidden;
  background: var(--bg-glass);
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(56, 189, 248, 0.4), rgba(255, 56, 56, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.3;
  transition: opacity 0.3s var(--ease);
}

.project-card:hover {
  transform: translateY(-4px) scale(1.008);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.12);
}

.project-card:hover::before {
  opacity: 1;
}

.card-shine {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.06), transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.project-card:hover .card-shine {
  opacity: 1;
}

.p-num {
  font-family: var(--f-mono);
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-cyan);
  text-shadow: 0 0 12px var(--accent-cyan-glow);
}

.p-top-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.p-metric-badge {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 56, 56, 0.25), rgba(56, 189, 248, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

.p-featured-note {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.p-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(20px, 2.4vw, 26px);
  color: #fff;
  transition: color 0.25s;
}

.project-card:hover .p-title {
  color: var(--accent-cyan);
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.p-desc-short {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 6px 0 14px;
  max-width: 680px;
}

.p-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.p-tag {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.p-tag-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

.project-card:hover .p-tag {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.p-arrow-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 20px;
  transition: all 0.3s var(--ease);
}

.project-card:hover .p-arrow-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateX(4px) rotate(-45deg) scale(1.1);
  box-shadow: 0 0 20px var(--accent-glow);
}

@media (max-width: 768px) {
  .project-card {
    grid-template-columns: 1fr auto;
    padding: 24px;
  }

  .p-num {
    display: none;
  }
}

/* ============ PROJECT DETAIL MODAL ============ */
html.modal-open,
body.modal-open {
  overflow: hidden !important;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 32px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
}

.overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 10, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.overlay-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 860px;
  max-height: 85vh;
  background: #0d121e;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 44px);
  overflow-y: auto !important;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
  transform: translateY(20px) scale(0.98);
  transition: transform 0.3s var(--ease);
  outline: none;
}

.overlay-container::-webkit-scrollbar {
  width: 6px;
}

.overlay-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}

.overlay-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}

.overlay-container::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.overlay.open .overlay-container {
  transform: translateY(0) scale(1);
}

.overlay-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.overlay-close:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.overlay-content h2 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(26px, 4vw, 40px);
  margin: 12px 0 20px;
  color: #fff;
}

.ov-tag {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--accent-cyan);
}

.ov-links {
  display: flex;
  gap: 14px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.ov-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  transition: all 0.2s;
}

.ov-btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.ov-btn-primary:hover {
  box-shadow: 0 0 16px var(--accent-glow);
}

.ov-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
}

.ov-btn-secondary:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.ov-block {
  border-top: 1px solid var(--line);
  padding: 24px 0;
}

.ov-block h4 {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.ov-block p,
.ov-block li {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
}

.ov-block ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ov-block li::before {
  content: '✦ ';
  color: var(--accent-cyan);
}

.ov-tech {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.ov-tech span {
  font-family: var(--f-mono);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  color: var(--text);
}

/* ============ EXPERIENCE SECTION ============ */
.experience {
  padding: 60px var(--pad) 140px;
  max-width: var(--container);
  margin: 0 auto;
}

.timeline {
  margin-top: 40px;
}

.timeline-item {
  padding: 36px;
  position: relative;
  overflow: hidden;
  border-left: 3px solid var(--accent-cyan);
  transition: transform 0.28s var(--ease), border-color 0.28s var(--ease), box-shadow 0.28s var(--ease);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-cyan));
  box-shadow: 0 0 12px var(--accent-cyan);
}

.timeline-item:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.6), 0 0 25px rgba(56, 189, 248, 0.1);
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.timeline-badge {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--accent-cyan);
  border-radius: var(--radius-full);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

.timeline-date {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.timeline-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 6px;
}

.timeline-body h3 {
  font-family: var(--f-display);
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 700;
  color: #fff;
}

.timeline-tag {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  background: rgba(255, 56, 56, 0.1);
  border: 1px solid rgba(255, 56, 56, 0.3);
  border-radius: var(--radius-full);
  color: var(--accent);
  box-shadow: 0 0 10px rgba(255, 56, 56, 0.15);
}

.timeline-org {
  font-size: 14px;
  color: var(--accent-cyan);
  margin-bottom: 20px;
  font-family: var(--f-mono);
}

.timeline-points {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-points li {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
  position: relative;
  padding-left: 24px;
  transition: color 0.2s, transform 0.2s;
}

.timeline-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  transition: transform 0.2s, background 0.2s;
}

.timeline-points li:hover {
  color: #fff;
  transform: translateX(4px);
}

.timeline-points li:hover::before {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  transform: scale(1.4);
}

/* ============ SKILLS SECTION ============ */
.skills {
  padding: 60px var(--pad) 140px;
  max-width: var(--container);
  margin: 0 auto;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
  perspective: 1200px;
}

.skill-card {
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: transform 0.28s var(--ease), border-color 0.28s var(--ease), box-shadow 0.28s var(--ease);
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  opacity: 0.6;
  transition: opacity 0.3s, height 0.3s;
}

.skill-card:nth-child(1)::before { background: linear-gradient(90deg, transparent, #ff4757, transparent); }
.skill-card:nth-child(2)::before { background: linear-gradient(90deg, transparent, #38bdf8, transparent); }
.skill-card:nth-child(3)::before { background: linear-gradient(90deg, transparent, #f59e0b, transparent); }
.skill-card:nth-child(4)::before { background: linear-gradient(90deg, transparent, #818cf8, transparent); }
.skill-card:nth-child(5)::before { background: linear-gradient(90deg, transparent, #10b981, transparent); }
.skill-card:nth-child(6)::before { background: linear-gradient(90deg, transparent, #ec4899, transparent); }

.skill-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.6), 0 0 24px rgba(56, 189, 248, 0.08);
}

.skill-card:hover::before {
  opacity: 1;
  height: 3px;
}

.skill-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.skill-icon {
  font-size: 24px;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s var(--ease), background 0.25s;
}

.skill-card:hover .skill-icon {
  transform: scale(1.1) rotate(5deg);
  background: rgba(255, 255, 255, 0.08);
}

.skill-header h3 {
  font-family: var(--f-display);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.skill-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skill-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.2s, transform 0.2s, background 0.2s;
}

.skill-list li .bullet {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
  transition: transform 0.2s, background 0.2s;
}

.skill-list li:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(6px);
}

.skill-list li:hover .bullet {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  transform: scale(1.4);
}

@media (max-width: 960px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ============ CONTACT SECTION ============ */
.contact {
  padding: 60px var(--pad) 120px;
  max-width: var(--container);
  margin: 0 auto;
  position: relative;
}

.contact-container {
  padding: clamp(36px, 6vw, 68px);
  position: relative;
  overflow: hidden;
}

#contactCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}

.contact-glow-orb {
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 56, 56, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.contact-headline {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(28px, 4.5vw, 52px);
  line-height: 1.15;
  color: #fff;
  max-width: 720px;
  margin: 14px 0 18px;
}

.contact-desc {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 580px;
  margin-bottom: 40px;
}

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

.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.28s var(--ease);
}

.contact-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.cc-icon {
  font-size: 22px;
  margin-right: 14px;
}

.cc-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cc-label {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.cc-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.cc-action {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--accent-cyan);
  padding: 4px 10px;
  background: rgba(56, 189, 248, 0.08);
  border-radius: var(--radius-full);
}

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

/* ============ FOOTER ============ */
.footer {
  border-top: 1px solid var(--line);
  padding: 36px var(--pad);
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(16px);
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 13px;
  color: var(--text-dim);
}

.footer-brand {
  display: flex;
  flex-direction: column;
}

.fb-name {
  font-weight: 700;
  color: var(--text);
}

.fb-role {
  font-family: var(--f-mono);
  font-size: 11px;
}

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

.footer-links a {
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

/* ============ SIDE QUICK RAIL ============ */
.rail {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rail-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  cursor: pointer;
  position: relative;
  transition: all 0.3s var(--ease);
}

.rail-dot span {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
  background: var(--bg-elevated);
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  pointer-events: none;
}

.rail-dot:hover span {
  opacity: 1;
}

.rail-dot.active {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  transform: scale(1.6);
}

@media (max-width: 1100px) {
  .rail {
    display: none;
  }
}

/* ============ TOAST NOTIFICATION ============ */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #141c2e;
  border: 1px solid var(--accent);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-family: var(--f-mono);
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-glow);
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s var(--ease-spring);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

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

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

  .reveal-up {
    opacity: 1 !important;
    transform: none !important;
  }
}