/* ==========================================================================
   NSSoftDev — Custom Stylesheet
   Author: Nikolay Savosin (NSSoftDev)
   --------------------------------------------------------------------------
   This file layers on top of Tailwind CSS (loaded via CDN in the <head> of
   index.html / resume.html). Tailwind handles layout, spacing and the base
   responsive grid; everything here is the "cinematic" layer that Tailwind
   utility classes can't express cleanly: glassmorphism, neon glow effects,
   the custom cursor, the canvas background container, capsule buttons and
   the fine-grained brand animations (float, pulse, gradient shimmer, etc).

   Table of contents:
     1.  Design tokens (CSS custom properties)
     2.  Base / global resets & typography
     3.  Scrollbar & selection
     4.  Canvas background layer
     5.  Custom cursor (magnetic, active-mode only)
     6.  Glassmorphism utilities
     7.  Glow utilities
     8.  Capsule buttons
     9.  Rounded container utility
     10. Header & navigation
     11. Language switcher
     12. Hero section
     13. Floating tech tags
     14. About & tech stack
     15. Portfolio showcase
     16. Footer & social capsule links
     17. Resume page specific styles
     18. Preloader
     19. Scroll reveal helpers (paired with GSAP in animations.js)
     20. Keyframe animations
     21. Responsive tweaks
     22. Print styles (resume PDF)
     23. Reduced motion support
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   Central source of truth for the brand palette & geometry. Tailwind config
   (inline in <head>) references some of these via CSS variables so both
   systems stay perfectly in sync.
   -------------------------------------------------------------------------- */
:root {
  /* Brand core */
  --color-bg: #0A0A0C;              /* premium near-black background */
  --color-bg-elevated: #111114;      /* slightly lifted panels */
  --color-bg-soft: #16161A;          /* cards, inputs */
  --color-purple: #8A2BE2;           /* primary brand violet */
  --color-purple-soft: #A855F7;      /* lighter violet for text/hover */
  --color-emerald: #00E599;          /* neon emerald accent */
  --color-emerald-soft: #34F5B3;     /* lighter emerald for hover */

  /* Text */
  --color-text-primary: #F5F5F7;
  --color-text-secondary: #A0A0AC;
  --color-text-muted: #6B6B75;

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, var(--color-purple) 0%, var(--color-emerald) 100%);
  --gradient-brand-reverse: linear-gradient(135deg, var(--color-emerald) 0%, var(--color-purple) 100%);
  --gradient-radial-glow: radial-gradient(circle, rgba(138,43,226,0.35) 0%, rgba(0,229,153,0.12) 45%, transparent 70%);

  /* Geometry */
  --radius-container: 20px;   /* 16px–24px range required by spec */
  --radius-container-lg: 24px;
  --radius-container-sm: 16px;
  --radius-capsule: 9999px;

  /* Elevation / glow */
  --shadow-glow-purple: 0 0 40px rgba(138, 43, 226, 0.45);
  --shadow-glow-emerald: 0 0 40px rgba(0, 229, 153, 0.45);
  --shadow-glow-mixed: 0 0 60px rgba(138, 43, 226, 0.25), 0 0 30px rgba(0, 229, 153, 0.2);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.45);

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.035);
  --glass-bg-strong: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-blur: 20px;

  /* Motion */
  --ease-cinematic: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 0.25s;
  --duration-base: 0.45s;
  --duration-slow: 0.8s;

  /* Fonts */
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}


/* --------------------------------------------------------------------------
   2. BASE / GLOBAL
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
}

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

body {
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Only hide the native cursor once we know we're on a fine-pointer (mouse)
   device AND JS has confirmed the custom cursor initialized successfully.
   This class is toggled on <body> by main.js — touch devices never get it,
   so mobile/tablet users keep their normal cursor/tap behaviour. */
body.custom-cursor-active {
  cursor: none;
}
body.custom-cursor-active a,
body.custom-cursor-active button,
body.custom-cursor-active [data-cursor-hover] {
  cursor: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

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

/* Reusable gradient text treatment for headings/accents */
.text-gradient-brand {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 200%;
  animation: gradient-shift 6s ease infinite;
}

/* Section container rhythm */
.section-padding {
  padding-top: clamp(4rem, 10vw, 8rem);
  padding-bottom: clamp(4rem, 10vw, 8rem);
}


/* --------------------------------------------------------------------------
   3. SCROLLBAR & SELECTION
   -------------------------------------------------------------------------- */
::selection {
  background: var(--color-purple);
  color: #fff;
}

html {
  scrollbar-width: thin;
  scrollbar-color: var(--color-purple) var(--color-bg);
}
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--gradient-brand);
  border-radius: var(--radius-capsule);
  border: 2px solid var(--color-bg);
}


/* --------------------------------------------------------------------------
   4. CANVAS BACKGROUND LAYER
   The <canvas id="bg-canvas"> sits fixed behind all content. Ambient +
   interactive particle logic lives in js/main.js; this just positions and
   fades it in nicely once the JS has booted.
   -------------------------------------------------------------------------- */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s var(--ease-cinematic);
  pointer-events: none;
}
#bg-canvas.is-ready {
  opacity: 1;
}

/* Soft vignette overlay to keep text readable over the particle field and
   reinforce the "premium dark" cinematic look at the viewport edges. */
.bg-vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 40%, rgba(10,10,12,0.55) 100%),
    linear-gradient(to bottom, rgba(10,10,12,0.4) 0%, transparent 15%, transparent 85%, rgba(10,10,12,0.7) 100%);
}

/* Everything else in the document sits above the canvas/vignette layers */
.content-layer {
  position: relative;
  z-index: 2;
}


/* --------------------------------------------------------------------------
   5. CUSTOM CURSOR
   Two-part cursor: a small solid dot that tracks instantly, and a larger
   ring that trails with easing and "magnetically" snaps to hoverable
   elements (data-cursor-hover). Disabled entirely on touch devices by JS.
   -------------------------------------------------------------------------- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  will-change: transform;
}

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

.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(138, 43, 226, 0.7);
  border-radius: 50%;
  transition: width var(--duration-fast) var(--ease-cinematic),
              height var(--duration-fast) var(--ease-cinematic),
              border-color var(--duration-fast) var(--ease-cinematic),
              background var(--duration-fast) var(--ease-cinematic);
}

/* Magnetic "hover" state — grows, fills softly, ring color flips emerald */
.cursor-ring.is-hovering {
  width: 64px;
  height: 64px;
  background: rgba(0, 229, 153, 0.08);
  border-color: var(--color-emerald);
}

@media (hover: none), (pointer: coarse) {
  .cursor-dot, .cursor-ring { display: none !important; }
}


/* --------------------------------------------------------------------------
   6. GLASSMORPHISM UTILITIES
   -------------------------------------------------------------------------- */
.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-container);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  box-shadow: var(--shadow-card);
}

.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-container);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  transition: transform var(--duration-base) var(--ease-cinematic),
              border-color var(--duration-base) var(--ease-cinematic),
              background var(--duration-base) var(--ease-cinematic),
              box-shadow var(--duration-base) var(--ease-cinematic);
}

.glass-card:hover {
  transform: translateY(-6px);
  background: var(--glass-bg-strong);
  border-color: rgba(138, 43, 226, 0.4);
  box-shadow: var(--shadow-glow-mixed);
}


/* --------------------------------------------------------------------------
   7. GLOW UTILITIES
   -------------------------------------------------------------------------- */
.glow-purple   { box-shadow: var(--shadow-glow-purple); }
.glow-emerald  { box-shadow: var(--shadow-glow-emerald); }
.glow-mixed    { box-shadow: var(--shadow-glow-mixed); }

.text-glow-emerald {
  text-shadow: 0 0 20px rgba(0, 229, 153, 0.6);
}
.text-glow-purple {
  text-shadow: 0 0 20px rgba(138, 43, 226, 0.6);
}

/* Slow ambient pulse used on hero accents / status dots even when idle */
.glow-pulse {
  animation: glow-pulse 3.2s ease-in-out infinite;
}


/* --------------------------------------------------------------------------
   8. CAPSULE BUTTONS
   -------------------------------------------------------------------------- */
.btn-capsule {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-capsule);
  padding: 0.85rem 2rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform var(--duration-fast) var(--ease-cinematic),
              box-shadow var(--duration-fast) var(--ease-cinematic),
              background var(--duration-fast) var(--ease-cinematic),
              border-color var(--duration-fast) var(--ease-cinematic);
}
.btn-capsule:active {
  transform: scale(0.96);
}

/* Primary: solid brand gradient fill */
.btn-capsule-primary {
  background: var(--gradient-brand);
  background-size: 180% 180%;
  color: #06060A;
  border: 1px solid transparent;
}
.btn-capsule-primary:hover {
  box-shadow: var(--shadow-glow-mixed);
  transform: translateY(-3px);
  background-position: 100% 0;
}

/* Secondary: glass outline, fills with brand color on hover */
.btn-capsule-outline {
  background: var(--glass-bg);
  color: var(--color-text-primary);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}
.btn-capsule-outline:hover {
  border-color: var(--color-emerald);
  color: var(--color-emerald);
  box-shadow: var(--shadow-glow-emerald);
  transform: translateY(-3px);
}

/* Small capsule used for nav pills / language switcher trigger */
.btn-capsule-sm {
  padding: 0.45rem 1.1rem;
  font-size: 0.82rem;
}


/* --------------------------------------------------------------------------
   9. ROUNDED CONTAINER UTILITY (generic — anything not covered above)
   -------------------------------------------------------------------------- */
.rounded-container {
  border-radius: var(--radius-container);
}


/* --------------------------------------------------------------------------
   10. HEADER & NAVIGATION
   -------------------------------------------------------------------------- */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.1rem 0;
  transition: padding var(--duration-base) var(--ease-cinematic),
              background var(--duration-base) var(--ease-cinematic),
              border-color var(--duration-base) var(--ease-cinematic),
              box-shadow var(--duration-base) var(--ease-cinematic);
  border-bottom: 1px solid transparent;
}

/* Applied by main.js once the user scrolls past the hero fold */
#site-header.is-scrolled {
  padding: 0.65rem 0;
  background: rgba(10, 10, 12, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: rgba(255, 255, 255, 0.07);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.nav-link {
  position: relative;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--duration-fast) ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--gradient-brand);
  border-radius: 2px;
  transition: width var(--duration-base) var(--ease-cinematic);
}
.nav-link:hover,
.nav-link.is-active {
  color: var(--color-text-primary);
}
.nav-link:hover::after,
.nav-link.is-active::after {
  width: 100%;
}

.logo-mark {
  height: 34px;
  width: auto;
  filter: drop-shadow(0 0 14px rgba(138, 43, 226, 0.45));
  transition: filter var(--duration-base) ease, transform var(--duration-base) ease;
}
.logo-mark:hover {
  filter: drop-shadow(0 0 20px rgba(0, 229, 153, 0.6));
  transform: rotate(-4deg) scale(1.04);
}

/* Mobile nav drawer */
#mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(10, 10, 12, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity var(--duration-base) var(--ease-cinematic),
              transform var(--duration-base) var(--ease-cinematic),
              visibility 0s linear var(--duration-base);
}
#mobile-nav.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity var(--duration-base) var(--ease-cinematic),
              transform var(--duration-base) var(--ease-cinematic),
              visibility 0s;
}
#mobile-nav .nav-link {
  font-family: var(--font-display);
  font-size: 1.6rem;
}

.hamburger {
  width: 26px;
  height: 18px;
  position: relative;
}
.hamburger span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-text-primary);
  border-radius: 2px;
  transition: transform var(--duration-base) var(--ease-cinematic),
              opacity var(--duration-base) var(--ease-cinematic),
              top var(--duration-base) var(--ease-cinematic);
}
.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 8px; }
.hamburger span:nth-child(3) { top: 16px; }
.hamburger.is-active span:nth-child(1) { top: 8px; transform: rotate(45deg); }
.hamburger.is-active span:nth-child(2) { opacity: 0; }
.hamburger.is-active span:nth-child(3) { top: 8px; transform: rotate(-45deg); }


/* --------------------------------------------------------------------------
   11. LANGUAGE SWITCHER
   Capsule trigger + glass dropdown listing RU / EN / UZ with flag emoji.
   Logic (open/close, data-lang application) lives in js/main.js.
   -------------------------------------------------------------------------- */
.lang-switcher {
  position: relative;
}

.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.lang-trigger .chevron {
  transition: transform var(--duration-fast) var(--ease-cinematic);
}
.lang-switcher.is-open .lang-trigger .chevron {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 160px;
  padding: 0.4rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top right;
  transition: opacity var(--duration-fast) var(--ease-cinematic),
              transform var(--duration-fast) var(--ease-cinematic),
              visibility 0s linear var(--duration-fast);
  z-index: 110;
}
.lang-switcher.is-open .lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition: opacity var(--duration-fast) var(--ease-cinematic),
              transform var(--duration-fast) var(--ease-cinematic),
              visibility 0s;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-capsule);
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  transition: background var(--duration-fast) ease, color var(--duration-fast) ease;
}
.lang-option:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-primary);
}
.lang-option.is-active {
  color: var(--color-emerald);
  background: rgba(0, 229, 153, 0.08);
}


/* --------------------------------------------------------------------------
   12. HERO SECTION
   -------------------------------------------------------------------------- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: 6rem;
  perspective: 1200px; /* enables the 3D parallax tilt driven by animations.js */
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-emerald);
}

.hero-title {
  font-size: clamp(2.4rem, 6.5vw, 5.2rem);
  line-height: 1.05;
  font-weight: 700;
}

.hero-slogan {
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  color: var(--color-text-secondary);
  max-width: 42ch;
}

/* 3D layers used for the mouse-parallax effect — each layer is offset a
   different amount by animations.js based on data-depth */
.hero-parallax-layer {
  will-change: transform;
  transform-style: preserve-3d;
}

/* Large soft brand blobs behind the hero copy, drifting on their own even
   at rest (see keyframes) and nudged further by the parallax layer above */
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}
.hero-blob-purple {
  width: 480px;
  height: 480px;
  background: var(--color-purple);
  top: -10%;
  left: -8%;
  animation: blob-drift-a 14s ease-in-out infinite;
}
.hero-blob-emerald {
  width: 420px;
  height: 420px;
  background: var(--color-emerald);
  bottom: -12%;
  right: -6%;
  animation: blob-drift-b 16s ease-in-out infinite;
}


/* --------------------------------------------------------------------------
   13. FLOATING TECH TAGS (hero)
   -------------------------------------------------------------------------- */
.tech-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-capsule);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  color: var(--color-text-secondary);
  animation: tag-float 5s ease-in-out infinite;
}
.tech-tag:nth-child(odd) { animation-duration: 6s; }
.tech-tag:nth-child(3n) { animation-duration: 7s; animation-delay: -1.2s; }
.tech-tag:nth-child(4n) { animation-delay: -2.4s; }


/* --------------------------------------------------------------------------
   14. ABOUT & TECH STACK
   -------------------------------------------------------------------------- */
.stack-card {
  padding: 1.5rem;
  border-radius: var(--radius-container-sm);
  text-align: center;
}
/* Circular gradient "badge" used in place of third-party tech logos —
   keeps the stack grid on-brand and avoids any external logo/icon
   dependency or trademark concerns. */
.stack-card .stack-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 0.85rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  background-size: 160% 160%;
  color: #06060A;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.7rem;
  transition: background-position var(--duration-base) ease, transform var(--duration-base) var(--ease-cinematic);
}
.stack-card:hover .stack-icon {
  background-position: 100% 0;
  transform: scale(1.08) rotate(-6deg);
}

.approach-point {
  border-radius: var(--radius-container-sm);
  padding: 1.5rem;
}
.approach-point .approach-index {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-purple-soft);
}


/* --------------------------------------------------------------------------
   15. PORTFOLIO SHOWCASE
   -------------------------------------------------------------------------- */
.project-card {
  position: relative;
  border-radius: var(--radius-container-lg);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--color-bg-soft);
}

.project-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

/* Faint diagonal "circuit" texture layered over each project's gradient
   placeholder thumbnail — swap .project-thumb backgrounds for real
   screenshots and this texture still reads as a nice subtle overlay. */
.thumb-pattern::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.06) 0px,
    rgba(255, 255, 255, 0.06) 1px,
    transparent 1px,
    transparent 14px
  );
  mix-blend-mode: overlay;
}

.project-card-media .project-thumb {
  position: absolute;
  inset: 0;
  transition: transform 0.7s var(--ease-cinematic), filter 0.7s var(--ease-cinematic);
  transform: scale(1.02);
}

.project-card:hover .project-thumb {
  transform: scale(1.12);
  filter: saturate(1.15) brightness(1.05);
}

.project-card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,10,12,0.92) 0%, rgba(10,10,12,0.15) 55%, transparent 100%);
  pointer-events: none;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-capsule);
  background: rgba(255,255,255,0.07);
  color: var(--color-text-secondary);
}

.project-card-link {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  transition: transform var(--duration-fast) var(--ease-cinematic),
              background var(--duration-fast) ease,
              box-shadow var(--duration-fast) ease;
}
.project-card:hover .project-card-link {
  box-shadow: var(--shadow-glow-emerald);
}
.project-card-link:hover {
  transform: scale(1.1) rotate(45deg);
  background: var(--color-emerald);
  color: #06060A;
}


/* --------------------------------------------------------------------------
   16. FOOTER & SOCIAL CAPSULE LINKS
   Each platform gets its own accent color for the glow (kept close to each
   service's real brand color) while the resting state stays on-brand
   (dark glass) so the footer doesn't look like a rainbow at rest.
   -------------------------------------------------------------------------- */
#site-footer {
  border-top: 1px solid var(--glass-border);
  position: relative;
}

.social-capsule {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-capsule);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: transform var(--duration-fast) var(--ease-cinematic),
              color var(--duration-fast) ease,
              border-color var(--duration-fast) ease,
              box-shadow var(--duration-fast) ease,
              background var(--duration-fast) ease;
  --social-glow: rgba(138, 43, 226, 0.5);
}
.social-capsule svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.social-capsule:hover {
  transform: translateY(-4px);
  color: var(--color-text-primary);
  border-color: transparent;
  box-shadow: 0 0 28px var(--social-glow), 0 6px 20px rgba(0,0,0,0.35);
  background: rgba(255,255,255,0.06);
}

/* Per-service accent (glow color only — keeps footer cohesive with brand) */
.social-capsule[data-social="telegram"]  { --social-glow: rgba(41, 165, 230, 0.55); }
.social-capsule[data-social="github"]    { --social-glow: rgba(255, 255, 255, 0.35); }
.social-capsule[data-social="instagram"] { --social-glow: rgba(225, 48, 108, 0.5); }
.social-capsule[data-social="x"]         { --social-glow: rgba(255, 255, 255, 0.35); }
.social-capsule[data-social="email"]     { --social-glow: rgba(0, 229, 153, 0.55); }
.social-capsule[data-social="linkedin"]  { --social-glow: rgba(10, 102, 194, 0.55); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
}


/* --------------------------------------------------------------------------
   17. RESUME PAGE SPECIFIC STYLES
   -------------------------------------------------------------------------- */
.resume-hero {
  padding-top: 8rem;
}

.resume-photo-ring {
  position: relative;
  border-radius: 50%;
  isolation: isolate;
}

/* Rotating conic gradient — the visible spinning "border" */
.resume-photo-ring::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--color-purple) 0deg,
    var(--color-emerald) 120deg,
    var(--color-purple-soft) 240deg,
    var(--color-purple) 360deg
  );
  animation: spin-slow 5s linear infinite;
  z-index: -2;
}

/* Soft pulsing halo behind the ring for extra depth */
.resume-photo-ring::after {
  content: '';
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  background: var(--gradient-radial-glow);
  animation: glow-pulse 3.2s ease-in-out infinite;
  z-index: -3;
}

.resume-photo-ring img {
  position: relative;
  z-index: 1;
  display: block;
  /* creates a clean gap between the photo and the spinning ring behind it */
  box-shadow: 0 0 0 4px var(--color-bg);
}

@media (prefers-reduced-motion: reduce) {
  .resume-photo-ring::before,
  .resume-photo-ring::after {
    animation: none;
  }
}


/* --------------------------------------------------------------------------
   18. COOKIE NOTICE BANNER
   -------------------------------------------------------------------------- */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 95;
  padding: 1rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.6s var(--ease-cinematic), opacity 0.6s var(--ease-cinematic);
  pointer-events: none;
}

.cookie-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.cookie-banner-inner {
  width: 100%;
  max-width: 780px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem 1.5rem;
  padding: 1.1rem 1.4rem;
  border-radius: 20px;
  background: rgba(17, 17, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.cookie-banner-text {
  flex: 1 1 320px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin: 0;
}

.cookie-banner-btn {
  flex-shrink: 0;
  padding: 0.65rem 1.6rem;
  font-size: 0.85rem;
}

@media (max-width: 480px) {
  .cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .cookie-banner-btn {
    width: 100%;
  }
}

.timeline {
  position: relative;
  padding-left: 2.25rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-purple), var(--color-emerald));
  opacity: 0.4;
}
.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.25rem;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 2px solid var(--color-emerald);
  box-shadow: 0 0 12px rgba(0, 229, 153, 0.6);
}
.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-purple-soft);
  letter-spacing: 0.03em;
}

.skill-row {
  margin-bottom: 1.1rem;
}
.skill-track {
  height: 8px;
  border-radius: var(--radius-capsule);
  background: rgba(255,255,255,0.07);
  overflow: hidden;
}
.skill-fill {
  height: 100%;
  border-radius: var(--radius-capsule);
  background: var(--gradient-brand);
  width: 0%; /* animated to data-level via JS/GSAP on scroll into view */
  transition: width 1.4s var(--ease-cinematic);
}

.edu-card, .cv-card {
  border-radius: var(--radius-container);
  padding: 1.75rem;
}

/* Sticky mini-CTA sidebar column on wide viewports */
.resume-sticky {
  position: sticky;
  top: 6.5rem;
}


/* --------------------------------------------------------------------------
   18. PRELOADER
   Brief cinematic "ignition" moment before the site reveals itself — keeps
   the very first impression premium instead of a flash of unstyled layout.
   -------------------------------------------------------------------------- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s var(--ease-cinematic), visibility 0.7s;
}
#preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#preloader .preloader-mark {
  width: 64px;
  height: 64px;
  animation: preloader-pulse 1.4s ease-in-out infinite;
}


/* --------------------------------------------------------------------------
   19. SCROLL REVEAL HELPERS
   .reveal-up elements are fully visible by default (no CSS opacity:0) —
   this is deliberate: if JavaScript fails to load or is disabled, content
   must still be readable. animations.js applies the hidden "from" state
   itself (via GSAP's fromTo) only once it has actually booted, then
   animates each element in as it scrolls into view.
   -------------------------------------------------------------------------- */
.reveal-up {
  /* Intentionally no base opacity/transform — see comment above. */
}


/* --------------------------------------------------------------------------
   20. KEYFRAME ANIMATIONS
   -------------------------------------------------------------------------- */
@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

@keyframes tag-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-10px) rotate(-1.5deg); }
}

@keyframes blob-drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(30px, 40px) scale(1.08); }
  66%      { transform: translate(-20px, 15px) scale(0.96); }
}

@keyframes blob-drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(-25px, -30px) scale(1.05); }
  66%      { transform: translate(15px, -10px) scale(0.94); }
}

@keyframes preloader-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(138,43,226,0.5)); }
  50%      { transform: scale(1.12); filter: drop-shadow(0 0 22px rgba(0,229,153,0.7)); }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.animate-spin-slow {
  animation: spin-slow 12s linear infinite;
}


/* --------------------------------------------------------------------------
   21. RESPONSIVE TWEAKS
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .hero-blob-purple, .hero-blob-emerald {
    filter: blur(60px);
    opacity: 0.4;
  }
  .glass-card:hover {
    transform: none; /* avoid layout jump on touch */
  }
  .resume-sticky {
    position: static;
  }
}

@media (max-width: 480px) {
  .btn-capsule {
    padding: 0.75rem 1.5rem;
    font-size: 0.88rem;
  }
}


/* --------------------------------------------------------------------------
   22. PRINT STYLES (resume.html → "Download PDF Resume")
   The capsule button triggers window.print(); these rules turn the same
   markup into a clean, ink-friendly single-column CV instead of shipping a
   separate static PDF that could drift out of sync with the page content.
   -------------------------------------------------------------------------- */
@media print {
  #bg-canvas, .bg-vignette, .cursor-dot, .cursor-ring,
  #site-header, #site-footer, #mobile-nav, #preloader,
  .no-print, .hero-blob-purple, .hero-blob-emerald {
    display: none !important;
  }
  html, body {
    /* !important needed here to beat the Tailwind .bg-brandbg utility
       class applied directly on <body> (class selectors outrank the
       plain element selector otherwise). */
    background: #fff !important;
    color: #111 !important;
  }
  .glass-card, .glass-panel, .cv-card, .edu-card {
    background: #fff !important;
    border: 1px solid #ddd !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    color: #111;
  }
  .text-gradient-brand {
    -webkit-text-fill-color: initial;
    background: none;
    color: #6b1fb8;
  }
  a { color: #6b1fb8; text-decoration: underline; }

  /* Body copy throughout the site uses semi-transparent white utility
     classes (text-white/40 … text-white/70) for hierarchy against the
     dark background — on printed white paper those read as near-invisible
     light grey. Remap every one of them to solid, legible dark greys. */
  [class*="text-white/70"] { color: #1a1a1a !important; }
  [class*="text-white/60"] { color: #333333 !important; }
  [class*="text-white/55"] { color: #3a3a3a !important; }
  [class*="text-white/50"] { color: #454545 !important; }
  [class*="text-white/45"] { color: #4d4d4d !important; }
  [class*="text-white/40"] { color: #555555 !important; }
  [class*="text-white/35"] { color: #666666 !important; }

  /* Bright neon accent text (emerald/purple) also loses contrast on white
     paper — swap to darker, print-safe shades of the same brand hues. */
  [class*="text-brandemerald"], .hero-eyebrow, .timeline-period {
    color: #0a8a5c !important;
  }
  .text-glow-emerald, .text-glow-purple {
    text-shadow: none !important;
  }
}


/* --------------------------------------------------------------------------
   23. REDUCED MOTION
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
