/* ============================================================
   PESKOV.AI HERO — drop-in 3D-points hero block
   ============================================================
   All selectors scoped under `.hero` — safe to drop into any page.
   Required: <link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700;800&display=swap" rel="stylesheet">
   See /assets/hero/README.md for integration & tuning notes.
   ============================================================ */

.hero {
  --hero-bg: #050505;
  --hero-text: #ECE8DC;
  --hero-accent: #C6F432;
  --hero-muted: #6A6660;
  --hero-line: rgba(236, 232, 220, 0.10);

  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: var(--hero-bg);
  color: var(--hero-text);
  font-family: 'Roboto Condensed', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.hero, .hero *, .hero *::before, .hero *::after {
  box-sizing: border-box;
}

.hero #hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  filter: saturate(1.25);
}

/* Color vignette — fades edges to bg color */
.hero .bg-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(
    ellipse 50% 55% at center,
    transparent 22%,
    rgba(5, 5, 5, 0.18) 45%,
    rgba(5, 5, 5, 0.50) 65%,
    rgba(5, 5, 5, 0.85) 85%,
    rgba(5, 5, 5, 1) 100%
  );
}

/* Atmospheric ground vignette */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 40%, rgba(5, 5, 5, 0.65) 90%),
    linear-gradient(180deg, transparent 60%, rgba(5, 5, 5, 0.9));
  z-index: 2;
}

/* Top bar */
.hero .topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 24px 56px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}
.hero .topbar::before {
  content: '';
  position: absolute;
  bottom: 0; left: 56px; right: 56px;
  height: 1px;
  background: var(--hero-line);
}

.hero .logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--hero-text);
}
.hero .logo img {
  height: 26px;
  width: auto;
  display: block;
}
.hero .brand-label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--hero-text);
  padding-left: 14px;
  border-left: 1px solid rgba(236, 232, 220, 0.18);
  line-height: 1;
}
.hero .brand-label em {
  color: var(--hero-accent);
  font-style: normal;
  font-weight: 600;
  margin-left: 4px;
}

.hero .topnav {
  display: flex;
  gap: 40px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.hero .topnav a {
  color: var(--hero-text);
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.hero .topnav a:hover { opacity: 1; }

/* Hamburger (mobile only) */
.hero .hamburger {
  display: none;
  width: 36px; height: 36px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  position: relative;
  z-index: 110;
}
.hero .hamburger span {
  position: absolute;
  left: 8px; right: 8px;
  height: 1.5px;
  background: var(--hero-text);
  border-radius: 1px;
  transition: transform 0.25s, opacity 0.2s, top 0.25s;
}
.hero .hamburger span:nth-child(1) { top: 12px; }
.hero .hamburger span:nth-child(2) { top: 17.5px; }
.hero .hamburger span:nth-child(3) { top: 23px; }
.hero .hamburger.open span:nth-child(1) { top: 17.5px; transform: rotate(45deg); }
.hero .hamburger.open span:nth-child(2) { opacity: 0; }
.hero .hamburger.open span:nth-child(3) { top: 17.5px; transform: rotate(-45deg); }

/* Center content */
.hero .content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
  padding: 120px 24px 0;
  text-align: center;
}

.hero .kicker {
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--hero-text);
  opacity: 0.55;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero .kicker .lime {
  width: 24px;
  height: 1px;
  background: var(--hero-accent);
  display: inline-block;
}

.hero h1 {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 700;
  font-size: clamp(46px, 7.4vw, 116px);
  line-height: 1.0;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  margin: 0;
}
.hero h1 .line { display: block; }
.hero h1 .word { display: inline-block; }
.hero h1 .word + .word { margin-left: 0.32em; }
.hero h1 .accent { color: var(--hero-accent); }

/* Enigma scrambling word */
.hero .word-rotator {
  display: inline-block;
  color: var(--hero-accent);
  vertical-align: baseline;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.hero .word-rotator .flap {
  display: inline-block;
  min-width: 0.42em;
  text-align: center;
}
.hero .word-rotator .flap.scrambling {
  opacity: 0.85;
}

.hero .tagline {
  margin-top: 24px;
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--hero-text);
  opacity: 0.65;
}

.hero .cta {
  display: flex;
  gap: 0;
  margin-top: 44px;
  pointer-events: auto;
  border: 1px solid var(--hero-text);
  background: rgba(5, 5, 5, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.hero .btn {
  padding: 18px 30px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: background 0.2s, color 0.2s;
}
.hero .btn.primary {
  background: var(--hero-accent);
  color: var(--hero-bg);
}
.hero .btn.primary:hover { background: #B5E022; }
.hero .btn.ghost {
  background: transparent;
  color: var(--hero-text);
  border-left: 1px solid var(--hero-text);
}
.hero .btn.ghost:hover {
  background: var(--hero-text);
  color: var(--hero-bg);
}
.hero .btn .arrow {
  width: 14px; height: 1px;
  background: currentColor;
  position: relative;
}
.hero .btn .arrow::after {
  content: '';
  position: absolute;
  right: 0; top: -3px;
  width: 6px; height: 6px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}

/* Corner labels */
.hero .corner {
  position: absolute;
  bottom: 32px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--hero-text);
  opacity: 0.75;
  z-index: 10;
}
.hero .corner.left  { left: 56px; }
.hero .corner.right { right: 56px; text-align: right; }

/* Scroll indicator */
.hero .scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.5;
}
.hero .scroll .arrow-down {
  width: 1px; height: 22px;
  background: var(--hero-text);
  position: relative;
  animation: hero-drip 2.4s ease-in-out infinite;
}
.hero .scroll .arrow-down::after {
  content: '';
  position: absolute;
  bottom: 0; left: -3px;
  width: 7px; height: 7px;
  border-bottom: 1px solid var(--hero-text);
  border-right: 1px solid var(--hero-text);
  transform: rotate(45deg) translate(-2px, 0);
}
@keyframes hero-drip {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50%      { transform: translateY(8px); opacity: 1; }
}

/* Loader (overlay only — does NOT cover the rest of the page) */
.hero .hero-loader {
  position: absolute;
  inset: 0;
  background: var(--hero-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 0.6s;
  gap: 20px;
}
.hero .hero-loader.hidden {
  opacity: 0;
  pointer-events: none;
}
.hero .hero-loader-bar {
  width: 280px;
  height: 1px;
  background: rgba(236, 232, 220, 0.12);
  position: relative;
  overflow: hidden;
}
.hero .hero-loader-fill {
  position: absolute;
  height: 100%;
  background: var(--hero-accent);
  width: 0%;
  transition: width 0.4s ease;
}
.hero .hero-loader-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--hero-muted);
}
.hero .hero-loader-brand {
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.hero .hero-loader-brand .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--hero-accent);
  border-radius: 50%;
  margin: 0 2px 2px 4px;
  vertical-align: middle;
}

/* Responsive — mobile breakpoint */
@media (max-width: 768px) {
  .hero .topbar { padding: 16px 18px 12px; }
  .hero .topbar::before { left: 18px; right: 18px; }
  .hero .corner.left  { left: 18px; bottom: 22px; font-size: 10px; }
  .hero .corner.right { right: 18px; bottom: 22px; font-size: 10px; }

  /* Brand-label — keep, just shrink */
  .hero .brand-label {
    font-size: 9px;
    padding-left: 10px;
    letter-spacing: 0.18em;
  }

  /* Hamburger visible, nav becomes dropdown anchored top-right */
  .hero .hamburger { display: block; }
  .hero .topnav {
    position: absolute;
    top: 100%;
    right: 14px;
    left: auto;
    bottom: auto;
    width: auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
    padding: 18px 22px 20px;
    font-size: 13px;
    letter-spacing: 0.18em;
    background: rgba(5, 5, 5, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--hero-line);
    border-top: none;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  }
  .hero .topnav.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  /* Headline — bigger, per-word stacking (.line groups stay as block, .word inside become block) */
  .hero h1 {
    font-size: clamp(48px, 13vw, 80px);
    line-height: 0.98;
    letter-spacing: -0.03em;
  }
  .hero h1 .word { display: block; }
  .hero h1 .word + .word { margin-left: 0; }

  .hero .content { padding: 64px 18px 0; }
  .hero .tagline { margin-top: 18px; font-size: 11px; letter-spacing: 0.26em; }

  .hero .cta { flex-direction: column; margin-top: 28px; }
  .hero .btn { padding: 16px 24px; }
  .hero .btn.ghost {
    border-left: none;
    border-top: 1px solid var(--hero-text);
  }
}

/* ============================================================
   Light mode overrides
   ============================================================ */
html[data-theme="light"] .hero {
  --hero-bg:   #eeebe4;
  --hero-text: #1a1a1a;
  --hero-muted: #5a5d63;
  --hero-line: rgba(0, 0, 0, 0.12);
}

/* Vignettes use rgba so they inherit light bg via the variable override above */
html[data-theme="light"] .hero .bg-vignette {
  background: radial-gradient(
    ellipse 50% 55% at center,
    transparent 22%,
    rgba(238, 235, 228, 0.18) 45%,
    rgba(238, 235, 228, 0.50) 65%,
    rgba(238, 235, 228, 0.85) 85%,
    rgba(238, 235, 228, 1) 100%
  );
}
html[data-theme="light"] .hero::after {
  background:
    radial-gradient(ellipse at center, transparent 40%, rgba(238, 235, 228, 0.65) 90%),
    linear-gradient(180deg, transparent 60%, rgba(238, 235, 228, 0.9));
}

/* Text elements that hardcode white or near-white */
html[data-theme="light"] .hero .topnav a,
html[data-theme="light"] .hero .logo,
html[data-theme="light"] .hero .brand-label,
html[data-theme="light"] .hero .kicker,
html[data-theme="light"] .hero h1,
html[data-theme="light"] .hero .tagline,
html[data-theme="light"] .hero .corner,
html[data-theme="light"] .hero .scroll {
  color: var(--hero-text);
}

/* Loader bg */
html[data-theme="light"] .hero .hero-loader {
  background: var(--hero-bg);
}
html[data-theme="light"] .hero .hero-loader-text {
  color: var(--hero-muted);
}

/* Topbar — give it an explicit light bg so it matches body instead of showing canvas */
html[data-theme="light"] .hero .topbar {
  background: rgba(238, 235, 228, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* CTA button backdrop */
html[data-theme="light"] .hero .cta {
  background: rgba(238, 235, 228, 0.55);
  border-color: rgba(0, 0, 0, 0.20);
}
html[data-theme="light"] .hero .btn.ghost {
  border-color: rgba(0, 0, 0, 0.20);
  color: var(--hero-text);
}
html[data-theme="light"] .hero .btn.ghost:hover {
  background: var(--hero-text);
  color: var(--hero-bg);
}

/* Mobile dropdown nav */
@media (max-width: 768px) {
  html[data-theme="light"] .hero .topnav {
    background: rgba(238, 235, 228, 0.96);
    border-color: rgba(0, 0, 0, 0.12);
  }
}
