/* =========================================================
   DataLinx: engineering-studio theme
   near-black canvas, two-tone headlines, wireframe x-ray
   ========================================================= */

:root {
  --bg: #f3f3f0;
  --surface: #ffffff;
  --surface-2: #eaeae5;
  --text: #0b0c0e;
  --muted: #565c66;
  --dim: #5a6694;
  --line: #d8d8d1;
  --accent: #1f55e6;
  --accent-soft: rgba(31, 85, 230, 0.1);
  --orange: #c95400;
  --guide: #e0233a;
  --gold: #a26b00;
  --ok: #0f8a5f;
  --warn: #b45309;
  --alert: #d0243c;
  --solid-bg: #0b0c0e;
  --solid-fg: #ffffff;
  --header-bg: rgba(243, 243, 240, 0.86);
  --band: rgba(255, 255, 255, 0.6);
  --grid: rgba(11, 12, 14, 0.05);
  --shadow: 0 24px 48px -30px rgba(11, 12, 14, 0.35);
  --cursor-fill: #0b0c0e;
  --cursor-stroke: #ffffff;
  --display: "Inter Tight", "Segoe UI", system-ui, -apple-system, sans-serif;
  --body: "Inter Tight", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #08090b;
    --surface: #0e1013;
    --surface-2: #14171c;
    --text: #f2f3f5;
    --muted: #8a909c;
    --dim: #7d88b4;
    --line: #1c2027;
    --accent: #2f6bff;
    --accent-soft: rgba(47, 107, 255, 0.14);
    --orange: #ff7a1a;
    --guide: #ff3344;
    --gold: #f2b134;
    --ok: #34d399;
    --warn: #f59e0b;
    --alert: #ff4d61;
    --solid-bg: #f2f3f5;
    --solid-fg: #08090b;
    --header-bg: rgba(8, 9, 11, 0.82);
    --band: rgba(14, 16, 19, 0.6);
    --grid: rgba(255, 255, 255, 0.035);
    --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
    --cursor-fill: #f2f3f5;
    --cursor-stroke: #08090b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #08090b;
  --surface: #0e1013;
  --surface-2: #14171c;
  --text: #f2f3f5;
  --muted: #8a909c;
  --dim: #7d88b4;
  --line: #1c2027;
  --accent: #2f6bff;
  --accent-soft: rgba(47, 107, 255, 0.14);
  --orange: #ff7a1a;
  --guide: #ff3344;
  --gold: #f2b134;
  --ok: #34d399;
  --warn: #f59e0b;
  --alert: #ff4d61;
  --solid-bg: #f2f3f5;
  --solid-fg: #08090b;
  --header-bg: rgba(8, 9, 11, 0.82);
  --band: rgba(14, 16, 19, 0.6);
  --grid: rgba(255, 255, 255, 0.035);
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
  --cursor-fill: #f2f3f5;
  --cursor-stroke: #08090b;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 76px);
}
body {
  position: relative;
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 60;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
img, svg, canvas { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: #fff; }

.wrap { width: min(1240px, 100% - 3rem); margin-inline: auto; }

/* Cursor swarm canvas floats above content but never blocks clicks */
#bgCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 45;
  pointer-events: none;
}

/* Layout guides: two faint rails at the content edges */
.guides { position: fixed; inset: 0; pointer-events: none; z-index: -1; }
.guides span {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom, transparent, var(--line) 20%, var(--line) 80%, transparent);
}
.guides span:first-child { left: max(1.5rem, (100% - 1240px) / 2); }
.guides span:last-child { right: max(1.5rem, (100% - 1240px) / 2); }

/* ---------- Shared type ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  font-family: var(--mono); font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 1.3rem;
}
.eb-num { color: var(--orange); font-weight: 600; }
.eb-sq { width: 7px; height: 7px; background: var(--orange); box-shadow: 0 0 10px var(--orange); }
.eb-dim { color: var(--muted); opacity: 0.75; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; }
.dim { color: var(--dim); }

.logo-sq {
  display: inline-block; width: 26px; height: 26px; flex: none;
  background: var(--text); margin-right: 0.55rem;
  box-shadow: 4px 4px 0 var(--accent);
}

/* ---------- Boot sequence ---------- */
.boot { display: none; }
.js-boot .boot {
  display: grid; place-items: center;
  position: fixed; inset: 0; z-index: 300;
  background: #08090b; color: #f2f3f5;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.js-boot body { overflow: hidden; }
.boot.done { opacity: 0; visibility: hidden; }
.boot-inner { width: min(460px, 100% - 3rem); font-family: var(--mono); }
.boot-brand { display: flex; align-items: center; font-family: var(--display); font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 1.6rem; }
.boot-brand .logo-sq { background: #f2f3f5; box-shadow: 4px 4px 0 #2f6bff; }
.boot-brand > span:last-child { color: #7d88b4; }
.boot-lines { list-style: none; display: grid; gap: 0.35rem; min-height: 9.5rem; font-size: 0.85rem; }
.boot-lines li { display: flex; justify-content: space-between; color: #8a909c; animation: lineIn 0.25s ease both; }
.boot-lines li .ok { color: #34d399; }
.boot-bar { height: 2px; background: #1c2027; margin-top: 1rem; overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: 0; background: #2f6bff; box-shadow: 0 0 12px #2f6bff; transition: width 0.25s ease; }
.boot-skip { margin-top: 1rem; font-size: 0.75rem; color: #5b6170; }
@keyframes lineIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0;
  height: 2px; z-index: 70; background: var(--accent); box-shadow: 0 0 10px var(--accent);
  transform: scaleX(0); transform-origin: left;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header > .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand > span:last-child { color: var(--dim); }
.nav { display: flex; align-items: center; gap: 1.8rem; }
.nav a { position: relative; text-decoration: none; color: var(--muted); font-size: 0.92rem; font-weight: 500; transition: color 0.2s; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform 0.25s ease;
}
.nav a:hover, .nav a.active { color: var(--text); }
.nav a.active::after { transform: scaleX(1); }
.header-tools { display: flex; align-items: center; gap: 0.5rem; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  height: 36px; min-width: 36px; padding: 0 0.65rem;
  border: 1px solid var(--line); border-radius: 2px;
  background: transparent; color: var(--muted); cursor: pointer;
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }
.icon-btn svg { width: 16px; height: 16px; }
#xrayBtn[aria-pressed="true"] { color: #fff; background: var(--accent); border-color: var(--accent); }
kbd { font-family: var(--mono); font-size: 0.7rem; border: 1px solid var(--line); padding: 0 0.3rem; }
.menu-btn { display: none; }
.mobile-nav { display: none; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--display); font-weight: 600; font-size: 0.98rem;
  padding: 0.85rem 1.5rem; border-radius: 2px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; overflow: hidden;
  transition: transform 0.2s, box-shadow 0.25s;
}
.btn-solid { background: var(--solid-bg); color: var(--solid-fg); box-shadow: 4px 4px 0 var(--accent); }
.btn-solid:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--accent); }
.btn-solid:active { transform: none; box-shadow: 2px 2px 0 var(--accent); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.88rem; box-shadow: 3px 3px 0 var(--accent); }
.btn-primary { background: var(--accent); color: #fff; }
.text-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 600; text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: border-color 0.2s, color 0.2s;
}
.text-link::after { content: ""; width: 6px; height: 6px; background: var(--orange); }
.text-link:hover { border-color: var(--accent); color: var(--accent); }

.pulse-dot {
  display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); animation: ring 2s infinite;
}
@keyframes ring {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
  80%, 100% { box-shadow: 0 0 0 8px transparent; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding: 5rem 0 0; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(to right, var(--grid) 1px, transparent 1px), linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 70% 35%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 35%, #000 0%, transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 2rem; align-items: center; min-height: min(640px, 78vh); }
.hero h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.6rem, 5.8vw, 5.3rem); line-height: 0.98; letter-spacing: -0.045em;
  margin-bottom: 1.6rem;
}
.hero h1 span { display: block; }
.hero h1 .l2 { color: var(--dim); }
.hero-lede { color: var(--muted); font-size: 1.15rem; max-width: 36rem; margin-bottom: 2.4rem; }
.hero-actions { display: flex; align-items: center; gap: 1.8rem; flex-wrap: wrap; }
.hero-visual { position: relative; aspect-ratio: 1 / 1; max-height: 560px; width: 100%; }
#heroGL { width: 100%; height: 100%; }
.gl-fallback {
  display: none; position: absolute; inset: 18%;
  border-radius: 50%; border: 18px solid var(--accent);
  box-shadow: 0 0 60px var(--accent), inset 0 0 40px var(--accent);
  animation: spin 14s linear infinite;
}
.no-gl .gl-fallback { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.gl-tag {
  position: absolute; font-family: var(--mono); font-size: 0.72rem; color: var(--muted);
  border: 1px solid var(--line); background: var(--header-bg); padding: 0.2rem 0.5rem;
  pointer-events: none;
}
.gl-tag b { color: var(--accent); font-weight: 600; }
.gl-tag-a { top: 14%; left: 2%; }
.gl-tag-b { bottom: 20%; right: 0; }
.gl-status {
  position: absolute; left: 50%; bottom: 2%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 0.55rem; white-space: nowrap;
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
}
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line); margin-top: 3rem;
}
.stat { padding: 1.4rem 1.2rem 2.2rem 0; }
.stat + .stat { padding-left: 1.2rem; border-left: 1px solid var(--line); }
.stat-label { display: block; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.4rem; }
.stat b { font-family: var(--display); font-weight: 600; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }

/* ---------- Sections ---------- */
section { padding: 7rem 0; }
.band { background: var(--band); border-block: 1px solid var(--line); }
.section-head { max-width: 50rem; margin-bottom: 3.5rem; }
.section-head h2, .contact-copy h2 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.2rem, 4.6vw, 3.8rem); line-height: 1.02; letter-spacing: -0.04em;
  margin-bottom: 1.2rem;
}
.section-head h2 .dim, .contact-copy h2 .dim { display: block; }
.section-head p { color: var(--muted); font-size: 1.1rem; max-width: 42rem; }

/* ---------- Projects ---------- */
.projects { display: grid; gap: 7rem; }
.project { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 4rem; align-items: center; }
.project.flip .project-copy { order: 2; }
.project-copy .eyebrow { margin-bottom: 0.8rem; }
.project-copy h3 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2rem, 3.8vw, 3.2rem); line-height: 1; letter-spacing: -0.04em;
  margin-bottom: 1rem;
}
.project-copy > p { color: var(--muted); font-size: 1.05rem; margin-bottom: 1.3rem; }
.project-features { list-style: none; display: grid; gap: 0.5rem; margin-bottom: 1.6rem; }
.project-features li { display: flex; gap: 0.7rem; align-items: baseline; }
.project-features li::before { content: ""; flex: none; width: 6px; height: 6px; background: var(--accent); transform: translateY(-2px); }
.meta { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); margin-bottom: 1.6rem; }
.meta div { padding: 0.8rem 0; }
.meta div + div { padding-left: 1rem; border-left: 1px solid var(--line); }
.meta dt { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.meta dd { font-size: 0.95rem; font-weight: 500; }

/* Glitch on hover */
.glitch { position: relative; }
.glitch:hover, .glitch.glitching { animation: glitch 0.45s steps(2, end) 1; }
@keyframes glitch {
  0% { text-shadow: 3px 0 var(--guide), -3px 0 var(--accent); transform: translateX(0); }
  25% { text-shadow: -4px 0 var(--guide), 4px 0 var(--accent); transform: translateX(-2px) skewX(-6deg); }
  50% { text-shadow: 2px 0 var(--guide), -2px 0 var(--accent); clip-path: inset(10% 0 45% 0); transform: translateX(3px); }
  75% { text-shadow: -2px 0 var(--guide), 2px 0 var(--accent); clip-path: inset(55% 0 5% 0); }
  100% { text-shadow: none; clip-path: none; transform: none; }
}

.shot-frame {
  border: 1px solid var(--line); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow), 0 0 60px -30px var(--accent);
  position: relative;
}
.shot-frame::before, .shot-frame::after {
  content: ""; position: absolute; width: 9px; height: 9px; z-index: 2;
  border: 1px solid var(--accent); background: var(--bg);
}
.shot-frame::before { top: -5px; left: -5px; }
.shot-frame::after { bottom: -5px; right: -5px; }
.frame-bar {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.5rem 0.9rem; border-bottom: 1px solid var(--line); background: var(--surface-2);
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
}
.frame-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dots { display: flex; gap: 0.35rem; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.dots i:first-child { background: #ff4d61; }
.dots i:nth-child(2) { background: #f2b134; }
.dots i:nth-child(3) { background: #34d399; }
.shot-main { display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in; background: #08090b; aspect-ratio: 16 / 10; overflow: hidden; }
.shot-main img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform 0.6s ease, opacity 0.25s ease; }
.shot-main:hover img { transform: scale(1.025); }
.shot-main img.swap { opacity: 0; }
.thumbs { display: flex; gap: 0.5rem; margin-top: 0.75rem; overflow-x: auto; padding: 2px 2px 0.3rem; }
.thumb {
  flex: none; width: 104px; aspect-ratio: 16 / 10; padding: 0; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); opacity: 0.5;
  transition: opacity 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.thumb:hover { opacity: 0.9; }
.thumb[aria-pressed="true"] { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.shot-caption { margin-top: 0.5rem; font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }

.shot-placeholder { position: relative; aspect-ratio: 16 / 10; background: var(--bg); display: grid; grid-template-columns: 22% 1fr; gap: 0.9rem; padding: 1rem; }
.sk-side { display: grid; align-content: start; gap: 0.6rem; padding: 0.4rem; border-right: 1px solid var(--line); }
.sk { display: block; height: 8px; background: var(--line); width: 90%; }
.sk.w80 { width: 80%; height: 14px; background: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.sk.w60 { width: 60%; } .sk.w70 { width: 70%; }
.sk-main { display: grid; grid-template-rows: auto 1fr; gap: 0.8rem; }
.sk-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.sk-cards span { height: 56px; background: var(--surface); border: 1px solid var(--line); }
.sk-chart {
  border: 1px solid var(--line); background:
    linear-gradient(to top, var(--accent-soft), transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 11%, var(--line) 11% calc(11% + 1px));
}
.shot-placeholder[data-kind="card-recognition"] .sk-chart { background: radial-gradient(ellipse at 50% 40%, #14644a, #08291f 75%); border-color: #1c3b30; }
.shot-placeholder[data-kind="hris"] .sk-cards span:first-child { background: var(--accent-soft); }
.sk, .sk-cards span { animation: shimmer 1.8s ease-in-out infinite; }
@keyframes shimmer { 50% { opacity: 0.5; } }
.ph-note {
  position: absolute; left: 1rem; right: 1rem; bottom: 1rem;
  padding: 0.6rem 0.85rem; border: 1px dashed var(--accent);
  background: var(--surface); color: var(--muted); font-size: 0.85rem;
}
.ph-note code { font-family: var(--mono); color: var(--text); font-size: 0.8rem; }

/* ---------- Portal ---------- */
.portal { border: 1px solid var(--line); overflow: hidden; background: var(--bg); box-shadow: var(--shadow); }
.portal-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 0.75rem 1.1rem; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.portal-title { display: flex; flex-direction: column; }
.portal-title strong { font-weight: 600; font-size: 1.02rem; }
.portal-title span { color: var(--muted); font-size: 0.86rem; }
.filters { display: flex; gap: 0.2rem; padding: 0.2rem; background: var(--bg); border: 1px solid var(--line); flex-wrap: wrap; }
.filter { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-family: var(--mono); font-size: 0.78rem; padding: 0.35rem 0.7rem; transition: background 0.15s, color 0.15s; }
.filter:hover { color: var(--text); }
.filter[aria-selected="true"] { background: var(--accent); color: #fff; }
.filter .count { margin-left: 0.35rem; opacity: 0.75; }
.portal-body { display: grid; grid-template-columns: 1.35fr 1fr 0.95fr; }
.floor { padding: 1.3rem; border-right: 1px solid var(--line); min-height: 360px; }
.pit { margin-bottom: 1.3rem; }
.pit:last-child { margin-bottom: 0; }
.pit h3 { font-family: var(--mono); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.6rem; }
.pit-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 0.5rem; }
.floor-empty { color: var(--muted); padding: 2rem 0; }
.tbl {
  position: relative; text-align: left; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); padding: 0.6rem 0.7rem;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  animation: tblIn 0.3s ease both;
}
.tbl:hover { border-color: var(--accent); transform: translateY(-2px); }
.tbl[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent), 0 0 18px -6px var(--accent); }
.tbl b { display: block; font-family: var(--mono); font-weight: 600; font-size: 0.95rem; }
.tbl small { color: var(--muted); font-size: 0.8rem; }
.tbl i { position: absolute; top: 0.7rem; right: 0.7rem; width: 8px; height: 8px; border-radius: 50%; }
.tbl.is-alert { border-color: color-mix(in srgb, var(--alert) 55%, var(--line)); }
@keyframes tblIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
.s-open { background: var(--ok); }
.s-closed { background: transparent; border: 1px solid var(--muted); }
.s-alert { background: var(--alert); animation: alertRing 1.4s infinite; }
@keyframes alertRing {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--alert) 60%, transparent); }
  80%, 100% { box-shadow: 0 0 0 7px transparent; }
}
.detail { padding: 1.3rem; background: var(--surface); border-right: 1px solid var(--line); }
.detail h3 { font-family: var(--display); font-weight: 700; font-size: 1.6rem; letter-spacing: -0.03em; margin-bottom: 0.2rem; }
.status-line { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.9rem; color: var(--muted); margin-bottom: 1.1rem; }
.status-line i { width: 8px; height: 8px; border-radius: 50%; }
.detail dl { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1rem; font-size: 0.93rem; }
.detail dt { color: var(--muted); }
.detail dd { font-weight: 500; text-align: right; }
.spark { margin-top: 1.1rem; }
.spark-head { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.72rem; color: var(--muted); margin-bottom: 0.3rem; }
.spark svg { width: 100%; height: 54px; overflow: visible; }
.spark .area { fill: var(--accent-soft); }
.spark .line { fill: none; stroke: var(--accent); stroke-width: 1.8; vector-effect: non-scaling-stroke; }
.spark .dot { fill: var(--accent); }
.event { margin-top: 1rem; padding: 0.75rem 0.9rem; border-left: 2px solid var(--line); background: var(--bg); font-size: 0.9rem; }
.event.is-alert { border-left-color: var(--alert); }
.btn-ack { width: 100%; justify-content: center; margin-top: 0.8rem; box-shadow: none; }
.portal-log { padding: 1.1rem 1.2rem; background: var(--surface); min-width: 0; }
.log-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.4rem; }
.log-head strong { font-weight: 600; }
#eventLog { list-style: none; }
#eventLog li { display: grid; grid-template-columns: auto 1fr; gap: 0 0.6rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); font-size: 0.85rem; line-height: 1.45; animation: logIn 0.35s ease both; }
#eventLog li:last-child { border-bottom: none; }
#eventLog time { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
#eventLog b { font-family: var(--mono); font-weight: 600; color: var(--accent); margin-right: 0.3rem; }
#eventLog li.alert b { color: var(--alert); }
#eventLog li.ok b { color: var(--ok); }
@keyframes logIn { from { opacity: 0; transform: translateY(-6px); background: var(--accent-soft); } to { opacity: 1; transform: none; } }
.portal-foot { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); background: var(--surface-2); }
.portal-foot div { padding: 0.8rem 1.1rem; border-right: 1px solid var(--line); font-size: 0.88rem; color: var(--muted); }
.portal-foot div:last-child { border-right: none; }
.portal-foot b { display: block; font-family: var(--display); font-weight: 600; font-size: 1.5rem; letter-spacing: -0.02em; color: var(--text); }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem 2.5rem; margin-top: 4rem; }
.features > div { padding-top: 1rem; border-top: 1px solid var(--line); }
.features h3 { font-weight: 600; font-size: 1.12rem; letter-spacing: -0.01em; margin-bottom: 0.35rem; }
.features p { color: var(--muted); font-size: 0.97rem; }

/* ---------- Card vision ---------- */
.vision-grid { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 2.5rem; align-items: start; }
.feed-wrap { perspective: 1400px; }
.feed {
  position: relative; background: #05070a; border: 1px solid #1c2027; overflow: hidden;
  box-shadow: var(--shadow), 0 0 70px -24px rgba(47, 107, 255, 0.45);
  transform-style: preserve-3d; transition: transform 0.25s ease-out;
}
.feed::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(500px circle at var(--gx, 50%) var(--gy, 0%), rgba(147, 197, 253, 0.1), transparent 45%);
  opacity: 0; transition: opacity 0.3s;
}
.feed-wrap:hover .feed::after { opacity: 1; }
.feed-bar { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0.9rem; font-family: var(--mono); font-size: 0.75rem; color: #8a909c; border-bottom: 1px solid #1c2027; }
.rec { display: inline-flex; align-items: center; gap: 0.45rem; color: #f2f3f5; }
.rec::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #ff4d61; box-shadow: 0 0 8px #ff4d61; animation: blink 1.6s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.feed-stage { position: relative; }
.feed-stage canvas { width: 100%; aspect-ratio: 16 / 10; }
.hud { position: absolute; pointer-events: none; font-family: var(--mono); font-size: 0.7rem; color: rgba(242, 243, 245, 0.85); background: rgba(5, 7, 10, 0.65); border: 1px solid rgba(96, 165, 250, 0.3); padding: 0.15rem 0.45rem; }
.hud span { color: #8a909c; }
.hud b { color: #93c5fd; font-weight: 600; }
.hud-tl { top: 10px; left: 10px; } .hud-tr { top: 10px; right: 10px; }
.hud-bl { bottom: 10px; left: 10px; } .hud-br { bottom: 10px; right: 10px; color: #ff9a4d; border-color: rgba(255, 122, 26, 0.4); }
.feed-flag { position: absolute; top: 44px; left: 50%; transform: translateX(-50%); font-family: var(--mono); font-weight: 600; font-size: 0.8rem; color: #fff; background: rgba(255, 51, 68, 0.92); padding: 0.3rem 0.9rem; box-shadow: 0 0 24px rgba(255, 51, 68, 0.6); animation: flagPulse 1.2s ease-in-out infinite; }
.feed-flag[hidden] { display: none; }
@keyframes flagPulse { 50% { box-shadow: 0 0 6px rgba(255, 51, 68, 0.3); } }
.feed-controls { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.6rem 0.9rem; border-top: 1px solid #1c2027; background: #0a0c10; }
.ctl { font-family: var(--mono); font-size: 0.75rem; padding: 0.38rem 0.7rem; cursor: pointer; background: #0e1013; border: 1px solid #262b34; color: #cdd2da; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.ctl:hover { border-color: #2f6bff; color: #fff; }
.ctl[aria-pressed="true"] { border-color: #2f6bff; color: #fff; background: rgba(47, 107, 255, 0.22); }
.ctl.danger { margin-left: auto; border-color: rgba(255, 51, 68, 0.5); color: #ff8a98; }
.ctl.danger:hover { background: rgba(255, 51, 68, 0.16); color: #fff; }
.ctl:disabled { opacity: 0.5; cursor: wait; }
.readout { display: grid; grid-template-columns: 1fr 1fr 1fr; border-top: 1px solid #1c2027; color: #f2f3f5; }
.readout > div { padding: 0.7rem 0.9rem; border-right: 1px solid #1c2027; min-width: 0; }
.readout > div:last-child { border-right: none; }
.readout dt { font-family: var(--mono); font-size: 0.68rem; color: #8a909c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout dd { font-weight: 600; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout .red { color: #ff6b7f; }
.readout .result { color: #f2b134; }
.readout .result.flagged { color: #ff6b7f; }

.pipeline { list-style: none; position: relative; display: grid; gap: 0.3rem; }
.pipeline::before { content: ""; position: absolute; left: calc(0.9rem + 1.1rem); top: 2rem; bottom: 2rem; width: 1px; background: var(--line); }
.step { position: relative; display: block; width: 100%; text-align: left; cursor: pointer; background: transparent; color: inherit; border: 1px solid transparent; padding: 0.9rem 1rem 1.1rem 3.6rem; transition: background 0.2s, border-color 0.2s; }
.step:hover { background: var(--surface); }
.step.active { background: var(--surface); border-color: var(--line); }
.step-num { position: absolute; left: 0.9rem; top: 0.85rem; width: 2.2rem; height: 2.2rem; display: grid; place-items: center; font-family: var(--mono); font-weight: 600; font-size: 0.85rem; color: var(--accent); border: 1px solid var(--accent); background: var(--bg); transition: background 0.2s, color 0.2s, box-shadow 0.2s; }
.step.active .step-num { background: var(--accent); color: #fff; box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 60%, transparent); }
.step h3 { font-weight: 600; font-size: 1.12rem; letter-spacing: -0.01em; margin-bottom: 0.2rem; }
.step p { color: var(--muted); font-size: 0.93rem; }
.step-progress { position: absolute; left: 3.6rem; right: 1rem; bottom: 0.45rem; height: 1px; background: var(--line); overflow: hidden; opacity: 0; }
.step-progress i { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.pipeline.auto .step.active .step-progress { opacity: 1; }
.pipeline.auto .step.active .step-progress i { animation: fill 6s linear forwards; }
@keyframes fill { to { transform: scaleX(1); } }
.console { margin-top: 2.5rem; background: #05070a; border: 1px solid #1c2027; overflow: hidden; box-shadow: var(--shadow); }
.console-bar { display: flex; align-items: center; gap: 0.8rem; padding: 0.5rem 0.9rem; border-bottom: 1px solid #1c2027; font-family: var(--mono); font-size: 0.75rem; color: #8a909c; }
#consoleOut { font-family: var(--mono); font-size: 0.82rem; line-height: 1.65; color: #cdd2da; padding: 1.1rem 1.3rem; min-height: 230px; white-space: pre; overflow-x: auto; }
#consoleOut.typing::after { content: "▋"; color: #2f6bff; animation: blink 1s steps(2, start) infinite; }
.catches { margin-top: 3rem; }
.catches h3 { font-family: var(--mono); font-weight: 500; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.8rem; }
.catches ul { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.catches li { display: flex; gap: 0.6rem; align-items: baseline; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.catches li::before { content: ""; flex: none; width: 6px; height: 6px; background: var(--orange); transform: translateY(-2px); }

/* ---------- Infrastructure ---------- */
.infra-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 4rem; align-items: center; }
.infra-copy .section-head { margin-bottom: 1.6rem; }
.infra-copy > p { color: var(--muted); margin-bottom: 1.1rem; max-width: 34rem; }
.gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 2.2rem; max-width: 30rem; }
.gauge { text-align: center; }
.gauge-ring { position: relative; width: min(108px, 100%); margin: 0 auto 0.4rem; }
.gauge svg { width: 100%; transform: rotate(-90deg); }
.gauge circle { fill: none; stroke-width: 5; }
.gauge .track { stroke: var(--line); }
.gauge .value { stroke: var(--accent); stroke-dasharray: 251.33; stroke-dashoffset: 251.33; transition: stroke-dashoffset 0.9s ease; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--accent) 60%, transparent)); }
.gauge-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-weight: 600; font-size: 1.05rem; }
.gauge figcaption { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.noc { border: 1px solid var(--line); background: var(--bg); overflow: hidden; box-shadow: var(--shadow); }
.noc-head { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1.1rem; border-bottom: 1px solid var(--line); background: var(--surface-2); font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.noc-head > span { display: inline-flex; align-items: center; gap: 0.5rem; }
.noc-head strong { font-family: var(--body); font-weight: 600; color: var(--text); font-size: 1rem; }
.chart-wrap { padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }
.chart-head b { font-family: var(--mono); color: var(--text); font-size: 1.05rem; }
#latChart { width: 100%; height: 120px; }
.svc { display: grid; grid-template-columns: 1.1fr 1.6fr 4.4rem; gap: 1rem; align-items: center; padding: 0.8rem 1.1rem; border-bottom: 1px solid var(--line); }
.svc:last-child { border-bottom: none; }
.svc-name { font-weight: 500; font-size: 0.95rem; }
.svc-name small { display: block; color: var(--muted); font-weight: 400; font-size: 0.8rem; }
.checks { display: flex; gap: 2px; height: 20px; align-items: stretch; }
.checks span { flex: 1; background: var(--ok); opacity: 0.8; transition: opacity 0.15s, transform 0.15s; }
.checks span:hover { opacity: 1; transform: scaleY(1.25); }
.checks span.warn { background: var(--warn); }
.uptime { font-family: var(--mono); font-weight: 600; font-size: 0.88rem; text-align: right; }

/* ---------- Services ---------- */
.services { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.spot { position: relative; overflow: hidden; background: var(--surface); padding: 2rem 1.6rem 2.4rem; transition: background 0.25s; }
.spot + .spot { border-left: 1px solid var(--line); }
.spot::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 55%);
  opacity: 0; transition: opacity 0.3s;
}
.spot:hover::before { opacity: 1; }
.spot-num { display: block; font-family: var(--mono); font-size: 0.75rem; color: var(--orange); margin-bottom: 3rem; }
.spot h3 { font-weight: 600; font-size: 1.3rem; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.spot p { color: var(--muted); font-size: 0.97rem; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
.contact-copy > p { color: var(--muted); font-size: 1.1rem; max-width: 32rem; margin-bottom: 2rem; }
.mail-card {
  display: grid; gap: 0.3rem; max-width: 26rem; padding: 1.1rem 1.3rem; text-decoration: none;
  background: var(--solid-bg); color: var(--solid-fg); box-shadow: 6px 6px 0 var(--accent);
  transition: transform 0.2s, box-shadow 0.2s;
}
.mail-card .eb-dim { color: inherit; opacity: 0.6; }
.mail-card b { font-size: 1.15rem; font-weight: 600; word-break: break-all; }
.mail-card:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--accent); }
.demo-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 1rem; background: var(--surface); border: 1px solid var(--line); padding: 1.6rem; box-shadow: var(--shadow); }
.field { display: grid; gap: 0.35rem; align-content: start; }
.field.full { grid-column: 1 / -1; }
.field label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; font: inherit; font-size: 1rem; color: var(--text); background: var(--bg); border: 1px solid var(--line); padding: 0.65rem 0.8rem; transition: border-color 0.15s, box-shadow 0.15s; border-radius: 0; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field [aria-invalid="true"] { border-color: var(--alert); }
.err { color: var(--alert); font-size: 0.82rem; min-height: 1.3em; }
.form-actions { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; margin-top: 0.6rem; }
.form-note { color: var(--muted); font-size: 0.85rem; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 4rem 0 2rem; color: var(--muted); font-size: 0.92rem; background: var(--bg); position: relative; z-index: 1; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
.foot-brand p { max-width: 22rem; margin-top: 1rem; }
footer .brand { color: var(--text); }
footer h4 { font-family: var(--mono); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--orange); margin-bottom: 0.9rem; }
footer ul { list-style: none; display: grid; gap: 0.45rem; }
footer ul a { text-decoration: none; transition: color 0.2s; }
footer ul a:hover { color: var(--text); }
.foot-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 3.5rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }

/* ---------- X-ray: wireframe overlay ---------- */
#xray { position: absolute; top: 0; left: 0; width: 100%; height: 0; z-index: 44; pointer-events: none; }
.xbox {
  position: absolute; border: 1px solid var(--accent);
  background: repeating-linear-gradient(to bottom, color-mix(in srgb, var(--accent) 22%, transparent) 0 2px, transparent 2px 5px);
  transform-origin: left center; animation: xIn 0.28s ease-out both;
  transition: opacity 0.4s ease;
}
.xbox::before, .xbox::after { content: ""; position: absolute; width: 5px; height: 5px; background: var(--bg); border: 1px solid var(--accent); }
.xbox::before { top: -3px; left: -3px; }
.xbox::after { bottom: -3px; right: -3px; }
.xbox span {
  position: absolute; top: -17px; left: -1px; white-space: nowrap;
  font-family: var(--mono); font-size: 10px; line-height: 15px; padding: 0 4px;
  background: var(--accent); color: #fff;
}
.xbox.hot { border-color: var(--guide); background: repeating-linear-gradient(to bottom, color-mix(in srgb, var(--guide) 25%, transparent) 0 2px, transparent 2px 5px); }
.xbox.hot span { background: var(--guide); }
.xline { position: absolute; left: 0; width: 100%; height: 1px; background: var(--accent); opacity: 0.55; animation: xLine 0.5s ease-out both; transform-origin: left; transition: opacity 0.4s ease; }
.xline.v { top: 0; width: 1px; height: 100%; background: var(--guide); transform-origin: top; animation-name: xLineV; }
.xray-out .xbox, .xray-out .xline { opacity: 0; }
@keyframes xIn { from { transform: scaleX(0); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes xLine { from { transform: scaleX(0); } to { transform: none; } }
@keyframes xLineV { from { transform: scaleY(0); } to { transform: none; } }
.glitch-in { animation: glitchIn 0.6s steps(6, end) both; }
@keyframes glitchIn {
  0% { opacity: 0; transform: translateX(-6px); text-shadow: 4px 0 var(--guide), -4px 0 var(--accent); }
  30% { opacity: 1; transform: translateX(4px); clip-path: inset(0 0 60% 0); }
  60% { transform: translateX(-2px); clip-path: inset(40% 0 0 0); text-shadow: -2px 0 var(--guide), 2px 0 var(--accent); }
  100% { opacity: 1; transform: none; clip-path: none; text-shadow: none; }
}

/* ---------- Builder crew ---------- */
/* Elements wait invisible until a cursor builds them (only set by JS, never without it) */
.bld-wait { opacity: 0 !important; }
.bld-pop { animation: bldPop 0.55s ease-out; }
@keyframes bldPop {
  0% { opacity: 0.2; filter: brightness(1.9) saturate(0.6); }
  35% { opacity: 1; }
  100% { filter: none; }
}

/* Persistent x-ray mode (header toggle) */
.xray-on :is(h1, h2, h3, .section-head p, .project-copy > p, .btn, .text-link, .shot-frame, .feed, .portal, .noc, .console, .step, .spot, .stat, .eyebrow, .demo-form, .gauge, .features > div, .tbl, .meta, .mail-card, .hero-visual) {
  outline: 1px solid color-mix(in srgb, var(--accent) 70%, transparent);
  outline-offset: 3px;
}
.xray-on .guides span { background: var(--guide); opacity: 0.7; }
.xray-on body { background-image: linear-gradient(to right, var(--grid) 1px, transparent 1px), linear-gradient(to bottom, var(--grid) 1px, transparent 1px); background-size: 16px 16px; }

/* ---------- Screenshot viewer ---------- */
.lightbox { width: min(1240px, 96vw); max-height: 94vh; margin: auto; padding: 0; border: 1px solid #1c2027; background: #05070a; color: #f2f3f5; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.8); }
.lightbox::backdrop { background: rgba(3, 4, 6, 0.85); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.lightbox[open] { animation: popIn 0.2s ease; }
.lb-bar { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0.6rem 0.5rem 1rem; border-bottom: 1px solid #1c2027; font-family: var(--mono); font-size: 0.8rem; }
.lb-btn { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #262b34; background: transparent; color: #cdd2da; cursor: pointer; }
.lb-btn:hover { border-color: #2f6bff; color: #fff; }
.lb-btn svg, .lb-nav svg { width: 18px; height: 18px; }
.lightbox figure { position: relative; }
#lbImg { width: 100%; max-height: calc(94vh - 110px); object-fit: contain; background: #05070a; }
.lightbox figcaption { padding: 0.7rem 1rem; border-top: 1px solid #1c2027; color: #8a909c; font-family: var(--mono); font-size: 0.8rem; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; border: 1px solid rgba(96, 165, 250, 0.35); background: rgba(5, 7, 10, 0.8); color: #f2f3f5; }
.lb-nav:hover { background: #2f6bff; border-color: #2f6bff; }
.lb-nav.prev { left: 12px; } .lb-nav.next { right: 12px; }
.lb-nav[hidden] { display: none; }

/* ---------- Quick navigation ---------- */
.palette { width: min(560px, 100% - 2rem); margin: 12vh auto auto; padding: 0; border: 1px solid var(--line); background: var(--surface); color: var(--text); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.6), 8px 8px 0 var(--accent); }
.palette::backdrop { background: rgba(3, 4, 6, 0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.palette[open] { animation: popIn 0.18s ease; }
@keyframes popIn { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: none; } }
#paletteInput { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; font-size: 1.05rem; padding: 1rem 1.1rem; }
#paletteInput:focus { outline: none; }
#paletteList { list-style: none; padding: 0.4rem; max-height: 360px; overflow-y: auto; }
.cmd { width: 100%; display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 0.65rem 0.8rem; background: none; border: 0; color: inherit; text-align: left; cursor: pointer; }
.cmd small { font-family: var(--mono); color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
.cmd[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.palette-empty { padding: 0.8rem; color: var(--muted); }
.palette-foot { padding: 0.6rem 1.1rem; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }

/* ---------- Toasts ---------- */
#toasts { position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); display: grid; gap: 0.5rem; z-index: 150; pointer-events: none; }
.toast { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 0.75rem 1rem; width: min(340px, calc(100vw - 2rem)); font-size: 0.92rem; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); transition: opacity 0.25s, transform 0.25s; }
.toast.show { opacity: 1; transform: none; }
.toast.alert { border-left-color: var(--alert); }
.toast.ok { border-left-color: var(--ok); }

/* ---------- Live demo ---------- */
.nav a.nav-demo { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--text); }
.btn-live .pulse-dot { margin-right: 0.1rem; }
.live-badge {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--mono); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 45%, transparent);
  background: color-mix(in srgb, var(--ok) 10%, transparent); padding: 0.18rem 0.55rem;
}
.live-badge.sm { font-size: 0.62rem; padding: 0.1rem 0.45rem; }
.eyebrow .live-badge { margin-left: 0.4rem; }
.inline-link { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.inline-link:hover { border-bottom-color: var(--accent); }

.demo {
  position: relative; border-block: 1px solid var(--line);
  background:
    radial-gradient(900px 500px at 85% 0%, var(--accent-soft), transparent 70%),
    radial-gradient(600px 400px at 0% 100%, color-mix(in srgb, var(--orange) 8%, transparent), transparent 70%);
}
.demo-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 2.5rem; align-items: start; }
.demo-panel {
  background: var(--surface); border: 1px solid var(--line); padding: 1.5rem;
  box-shadow: var(--shadow), 8px 8px 0 var(--accent);
}
.demo-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.demo-url { font-family: var(--mono); font-size: 0.85rem; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); }
.demo-url:hover { border-bottom-color: var(--accent); color: var(--accent); }
.demo-label { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 1.4rem 0 0.6rem; }
.roles { list-style: none; display: grid; gap: 0.4rem; }
.role {
  display: grid; grid-template-columns: 6.8rem 1fr auto; align-items: center; gap: 0.8rem;
  padding: 0.7rem 0.85rem; border: 1px solid var(--line); background: var(--bg);
  color: var(--text); text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.role code { font-family: var(--mono); font-size: 0.92rem; font-weight: 600; color: var(--accent); }
.role span { color: var(--muted); font-size: 0.93rem; }
.role i { font-style: normal; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); transition: color 0.15s; }
.role:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateX(4px); }
.role:hover i { color: var(--accent); }
.demo-pass {
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
  margin-top: 1rem; padding: 0.75rem 0.85rem; border: 1px dashed var(--line);
}
.demo-pass span { flex: 1; color: var(--muted); font-size: 0.88rem; }
.demo-pass code { font-family: var(--mono); font-size: 1.02rem; font-weight: 600; }
.copy-btn {
  font-family: var(--mono); font-size: 0.72rem; padding: 0.3rem 0.65rem; cursor: pointer;
  background: transparent; color: var(--text); border: 1px solid var(--line);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.done { background: var(--ok); border-color: var(--ok); color: #08090b; }
.demo-actions { margin-top: 1.4rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.demo-note { margin-top: 1rem; color: var(--muted); font-size: 0.86rem; }

.demo-screen { border: 1px solid #1c2027; background: #05070a; box-shadow: var(--shadow), 0 0 80px -30px var(--accent); position: relative; }
.demo-screen::before, .demo-screen::after { content: ""; position: absolute; width: 9px; height: 9px; z-index: 3; border: 1px solid var(--accent); background: var(--bg); }
.demo-screen::before { top: -5px; left: -5px; }
.demo-screen::after { bottom: -5px; right: -5px; }
.demo-screen .frame-bar { background: #0a0c10; border-bottom-color: #1c2027; color: #8a909c; }
.screen-tabs { flex: 1; display: flex; gap: 0.25rem; }
.screen-tab { border: 0; background: transparent; color: #8a909c; cursor: pointer; font-family: var(--mono); font-size: 0.72rem; padding: 0.25rem 0.6rem; }
.screen-tab:hover { color: #f2f3f5; }
.screen-tab[aria-selected="true"] { background: #2f6bff; color: #fff; }
.screen-stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #05070a; }
.screen-fallback { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-size: 0.8rem; color: #5b6170; }
#screenFrame {
  position: absolute; top: 0; left: 0; width: 1600px; height: 900px; border: 0;
  transform-origin: 0 0; pointer-events: none; background: transparent; z-index: 1;
}
.screen-open {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: flex-end; justify-content: flex-end;
  padding: 0.8rem; text-decoration: none;
}
.screen-open span {
  font-family: var(--mono); font-size: 0.75rem; color: #f2f3f5; background: rgba(5, 7, 10, 0.82);
  border: 1px solid rgba(96, 165, 250, 0.4); padding: 0.4rem 0.75rem; transition: background 0.15s;
}
.screen-open:hover span { background: #2f6bff; border-color: #2f6bff; }
.screen-caption { padding: 0.6rem 0.9rem; border-top: 1px solid #1c2027; font-family: var(--mono); font-size: 0.75rem; color: #8a909c; }

.project.is-featured .shot-frame { box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), 0 0 90px -30px var(--accent); }
.project-actions { display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap; }

@media (max-width: 980px) {
  .demo-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .role { grid-template-columns: 5.8rem 1fr; }
  .demo-panel { padding: 1.2rem; box-shadow: var(--shadow), 5px 5px 0 var(--accent); }
  .role i { display: none; }
  .screen-tabs { overflow-x: auto; }
}

/* TRY NOW buttons (open the demo site) */
.btn-try { text-transform: uppercase; letter-spacing: 0.06em; }
.btn-try .pulse-dot { margin-right: 0.1rem; }
.btn .ext { width: 14px; height: 14px; transition: transform 0.2s; }
.btn:hover .ext { transform: translate(2px, -2px); }
.mobile-nav a.mobile-try { color: var(--ok); }

/* ---------- Staging badge (only rendered off the live domain) ---------- */
.staging-badge {
  position: fixed; left: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 160;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em;
  color: #08090b; background: #f2b134; padding: 0.3rem 0.6rem; pointer-events: none;
  box-shadow: 3px 3px 0 #08090b;
}
.staging-badge span { font-weight: 400; letter-spacing: 0; margin-left: 0.4rem; opacity: 0.7; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .portal-body { grid-template-columns: 1.3fr 1fr; }
  .portal-log { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .detail { border-right: none; }
  .services { grid-template-columns: 1fr 1fr; }
  .spot:nth-child(3) { border-left: none; }
  .spot:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .nav { gap: 1.2rem; }
  #xrayBtn span { display: none; }
}
@media (max-width: 980px) {
  .hero-grid, .project, .vision-grid, .infra-grid, .contact-grid { grid-template-columns: 1fr; }
  .hero-grid { min-height: 0; }
  .hero-visual { max-width: 420px; margin: 0 auto; }
  .project { gap: 2rem; }
  .project.flip .project-copy { order: 0; }
  .project .gallery { order: -1; }
  .features { grid-template-columns: 1fr 1fr; }
  .catches ul { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { padding-left: 0; border-left: none; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav, .header-cta, #paletteBtn kbd { display: none; }
  .menu-btn { display: inline-flex; }
  .mobile-nav[data-open="true"] { display: flex; flex-direction: column; padding: 0.5rem 1.5rem 1.25rem; border-top: 1px solid var(--line); }
  .mobile-nav a { padding: 0.8rem 0; text-decoration: none; font-weight: 600; font-size: 1.15rem; border-bottom: 1px solid var(--line); }
  .mobile-nav a:last-child { border-bottom: none; color: var(--accent); }
  .wrap { width: min(1240px, 100% - 2.5rem); }
  .portal-body { grid-template-columns: 1fr; }
  .floor { border-right: none; border-bottom: 1px solid var(--line); min-height: 0; }
  .features, .services, .catches ul, .demo-form, .footer-grid { grid-template-columns: 1fr; }
  .spot + .spot { border-left: none; border-top: 1px solid var(--line); }
  .spot-num { margin-bottom: 1.2rem; }
  .svc { grid-template-columns: 1fr auto; }
  .checks { grid-column: 1 / -1; order: 3; }
  .readout dd { font-size: 0.9rem; }
  .ctl.danger { margin-left: 0; }
  .hud { font-size: 0.62rem; }
  .shot-placeholder { grid-template-columns: 1fr; }
  .sk-side { display: none; }
  .meta { grid-template-columns: 1fr; }
  .meta div + div { padding-left: 0; border-left: none; border-top: 1px solid var(--line); }
  section { padding: 5rem 0; }
  .gl-tag { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
