/* ============================================================
   Navbar
   ============================================================ */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  padding-block: 0;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: var(--header-h);
  transition: height var(--dur-base) var(--ease-out-expo),
              background var(--dur-base) var(--ease-out-expo),
              border-color var(--dur-base) var(--ease-out-expo),
              backdrop-filter var(--dur-base) var(--ease-out-expo);
  border-bottom: 1px solid transparent;
}
header.is-scrolled .nav {
  height: var(--header-h-scrolled);
  background: rgba(8, 9, 11, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--ink);
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  gap: 2.2rem;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-dim);
  position: relative;
  padding-block: 4px;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-fast) var(--ease-out-expo);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a.is-active { color: var(--ink); }
.nav-links a.is-active::after { transform: scaleX(1); }

.nav-cta {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--ink);
  padding: 0.7em 1.3em;
  border-radius: 999px;
  flex-shrink: 0;
  transition: background var(--dur-fast), transform var(--dur-fast) var(--ease-out-expo);
}
.nav-cta:hover { background: var(--accent-2); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--ink);
  width: 42px; height: 42px;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px;
  height: 1.5px;
  background: var(--ink);
  transition: transform var(--dur-fast) var(--ease-out-expo), opacity var(--dur-fast);
}
.nav-toggle span { top: 50%; transform: translateY(-50%); }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-toggle.is-open span { background: transparent; }
.nav-toggle.is-open span::before { top: 0; transform: rotate(45deg); }
.nav-toggle.is-open span::after { top: 0; transform: rotate(-45deg); }

.nav-mobile {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.6rem;
  padding: 2rem var(--gutter);
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out-expo),
              transform var(--dur-base) var(--ease-out-expo),
              visibility 0s linear var(--dur-base);
  z-index: 190;
}
.nav-mobile.is-open {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}
.nav-mobile a { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; color: var(--ink); }

@media (min-width: 901px) {
  .nav-mobile { display: none; }
}

@media (max-width: 900px) {
  .nav-links, .desktop-only { display: none; }
  .nav-toggle { display: block; }
}

/* ============================================================
   Custom cursor (fine pointer only, JS gates with .has-custom-cursor)
   ============================================================ */
.has-custom-cursor, .has-custom-cursor a, .has-custom-cursor button { cursor: none !important; }

.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--accent);
}
.cursor-ring {
  width: 34px; height: 34px;
  border: 1px solid var(--border-strong);
  transition: width var(--dur-fast) var(--ease-out-expo), height var(--dur-fast) var(--ease-out-expo),
              border-color var(--dur-fast), background var(--dur-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cursor-ring.is-active {
  width: 76px; height: 76px;
  border-color: var(--accent);
  background: rgba(62, 157, 255, 0.08);
}
.cursor-ring-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
  opacity: 0;
  transition: opacity var(--dur-fast);
  white-space: nowrap;
}
.cursor-ring.is-active .cursor-ring-label { opacity: 1; }

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

/* ============================================================
   Browser mockup
   ============================================================ */
.mockup {
  position: relative;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}
.mockup-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}
.mockup-dots { display: flex; gap: 6px; flex-shrink: 0; }
.mockup-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.mockup-url {
  flex: 1;
  height: 22px;
  border-radius: 6px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  padding-inline: 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-faint);
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.mockup-screen {
  position: relative;
  background: var(--bg);
  overflow: hidden;
}

.mockup-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(ellipse at 50% 40%, var(--accent-glow), transparent 60%);
  filter: blur(40px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.7;
}

/* ============================================================
   Floating chips
   ============================================================ */
.chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.6em;
  background: rgba(18, 20, 24, 0.85);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 0.8em 1.1em;
  font-size: 0.82rem;
  color: var(--ink);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  animation: chip-float 5s ease-in-out infinite;
}
.chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.chip-dot.pulse { animation: chip-pulse 1.8s ease-in-out infinite; }
.chip strong { color: var(--ink); font-weight: 600; }

@keyframes chip-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes chip-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { opacity: 0.6; box-shadow: 0 0 0 6px transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .chip { animation: none; }
  .chip-dot.pulse { animation: none; }
}

/* ============================================================
   Grain / background texture
   ============================================================ */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  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.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, black, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, black, transparent 75%);
  opacity: 0.5;
  pointer-events: none;
}

/* ============================================================
   Page-load intro
   ============================================================ */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s var(--ease-out-expo), visibility 0.5s;
  /* CSS-only failsafe: if js/intro.js never runs (a blocked/broken script,
     a crashed module earlier in the chain), don't leave the whole page
     covered forever — fade this out on a timer no matter what. Normally
     the JS removes the element from the DOM well before this ever fires. */
  animation: intro-failsafe 0.01s 4s forwards;
}
@keyframes intro-failsafe {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}
.intro-overlay.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--ink);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.intro-overlay.is-visible .intro-mark { opacity: 1; transform: translateY(0); }
.intro-line {
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.6s var(--ease-out-expo) 0.15s;
}
.intro-overlay.is-visible .intro-line { width: 64px; }

@media (prefers-reduced-motion: reduce) {
  .intro-overlay { transition: none; }
  .intro-mark, .intro-line { transition: none; }
}
