/* ==========================================================================
   LUMEN — supplemental CSS
   Tailwind (Play CDN) carries the design. This file only holds what utility
   classes can't express: @property gradients, masks, grain, pointer-driven
   spotlights, syntax tokens, and a few scroll/motion guards.
   ========================================================================== */

@property --angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

:root {
  color-scheme: dark;
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* fluid root: 1x up to 1080p, scales gently for 1440p / 4K so rem-based layout grows with the canvas */
html {
  font-size: clamp(16px, calc(16px + (100vw - 1920px) * 0.0056), 24px);
  -webkit-text-size-adjust: 100%;
  background: #05060a;
}
body {
  background: #05060a;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
::selection { background: #c8ff3e; color: #05060a; }
[hidden] { display: none !important; }

/* fade the page in once Tailwind's runtime CSS is applied (avoids an unstyled flash) */
.js body { opacity: 0; }
.js.is-ready body { opacity: 1; transition: opacity 0.6s ease; }

:focus-visible {
  outline: 2px solid #c8ff3e;
  outline-offset: 3px;
}
:focus:not(:focus-visible) { outline: none; }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: clip; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* film grain overlay */
.grain {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n' x='0' y='0'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}

/* masks */
.mask-x {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.mask-b {
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
}
.mask-radial {
  -webkit-mask-image: radial-gradient(ellipse 70% 100% at 50% 50%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 100% at 50% 50%, #000 30%, transparent 100%);
}

/* ---- pre-JS hidden states (only when motion is welcome; JS flips them) ---- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(2.25rem); }
  .js [data-reveal].is-revealed { opacity: 1; transform: none; }
  .js [data-hero] { opacity: 0; }
  .js [data-hero-title] { visibility: hidden; }
  .js.reveal-all [data-reveal],
  .js.reveal-all [data-hero] { opacity: 1 !important; transform: none !important; }
  .js.reveal-all [data-hero-title] { visibility: visible !important; }
}

/* split-text masks */
.w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0.12em 0.08em 0.18em;
  margin: -0.12em -0.08em -0.18em;
}
.wi { display: inline-block; will-change: transform; }

/* ---- animated gradient border (conic, @property driven) ---- */
.gborder { position: relative; }
.gborder::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(from var(--angle), rgba(139, 108, 255, 0) 0deg, #8b6cff 60deg, #4de1ff 130deg, #ff58d6 220deg, #c8ff3e 290deg, rgba(139, 108, 255, 0) 345deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: gb-spin 5.5s linear infinite;
  pointer-events: none;
}
.gborder::after {
  content: '';
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: inherit;
  background: conic-gradient(from var(--angle), transparent 0deg, rgba(139, 108, 255, 0.7) 70deg, rgba(77, 225, 255, 0.6) 140deg, rgba(255, 88, 214, 0.6) 220deg, transparent 300deg);
  filter: blur(30px);
  opacity: 0.32;
  animation: gb-spin 5.5s linear infinite;
  pointer-events: none;
}
@keyframes gb-spin { to { --angle: 360deg; } }

/* ---- cursor-follow spotlight cards ---- */
.spot { --mx: 50%; --my: 0%; position: relative; isolation: isolate; }
.spot::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 20;
  padding: 1px;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(150, 128, 255, 0.95), rgba(77, 225, 255, 0.55) 32%, transparent 62%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity 0.5s var(--ease-expo);
  pointer-events: none;
}
.spot::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: radial-gradient(520px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.075), transparent 45%);
  opacity: 0;
  transition: opacity 0.5s var(--ease-expo);
  pointer-events: none;
}
.spot:hover::after { opacity: 1; }
.spot:hover::before,
[data-spot-group]:hover .spot::before { opacity: 1; }

/* ---- FAQ accordion (grid-rows trick = smooth, no JS measuring) ---- */
.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.6s var(--ease-expo);
}
.faq-panel > div {
  min-height: 0;
  overflow: hidden;
  visibility: hidden;
  transition: visibility 0s linear 0.6s;
}
.faq-item[data-open='true'] .faq-panel { grid-template-rows: 1fr; }
.faq-item[data-open='true'] .faq-panel > div { visibility: visible; transition-delay: 0s; }
.faq-item[data-open='true'] .faq-plus { transform: rotate(45deg); background: rgba(255, 255, 255, 0.08); }
.faq-item[data-open='true'] .faq-q { color: #fff; }

/* ---- code / terminal ---- */
.code-lines { counter-reset: ln; white-space: normal; }
.ln { display: block; position: relative; padding-left: 2.75rem; white-space: pre; min-height: 1.75em; counter-increment: ln; }
.ln::before {
  content: counter(ln);
  position: absolute;
  left: 0;
  width: 1.7rem;
  text-align: right;
  color: #545b76;
  user-select: none;
}
.lt { display: inline-block; }
.code-lines i, .term i { font-style: normal; }
.tk-k { color: #b7a4ff; }
.tk-s { color: #c8ff3e; }
.tk-f { color: #6ee7ff; }
.tk-n { color: #ff8ae2; }
.tk-t { color: #7fd6ff; }
.tk-p { color: #8d93a8; }
.tk-c { color: #7d84a3; font-style: italic !important; }
.code-play .lt { animation: code-wipe 0.6s steps(26, end) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes code-wipe {
  from { clip-path: inset(0 100% 0 0); opacity: 0.2; }
  to { clip-path: inset(0 0 0 0); opacity: 1; }
}

.term .tl { min-height: 1.75em; white-space: pre-wrap; word-break: break-word; }
.term .prompt { color: #c8ff3e; user-select: none; }
.term .dim { color: #7d84a3; }
.term .ok { color: #c8ff3e; }
.term .cy { color: #6ee7ff; }
.term .mg { color: #ff8ae2; }
.term .bar { display: inline-block; width: 11rem; max-width: 40vw; height: 0.45rem; margin: 0 0.6rem; vertical-align: 0.1em; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.term .bar > b { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #8b6cff, #4de1ff, #c8ff3e); transition: width var(--bar-ms, 900ms) cubic-bezier(0.5, 0, 0.2, 1); }
.caret {
  display: inline-block;
  width: 0.6em;
  height: 1.15em;
  margin-left: 1px;
  vertical-align: -0.2em;
  background: #c8ff3e;
  animation: caret-blink 1.05s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

/* marquee only runs after JS has cloned the track */
#logo-track:not([data-cloned]) { animation: none; }
.marquee-wrap:hover #logo-track { animation-play-state: paused; }

/* hero sticky: no extra scroll runway when motion is reduced */
@media (prefers-reduced-motion: reduce) {
  #logo-track { flex-wrap: wrap; justify-content: center; width: auto !important; animation: none !important; padding-right: 0; row-gap: 1.5rem; }
  #logo-track > [aria-hidden='true'] { display: none; }
  .marquee-wrap { -webkit-mask-image: none; mask-image: none; }
  #hero { height: 100svh !important; }
  #how { height: auto !important; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .gborder::after { display: none; }
}

/* scrollbar polish (WebKit + Firefox) */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 99px; border: 2px solid #05060a; }
