/* ============================================================
   NetPulse - premium hardware landing page
   Dark, cinematic, product-first.
   ============================================================ */

:root {
  /* surfaces */
  --bg:        #050607;
  --bg-1:      #0a0c0e;
  --bg-2:      #101315;
  --line:      rgba(255, 255, 255, 0.075);
  --line-2:    rgba(255, 255, 255, 0.14);

  /* type */
  --text:      #eceff2;
  --muted:     rgba(236, 239, 242, 0.52);
  --faint:     rgba(236, 239, 242, 0.32);

  /* product accents, sampled from the device screen */
  --cyan:      #2ab7f0;
  --cyan-soft: rgba(42, 183, 240, 0.16);
  --green:     #3ddc84;
  --green-soft:rgba(61, 220, 132, 0.14);
  --red:       #ff5a4d;

  /* motion */
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);

  --pad:       clamp(20px, 5vw, 96px);
  --maxw:      1240px;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: auto; /* scroll drives the sequence - never let the browser snap it */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--cyan); color: #04070a; }

/* ------------------------------------------------------------
   Typography primitives
   ------------------------------------------------------------ */

.eyebrow {
  margin: 0 0 clamp(14px, 1.6vw, 22px);
  font-size: clamp(10px, 0.78vw, 12px);
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--faint);
}
.eyebrow .dot {
  display: inline-block;
  width: 5px; height: 5px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  vertical-align: middle;
}

.display {
  margin: 0;
  font-size: clamp(38px, 6.4vw, 104px);
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: -0.045em;
}
.display b { font-weight: 600; }
.display .cyan { color: var(--cyan); }

h2.section-title {
  margin: 0 0 clamp(18px, 2vw, 28px);
  font-size: clamp(28px, 3.6vw, 58px);
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.lede {
  margin: 0;
  font-size: clamp(15px, 1.35vw, 21px);
  font-weight: 300;
  color: var(--muted);
  letter-spacing: -0.015em;
}

/* ------------------------------------------------------------
   Nav
   ------------------------------------------------------------ */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--pad);
  background: linear-gradient(to bottom, rgba(5, 6, 7, 0.82), rgba(5, 6, 7, 0));
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  pointer-events: none;
}
.nav > * { pointer-events: auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}
.brand-mark { display: block; width: 18px; height: 18px; flex: none; }

.nav-links {
  display: flex;
  gap: clamp(16px, 2.2vw, 34px);
  font-size: 13px;
  color: var(--muted);
}
.nav-links a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s var(--ease);
}
.nav-links a:hover { color: var(--text); }

@media (max-width: 720px) { .nav-links { display: none; } }

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */

.btn {
  --btn-bg: var(--text);
  --btn-fg: #05070a;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border: 0;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), background 0.35s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(255, 255, 255, 0.14); }
.btn:active { transform: translateY(0); }
.btn svg { width: 14px; height: 14px; flex: none; }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(10px);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.05); box-shadow: none; }

.btn--pulse {
  --btn-bg: var(--cyan);
  --btn-fg: #03151f;
}
.btn--pulse:hover { box-shadow: 0 14px 46px rgba(42, 183, 240, 0.42); }

/* ------------------------------------------------------------
   STAGE - the scroll-driven 3D sequence
   ------------------------------------------------------------ */

.stage {
  position: relative;
  height: 760vh; /* total scroll distance of the product sequence */
}
@media (max-width: 900px) { .stage { height: 640vh; } }

.stage__sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  background: radial-gradient(120% 88% at 50% 34%, #14181c 0%, #0a0c0e 42%, #050607 78%);
}

#gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.stage__vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(78% 62% at 50% 46%, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, 0.62) 100%);
  mix-blend-mode: multiply;
}

.overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

/* copy blocks - opacity/transform written by JS from scroll progress */
.copy {
  position: absolute;
  left: 50%;
  width: min(92vw, 1100px);
  transform: translateX(-50%);
  text-align: center;
  opacity: 0;
  will-change: opacity, transform;
}
.copy--top    { top: clamp(78px, 12vh, 150px); }
.copy--bottom { bottom: clamp(58px, 11vh, 130px); }

.copy .lede { margin-top: clamp(10px, 1.2vw, 18px); }
.copy--final .btn { pointer-events: auto; margin-top: clamp(20px, 2.6vw, 34px); }

/* face read-out during the rotation chapter */
.faceread {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 12, 14, 0.5);
  backdrop-filter: blur(12px);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}
.faceread b {
  min-width: 4.6em;
  text-align: left;
  font-weight: 600;
  color: var(--text);
}

/* ------------------------------------------------------------
   Exploded-view labels (positioned in screen space by JS)
   ------------------------------------------------------------ */

.labels { position: absolute; inset: 0; pointer-events: none; }

.label {
  position: absolute;
  top: 0; left: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  white-space: nowrap;
  will-change: transform, opacity;
}
.label__dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  flex: none;
}
.label__line {
  width: clamp(30px, 5vw, 78px);
  height: 1px;
  background: linear-gradient(to left, rgba(42, 183, 240, 0), var(--cyan));
}
.label__body { text-align: left; }
.label__idx {
  display: block;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--cyan);
  opacity: 0.85;
}
.label__text {
  display: block;
  font-size: clamp(12px, 1.05vw, 15px);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
}
.label__sub {
  display: block;
  font-size: clamp(10px, 0.8vw, 12px);
  color: var(--faint);
}
/* labels anchored to the left of their component mirror their layout */
.label--left { flex-direction: row-reverse; }
.label--left .label__line { background: linear-gradient(to right, rgba(42, 183, 240, 0), var(--cyan)); }
.label--left .label__body { text-align: right; }

/* ------------------------------------------------------------
   Chapter rail
   ------------------------------------------------------------ */

.chapters {
  position: absolute;
  right: clamp(16px, 2.4vw, 40px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: auto;
}
.chapter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 7px 0;
  border: 0;
  background: none;
  color: var(--faint);
  font: inherit;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.4s var(--ease);
}
.chapter span {
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.chapter i {
  display: block;
  width: 22px; height: 1px;
  background: currentColor;
  opacity: 0.45;
  transition: width 0.5s var(--ease), opacity 0.4s var(--ease), background 0.4s var(--ease);
}
.chapter:hover, .chapter.is-active { color: var(--text); }
.chapter:hover span, .chapter.is-active span { opacity: 1; transform: none; }
.chapter.is-active i { width: 40px; opacity: 1; background: var(--cyan); }

@media (max-width: 860px) {
  .chapters { right: 10px; }
  .chapter span { display: none; }
  .chapter i { width: 14px; }
  .chapter.is-active i { width: 24px; }
}

/* scroll cue */
.cue {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--faint);
}
.cue__track {
  width: 1px; height: 44px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
  position: relative;
  overflow: hidden;
}
.cue__track::after {
  content: "";
  position: absolute;
  left: 0; top: -60%;
  width: 1px; height: 60%;
  background: var(--cyan);
  animation: cueRun 2.4s var(--ease) infinite;
}
@keyframes cueRun {
  0%   { top: -60%; opacity: 0; }
  30%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* WebGL fallback */
.glfallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  padding: var(--pad);
  text-align: center;
  color: var(--muted);
  z-index: 5;
}
.no-webgl .glfallback { display: grid; }
.no-webgl .chapters,
.no-webgl .labels,
.no-webgl .cue { display: none; }
.glfallback img { max-width: min(88vw, 460px); border-radius: 14px; }

/* ------------------------------------------------------------
   Standard page sections
   ------------------------------------------------------------ */

.section { position: relative; padding: clamp(90px, 13vh, 190px) var(--pad); }
.wrap { max-width: var(--maxw); margin: 0 auto; }

.section-head { max-width: 720px; margin-bottom: clamp(48px, 7vw, 96px); }
.section-head .lede { max-width: 54ch; }

/* ---- Features ---- */

.features {
  border-top: 1px solid var(--line);
  background: linear-gradient(to bottom, #07090b, var(--bg));
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(28px, 3.4vw, 56px);
}
@media (max-width: 1080px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px)  { .feature-grid { grid-template-columns: 1fr; } }

.feature { padding-top: 22px; border-top: 1px solid var(--line-2); }
.feature__no {
  display: block;
  margin-bottom: clamp(28px, 5vw, 64px);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--cyan);
}
.feature h3 {
  margin: 0 0 10px;
  font-size: clamp(18px, 1.55vw, 23px);
  font-weight: 400;
  letter-spacing: -0.025em;
}
.feature p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); }

/* live readout strip */
.readout {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: clamp(56px, 7vw, 104px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--line);
  overflow: hidden;
}
@media (max-width: 720px) { .readout { grid-template-columns: repeat(2, 1fr); } }

.readout__cell { padding: clamp(20px, 2.4vw, 30px); background: rgba(12, 15, 17, 0.92); }
.readout__k {
  display: block;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--faint);
}
.readout__v {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: clamp(24px, 2.6vw, 38px);
  font-weight: 300;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.readout__v small { font-size: 0.42em; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.readout__v.is-green { color: var(--green); }
.readout__spark { display: block; width: 100%; height: 34px; margin-top: 14px; }

/* ---- Use cases ---- */

.cases { border-top: 1px solid var(--line); }
.case-list { border-top: 1px solid var(--line); }

.case {
  display: grid;
  grid-template-columns: 96px 1.1fr 1fr;
  gap: clamp(20px, 3vw, 56px);
  align-items: start;
  padding: clamp(28px, 3.6vw, 52px) 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.6s var(--ease);
}
.case:hover { background: rgba(255, 255, 255, 0.018); }
@media (max-width: 820px) { .case { grid-template-columns: 1fr; gap: 12px; } }

.case__no {
  padding-top: 0.55em;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--faint);
}
.case h3 {
  margin: 0;
  font-size: clamp(21px, 2.3vw, 34px);
  font-weight: 300;
  letter-spacing: -0.035em;
}
.case p { margin: 0; max-width: 46ch; font-size: 14.5px; color: var(--muted); }

/* ---- Spec strip ---- */

.specs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(34px, 4vw, 52px); }
.spec {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.022);
  font-size: 12px;
  color: var(--muted);
}
.spec b { color: var(--text); font-weight: 500; }

/* ---- Closing CTA ---- */

.cta {
  position: relative;
  border-top: 1px solid var(--line);
  text-align: center;
  overflow: hidden;
}
.cta::before {
  content: "";
  position: absolute;
  left: 50%; top: -40%;
  width: min(120vw, 1400px);
  aspect-ratio: 2 / 1;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(42, 183, 240, 0.14), rgba(42, 183, 240, 0));
  pointer-events: none;
}
.cta .wrap { position: relative; }
.cta .lede { margin: clamp(16px, 2vw, 26px) auto 0; max-width: 48ch; }
.cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: clamp(30px, 3.6vw, 48px);
}

/* ---- Footer ---- */

.footer {
  padding: 44px var(--pad);
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
}
.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--text); }
.footer nav { display: flex; gap: 22px; }

/* ------------------------------------------------------------
   Reveal on enter
   ------------------------------------------------------------ */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 1s var(--ease) var(--d, 0s),
    transform 1s var(--ease) var(--d, 0s);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .cue__track::after { animation: none; }
  .btn { transition: none; }
}

/* ------------------------------------------------------------
   Narrow screens: the projected callouts cannot fit beside the
   diagram, so they collapse into a legend pinned to the bottom of
   the stage. The index numbers keep them tied to the parts.
   ------------------------------------------------------------ */

@media (max-width: 720px) {
  .labels {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 6px;
    padding: 0 22px calc(20px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, rgba(5, 6, 7, 0.94) 0%, rgba(5, 6, 7, 0.62) 20%, rgba(5, 6, 7, 0) 34%);
  }
  .label,
  .label--left {
    position: static;
    flex-direction: row;
    gap: 10px;
    transform: none !important;
    align-items: center;
  }
  .label__line { display: none; }
  .label__body,
  .label--left .label__body { text-align: left; }
  .label__idx {
    display: inline-block;
    min-width: 2.4em;
  }
  .label__text { font-size: 13px; line-height: 1.3; }
  .label__sub { font-size: 10.5px; line-height: 1.3; }
  .label__idx { font-size: 8.5px; }
}
