/* ══════════════════════════════════════════════════════════════════════════
   PQForge HSM — design masterclass site
   Palette + layout language from the CourseIntro / Masterclass wireframes.
   Fonts: Space Grotesk (display/sans) + DM Mono (code/labels) — the
   yardenah.com stack, serving hardware.yardenah.com.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── TOKENS ────────────────────────────────────────────────────────────── */
:root {
  --bg: #06090f;
  --s1: #0b1120;
  --s2: #111928;
  --s3: #182034;
  --br: #1c2a3f;
  --cyan: #00d4ff;
  --cdim: rgba(0, 212, 255, 0.12);
  --amber: #f59e0b;
  --violet: #818cf8;
  --green: #34d399;
  --red: #f87171;
  --rust: #f97316;
  --dart: #54c5f8;
  --tx: #edf4fc;
  --tx2: #a9bed7;
  --tx3: #7e96b3;
  --mono: 'JetBrains Mono', 'DM Mono', ui-monospace, monospace;
  --sans: 'Space Grotesk', system-ui, sans-serif;
  color-scheme: dark;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  /* intro-only aliases used by the cinematic engine */
  --c: #00d4ff;
  --v: #818cf8;
  --g: #34d399;
  --a: #f59e0b;
  --r: #f87171;
}

/* ── RESET / BASE ──────────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 58px;
}

body {
  background: var(--bg);
  color: var(--tx);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
}

::selection {
  background: rgba(0, 212, 255, 0.25);
  color: #fff;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--s3);
  border-radius: 8px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--br);
}

code {
  font-family: var(--mono);
}

/* The intro page locks scrolling; the masterclass page flows normally. */
body.intro-page {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

/* ── READING PROGRESS ──────────────────────────────────────────────────── */
#prog {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  z-index: 999;
  transition: width 0.15s;
}

.scroll-line {
  position: fixed;
  left: 4px;
  top: 70px;
  bottom: 24px;
  width: 2px;
  background: rgba(255, 255, 255, 0.05);
  z-index: 40;
}

.scroll-thumb {
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, var(--cyan), var(--violet));
  border-radius: 2px;
}

/* ── TOPBAR ────────────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: var(--safe-t);
  left: 0;
  right: 0;
  height: 58px;
  background: rgba(6, 9, 15, 0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--br);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 18px;
  z-index: 100;
  overflow-x: auto;
  scrollbar-width: none;
}

.topbar::-webkit-scrollbar {
  display: none;
}

.topbar-logo {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 15px;
  color: #fff;
  margin-right: 18px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.topbar-logo em {
  font-style: normal;
  color: var(--cyan);
}

.topbar a {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--tx2);
  padding: 7px 13px;
  border-radius: 8px;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: 0.15s;
  flex-shrink: 0;
}

.topbar a:hover {
  color: var(--cyan);
  background: rgba(0, 212, 255, 0.06);
}

.topbar a.cur {
  color: var(--cyan);
  background: var(--cdim);
  border-color: rgba(0, 212, 255, 0.18);
}

.lang-badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--tx2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding-left: 10px;
}

.lang-badge .dart {
  color: var(--dart);
  font-weight: 500;
}

.lang-badge .rust {
  color: var(--rust);
  font-weight: 500;
}

#searchbtn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--tx2);
  cursor: pointer;
  padding: 0 14px;
  font-size: 14px;
  transition: 0.2s;
}

#searchbtn:hover {
  color: var(--cyan);
}

/* ── HERO ──────────────────────────────────────────────────────────────── */
.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(96px, 14vh, 160px) 28px 0;
}

.hero-eye {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--tx2);
  letter-spacing: 0.08em;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-eye::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--cyan);
}

.hero h1 {
  font-size: clamp(34px, 6.5vw, 74px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: #fff;
}

.hero h1 em {
  font-style: normal;
  color: var(--cyan);
}

.hero-sub {
  max-width: 720px;
  margin-top: 22px;
  font-size: clamp(14px, 1.7vw, 17px);
  font-weight: 400;
  line-height: 1.65;
  color: var(--tx2);
}

.hero-sub strong {
  color: #fff;
  font-weight: 500;
}

.hero-sub strong.sub-dart {
  color: var(--dart);
}

.hero-sub strong.sub-rust {
  color: var(--rust);
}

.lang-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.lang-pill {
  font-family: var(--mono);
  font-size: 11px;
  padding: 8px 16px;
  border-radius: 100px;
  border: 1px solid var(--br);
  background: var(--s1);
  color: var(--tx2);
}

.lp-dart {
  color: var(--dart) !important;
  border-color: rgba(84, 197, 248, 0.3);
}

.lp-rust {
  color: var(--rust) !important;
  border-color: rgba(249, 115, 22, 0.3);
}

.lp-verilog {
  color: var(--cyan) !important;
  border-color: rgba(0, 212, 255, 0.3);
}

/* Target grid — AMCITIOUS GOAL framing (simulated engine totals) */
.tgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 42px 0 26px;
}

.tc {
  background: var(--s1);
  border: 1px solid var(--br);
  border-radius: 14px;
  padding: 22px 20px;
  position: relative;
  overflow: hidden;
}

.tc::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(0, 212, 255, 0.04), transparent 55%);
  pointer-events: none;
}

.tc-alg {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--tx2);
  margin-bottom: 10px;
}

.tc-n {
  font-size: clamp(26px, 3.2vw, 40px);
  font-weight: 700;
  line-height: 1;
  color: #fff;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.tc-u {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--tx3);
  margin-top: 8px;
  letter-spacing: 0.04em;
}

.tc-total {
  grid-column: 1 / -1;
  background: var(--s3);
  border-color: rgba(0, 212, 255, 0.22);
}

.c-c {
  color: var(--cyan);
}

.c-v {
  color: var(--violet);
}

.c-g {
  color: var(--green);
}

.c-a {
  color: var(--amber);
}

/* ── CALCULATOR ────────────────────────────────────────────────────────── */
.calc-widget {
  max-width: 1180px;
  margin: 22px auto 0;
  padding: 0 28px;
}

.calc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--s2);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  padding: 14px 20px;
}

.calc-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--cyan);
}

.calc-badge {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--tx2);
}

.calc-body {
  max-width: 1180px;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  background: var(--s2);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 0 0 14px 14px;
  padding: 22px 20px 20px;
}

.slider-row {
  margin-bottom: 18px;
}

.slider-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--tx2);
  margin-bottom: 8px;
}

.slider-label span {
  color: #fff;
  font-weight: 500;
}

.slider-row input[type='range'] {
  width: 100%;
  accent-color: var(--cyan);
  height: 3px;
  cursor: pointer;
}

.calc-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.calc-alg-row {
  display: grid;
  grid-template-columns: 74px 1fr 64px;
  align-items: center;
  gap: 12px;
}

.car-name {
  font-family: var(--mono);
  font-size: 11px;
}

.car-bar {
  height: 6px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.car-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.25s;
  min-width: 2px;
  width: 2px;
}

.car-val {
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
}

.calc-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid var(--br);
  margin-top: 16px;
  padding-top: 14px;
}

.calc-total-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--tx2);
  letter-spacing: 0.08em;
}

.calc-total-val {
  font-size: 30px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: -0.02em;
}

.calc-notes {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--tx3);
  margin-top: 10px;
}

.calc-frame {
  max-width: 1180px;
  margin: 10px auto 0;
  padding: 0 28px;
}

/* ── LAYOUT ────────────────────────────────────────────────────────────── */
.layout {
  max-width: 1280px;
  margin: 70px auto 0;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 34px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
}

.sidebar h3 {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  color: var(--tx3);
  letter-spacing: 0.14em;
  margin: 18px 0 8px;
}

.sidelink {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--tx2);
  padding: 7px 10px;
  border-radius: 8px;
  transition: 0.15s;
  border-left: 2px solid transparent;
}

.sidelink:hover {
  background: var(--s1);
  color: var(--tx);
}

.sidelink.active {
  background: var(--s1);
  color: var(--cyan);
  border-left-color: var(--cyan);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.phase-check {
  margin-left: auto;
  width: 17px;
  height: 17px;
  border: 1px solid var(--br);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  cursor: pointer;
  transition: 0.2s;
  flex-shrink: 0;
}

.phase-check:hover {
  border-color: var(--cyan);
  color: var(--tx3);
}

.phase-check.done {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #06090f;
  font-weight: 500;
}

.sidebar-prog {
  margin-top: 22px;
  padding: 14px;
  background: var(--s1);
  border: 1px solid var(--br);
  border-radius: 10px;
}

.sp-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--tx2);
  margin-bottom: 8px;
}

.sp-bar {
  height: 5px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.sp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Back to top */
#btt {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--s2);
  border: 1px solid var(--br);
  color: var(--tx2);
  font-size: 16px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
}

#btt.show {
  opacity: 1;
  pointer-events: all;
}

#btt:hover {
  color: var(--cyan);
  border-color: rgba(0, 212, 255, 0.3);
}

/* ── MAIN / PHASES ─────────────────────────────────────────────────────── */
.main {
  min-width: 0;
  padding-bottom: 40px;
}

#bgc {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.5;
}

#circuit-svg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.55;
  pointer-events: none;
}

.ct {
  fill: none;
  stroke: #00d4ff;
  stroke-width: 1.5;
}

.ct2 {
  fill: none;
  stroke: #818cf8;
  stroke-width: 1;
}

.cd {
  fill: #00d4ff;
}

.phase {
  background: rgba(11, 17, 32, 0.62);
  border: 1px solid var(--br);
  border-radius: 18px;
  padding: clamp(26px, 4vw, 44px);
  margin-bottom: 34px;
  backdrop-filter: blur(6px);
}

.phase-head {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 30px;
}

.phase-tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 100px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.phase-title {
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.phase-sub {
  font-size: 14px;
  font-weight: 400;
  color: var(--tx2);
  margin-top: 6px;
}

.phase-meta {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.meta-pill {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--tx2);
  background: var(--s2);
  border: 1px solid var(--br);
  padding: 4px 11px;
  border-radius: 100px;
  white-space: nowrap;
}

.sl {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--tx3);
  text-transform: uppercase;
  margin: 34px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sl::after {
  content: '';
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, var(--br), transparent);
}

/* ── CARDS ─────────────────────────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 14px;
}

.card {
  background: var(--s2);
  border: 1px solid var(--br);
  border-radius: 12px;
  padding: 22px;
  transition: border-color 0.25s;
}

.card:hover {
  border-color: rgba(0, 212, 255, 0.3);
}

.card-title {
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--br);
}

.ct-hw {
  color: var(--cyan) !important;
}

.ct-dart {
  color: var(--dart) !important;
}

.ct-sec {
  color: var(--red) !important;
}

.ct-rust {
  color: var(--rust) !important;
}

.items li {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--tx);
  line-height: 1.55;
  padding: 5px 0 5px 16px;
  position: relative;
}

.items li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--cyan);
  font-size: 10px;
  opacity: 0.6;
}

.items li strong {
  font-weight: 500;
  color: #fff;
}

.note {
  display: block;
  font-size: 12px !important;
  font-weight: 400;
  font-style: italic;
  color: var(--tx2);
  margin-top: 2px;
  line-height: 1.5;
}

/* ── ALGORITHM CARDS (P2) ──────────────────────────────────────────────── */
.algo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.ac {
  background: var(--s2);
  border: 1px solid var(--br);
  border-radius: 14px;
  padding: 20px;
  transition: transform 0.25s;
}

.ac:hover {
  transform: translateY(-3px);
}

.ac-name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 3px;
}

.ac-std {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--tx2);
  margin-bottom: 14px;
}

.ac-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 400;
  padding: 7px 0;
  border-bottom: 1px solid rgba(28, 42, 63, 0.55);
}

.ac-row:last-child {
  border-bottom: none;
}

.ac-row span:first-child {
  color: var(--tx2);
  font-family: var(--mono);
  font-size: 10px;
  padding-top: 1px;
}

.ac-row span:last-child {
  color: var(--tx);
  text-align: right;
}

/* ── PROJECT BOXES ─────────────────────────────────────────────────────── */
.proj {
  margin-top: 30px;
  background: linear-gradient(150deg, rgba(0, 212, 255, 0.05), rgba(129, 140, 248, 0.03));
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 14px;
  padding: 26px;
  position: relative;
  overflow: hidden;
}

.proj::before {
  content: '◆';
  position: absolute;
  right: -14px;
  bottom: -34px;
  font-size: 128px;
  opacity: 0.05;
  color: var(--cyan);
}

.proj-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--amber);
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}

.proj-title {
  font-size: clamp(16px, 2vw, 21px);
  font-weight: 500;
  color: #fff;
  margin-bottom: 18px;
  line-height: 1.3;
}

.proj-steps {
  list-style: none;
  counter-reset: s;
}

.proj-steps li {
  counter-increment: s;
  font-size: 13px;
  color: var(--tx2);
  padding: 9px 0 9px 44px;
  border-bottom: 1px solid rgba(28, 42, 63, 0.5);
  position: relative;
}

.proj-steps li:last-child {
  border-bottom: none;
}

.proj-steps li::before {
  content: counter(s, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 10px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--cyan);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 6px;
  padding: 2px 6px;
}

.proj-steps li strong {
  display: block;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 2px;
}

/* ── CODE BLOCKS ───────────────────────────────────────────────────────── */
.code-wrap {
  position: relative;
  background: #05080d;
  border: 1px solid var(--br);
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
}

.code-lang {
  position: absolute;
  top: 12px;
  right: 68px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dart);
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 10px;
  background: var(--s3);
  border: 1px solid var(--br);
  border-radius: 6px;
  color: var(--tx2);
  cursor: pointer;
  transition: 0.2s;
  z-index: 2;
}

.copy-btn:hover {
  color: var(--cyan);
  border-color: rgba(0, 212, 255, 0.3);
}

.copy-btn.copied {
  color: var(--green);
  border-color: rgba(52, 211, 153, 0.3);
}

.code {
  display: block;
  overflow-x: auto;
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.62;
  color: #dce8f5;
  font-weight: 400;
  tab-size: 2;
}

.code .kw {
  color: #ff7b72;
}

.code .ty {
  color: #79c0ff;
}

.code .cm {
  color: #829ab8;
  font-style: italic;
}

.code .fn {
  color: #d2a8ff;
}

.code .st {
  color: #a5d6ff;
}

.code .nu {
  color: #f2cc60;
}

.code .at {
  color: #fa7859;
}

.code .dk {
  color: var(--dart);
}

.code .dc {
  color: #7ee787;
}

/* ── SPEC TABLES ───────────────────────────────────────────────────────── */
.spec-wrap {
  overflow-x: auto;
  border: 1px solid var(--br);
  border-radius: 12px;
  background: var(--s2);
}

.spec {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.spec th {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--cyan);
  text-align: left;
  letter-spacing: 0.08em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--br);
  background: rgba(0, 212, 255, 0.04);
  white-space: nowrap;
}

.spec td {
  font-size: 13px;
  font-weight: 400;
  color: var(--tx);
  padding: 11px 16px;
  border-bottom: 1px solid rgba(28, 42, 63, 0.55);
}

.spec tr:last-child td {
  border-bottom: none;
}

.spec .mu {
  color: var(--tx2);
}

.spec .hl {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
}

/* ── LIVE OPS TICKER ───────────────────────────────────────────────────── */
.live-ticker {
  background: var(--s1);
  border: 1px solid var(--br);
  border-radius: 12px;
  padding: 20px;
  margin: 24px 0;
  position: relative;
  overflow: hidden;
}

.live-ticker::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.03), transparent);
  pointer-events: none;
}

.lt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.lt-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: #fff;
}

.live-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--green);
}

.live-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: livePulse 1.4s ease-in-out infinite;
}

@keyframes livePulse {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
  }

  50% {
    opacity: 0.5;
    box-shadow: 0 0 0 5px rgba(52, 211, 153, 0);
  }
}

.lt-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.lt-card {
  background: var(--s2);
  border: 1px solid var(--br);
  border-radius: 10px;
  padding: 14px 16px;
}

.lt-alg {
  font-family: var(--mono);
  font-size: 10px;
  margin-bottom: 8px;
}

.lt-val {
  font-size: 21px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.lt-bar {
  height: 3px;
  background: var(--bg);
  border-radius: 3px;
  margin-top: 10px;
  overflow: hidden;
}

.lt-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.lt-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--br);
}

.lt-total-label {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--tx3);
  letter-spacing: 0.1em;
}

.lt-total-val {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
}

/* ── MILESTONES ────────────────────────────────────────────────────────── */
.milestones {
  display: flex;
  flex-direction: column;
}

.ml {
  display: flex;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid rgba(28, 42, 63, 0.55);
}

.ml:last-child {
  border-bottom: none;
}

.ml-num {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--cyan);
  transition: 0.25s;
}

.ml:hover .ml-num {
  background: rgba(0, 212, 255, 0.1);
  border-color: rgba(0, 212, 255, 0.3);
}

.ml-body h4 {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 3px;
}

.ml-body p {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--tx2);
  line-height: 1.55;
}

/* ── RESOURCES ─────────────────────────────────────────────────────────── */
.res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 9px;
}

.res {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--s2);
  border: 1px solid var(--br);
  border-radius: 9px;
  padding: 11px 15px;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--tx);
  transition: 0.2s;
}

.res:hover {
  cursor: pointer;
  text-decoration: none;
  transform: translateY(-2px);
  filter: brightness(1.25);
  color: #fff;
}

.res.rar {
  border-color: rgba(129, 140, 248, 0.18);
}

.res.rb {
  border-color: rgba(0, 212, 255, 0.16);
}

.res.rc {
  border-color: rgba(255, 255, 255, 0.09);
}

.res.rh {
  border-color: rgba(245, 158, 11, 0.18);
}

.res.rp {
  border-color: rgba(216, 228, 240, 0.09);
}

.res.rdart {
  border-color: rgba(84, 197, 248, 0.2);
}

.res.rrust {
  border-color: rgba(249, 115, 22, 0.2);
}

.res.rt {
  border-color: rgba(52, 211, 153, 0.16);
}

/* ── FINAL SPEC ────────────────────────────────────────────────────────── */
.finalspec {
  background: linear-gradient(155deg, rgba(0, 212, 255, 0.06), rgba(129, 140, 248, 0.05)),
    var(--s1);
  border: 1px solid rgba(0, 212, 255, 0.28);
  border-radius: 18px;
  padding: clamp(26px, 4vw, 44px);
  margin-top: 20px;
}

.finalspec h3 {
  font-size: clamp(19px, 2.4vw, 26px);
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.fs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.fs-block {
  background: rgba(6, 9, 15, 0.55);
  border: 1px solid var(--br);
  border-radius: 12px;
  padding: 20px;
}

.fs-block h4 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--cyan);
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--br);
}

.fs-block ul {
  list-style: none;
}

.fs-block li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 13px;
  font-weight: 400;
  padding: 6px 0;
  color: var(--tx);
}

.fs-block li span:first-child {
  color: var(--tx2);
}

.fs-block li span:last-child {
  font-family: var(--mono);
  font-size: 11px;
  color: #fff;
  text-align: right;
}

/* ── FOOTER ────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--br);
  padding: 34px 28px 46px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 34px;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--tx3);
  letter-spacing: 0.06em;
  max-width: 1280px;
  margin: 0 auto;
}

.site-footer a {
  color: var(--tx2);
}

.site-footer a:hover {
  color: var(--cyan);
}

/* ── REVEAL ANIMATION ──────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal-d1 {
  transition-delay: 0.08s;
}

.reveal-d2 {
  transition-delay: 0.16s;
}

.reveal-d3 {
  transition-delay: 0.24s;
}

.reveal-d4 {
  transition-delay: 0.32s;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

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

  html {
    scroll-behavior: auto;
  }
}

/* ── SEARCH OVERLAY ────────────────────────────────────────────────────── */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, 0.8);
  backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.search-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.search-box {
  width: min(620px, 92vw);
  background: var(--s2);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}

#search-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--mono);
  font-size: 14px;
  padding: 16px 18px;
}

#search-input::placeholder {
  color: var(--tx3);
}

.search-sep {
  height: 1px;
  background: var(--br);
}

.search-results {
  max-height: 46vh;
  overflow-y: auto;
}

.search-item {
  padding: 12px 18px;
  border-bottom: 1px solid rgba(28, 42, 63, 0.5);
  cursor: pointer;
}

.search-item:hover {
  background: var(--s1);
}

.si-phase {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--cyan);
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

.si-text {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--tx);
}

.si-text mark {
  background: rgba(0, 212, 255, 0.2);
  color: var(--cyan);
  border-radius: 3px;
  padding: 0 2px;
}

.search-hint {
  padding: 10px 18px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--tx3);
  border-top: 1px solid var(--br);
}

/* ── MOBILE BOTTOM NAV ─────────────────────────────────────────────────── */
.mob-nav {
  display: none;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .calc-body {
    grid-template-columns: 1fr;
  }

  .lt-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .fs-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .tgrid {
    grid-template-columns: repeat(2, 1fr);
  }

  .phase {
    padding: 22px 16px;
    border-radius: 14px;
  }

  .phase-head {
    flex-direction: column;
    gap: 10px;
  }

  .topbar .lang-badge {
    display: none;
  }

  .mob-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: rgba(6, 9, 15, 0.92);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--br);
    flex-direction: column;
    gap: 4px;
    padding: 8px 12px calc(8px + var(--safe-b));
  }

  .mob-nav-phase {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--cyan);
    text-align: center;
    letter-spacing: 0.08em;
  }

  .mob-nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .mob-nav-btn {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--tx2);
    background: var(--s2);
    border: 1px solid var(--br);
    border-radius: 8px;
    padding: 7px 14px;
    cursor: pointer;
    transition: 0.2s;
  }

  .mob-nav-btn:disabled {
    opacity: 0.3;
  }

  .mob-nav-btn:not(:disabled):hover {
    color: var(--cyan);
    border-color: rgba(0, 212, 255, 0.3);
  }

  .mob-dots {
    display: flex;
    gap: 7px;
  }

  .mob-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--s3);
    cursor: pointer;
    transition: 0.2s;
  }

  .mob-dot.cur {
    background: var(--cyan);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
  }

  #btt {
    bottom: 92px;
  }

  .scroll-line {
    display: none;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   INTRO CINEMATIC (home page — the autoplaying opening film)
   ══════════════════════════════════════════════════════════════════════════ */
body.intro-page #ichost {
  position: fixed;
  inset: 0;
  z-index: 0;
}

body.intro-page #ic {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

#scan {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0, 0, 0, 0.07) 3px, rgba(0, 0, 0, 0.07) 4px);
}

body.intro-page #topskip {
  position: fixed;
  bottom: calc(20px + var(--safe-b));
  right: 20px;
  z-index: 10;
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: all;
}

.cbtn {
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--mono);
  font-size: 10px;
  cursor: pointer;
  transition: 0.2s;
}

.cbtn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

#pausebtn,
#replaybtn,
#snd {
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

#skipbtn {
  padding-left: 16px;
  padding-right: 16px;
}

#pausebtn:focus-visible,
#replaybtn:focus-visible,
#snd:focus-visible,
#skipbtn:focus-visible {
  outline: 2px solid var(--c);
  outline-offset: 2px;
}

.snd-hint {
  position: fixed;
  right: 20px;
  bottom: calc(64px + var(--safe-b));
  z-index: 11;
  display: none;
  align-items: center;
  padding: 8px 13px;
  border-radius: 9px;
  border: 1px solid rgba(0, 212, 255, 0.4);
  background: rgba(0, 212, 255, 0.12);
  color: #d9f6ff;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  pointer-events: none;
  animation: sndPulse 2.4s ease-in-out infinite;
}

@keyframes sndPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 212, 255, 0);
  }

  50% {
    box-shadow: 0 0 18px 2px rgba(0, 212, 255, 0.18);
  }
}

/* Pausing the film freezes every CSS reveal and marquee as well as the canvas. */
body.intro-paused *,
body.intro-paused *::before,
body.intro-paused *::after {
  animation-play-state: paused !important;
}

#pb {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
  z-index: 10;
}

#pf {
  height: 100%;
  background: linear-gradient(90deg, var(--c), var(--v));
  box-shadow: 0 0 6px var(--c);
  transition: width 0.08s linear;
  width: 0;
}

#ov {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.ic-sc {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.5s ease;
  padding: clamp(20px, 5vw, 60px);
  text-align: center;
}

.ic-sc.on {
  opacity: 1;
}

/* SC0 · BOOT */
#s-boot {
  align-items: flex-start;
  justify-content: flex-start;
  padding: clamp(32px, 6vw, 64px);
}

#blines {
  width: 100%;
}

.bl {
  font-family: var(--mono);
  font-size: clamp(9px, 1.5vw, 13px);
  color: var(--c);
  margin-bottom: 5px;
  opacity: 0;
  transition: opacity 0.1s;
  letter-spacing: 0.03em;
  line-height: 1.4;
  white-space: pre;
  text-align: left;
}

.bl.ok::after {
  content: ' ✓';
  color: var(--g);
}

.blinker {
  display: inline-block;
  width: 7px;
  height: 1.1em;
  background: var(--c);
  vertical-align: middle;
  margin-left: 3px;
  animation: blk 0.55s step-end infinite;
}

@keyframes blk {
  50% {
    opacity: 0;
  }
}

/* SC1 · THREAT */
#s-threat {
  background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(248, 113, 113, 0.05), transparent);
}

#ttext {
  font-size: clamp(15px, 3.2vw, 38px);
  font-weight: 700;
  line-height: 1.35;
  max-width: min(820px, 90vw);
  color: #fff;
  letter-spacing: -0.01em;
}

#ttext .dead {
  text-decoration: line-through;
  color: #b46b6b;
}

#ttext .hot {
  color: var(--r);
}

/* SC2 · SOLUTION */
#s-sol {
  background: radial-gradient(ellipse 60% 50% at 50% 50%, rgba(0, 212, 255, 0.05), transparent);
}

.sol-big {
  font-size: clamp(22px, 5.5vw, 68px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow: 0 0 48px rgba(0, 212, 255, 0.3);
  line-height: 1.1;
}

.sol-tag {
  font-family: var(--mono);
  font-size: clamp(10px, 1.6vw, 14px);
  color: rgba(255, 255, 255, 0.62);
  margin-top: 16px;
  letter-spacing: 0.12em;
}

/* SC3 · ALGORITHMS */
#s-algs {
  gap: 16px;
}

.alg-eyebrow {
  font-family: var(--mono);
  font-size: clamp(9px, 1.3vw, 11px);
  color: rgba(255, 255, 255, 0.58);
  letter-spacing: 0.14em;
  margin-bottom: 8px;
}

.iag {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
  max-width: min(800px, 95vw);
}

@media (min-width: 600px) {
  .iag {
    grid-template-columns: repeat(4, 1fr);
  }
}

.iac {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: clamp(12px, 2vw, 20px);
  transform: translateY(24px) scale(0.97);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease, border-color 0.3s;
}

.iac.in {
  transform: none;
  opacity: 1;
}

.iac .an {
  font-family: var(--mono);
  font-size: clamp(11px, 1.6vw, 14px);
  font-weight: 500;
  margin-bottom: 10px;
  text-align: left;
}

.iac .av {
  font-size: clamp(22px, 3.5vw, 38px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.iac .au {
  font-family: var(--mono);
  font-size: clamp(8px, 1.1vw, 10px);
  color: rgba(255, 255, 255, 0.55);
  margin-top: 4px;
  text-align: left;
}

/* SC4 · HARDWARE */
#s-hw {
  background: radial-gradient(ellipse 80% 70% at 50% 50%, rgba(0, 212, 255, 0.04), transparent);
}

.hw-n {
  font-size: clamp(40px, 10vw, 110px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 80px rgba(0, 212, 255, 0.25);
  font-variant-numeric: tabular-nums;
}

.hw-l {
  font-family: var(--mono);
  font-size: clamp(9px, 1.4vw, 12px);
  color: rgba(0, 212, 255, 0.85);
  letter-spacing: 0.16em;
  margin-top: 6px;
  margin-bottom: 28px;
}

.isr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: min(540px, 90vw);
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.isr.in {
  opacity: 1;
  transform: none;
}

.isr .ilb {
  font-family: var(--mono);
  font-size: clamp(9px, 1.4vw, 12px);
  color: rgba(255, 255, 255, 0.68);
}

.isr .ivl {
  font-size: clamp(11px, 1.8vw, 15px);
  font-weight: 500;
  color: var(--c);
}

/* SC5 · PHASES */
#s-ph {
  gap: 20px;
}

.ph-head {
  font-size: clamp(18px, 4vw, 46px);
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}

.ph-sub {
  font-family: var(--mono);
  font-size: clamp(9px, 1.4vw, 12px);
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.1em;
}

.ps-wrap {
  overflow: hidden;
  width: 100%;
  max-width: 100vw;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.ps {
  display: flex;
  gap: 10px;
  width: max-content;
  animation: scrollp 14s linear infinite;
}

@keyframes scrollp {
  to {
    transform: translateX(-50%);
  }
}

.pp {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--mono);
  font-size: clamp(9px, 1.3vw, 12px);
  font-weight: 500;
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}

.pp span {
  opacity: 0.45;
}

/* SC6 · TECH */
#s-tech {
  gap: 12px;
}

.te {
  font-family: var(--mono);
  font-size: clamp(9px, 1.3vw, 11px);
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.14em;
  margin-bottom: 4px;
}

.lr {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 4vw, 48px);
  flex-wrap: wrap;
}

.lb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(20px, 4vw, 46px);
  font-weight: 700;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lb.in {
  opacity: 1;
  transform: none;
}

.lb .li {
  filter: drop-shadow(0 0 10px currentColor);
  font-size: 1.1em;
}

.lsep {
  font-size: clamp(14px, 2.5vw, 28px);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.35);
}

.lsub {
  font-family: var(--mono);
  font-size: clamp(9px, 1.3vw, 12px);
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.08em;
}

/* SC7 · FINALE */
#s-fin {
  background: radial-gradient(ellipse 70% 60% at 50% 45%, rgba(0, 212, 255, 0.06), transparent);
  pointer-events: all;
}

.fl {
  font-size: clamp(34px, 8.5vw, 96px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.fl-acc {
  color: var(--c);
}

.fd {
  font-family: var(--mono);
  font-size: clamp(10px, 1.8vw, 17px);
  color: rgba(255, 255, 255, 0.64);
  letter-spacing: 0.14em;
  margin: 10px 0 6px;
}

.fb {
  display: inline-block;
  padding: 4px 14px;
  border: 1px solid rgba(0, 212, 255, 0.35);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: clamp(8px, 1.1vw, 10px);
  color: var(--c);
  letter-spacing: 0.1em;
  margin-bottom: 28px;
}

.fsg {
  display: flex;
  gap: clamp(16px, 4vw, 40px);
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 28px;
}

.fsi {
  text-align: center;
}

.fsn {
  font-size: clamp(22px, 4vw, 44px);
  font-weight: 700;
  color: var(--c);
  line-height: 1;
}

.fsl {
  font-family: var(--mono);
  font-size: clamp(8px, 1.1vw, 10px);
  color: rgba(255, 255, 255, 0.58);
  letter-spacing: 0.1em;
  margin-top: 4px;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: clamp(11px, 1.8vw, 16px) clamp(20px, 3vw, 36px);
  background: var(--c);
  color: #000;
  border-radius: 10px;
  font-family: var(--mono);
  font-size: clamp(11px, 1.6vw, 15px);
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  letter-spacing: 0.04em;
  pointer-events: all;
}

.cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 212, 255, 0.3);
}

.byline {
  display: inline-block;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.62);
  border-bottom: 1px solid transparent;
  transition: 0.2s;
  pointer-events: all;
}

.byline:hover {
  color: var(--c);
  border-bottom-color: rgba(0, 212, 255, 0.45);
}

/* GLITCH (PQForge wordmark) */
.gx {
  position: relative;
  display: inline-block;
}

.gx::before,
.gx::after {
  content: attr(data-g);
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.gx::before {
  color: var(--r);
  clip-path: polygon(0 25%, 100% 25%, 100% 45%, 0 45%);
  animation: gxa 2.5s steps(1) infinite;
}

.gx::after {
  color: var(--g);
  clip-path: polygon(0 65%, 100% 65%, 100% 80%, 0 80%);
  animation: gxb 2.5s steps(1) infinite 0.2s;
}

@keyframes gxa {

  0%,
  88%,
  100% {
    opacity: 0;
    transform: none;
  }

  89% {
    opacity: 1;
    transform: translateX(-4px);
  }

  91% {
    opacity: 1;
    transform: translateX(2px);
  }

  93% {
    opacity: 0;
  }
}

@keyframes gxb {

  0%,
  90%,
  100% {
    opacity: 0;
    transform: none;
  }

  91% {
    opacity: 1;
    transform: translateX(3px);
  }

  93% {
    opacity: 0;
  }
}

/* Static pre-hydration frame: a faint boot shimmer so hydration feels seamless */
.pre-boot {
  position: absolute;
  top: clamp(32px, 6vw, 64px);
  left: clamp(32px, 6vw, 64px);
  font-family: var(--mono);
  font-size: clamp(9px, 1.5vw, 13px);
  color: rgba(0, 212, 255, 0.75);
  letter-spacing: 0.03em;
  animation: preboot 1.2s ease-in-out infinite;
  text-align: left;
}

@keyframes preboot {

  0%,
  100% {
    opacity: 0.35;
  }

  50% {
    opacity: 0.85;
  }
}

/* Screen-reader-only (skipping the film jumps straight to content) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── SVG CIRCUIT OVERLAY palette ── */
.ct {
  fill: none;
  stroke: #00d4ff;
  stroke-width: 1.5;
}

.ct2 {
  fill: none;
  stroke: #818cf8;
  stroke-width: 1;
}

.cd {
  fill: #00d4ff;
}

/* ── HERO TYPEWRITER LINES (server-rendered, CSS-only reveal) ── */
.hero h1 .tw-line {
  display: block;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px);
  animation: twUp 0.5s ease forwards;
}

.hero h1 .tw-line:nth-child(1) {
  animation-delay: 0.35s;
}

.hero h1 .tw-line:nth-child(2) {
  animation-delay: 0.75s;
}

.hero h1 .tw-line:nth-child(3) {
  animation-delay: 1.15s;
}

@keyframes twUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── SCROLL-STATE: pause non-essential animations while scrolling ── */
body.is-scrolling .phase-tag,
body.is-scrolling .proj,
body.is-scrolling .tc,
body.is-scrolling .ac,
body.is-scrolling .topbar-logo {
  animation-play-state: paused !important;
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .hero h1 .tw-line {
    opacity: 1;
    transform: none;
    animation: none;
  }
}