/* ==========================================================================
   WIN MARTIN — Core stylesheet
   Deep-space dark theme, glassmorphism, neon/monochrome accent glows
   ========================================================================== */

:root {
  --space-950: #050507;
  --space-900: #0a0a10;
  --space-850: #0d0d16;
  --space-800: #12121d;
  --space-700: #1c1c2c;
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.05);
  --text-primary: #f3f4f8;
  --text-muted: #8a8fa3;
  --glow-cyan: #5eead4;
  --glow-blue: #60a5fa;
  --glow-violet: #a78bfa;
  --accent: #7dd3fc;
}

* {
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: auto; /* Lenis handles smooth scroll */
  background: var(--space-950);
}

body {
  background: var(--space-950);
  color: var(--text-primary);
  font-family: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  overflow-x: hidden;
  cursor: default;
}

::selection {
  background: rgba(94, 234, 212, 0.25);
  color: #ffffff;
}

/* ---------------------------------------------------------------------- */
/* Scrollbar                                                               */
/* ---------------------------------------------------------------------- */
html {
  scrollbar-width: auto;
  scrollbar-color: rgba(255, 255, 255, 0.28) var(--space-900);
}
::-webkit-scrollbar { width: 14px; }
::-webkit-scrollbar-track { background: var(--space-900); }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  border: 3px solid var(--space-900);
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.42); }

/* ---------------------------------------------------------------------- */
/* Background canvases / fixed layers                                     */
/* ---------------------------------------------------------------------- */
#starfield-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.bg-grid {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
}

/* ---------------------------------------------------------------------- */
/* Glassmorphism                                                          */
/* ---------------------------------------------------------------------- */
.glass {
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-strong {
  background: rgba(20, 20, 32, 0.55);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---------------------------------------------------------------------- */
/* Navigation                                                              */
/* ---------------------------------------------------------------------- */
#navbar {
  transition: top 0.5s ease, padding 0.5s ease, transform 0.5s ease;
}

#navbar .nav-inner {
  transition: max-width 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.5s ease, box-shadow 0.5s ease;
}

#navbar.scrolled .nav-inner {
  max-width: 56rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.nav-link {
  position: relative;
  color: var(--text-muted);
  transition: color 0.25s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 1px;
  background: linear-gradient(90deg, var(--glow-cyan), var(--glow-blue));
  transition: width 0.3s ease;
}
.nav-link:hover {
  color: var(--text-primary);
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}
.nav-link.active {
  color: var(--text-primary);
}

/* ---------------------------------------------------------------------- */
/* Floating persistent CTA                                                 */
/* ---------------------------------------------------------------------- */
.fab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  border-radius: 999px;
  color: var(--text-primary);
  transition: background-color 0.3s ease, transform 0.2s ease, border-color 0.3s ease;
}
.fab:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}
.fab:active {
  transform: translateY(0);
}

.fab-pulse {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  pointer-events: none;
}
.fab-pulse::before,
.fab-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid rgba(94, 234, 212, 0.35);
  animation: fab-pulse 3s ease-out infinite;
}
.fab-pulse::after {
  animation-delay: 1.5s;
}
@keyframes fab-pulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* ---------------------------------------------------------------------- */
/* Hero                                                                    */
/* ---------------------------------------------------------------------- */
#hero {
  position: relative;
}

.hero-headline {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
  background: linear-gradient(180deg, #ffffff 0%, #c9d4e6 55%, #7c8bab 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 60px rgba(125, 211, 252, 0.18));
}

.hero-kicker {
  letter-spacing: 0.35em;
  color: var(--section-accent, var(--text-muted));
}

/* Per-section accent colors — give each major section its own pop */
.section-accent-cyan { --section-accent: var(--glow-cyan); }
.section-accent-blue { --section-accent: var(--glow-blue); }
.section-accent-violet { --section-accent: var(--glow-violet); }

/* Section titles — subtle depth so headings stay crisp over background photos */
main h2.font-display,
footer h2.font-display {
  text-shadow: 0 4px 32px rgba(0, 0, 0, 0.55);
}

.pillar-cell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
  transition: border-color 0.4s ease, background-color 0.4s ease, transform 0.4s ease;
}
.pillar-cell::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: radial-gradient(120px 120px at var(--mx, 50%) var(--my, 50%), rgba(94, 234, 212, 0.18), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.pillar-cell:hover::before {
  opacity: 1;
}
.pillar-cell:hover {
  border-color: rgba(94, 234, 212, 0.35);
  background: rgba(255, 255, 255, 0.04);
}
.pillar-cell:hover .pillar-num {
  opacity: 1;
  transform: translateY(0);
}
.pillar-num {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* floating space objects */
.space-object {
  position: absolute;
  pointer-events: none;
  will-change: transform;
}

/* hero elements animated via scrubbed ScrollTrigger — hint the compositor
   so opacity/transform updates stay smooth in both scroll directions */
[data-hero-kicker],
[data-hero-headline],
[data-hero-pillars],
[data-scroll-cue],
#starfield-canvas {
  will-change: opacity, transform;
}

.planet {
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.25), transparent 40%),
    radial-gradient(circle at 65% 70%, var(--p-color, #60a5fa), var(--p-color-dark, #1e3a8a) 70%);
  box-shadow: 0 0 60px var(--p-glow, rgba(96, 165, 250, 0.35)), inset -10px -10px 30px rgba(0,0,0,0.45);
}

.animate-drift {
  animation: drift 14s ease-in-out infinite;
}
.animate-drift-slow {
  animation: drift 22s ease-in-out infinite;
}
@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(14px, -22px, 0) rotate(4deg); }
}

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

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 2.25rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  letter-spacing: 0.3em;
}
.scroll-cue .line {
  width: 1px;
  height: 36px;
  background: linear-gradient(180deg, rgba(255,255,255,0.5), transparent);
  animation: scroll-cue-flow 2s ease-in-out infinite;
}
@keyframes scroll-cue-flow {
  0%, 100% { transform: scaleY(1); opacity: 0.4; }
  50% { transform: scaleY(1.3); opacity: 1; }
}

/* ---------------------------------------------------------------------- */
/* Bento cards — Media & Tech                                              */
/* ---------------------------------------------------------------------- */
.bento-card {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255,255,255,0.035), rgba(255,255,255,0.005));
  border-radius: 1rem;
  overflow: hidden;
  transition: border-color 0.4s ease, transform 0.35s ease, box-shadow 0.4s ease;
}
.bento-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(220px 220px at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--section-accent, var(--glow-cyan)) 14%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.bento-card:hover::before { opacity: 1; }
.bento-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px -20px color-mix(in srgb, var(--section-accent, var(--glow-cyan)) 55%, transparent);
}

.bento-icon {
  transition: transform 0.4s ease, color 0.4s ease;
}
.bento-card:hover .bento-icon {
  transform: scale(1.08) translateY(-2px);
  color: var(--section-accent, var(--glow-cyan));
}

/* Tech cards — cybernetic corner brackets */
.tech-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: linear-gradient(165deg, rgba(255,255,255,0.04), rgba(255,255,255,0.005) 60%);
  overflow: hidden;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.tech-card::before,
.tech-card::after,
.tech-card .bracket-tl,
.tech-card .bracket-br {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: var(--section-accent, var(--accent));
  opacity: 0;
  transition: opacity 0.4s ease, width 0.4s ease, height 0.4s ease;
}
.tech-card::before {
  top: -1px; left: -1px;
  border-top: 2px solid var(--section-accent, var(--accent));
  border-left: 2px solid var(--section-accent, var(--accent));
}
.tech-card::after {
  bottom: -1px; right: -1px;
  border-bottom: 2px solid var(--section-accent, var(--accent));
  border-right: 2px solid var(--section-accent, var(--accent));
}
.tech-card:hover::before,
.tech-card:hover::after {
  opacity: 0.9;
  width: 38px;
  height: 38px;
}
.tech-card:hover {
  border-color: color-mix(in srgb, var(--section-accent, var(--accent)) 35%, transparent);
  box-shadow: 0 0 50px -16px color-mix(in srgb, var(--section-accent, var(--accent)) 55%, transparent);
}

.tech-card .scan {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(125,211,252,0.6), transparent);
  top: -10%;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.tech-card:hover .scan {
  opacity: 1;
  animation: scan-move 2.2s linear infinite;
}
@keyframes scan-move {
  0% { top: -5%; }
  100% { top: 105%; }
}

/* ---------------------------------------------------------------------- */
/* Section background photography                                         */
/* ---------------------------------------------------------------------- */
.section-photo {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  filter: grayscale(55%) brightness(0.32) contrast(1.05);
  opacity: 0.65;
  pointer-events: none;
}
.section-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 25% 15%, color-mix(in srgb, var(--section-accent, transparent) 16%, transparent), transparent 55%),
    linear-gradient(180deg, var(--space-950) 0%, rgba(5, 5, 7, 0.45) 28%, rgba(5, 5, 7, 0.6) 72%, var(--space-950) 100%),
    linear-gradient(90deg, var(--space-950) 0%, rgba(5, 5, 7, 0.15) 35%, rgba(5, 5, 7, 0.15) 65%, var(--space-950) 100%);
}

/* ---------------------------------------------------------------------- */
/* About — founder photo & signature                                      */
/* ---------------------------------------------------------------------- */
.about-photo-glow {
  position: absolute;
  inset: -12%;
  z-index: -1;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--glow-blue) 35%, transparent), transparent 65%);
  filter: blur(50px);
  pointer-events: none;
}
.about-photo {
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.6);
}
.signature-img {
  mix-blend-mode: screen;
  opacity: 0.95;
}

/* ---------------------------------------------------------------------- */
/* Section divider — connector line + glowing node                        */
/* ---------------------------------------------------------------------- */
.section-divider {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.section-divider .divider-line {
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 50%, transparent);
}
.section-divider .divider-node {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin: 0 1rem;
  background: var(--glow-cyan);
  transform: rotate(45deg);
  box-shadow: 0 0 14px rgba(94, 234, 212, 0.55);
}
.section-divider--blue .divider-node {
  background: var(--glow-blue);
  box-shadow: 0 0 14px rgba(96, 165, 250, 0.55);
}
.section-divider--violet .divider-node {
  background: var(--glow-violet);
  box-shadow: 0 0 14px rgba(167, 139, 250, 0.55);
}

/* ---------------------------------------------------------------------- */
/* Hero — orbit / constellation graphic                                    */
/* ---------------------------------------------------------------------- */
.hero-orbits {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(140vw, 1400px);
  height: min(140vw, 1400px);
  pointer-events: none;
  z-index: 0;
}
.hero-orbits .orbit-ring {
  transform-origin: 200px 200px;
  animation: spin-slow linear infinite;
}
.hero-orbits .orbit-ring--a { animation-duration: 90s; }
.hero-orbits .orbit-ring--b { animation-duration: 130s; animation-direction: reverse; }
.hero-orbits .orbit-dot {
  animation: orbit-pulse 4s ease-in-out infinite;
}
@keyframes orbit-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* ---------------------------------------------------------------------- */
/* Section reveal helper (used by GSAP) — initial state for fade-ups       */
/* ---------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(36px);
}

/* ---------------------------------------------------------------------- */
/* Footer                                                                  */
/* ---------------------------------------------------------------------- */
.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-muted);
  transition: color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
}
.social-icon:hover {
  color: var(--text-primary);
  border-color: rgba(94, 234, 212, 0.4);
  background: rgba(94, 234, 212, 0.06);
  transform: translateY(-3px);
}

.footer-link {
  color: var(--text-muted);
  transition: color 0.25s ease;
}
.footer-link:hover {
  color: var(--text-primary);
}

/* ---------------------------------------------------------------------- */
/* Misc utilities                                                          */
/* ---------------------------------------------------------------------- */
.text-glow-cyan {
  text-shadow: 0 0 24px rgba(94, 234, 212, 0.35);
}

.font-display { font-family: "Space Grotesk", sans-serif; }
.font-body { font-family: "DM Sans", sans-serif; }

@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;
  }
}
