/* ============================================================
   ANC — Scroll & Motion Skill Demos
   Brand tokens per anc-brand skill.
   ============================================================ */

:root {
  --anc-blue: #0A52EF;
  --anc-blue-2: #0055B3;
  --anc-cyan: #00AEEF;
  --blue-bright: #4F86FF;
  --blue-soft: rgba(10, 82, 239, .16);
  --blue-line: rgba(79, 134, 255, .34);

  --bg: #0A0F1C;
  --surface: #101A2E;
  --surface-2: #15213A;
  --ink: #EBF1FC;
  --muted: #93A2C2;
  --faint: #5F6E8E;
  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .14);
  --green: #46D588;

  --disp: "Space Grotesk", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --body: "Inter", system-ui, sans-serif;

  --gutter: clamp(20px, 5vw, 88px);
  --maxw: 1240px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--disp);
  letter-spacing: -.025em;
  line-height: 1.04;
  margin: 0;
  font-weight: 600;
}

p { margin: 0; }
a { color: inherit; }

/* ---------- shared shell ---------- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--anc-cyan);
  margin: 0;
}

.lede {
  color: var(--muted);
  font-size: clamp(15px, 1.35vw, 18px);
  max-width: 62ch;
}

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

/* ---------- preloader (cinematic-scroll-storytelling) ---------- */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #070B14;
  display: grid;
  place-content: center;
  gap: 26px;
  justify-items: center;
}

.preloader__mark { width: 128px; opacity: .92; }

.preloader__track {
  width: min(320px, 60vw);
  height: 2px;
  background: rgba(255, 255, 255, .09);
  overflow: hidden;
}

.preloader__bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--anc-blue), var(--anc-cyan));
  transform: scaleX(0);
  transform-origin: left;
}

.preloader__label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- custom cursor (cinematic-gsap-lenis-motion-system) ---------- */

[data-cursor] {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 190;
  pointer-events: none;
  mix-blend-mode: difference;
  transform: translate3d(-50%, -50%, 0);
  will-change: transform;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .75);
  display: grid;
  place-content: center;
}

[data-cursor] span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce), (pointer: coarse) {
  [data-cursor] { display: none; }
}

/* ---------- global progress rail ---------- */

.railtop {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 180;
  background: rgba(255, 255, 255, .05);
}

.railtop__fill {
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--anc-blue), var(--anc-cyan));
}

/* ---------- masthead ---------- */

.masthead {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 170;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px var(--gutter);
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(10, 15, 28, .84), rgba(10, 15, 28, 0));
  pointer-events: none;
}

.masthead img { width: 82px; display: block; }

.masthead__meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- motion primitives (from the skills, verbatim contracts) ---------- */

html.has-motion [data-motion-text],
html.has-motion [data-split-reveal],
html.has-motion [data-reveal],
html.has-motion [data-reveal-item] { visibility: hidden; }

.motion-line-mask,
.motion-word-mask,
.split-word-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}

.motion-line,
.motion-word,
.split-word {
  display: inline-block;
  will-change: transform, opacity, filter;
}

[data-parallax-layer] { will-change: transform; }

/* ---------- hero (demo 01) ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px 0 90px;
  overflow: hidden;
}

.hero__field {
  position: absolute;
  inset: -12% -6%;
  z-index: 0;
  background:
    radial-gradient(900px 620px at 76% 22%, rgba(10, 82, 239, .30), transparent 62%),
    radial-gradient(700px 520px at 12% 84%, rgba(0, 174, 239, .13), transparent 66%);
}

.hero__dots {
  position: absolute;
  inset: -12% -6%;
  z-index: 0;
  background-image: radial-gradient(rgba(120, 160, 255, .17) 1px, transparent 1.4px);
  background-size: 26px 26px;
  mask-image: radial-gradient(1000px 700px at 60% 42%, #000 12%, transparent 78%);
}

.hero__inner { position: relative; z-index: 2; width: 100%; }

.hero h1 {
  font-size: clamp(40px, 7.4vw, 96px);
  margin: 22px 0 26px;
  max-width: 17ch;
}

.hero__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--anc-blue);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 13px 24px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  will-change: transform;
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--ink);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 58px;
}

.card {
  background: linear-gradient(180deg, var(--surface), rgba(16, 26, 46, .45));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
}

.card h4 {
  font-size: 15px;
  margin-bottom: 8px;
}

.card p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
}

.card__k {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .22em;
  color: var(--anc-cyan);
  text-transform: uppercase;
  display: block;
  margin-bottom: 12px;
}

/* ---------- section chrome ---------- */

.sect { position: relative; padding: 118px 0; }

.sect__head { max-width: 78ch; }

.sect__num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .3em;
  color: var(--faint);
}

.sect h2 {
  font-size: clamp(28px, 4.1vw, 54px);
  margin: 16px 0 20px;
}

.skillbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 26px 0 8px;
}

.chip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--blue-line);
  background: var(--blue-soft);
  color: var(--blue-bright);
}

.chip--plain {
  border-color: var(--line-2);
  background: transparent;
  color: var(--muted);
}

.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 30px;
}

.spec { background: var(--bg); padding: 15px 16px; }

.spec dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 7px;
}

.spec dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
}

/* ---------- demo 02 — sticky card stack ---------- */

.stack { position: relative; margin-top: 54px; }

.stackcard {
  position: sticky;
  top: 13vh;
  transform-origin: center top;
  will-change: transform, opacity;
  border-radius: 18px;
  border: 1px solid var(--line-2);
  padding: clamp(24px, 3.4vw, 44px);
  min-height: 340px;
  margin-bottom: 26px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-content: center;
  overflow: hidden;
}

.stackcard:nth-child(1) { background: linear-gradient(140deg, #0E2A64, #0A1730); }
.stackcard:nth-child(2) { background: linear-gradient(140deg, #0A52EF, #0A2050); }
.stackcard:nth-child(3) { background: linear-gradient(140deg, #06334F, #0A1526); }
.stackcard:nth-child(4) { background: linear-gradient(140deg, #16213A, #0B1120); }

.stackcard h3 { font-size: clamp(24px, 3.2vw, 40px); max-width: 20ch; }
.stackcard p { color: rgba(235, 241, 252, .78); max-width: 56ch; font-size: 15px; }

.stackcard__idx {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .3em;
  color: rgba(255, 255, 255, .62);
}

/* ---------- demo 03 — pinned product story ---------- */

.pinstage {
  position: relative;
  height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  padding: 76px 0 40px;
}

@media (max-width: 900px) {
  .pinstage { grid-template-columns: 1fr; gap: 20px; padding-top: 88px; }
}

.pincopy { position: relative; z-index: 3; }

.pinbeat {
  opacity: 0;
  transform: translateY(22px);
}

.pinbeat + .pinbeat { margin-top: 14px; }

.pinbeat h3 { font-size: clamp(21px, 2.5vw, 32px); margin-bottom: 10px; }
.pinbeat p { color: var(--muted); font-size: 14.5px; max-width: 44ch; }

.pinbeat__tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--anc-cyan);
  display: block;
  margin-bottom: 9px;
}

/* the "product" being narrated: an LED spec frame */
.frame {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--surface-2), #0B1222);
  padding: 16px;
  box-shadow: 0 40px 90px -50px rgba(0, 0, 0, .95);
  will-change: transform;
}

.frame__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.frame__dot { width: 9px; height: 9px; border-radius: 999px; background: var(--line-2); }

.frame__title {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
  margin-left: 6px;
}

.board {
  position: relative;
  aspect-ratio: 16 / 7;
  border-radius: 9px;
  overflow: hidden;
  background: #050912;
  border: 1px solid var(--line);
}

.board__px {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(79, 134, 255, .55) 1px, transparent 1.5px);
  background-size: 9px 9px;
  opacity: .5;
}

.board__sweep {
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  background: linear-gradient(90deg, transparent, rgba(10, 82, 239, .55), transparent);
  transform: translateX(-120%);
}

/* the ribbon strip overlay — the ANC-specific beat */
.board__ribbon {
  position: absolute;
  left: 0; right: 0;
  height: 12.5%;
  background: linear-gradient(90deg, rgba(0, 174, 239, .18), rgba(10, 82, 239, .55), rgba(0, 174, 239, .18));
  border-top: 1px solid rgba(79, 134, 255, .5);
  border-bottom: 1px solid rgba(79, 134, 255, .5);
  opacity: 0;
}

.board__ribbon:nth-of-type(1) { top: 14%; }
.board__ribbon:nth-of-type(2) { top: 30%; }
.board__ribbon:nth-of-type(3) { top: 46%; }
.board__ribbon:nth-of-type(4) { top: 62%; }

.board__label {
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(147, 162, 194, .9);
  opacity: 0;
}

.readout {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  margin-top: 14px;
  opacity: 0;
}

.readout > div { background: #0B1222; padding: 12px 13px; }

.readout dt {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 6px;
}

.readout dd {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(14px, 1.5vw, 19px);
  color: var(--blue-bright);
}

/* ---------- demo 04 — scroll world, HTML/data mode ---------- */

.modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 34px;
}

.mode {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 18px;
  background: var(--surface);
}

.mode.is-chosen {
  border-color: var(--blue-line);
  background: linear-gradient(180deg, rgba(10, 82, 239, .16), rgba(16, 26, 46, .6));
}

.mode h4 { font-size: 15px; margin-bottom: 8px; }
.mode p { font-size: 13px; color: var(--muted); line-height: 1.5; }

.mode__pick {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--anc-cyan);
  display: block;
  margin-top: 12px;
}

.datastage {
  position: sticky;
  top: 16vh;
  margin-top: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--surface), #0A1120);
  padding: clamp(20px, 3vw, 34px);
}

.datastage h3 { font-size: clamp(19px, 2.2vw, 27px); margin-bottom: 6px; }

.datastage__sub {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 22px;
}

.bars { display: grid; gap: 13px; }

.bar { display: grid; grid-template-columns: 118px 1fr 92px; gap: 14px; align-items: center; }

.bar__name { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

.bar__track {
  display: block;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  overflow: hidden;
}

.bar__fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--anc-blue), var(--anc-cyan));
  transform: scaleX(0);
  transform-origin: left;
}

.bar__val {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--blue-bright);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.datastage__foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--faint);
}

.databeats { margin-top: 26px; }
.databeat { min-height: 62svh; display: flex; align-items: center; }
.databeat p { font-size: clamp(17px, 2.1vw, 25px); font-family: var(--disp); max-width: 30ch; letter-spacing: -.02em; line-height: 1.3; }
.databeat span { color: var(--anc-cyan); }

/* ---------- demo 05 — three.js scroll world ---------- */

.world { position: relative; }

.world__stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  background: #05080F;
}

.world__stage canvas { display: block; width: 100%; height: 100%; }

.world__poster {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
  background:
    radial-gradient(700px 480px at 50% 44%, rgba(10, 82, 239, .34), transparent 66%),
    #05080F;
}

.world__poster p { color: var(--muted); font-size: 14px; max-width: 44ch; }

.world__hud {
  position: absolute;
  left: var(--gutter);
  bottom: 28px;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  gap: 22px;
  pointer-events: none;
}

.world__chapter { max-width: 40ch; }

.world__chapter .eyebrow { margin-bottom: 10px; }

.world__chapter h3 {
  font-size: clamp(23px, 3.2vw, 40px);
  margin-bottom: 9px;
}

.world__chapter p { color: rgba(235, 241, 252, .74); font-size: 14.5px; }

.world__readout {
  position: absolute;
  right: var(--gutter);
  bottom: 28px;
  z-index: 4;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: right;
  pointer-events: none;
  line-height: 1.9;
}

.world__readout b { color: var(--blue-bright); font-weight: 500; }

.world__scrim {
  position: absolute;
  inset: auto 0 0 0;
  height: 46%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(5, 8, 15, .88) 74%);
}

.world__ledger {
  position: absolute;
  left: var(--gutter);
  top: 96px;
  z-index: 4;
  display: flex;
  gap: 7px;
  pointer-events: none;
}

.world__tick {
  width: 30px;
  height: 2px;
  background: rgba(255, 255, 255, .16);
}

.world__tick.is-on { background: var(--anc-cyan); }

/* ---------- verdict / footer ---------- */

.verdict {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin-top: 40px;
}

.vcard {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  background: var(--surface);
}

.vcard h4 { font-size: 15px; margin-bottom: 9px; }
.vcard p { font-size: 13.5px; color: var(--muted); line-height: 1.55; }

.vcard--warn { border-color: rgba(255, 176, 80, .3); background: rgba(255, 176, 80, .06); }
.vcard--warn h4 { color: #FFC46B; }

.foot {
  padding: 74px 0 90px;
  border-top: 1px solid var(--line);
  background: #070B14;
}

.foot__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-end;
}

.foot__meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
  line-height: 2.1;
}

.foot img { width: 96px; display: block; margin-bottom: 18px; }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html.has-motion [data-motion-text],
  html.has-motion [data-split-reveal],
  html.has-motion [data-reveal],
  html.has-motion [data-reveal-item] { visibility: visible; }

  .pinbeat, .readout, .board__label { opacity: 1; transform: none; }
  .bar__fill { transform: scaleX(1); }
  .preloader { display: none; }
  .stackcard { position: relative; top: auto; }
  .datastage { position: relative; top: auto; }
  .world__stage { position: relative; height: 62svh; }
}
