/* ============================================
   VADIM.AI — Floating Poster + Orbit Menu
   ============================================ */

/* CSS Custom Properties */
:root {
  /* Colors — matching index2 */
  --color-bg: #06070a;
  --color-bg-alt: #0b1020;
  --color-surface: rgba(8, 10, 16, 0.78);
  --color-border: rgba(255, 255, 255, 0.10);
  
  --color-text: rgba(255, 255, 255, 0.92);
  --color-text-muted: rgba(255, 255, 255, 0.60);
  
  --color-vadim-blue: #22a4ff;
  --color-vadim-blue-light: #5cbfff;
  --color-ai-white: #ffffff;
  
  --color-blog-accent: #FFFFFF;

  --color-linkedin-accent: #0A66C2;
  
  /* Typography */
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.66rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  
  /* Animation */
  --duration-fast: 150ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* Layout */
  --logo-size: 200px;
  --orbit-radius: 220px;
  --orbit-radius-hover: 260px;
  
  /* Poster */
  --poster-height: 110vh;
  --poster-tilt-x: 12deg;
  --poster-tilt-y: -4deg;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-normal: 0ms;
    --duration-slow: 0ms;
  }
  
  .poster {
    transform: none !important;
  }
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  position: relative;
}

/* Ambient background gradient */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse 100% 80% at 50% 20%, rgba(34, 164, 255, 0.06), transparent 50%),
    radial-gradient(ellipse 80% 60% at 70% 80%, rgba(183, 108, 255, 0.04), transparent 50%);
  pointer-events: none;
  z-index: -2;
}

/* Focus styles */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-vadim-blue);
  outline-offset: 3px;
}

/* ============================================
   Floating Poster (3D Scene)
   ============================================ */
.poster-scene {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1500px;
  perspective-origin: 50% 50%;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}

.poster {
  position: relative;
  height: var(--poster-height);
  transform-style: preserve-3d;
  transform:
    rotateX(var(--poster-tilt-x))
    rotateY(var(--poster-tilt-y))
    translateZ(-100px);
  transition: transform 0.15s ease-out;
  will-change: transform;
}

.poster-image {
  display: block;
  width: auto;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  /* Subtle darkening to not compete with UI */
  filter: brightness(0.7) saturate(0.9);
  transition: filter 0.3s ease;
}

/* Poster frame effect */
.poster-frame {
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  pointer-events: none;
  box-shadow: 
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 25px 80px rgba(0, 0, 0, 0.6),
    0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Glow behind poster */
.poster-glow {
  position: absolute;
  inset: -60px;
  background: radial-gradient(
    ellipse 60% 50% at 50% 50%,
    rgba(34, 164, 255, 0.08) 0%,
    rgba(183, 108, 255, 0.04) 40%,
    transparent 70%
  );
  filter: blur(40px);
  z-index: -1;
  pointer-events: none;
}

/* ============================================
   Hub Layout (Navigation Nucleus)
   ============================================ */
.hub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--space-xl);
  position: relative;
  z-index: 10;
}

/* ============================================
   Logo Trigger Button
   ============================================ */
.logo-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--logo-size);
  height: var(--logo-size);
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 10;
  transition: transform var(--duration-normal) var(--ease-out);
}

.logo-trigger:hover,
.logo-trigger:focus-visible,
.logo-trigger[aria-expanded="true"] {
  transform: scale(1.05);
}

.logo-trigger:active {
  transform: scale(0.98);
}

/* Logo Image */
.logo-mark {
  width: 55%;
  height: 55%;
  object-fit: contain;
  opacity: 0.75;
}

/* ============================================
   Navigation Menu — Orbital Design
   ============================================ */
.nav-menu {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 5;
}

.nav-list {
  list-style: none;
  position: relative;
}

/* Position each nav item in orbit */
.nav-item {
  position: absolute;
  left: 50%;
  top: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  transition: 
    opacity var(--duration-normal) var(--ease-out),
    transform var(--duration-slow) var(--ease-elastic);
}

/* 
  5 items spread around the circle
  Blog at top, others distributed below
*/

/* Blog - Top center (most prominent) */
.nav-item:nth-child(1) {
  --angle: -90deg;
  --delay: 0ms;
}

/* LinkedIn - Upper right */
.nav-item:nth-child(2) {
  --angle: -30deg;
  --delay: 40ms;
}

/* CV - Lower right */
.nav-item:nth-child(3) {
  --angle: 30deg;
  --delay: 80ms;
}

/* X - Bottom */
.nav-item:nth-child(4) {
  --angle: 90deg;
  --delay: 120ms;
}

/* GitHub - Lower left */
.nav-item:nth-child(5) {
  --angle: 150deg;
  --delay: 160ms;
}

.nav-item {
  transition-delay: var(--delay);
}

/* Reveal state - items move to orbit positions */
/* Mobile/keyboard: .is-open class via JS */
.hub.is-open .nav-menu {
  pointer-events: auto;
}

.hub.is-open .nav-item {
  opacity: 1;
  transform:
    translate(-50%, -50%)
    rotate(var(--angle))
    translateY(calc(-1 * var(--orbit-radius)))
    rotate(calc(-1 * var(--angle)))
    scale(1.3);
}

/* Desktop proximity/click reveal - handled by JS adding .is-open class */

/* Hover state - expand orbit slightly */
.hub.is-open .nav-item:hover {
  transform:
    translate(-50%, -50%)
    rotate(var(--angle))
    translateY(calc(-1 * 0.85 * var(--orbit-radius-hover)))
    rotate(calc(-1 * var(--angle)))
    scale(1.43);
}

/* ============================================
   Navigation Links — Glowing Nodes
   ============================================ */
.nav-link {
  opacity: 0.80;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  /*padding: var(--space-sm) var(--space-md);*/
  padding: var(--space-md) var(--space-md);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border-radius: 100px;
  background: rgba(6, 7, 10, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(34, 164, 255, 0.05);
  transition: 
    color var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--color-text);
  background: rgba(20, 24, 35, 0.95);
  border-color: rgba(34, 164, 255, 0.3);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(34, 164, 255, 0.15);
}

/* Nav Icons */
.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-external {
  width: 10px;
  height: 10px;
  opacity: 0.4;
  margin-left: 2px;
}

/* ============================================
   Blog Link — Special Styling (Primary CTA)
   ============================================ */
.nav-link--blog {
  color: var(--color-blog-accent);
  font-size: 1rem;
  font-weight: 600;
  /*padding: var(--space-md) var(--space-lg);*/
  background: color-mix(in srgb, var(--color-blog-accent) 25%, black);
  border: 2px solid color-mix(in srgb, var(--color-blog-accent) 35%, black);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.4),
    0 0 40px color-mix(in srgb, var(--color-blog-accent) 20%, transparent);
}

.nav-link--blog:hover,
.nav-link--blog:focus-visible {
  color: color-mix(in srgb, var(--color-blog-accent) 75%, white);
  background: color-mix(in srgb, var(--color-blog-accent) 25%, black);
  border-color: var(--color-blog-accent);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.5),
    0 0 60px color-mix(in srgb, var(--color-blog-accent) 30%, transparent),
    0 0 100px color-mix(in srgb, var(--color-blog-accent) 15%, transparent);
}

/* ============================================
   LinkedIn Link — Special Styling
   ============================================ */
.nav-link--linkedin {
  color: var(--color-linkedin-accent);
  font-size: 1rem;
  font-weight: 600;
  /*padding: var(--space-md) var(--space-lg);*/
  background: color-mix(in srgb, var(--color-linkedin-accent) 25%, black);
  border: 2px solid color-mix(in srgb, var(--color-linkedin-accent) 35%, black);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.4),
    0 0 40px color-mix(in srgb, var(--color-linkedin-accent) 20%, transparent);
}

.nav-link--linkedin:hover,
.nav-link--linkedin:focus-visible {
  color: color-mix(in srgb, var(--color-linkedin-accent) 75%, white);
  background: color-mix(in srgb, var(--color-linkedin-accent) 25%, black);
  border-color: var(--color-linkedin-accent);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.5),
    0 0 60px color-mix(in srgb, var(--color-linkedin-accent) 30%, transparent),
    0 0 100px color-mix(in srgb, var(--color-linkedin-accent) 15%, transparent);
}

.nav-link--blog .nav-icon {
  width: 18px;
  height: 18px;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-md) var(--space-xl);
  text-align: center;
  z-index: 20;
}

.footer-text {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  opacity: 0.5;
  letter-spacing: 0.05em;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Large screens */
@media (min-width: 1400px) {
  :root {
    --logo-size: 240px;
    --orbit-radius: 280px;
    --orbit-radius-hover: 320px;
    --poster-height: 120vh;
  }
}

/* Desktop */
@media (min-width: 1024px) and (max-width: 1399px) {
  :root {
    --logo-size: 200px;
    --orbit-radius: 240px;
    --orbit-radius-hover: 280px;
  }
}

/* Tablet */
@media (max-width: 900px) {
  :root {
    --logo-size: 160px;
    --orbit-radius: 190px;
    --orbit-radius-hover: 220px;
    --poster-height: 115vh;
    --poster-tilt-x: 8deg;
    --poster-tilt-y: -2deg;
  }
  
  .nav-link {
    font-size: 0.85rem;
    padding: var(--space-sm) var(--space-md);
  }
  
  .nav-link--blog {
    font-size: 0.95rem;
    padding: var(--space-sm) var(--space-md);
  }
}

/* Mobile */
@media (max-width: 600px) {
  :root {
    --logo-size: 140px;
    --orbit-radius: 160px;
    --orbit-radius-hover: 180px;
    --poster-height: 120vh;
    --poster-tilt-x: 5deg;
    --poster-tilt-y: -1deg;
  }
  
  .hub {
    padding: var(--space-lg);
  }
  
  .nav-link {
    min-height: 44px;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.8rem;
  }
  
  .nav-link--blog {
    font-size: 0.9rem;
    padding: var(--space-sm) var(--space-lg);
  }
  
  /* Hide external link icons on mobile */
  .nav-external {
    display: none;
  }
  
  .poster-image {
    filter: brightness(0.5) saturate(0.8);
  }
}

/* Very small screens - reduce orbit */
@media (max-width: 400px) {
  :root {
    --logo-size: 120px;
    --orbit-radius: 140px;
    --orbit-radius-hover: 155px;
  }
  
  .nav-link {
    font-size: 0.75rem;
    padding: var(--space-xs) var(--space-sm);
  }
  
  .nav-link--blog {
    font-size: 0.85rem;
  }
}

/* Ultra-wide */
@media (min-width: 1920px) {
  :root {
    --logo-size: 280px;
    --orbit-radius: 340px;
    --orbit-radius-hover: 400px;
    --poster-height: 130vh;
  }
  
  .nav-link {
    font-size: 1rem;
    padding: var(--space-md) var(--space-lg);
  }
  
  .nav-link--blog {
    font-size: 1.1rem;
  }
}

/* ============================================
   Utility: Screen Reader Only
   ============================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
