/* =============================================================================
   IntelliBOM · intellibom.ca
   Scenario 2 · Ethereal Glass — Industrial Editorial
   styles.css — tokens + base + ambient + nav + utilities + buttons + responsive
   Pairs with sections.css (hero / features / compare / toc / footer).
   ============================================================================= */

/* -----------------------------------------------------------------------------
   1. TOKENS
   ---------------------------------------------------------------------------*/
:root {
  /* Colour — the void, the glass, the arc, the caution */
  --void:           #050505;
  --void-2:         #0a0a0a;
  --void-3:         #101010;
  --edge:           #151515;
  --line:           rgba(255, 255, 255, 0.08);
  --line-strong:    rgba(255, 255, 255, 0.14);
  --line-max:       rgba(255, 255, 255, 0.22);
  --steel:          #d4d4d4;
  --steel-2:        #8a8a8a;
  --steel-3:        #5a5a5a;
  --white:          #ffffff;
  --emerald:        #10b981;
  --emerald-2:      #6ee7b7;
  --emerald-glow:   rgba(16, 185, 129, 0.35);
  --emerald-glow-2: rgba(16, 185, 129, 0.55);
  --emerald-soft:   rgba(16, 185, 129, 0.08);
  --caution:        #facc15;
  --glass:          rgba(255, 255, 255, 0.025);
  --glass-hi:       rgba(255, 255, 255, 0.05);

  /* Type */
  --f-display: "Geist", system-ui, sans-serif;
  --f-serif:   "Playfair Display", Georgia, serif;
  --f-body:    "Geist", system-ui, sans-serif;
  --f-mono:    "JetBrains Mono", ui-monospace, monospace;

  /* Space */
  --max:        1280px;
  --pad-x:      clamp(24px, 4vw, 56px);
  --s-section:  clamp(80px, 10vw, 140px);

  /* Motion */
  --ease:       cubic-bezier(0.32, 0.72, 0, 1);
  --ease-glass: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-arc:   cubic-bezier(0.7, 0, 0.3, 1);
}

/* -----------------------------------------------------------------------------
   2. RESET + BASE
   ---------------------------------------------------------------------------*/
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--void);
  color: var(--steel);
  font-family: var(--f-body);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
::selection { background: var(--emerald); color: var(--void); }

main { position: relative; z-index: 2; }

/* -----------------------------------------------------------------------------
   3. AMBIENT FIELDS (fixed, behind content)
   ---------------------------------------------------------------------------*/
.field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.field--grid {
  /* Two layers stacked: major grid (every 288px, brighter) + minor grid (72px, subtle)  */
  background-image:
    linear-gradient(to right,  rgba(110, 231, 183, 0.09) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(110, 231, 183, 0.09) 1px, transparent 1px),
    linear-gradient(to right,  rgba(255, 255, 255, 0.09) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.09) 1px, transparent 1px);
  background-size: 288px 288px, 288px 288px, 72px 72px, 72px 72px;
  background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(ellipse 140% 130% at 50% 50%, #000 55%, transparent 100%);
          mask-image: radial-gradient(ellipse 140% 130% at 50% 50%, #000 55%, transparent 100%);
}
.field--noise {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.55;
  mix-blend-mode: overlay;
}
.field--glow {
  background:
    radial-gradient(ellipse 60% 40% at 22% 18%, rgba(16, 185, 129, 0.12), transparent 60%),
    radial-gradient(ellipse 50% 30% at 85% 45%, rgba(59, 130, 246, 0.05), transparent 60%);
  animation: drift 28s var(--ease-glass) infinite alternate;
}
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(40px, -20px, 0); }
}

/* Arc-flash (one-shot sweep) */
.arc-flash {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(100deg,
    transparent 42%,
    rgba(16, 185, 129, 0.45) 50%,
    rgba(110, 231, 183, 0.15) 55%,
    transparent 62%);
  opacity: 0;
  transform: translateX(-100%);
  mix-blend-mode: screen;
  filter: blur(8px);
}
.arc-flash.is-firing {
  animation: arc 1600ms var(--ease-arc) forwards;
}
@keyframes arc {
  0%   { opacity: 0;    transform: translateX(-100%); }
  12%  { opacity: 0.7; }
  100% { opacity: 0;    transform: translateX(100%); }
}

/* -----------------------------------------------------------------------------
   4. NAV
   ---------------------------------------------------------------------------*/
.nav {
  position: sticky;
  top: 16px;
  z-index: 20;
  max-width: var(--max);
  margin: 16px auto 0;
  padding: 10px 12px 10px 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
          backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 20px 40px -20px rgba(0, 0, 0, 0.6);
  transition: box-shadow 300ms var(--ease);
}
.nav.is-scrolled {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 20px 50px -20px rgba(0, 0, 0, 0.8);
}
.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--white);
  font-size: 16px;
}
.nav__logo-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 11px;
  background: var(--void-2);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--emerald);
  letter-spacing: 0.05em;
}
.nav__pill {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--f-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--steel-2);
}
.nav__pill a {
  position: relative;
  padding: 8px 2px;
  transition: color 220ms var(--ease);
}
.nav__pill a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 2px;
  height: 1px;
  background: var(--emerald);
  transition: right 260ms var(--ease);
}
.nav__pill a:hover { color: var(--white); }
.nav__pill a:hover::after { right: 0; }
.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--emerald);
  color: var(--void);
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 999px;
  box-shadow: 0 0 30px var(--emerald-glow);
  transition: transform 240ms var(--ease), box-shadow 240ms var(--ease);
}
.nav__cta svg { width: 12px; height: 12px; }
.nav__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 40px var(--emerald-glow-2);
}

/* -----------------------------------------------------------------------------
   5. UTILITIES
   ---------------------------------------------------------------------------*/
.bom-label {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--steel-2);
}
.bom-label--accent { color: var(--emerald); font-weight: 700; }
.bom-sep {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--steel-3);
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--steel-3);
  display: inline-block;
  flex-shrink: 0;
}
.dot--emerald { background: var(--emerald); box-shadow: 0 0 10px var(--emerald-glow); }
.dot--caution { background: var(--caution); box-shadow: 0 0 10px rgba(250, 204, 21, 0.5); }

/* -----------------------------------------------------------------------------
   6. BUTTONS
   ---------------------------------------------------------------------------*/
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 15px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition:
    transform 260ms var(--ease),
    box-shadow 260ms var(--ease),
    background 260ms var(--ease),
    border-color 260ms var(--ease),
    color 260ms var(--ease);
  cursor: pointer;
}
.btn svg { width: 14px; height: 14px; }
.btn--primary {
  background: var(--emerald);
  color: var(--void);
  font-weight: 700;
  box-shadow: 0 0 0 0 var(--emerald-glow), 0 12px 40px -10px var(--emerald-glow-2);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 32px var(--emerald-glow), 0 22px 60px -10px var(--emerald-glow-2);
}
.btn--ghost {
  background: var(--glass);
  border-color: var(--line-strong);
  color: var(--steel);
  -webkit-backdrop-filter: blur(16px);
          backdrop-filter: blur(16px);
}
.btn--ghost:hover {
  background: var(--glass-hi);
  border-color: var(--emerald);
  color: var(--white);
}
.btn__play { color: var(--emerald); font-size: 10px; }

/* -----------------------------------------------------------------------------
   7. REVEAL ON SCROLL
   ---------------------------------------------------------------------------*/
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  filter: blur(4px);
  transition:
    opacity 760ms var(--ease-glass),
    transform 760ms var(--ease-glass),
    filter 760ms var(--ease-glass);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

/* -----------------------------------------------------------------------------
   8. RESPONSIVE
   ---------------------------------------------------------------------------*/
@media (max-width: 1040px) {
  .hero {
    grid-template-columns: 1fr;
    row-gap: 40px;
  }
  .hero__left  { grid-column: 1; grid-row: 1; }
  .hero__right { grid-column: 1; grid-row: 2; }
  .stats       { grid-row: 3; }
}
@media (max-width: 720px) {
  .nav__pill { display: none; }
  .nav { grid-template-columns: auto auto; justify-content: space-between; }
  .hero { padding-top: 48px; }
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 20px;
  }
  .stats__sep { display: none; }
  .stats__item {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  .compare__split { grid-template-columns: 1fr; gap: 16px; }
  .compare__vs {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    justify-self: center;
    width: 52px;
    height: 52px;
    font-size: 13px;
  }
  .toc__row { grid-template-columns: 50px 1fr 80px; padding: 18px; gap: 12px; }
  .toc__row--head { grid-template-columns: 50px 1fr 80px; }
  .toc__status,
  .toc__row--head span:nth-child(3) { display: none; }
}

/* -----------------------------------------------------------------------------
   9. SPOTLIGHT (cursor-tracked radial on cards) — S402
   ---------------------------------------------------------------------------*/
.spot {
  position: relative;
  --spot-x: 50%;
  --spot-y: 50%;
  --spot-on: 0;
  isolation: isolate;
}
.spot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    320px circle at var(--spot-x) var(--spot-y),
    rgba(16, 185, 129, 0.18),
    transparent 60%
  );
  opacity: var(--spot-on);
  transition: opacity 360ms var(--ease-glass);
  pointer-events: none;
  z-index: 0;
}
.spot > * { position: relative; z-index: 1; }

/* -----------------------------------------------------------------------------
   10. LIGHTBOX (click-to-zoom screenshots) — S402
   ---------------------------------------------------------------------------*/
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(3, 3, 3, 0.92);
  -webkit-backdrop-filter: blur(24px) saturate(0.8);
          backdrop-filter: blur(24px) saturate(0.8);
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms var(--ease-glass);
}
.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox__stage {
  max-width: min(94vw, 1600px);
  max-height: 88vh;
  display: grid;
  gap: 14px;
  transform: scale(0.96);
  transition: transform 480ms var(--ease-glass);
}
.lightbox.is-open .lightbox__stage { transform: scale(1); }
.lightbox__img {
  max-width: 100%;
  max-height: 84vh;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  box-shadow:
    0 0 60px rgba(0, 0, 0, 0.7),
    0 0 120px -30px var(--emerald-glow);
}
.lightbox__cap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--steel-2);
  padding: 0 4px;
}
.lightbox__cap span:first-child { color: var(--emerald); }
.lightbox__close {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px);
          backdrop-filter: blur(20px);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--white);
  cursor: pointer;
  transition: transform 220ms var(--ease), border-color 220ms var(--ease);
}
.lightbox__close:hover {
  transform: scale(1.06);
  border-color: var(--emerald);
}
.lightbox__close svg { width: 16px; height: 16px; }
.zoomable {
  cursor: zoom-in;
}

/* -----------------------------------------------------------------------------
   11. SCAN-LINE (one-shot factory scanner sweep on screenshots) — S402
   ---------------------------------------------------------------------------*/
.scanframe {
  position: relative;
  overflow: hidden;
}
.scanframe::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 18%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(16, 185, 129, 0.32) 45%,
    rgba(110, 231, 183, 0.55) 50%,
    rgba(16, 185, 129, 0.32) 55%,
    transparent 100%
  );
  filter: blur(2px);
  mix-blend-mode: screen;
  transform: translateY(-120%);
  pointer-events: none;
  opacity: 0;
}
.scanframe.is-scanning::after {
  animation: scan 2.2s var(--ease-glass) forwards;
}
@keyframes scan {
  0%   { transform: translateY(-120%); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(620%); opacity: 0; }
}

/* -----------------------------------------------------------------------------
   12. REDUCED MOTION
   ---------------------------------------------------------------------------*/
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; filter: none; }
  .arc-flash { display: none; }
  .viewport__video { display: none; }
  .scanframe::after { display: none; }
  .viewport__chrome::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("assets/hero-poster.webp") center / cover;
    z-index: 1;
  }
}
