/* ==========================================================================
   BIMMOVATE — Design System v2
   "Drawing-sheet engineering" — dark technical ground, restrained accents,
   mono annotations, sheet-frame motifs. No frameworks, no build step.
   ========================================================================== */

:root {
  /* Colour tokens — all body-text pairs validated ≥ 4.5:1 on their grounds */
  --bg-0: #04070e;
  --bg-1: #070b18;
  --bg-2: #0b1122;
  --card: #0e152e;
  --card-hover: #121a38;
  --ink-hi: #eef2ff;
  --ink-mid: #aab5d4;
  --ink-low: #8691b3;
  --line: rgba(148, 163, 216, 0.16);
  --line-soft: rgba(148, 163, 216, 0.09);
  --accent: #3f8cff;        /* brand blue — actions, links, primary emphasis */
  --accent-2: #2dd4ff;      /* cyan — data, annotations, model geometry only */
  --ok: #34d399;            /* resolved / verified only */
  --warn: #fbbf24;          /* site / in-progress / flagged only */
  --bad: #f87171;           /* clash / error only */
  --glow: rgba(63, 140, 255, 0.28);
  --grad-accent: linear-gradient(100deg, #3f8cff 0%, #2dd4ff 100%);
  --grad-text: linear-gradient(100deg, #6ea8ff 0%, #2dd4ff 60%, #7ce7ff 100%);

  /* Type */
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;

  /* Rhythm */
  --section-pad: clamp(4.25rem, 8.5vw, 7.75rem);
  --container: 1200px;
  --radius: 14px;
  --radius-lg: 20px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.65s;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink-mid);
  background: var(--bg-0);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
strong { color: var(--ink-hi); }

::selection { background: rgba(63, 140, 255, 0.35); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: 0.6rem; left: 0.6rem;
  z-index: 200;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  background: var(--accent);
  color: #04122e;
  font-family: var(--font-display);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.25s var(--ease-out);
}
.skip-link:focus-visible { transform: none; outline-color: #fff; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink-hi);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
}

.display-1 { font-size: clamp(2.45rem, 4.8vw + 0.7rem, 4.3rem); }
.display-2 { font-size: clamp(1.85rem, 2.9vw + 0.55rem, 2.8rem); }
.h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead { font-size: clamp(1.08rem, 1.5vw, 1.2rem); color: var(--ink-mid); text-wrap: pretty; }

/* Section eyebrow — a mono label on a short accent rule. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 1.2rem;
}

.eyebrow::before {
  content: "";
  width: 1.9rem;
  height: 1px;
  background: var(--grad-accent);
}

/* ---------- Layout ---------- */
.container {
  width: min(var(--container), 100% - 2.5rem);
  margin-inline: auto;
}

.section { padding-block: var(--section-pad); position: relative; }
.section-alt { background: var(--bg-1); border-block: 1px solid var(--line-soft); }
.section-flush-top { padding-top: 0; }

.section-head { max-width: 760px; margin-bottom: clamp(2.4rem, 5vw, 3.75rem); }
.section-head p { margin-top: 1.05rem; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }

/* Blueprint grid backdrop — subtler than v1 */
.grid-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(120, 144, 220, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 144, 220, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 18%, #000 25%, transparent 72%);
  mask-image: radial-gradient(ellipse 85% 75% at 50% 18%, #000 25%, transparent 72%);
}

/* Sheet-frame corner ticks — draws four corner L-marks on a panel */
.ticks {
  position: relative;
}
.ticks::after {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  --t: rgba(148, 163, 216, 0.38);
  background:
    linear-gradient(var(--t), var(--t)) left 0 top 0 / 14px 1px,
    linear-gradient(var(--t), var(--t)) left 0 top 0 / 1px 14px,
    linear-gradient(var(--t), var(--t)) right 0 top 0 / 14px 1px,
    linear-gradient(var(--t), var(--t)) right 0 top 0 / 1px 14px,
    linear-gradient(var(--t), var(--t)) left 0 bottom 0 / 14px 1px,
    linear-gradient(var(--t), var(--t)) left 0 bottom 0 / 1px 14px,
    linear-gradient(var(--t), var(--t)) right 0 bottom 0 / 14px 1px,
    linear-gradient(var(--t), var(--t)) right 0 bottom 0 / 1px 14px;
  background-repeat: no-repeat;
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.9rem 1.8rem;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: none;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out),
              background 0.3s, border-color 0.3s;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; transition: transform 0.3s var(--ease-out); flex: none; }
.btn:hover svg, .btn:focus-visible svg { transform: translateX(4px); }
.btn:active { transform: translateY(0) scale(0.985); }

.btn-primary {
  background: var(--grad-accent);
  color: #04122e;
  box-shadow: 0 6px 22px -8px var(--glow);
}
.btn-primary:hover, .btn-primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -8px var(--glow);
}

.btn-ghost {
  background: rgba(148, 163, 216, 0.07);
  color: var(--ink-hi);
  border: 1px solid var(--line);
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  transform: translateY(-2px);
  background: rgba(148, 163, 216, 0.12);
  border-color: rgba(148, 163, 216, 0.32);
}

.btn[disabled], .btn[aria-busy="true"] { opacity: 0.65; cursor: wait; transform: none; }

/* button loading spinner */
.btn .spin {
  width: 16px; height: 16px;
  border: 2px solid rgba(4, 18, 46, 0.3);
  border-top-color: #04122e;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn[aria-busy="true"] .spin { display: inline-block; }
.btn[aria-busy="true"] .btn-label { opacity: 0.75; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background 0.35s, box-shadow 0.35s, border-color 0.35s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(4, 7, 14, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line-soft);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-block: 1.05rem;
  transition: padding 0.35s var(--ease-out);
}
.site-header.scrolled .header-inner { padding-block: 0.65rem; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.68rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
  color: var(--ink-hi);
}
.brand img { height: 38px; width: auto; filter: brightness(0) invert(1); opacity: 0.95; }
.brand .bim {
  color: transparent;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.1rem;
}
.nav-links a:not(.btn) {
  position: relative;
  font-size: 0.97rem;
  font-weight: 500;
  color: var(--ink-mid);
  padding-block: 0.4rem;
  transition: color 0.3s;
}
.nav-links a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  border-radius: 2px;
  background: var(--grad-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}
.nav-links a:not(.btn):hover,
.nav-links a:not(.btn)[aria-current="page"] { color: var(--ink-hi); }
.nav-links a:not(.btn):hover::after,
.nav-links a:not(.btn)[aria-current="page"]::after { transform: scaleX(1); }

.nav-links .btn { padding: 0.62rem 1.35rem; font-size: 0.91rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  padding: 10px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--ink-hi);
  transition: transform 0.32s var(--ease-out), opacity 0.22s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 880px) {
  .nav-toggle { display: flex; position: relative; z-index: 100; }
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    height: 100dvh;
    width: min(21rem, 86vw);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1.5rem;
    padding: 6rem 2.4rem;
    background: rgba(6, 9, 20, 0.97);
    backdrop-filter: blur(18px);
    border-left: 1px solid var(--line);
    transform: translateX(100%);
    visibility: hidden; /* keeps closed menu out of the tab order */
    transition: transform 0.42s var(--ease-out), visibility 0s linear 0.42s;
    z-index: 99;
  }
  .nav-links.open { transform: translateX(0); visibility: visible; transition-delay: 0s; }
  .nav-links a:not(.btn) { font-size: 1.22rem; font-family: var(--font-display); }
}

/* ==========================================================================
   HOME — hero + federated assembly animation
   ========================================================================== */
.hero {
  position: relative;
  min-height: 92vh;
  min-height: 92svh;
  display: flex;
  align-items: center;
  padding-top: 7.5rem;
  padding-bottom: 3.5rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse 52% 44% at 76% 34%, rgba(45, 90, 220, 0.14), transparent 65%),
    radial-gradient(ellipse 38% 34% at 12% 78%, rgba(42, 47, 143, 0.18), transparent 70%),
    var(--bg-0);
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}
.hero-copy h1 { margin-bottom: 1.35rem; }
.hero-copy .lead { max-width: 33rem; margin-bottom: 2.3rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 2.6rem; }

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.79rem;
  letter-spacing: 0.07em;
  color: var(--ink-low);
}
.hero-trust li { display: flex; align-items: center; gap: 0.5rem; }
.hero-trust li::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
  flex: none;
}

/* Federated-assembly stage */
.hero-visual { position: relative; }
.hero-visual svg { width: 100%; height: auto; overflow: visible; }

/* Discipline plates converge into alignment (JS adds .play to start) */
.asm-plate { transition: transform 1.5s var(--ease-out), opacity 1s var(--ease-out); }
.asm .plate-arc { transform: translate(46px, -84px); opacity: 0.35; }
.asm .plate-str { transform: translate(0, 0); }
.asm .plate-mep { transform: translate(-46px, 84px); opacity: 0.35; }
.asm.play .asm-plate { transform: translate(0, 0); opacity: 1; }

.asm-label { transition: opacity 0.6s; }
.asm.play .asm-label { opacity: 0; }

/* clash flag appears after convergence, then resolves */
.asm-clash, .asm-resolved, .asm-outputs { opacity: 0; }
.asm.play .asm-clash { animation: clash-blip 2s 1.5s forwards; }
@keyframes clash-blip {
  0% { opacity: 0; }
  14%, 72% { opacity: 1; }
  100% { opacity: 0; }
}
.asm.play .asm-resolved { animation: fade-in 0.6s 3.3s forwards; }
/* the straight branch gives way to the rerouted one at the same moment the
   resolved callout appears, so the "offset 2x45" label describes geometry the
   viewer can actually see */
.asm.play .asm-branch { animation: fade-out 0.5s 3.3s forwards; }
@keyframes fade-out { to { opacity: 0; } }
.asm.play .asm-outputs { animation: fade-in 0.7s 3.8s forwards; }
@keyframes fade-in { to { opacity: 1; } }

/* data pulses along output connectors */
.asm-pulse { opacity: 0; offset-rotate: 0deg; }
.asm.play .asm-pulse {
  animation: pulse-run 2.6s 4.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.asm-pulse.p2 { animation-delay: 5.2s !important; }
.asm-pulse.p3 { animation-delay: 6s !important; }
@keyframes pulse-run {
  0% { offset-distance: 0%; opacity: 0; }
  12% { opacity: 1; }
  76% { opacity: 1; }
  92%, 100% { offset-distance: 100%; opacity: 0; }
}

/* floating annotation chips */
.tag-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.48rem 0.8rem;
  border-radius: 9px;
  background: rgba(11, 17, 34, 0.88);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 0.71rem;
  letter-spacing: 0.05em;
  color: var(--ink-hi);
  box-shadow: 0 10px 26px -12px rgba(0, 0, 0, 0.65);
  animation: float 7s ease-in-out infinite;
  white-space: nowrap;
}
.tag-chip .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  flex: none;
}
.tag-chip .dot.ok { background: var(--ok); }
.tag-chip .dot.warn { background: var(--warn); }
.tag-chip small { color: var(--ink-low); letter-spacing: 0.04em; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.scroll-hint {
  position: absolute;
  bottom: 1.8rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.3em;
  color: var(--ink-low);
  text-transform: uppercase;
}
.scroll-hint::after {
  content: "";
  width: 1px; height: 40px;
  background: linear-gradient(var(--accent-2), transparent);
  animation: drip 2.2s ease-in-out infinite;
}
@keyframes drip {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

@media (max-width: 1100px) {
  .scroll-hint { display: none; }
}
@media (max-width: 960px) {
  .hero { min-height: auto; padding-top: 8rem; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { max-width: 540px; margin-inline: auto; width: 100%; }
  .tag-chip { font-size: 0.66rem; }
}
/* On phones the floating chips crowd the diagram — drop them and let the
   assembly animation carry the message on its own. */
@media (max-width: 700px) {
  .tag-chip { display: none; }
}

/* ---------- SVG line-draw primitives ---------- */
.draw {
  stroke-dasharray: var(--len, 600);
  stroke-dashoffset: var(--len, 600);
  animation: draw 2.2s var(--ease-out) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.node-dot { opacity: 0; animation: pop 0.5s var(--ease-out) forwards; animation-delay: var(--d, 1.5s); }
@keyframes pop {
  0% { opacity: 0; transform: scale(0); }
  70% { opacity: 1; transform: scale(1.4); }
  100% { opacity: 1; transform: scale(1); }
}

.pt { animation: twinkle 3s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes twinkle { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.9; } }

.pulse-ring {
  transform-origin: center;
  transform-box: fill-box;
  animation: ring 3.2s ease-out infinite;
  animation-delay: var(--d, 0s);
}
@keyframes ring {
  0% { transform: scale(0.4); opacity: 0.9; }
  80%, 100% { transform: scale(2.2); opacity: 0; }
}

/* CSS offset-path data packet (replaces SMIL — obeys reduced-motion kill switch) */
.packet {
  offset-path: var(--path);
  offset-rotate: 0deg;
  animation: packet-run var(--pd, 3s) linear infinite;
  animation-delay: var(--d, 0s);
}
@keyframes packet-run {
  0% { offset-distance: 0%; opacity: 0; }
  8% { opacity: 1; }
  88% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

/* ---------- Tools strip ---------- */
.marquee-section {
  padding-block: 2.1rem;
  border-block: 1px solid var(--line-soft);
  background: var(--bg-1);
  overflow: hidden;
}
.marquee-label {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-low);
  margin-bottom: 1.35rem;
}
.marquee {
  display: flex;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  flex: none;
  align-items: center;
  gap: 3.4rem;
  padding-right: 3.4rem;
  animation: scroll-x 38s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes scroll-x { to { transform: translateX(-100%); } }

.tool-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink-low);
  white-space: nowrap;
  transition: color 0.3s;
}
.tool-pill svg { width: 21px; height: 21px; color: var(--accent); opacity: 0.75; }
.tool-pill:hover { color: var(--ink-hi); }

/* ---------- Cards / grids ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.3rem;
}

.card {
  position: relative;
  padding: 1.9rem;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(148, 163, 216, 0.07), rgba(148, 163, 216, 0.02));
  border: 1px solid var(--line-soft);
  overflow: hidden;
  transition: transform 0.4s var(--ease-out), border-color 0.4s, background 0.4s;
}
.card::before {
  /* cursor-following glow (set via --mx/--my in JS) */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%), rgba(63, 140, 255, 0.11), transparent 62%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.card:hover { transform: translateY(-5px); border-color: rgba(63, 140, 255, 0.32); }
.card:hover::before { opacity: 1; }

.service-card { display: flex; flex-direction: column; min-height: 100%; }
.service-card .num {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  letter-spacing: 0.18em;
  color: var(--ink-low);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.service-icon {
  width: 50px; height: 50px;
  color: var(--accent-2);
  margin-bottom: 1.4rem;
  transition: transform 0.4s var(--ease-out);
}
.card:hover .service-icon { transform: translateY(-3px); }
.service-card h3 { margin-bottom: 0.65rem; font-size: 1.26rem; }
.service-card p { font-size: 0.96rem; flex: 1; }
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.45rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--accent-2);
  border-radius: 4px;
}
.card-link svg { width: 16px; height: 16px; transition: transform 0.3s var(--ease-out); }
.card:hover .card-link svg, .card-link:focus-visible svg { transform: translateX(5px); }

/* ---------- Stats band ---------- */
.stats-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border-block: 1px solid var(--line-soft);
}
.stat-cell {
  background: var(--bg-0);
  padding: 2.6rem 1.8rem;
  text-align: center;
}
.stat-value {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 3.8vw, 3.2rem);
  font-weight: 700;
  color: var(--ink-hi);
  line-height: 1;
}
.stat-value .suffix { color: var(--accent-2); }
.stat-label {
  margin-top: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-low);
}

/* ---------- Split & check-list ---------- */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr));
  gap: clamp(2.4rem, 5vw, 4.75rem);
  align-items: center;
}

.check-list { display: grid; gap: 1.05rem; margin-top: 1.9rem; }
.check-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
}
.check-list .tick {
  width: 26px; height: 26px;
  flex: none;
  margin-top: 0.2rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(63, 140, 255, 0.12);
  border: 1px solid rgba(63, 140, 255, 0.3);
  color: var(--accent-2);
}
.check-list .tick svg { width: 13px; height: 13px; }
.check-list strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: 0.12rem;
}
.check-list span.desc { font-size: 0.94rem; }

/* ---------- Panels (LOD explorer, widgets, CDE) ---------- */
.panel {
  position: relative;
  padding: clamp(1.4rem, 3vw, 2.4rem);
  border-radius: var(--radius-lg);
  background: linear-gradient(170deg, rgba(148, 163, 216, 0.08), rgba(148, 163, 216, 0.02));
  border: 1px solid var(--line);
  overflow: hidden;
}
.panel .grid-bg { background-size: 32px 32px; mask-image: none; -webkit-mask-image: none; opacity: 0.75; }
.panel > *:not(.grid-bg) { position: relative; z-index: 1; }

.lod-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.45rem;
}
.lod-value {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--accent-2);
}
.lod-name {
  font-family: var(--font-mono);
  font-size: 0.77rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-low);
}
.lod-stage svg { width: 100%; height: auto; }
.lod-stage [data-lod-layer] { transition: opacity 0.55s var(--ease-out); }

.lod-slider { margin-top: 1.4rem; }
.lod-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  color: var(--ink-low);
}
.lod-ticks span.active { color: var(--accent-2); }

/* styled range control (shared) */
input[type="range"].range-ctl {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent) var(--fill, 50%), rgba(148, 163, 216, 0.18) var(--fill, 50%));
  outline-offset: 6px;
  cursor: pointer;
}
input[type="range"].range-ctl::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: var(--ink-hi);
  border: 4px solid var(--accent);
  box-shadow: 0 0 12px var(--glow);
  cursor: grab;
}
input[type="range"].range-ctl::-moz-range-thumb {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--ink-hi);
  border: 4px solid var(--accent);
  box-shadow: 0 0 12px var(--glow);
  cursor: grab;
}

/* ---------- Process timeline ----------
   Explicit column counts (not auto-fit) so the connecting rail never
   leaves an orphan step with a line dangling into empty space. The
   overflow-x clip keeps the last rail in each row from pushing the
   page wider than the viewport. */
.process {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2rem;
  position: relative;
  overflow-x: clip;
  overflow-y: visible;
}
@media (max-width: 1100px) { .process { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .process { grid-template-columns: repeat(2, 1fr); gap: 1.6rem; } }
@media (max-width: 460px)  { .process { grid-template-columns: 1fr; } }

.process-step { position: relative; padding-top: 2.1rem; }
.process-step::before {
  content: "";
  position: absolute;
  top: 7px; left: 0; right: -2rem;
  height: 1px;
  background: var(--line);
}
.process-step:last-child::before { right: 0; }
.process-step::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--bg-0);
  border: 2px solid var(--accent);
}
.process-step .step-num {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  letter-spacing: 0.18em;
  color: var(--accent-2);
  display: block;
  margin-bottom: 0.55rem;
}
.process-step h3 { font-size: 1.13rem; margin-bottom: 0.45rem; }
.process-step p { font-size: 0.93rem; }

/* ---------- Industries ---------- */
.industries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 1.15rem;
}
.industry-tile {
  display: flex;
  align-items: center;
  gap: 1.05rem;
  padding: 1.3rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(148, 163, 216, 0.04);
  transition: transform 0.35s var(--ease-out), border-color 0.35s, background 0.35s;
}
.industry-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(63, 140, 255, 0.32);
  background: rgba(63, 140, 255, 0.06);
}
.industry-tile svg { width: 28px; height: 28px; color: var(--accent-2); flex: none; }
.industry-tile span {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink-hi);
  font-size: 0.99rem;
}
.industry-tile small {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink-low);
  font-size: 0.81rem;
  margin-top: 0.1rem;
}

/* ---------- CTA band ---------- */
.cta-band {
  position: relative;
  border-radius: var(--radius-lg);
  padding: clamp(2.8rem, 6vw, 5rem) clamp(1.6rem, 5vw, 4.75rem);
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 90% at 50% -20%, rgba(63, 140, 255, 0.24), transparent 70%),
    linear-gradient(170deg, #0f1531, #090d1e);
  border: 1px solid rgba(63, 140, 255, 0.22);
}
.cta-band h2 { margin-bottom: 1rem; }
.cta-band p { max-width: 560px; margin: 0 auto 2.1rem; }
.cta-band .btn-row { display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-1);
  border-top: 1px solid var(--line-soft);
  padding: clamp(2.8rem, 6vw, 4.25rem) 0 1.9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2.1fr 1fr 1fr 1.4fr;
  gap: 2.4rem;
  margin-bottom: 2.8rem;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand p { max-width: 34ch; font-size: 0.94rem; margin-top: 1rem; }
.footer-brand 
.footer-brand 
.footer-brand 

/* Footer column labels are h2 so the document outline never jumps a level;
   they are styled as small mono captions rather than headings. */
.footer-col h2 {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-low);
  margin-bottom: 1.15rem;
  line-height: 1.5;
}
.footer-col ul { display: grid; gap: 0.65rem; }
.footer-col a { font-size: 0.94rem; color: var(--ink-mid); transition: color 0.3s; }
.footer-col a:hover { color: var(--accent-2); }
.footer-col li { font-size: 0.94rem; }

.footer-contact li { display: flex; gap: 0.7rem; align-items: start; }
.footer-contact svg { width: 16px; height: 16px; margin-top: 0.3rem; color: var(--accent-2); flex: none; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.7rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.84rem;
  color: var(--ink-low);
}
.footer-bottom .mono { font-family: var(--font-mono); font-size: 0.71rem; letter-spacing: 0.1em; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  position: relative;
  padding: 10.5rem 0 4.5rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse 50% 60% at 80% 0%, rgba(45, 90, 220, 0.14), transparent 70%),
    var(--bg-0);
}
.page-hero h1 { max-width: 820px; }
.page-hero .lead { max-width: 640px; margin-top: 1.25rem; }
.breadcrumb {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-low);
  margin-bottom: 1.5rem;
}
.breadcrumb a:hover { color: var(--accent-2); }
.breadcrumb .sep { color: var(--accent); }

/* ==========================================================================
   SERVICES page
   ========================================================================== */
.services-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: clamp(2.4rem, 5vw, 4.75rem);
  align-items: start;
}
@media (max-width: 900px) { .services-layout { grid-template-columns: 1fr; } }

.services-nav {
  position: sticky;
  top: 6.5rem;
  display: grid;
  gap: 0.15rem;
  border-left: 1px solid var(--line);
}
.services-nav a {
  padding: 0.52rem 1.15rem;
  font-size: 0.91rem;
  color: var(--ink-low);
  border-left: 2px solid transparent;
  margin-left: -1.5px;
  transition: color 0.3s, border-color 0.3s;
}
.services-nav a:hover { color: var(--ink-hi); }
.services-nav a.active { color: var(--accent-2); border-left-color: var(--accent-2); }
@media (max-width: 900px) { .services-nav { display: none; } }

/* mobile in-page service jump menu */
.services-jump {
  display: none;
  margin-bottom: 2rem;
}
@media (max-width: 900px) {
  .services-jump { display: block; }
}
.services-jump label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-low);
  margin-bottom: 0.5rem;
}
.services-jump select {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  background: rgba(5, 8, 17, 0.6);
  border: 1px solid var(--line);
  color: var(--ink-hi);
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-low) 50%),
    linear-gradient(135deg, var(--ink-low) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.service-detail {
  padding-block: 2.4rem;
  border-top: 1px solid var(--line-soft);
  scroll-margin-top: 6.25rem;
}
.service-detail:first-child { border-top: 0; padding-top: 0; }
.num-lg {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  color: var(--accent-2);
  display: block;
  margin-bottom: 0.85rem;
}
.service-detail h2 { font-size: clamp(1.55rem, 3vw, 2.15rem); margin-bottom: 0.65rem; }
.service-detail .tagline {
  font-size: 1.08rem;
  color: var(--ink-mid);
  margin-bottom: 1.7rem;
  max-width: 58ch;
}

.deliverables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 0.65rem;
  margin-block: 1.35rem;
}
.deliverables li {
  display: flex;
  gap: 0.65rem;
  align-items: start;
  padding: 0.75rem 0.95rem;
  border-radius: 10px;
  background: rgba(148, 163, 216, 0.05);
  border: 1px solid var(--line-soft);
  font-size: 0.93rem;
  transition: border-color 0.3s, background 0.3s;
}
.deliverables li:hover { border-color: rgba(63, 140, 255, 0.3); background: rgba(63, 140, 255, 0.06); }
.deliverables svg { width: 15px; height: 15px; color: var(--accent-2); flex: none; margin-top: 0.3rem; }

.sub-head {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-low);
  margin: 1.7rem 0 0.85rem;
}

.soft-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.soft-tags span {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  letter-spacing: 0.05em;
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-mid);
  background: rgba(148, 163, 216, 0.04);
}

/* ---------- Widget panels ---------- */
.service-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.94fr);
  gap: clamp(1.4rem, 3vw, 2.4rem);
  align-items: start;
}
@media (max-width: 1100px) { .service-split { grid-template-columns: 1fr; } }

.widget-panel {
  position: relative;
  padding: 1.35rem 1.45rem 1.45rem;
  border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(148, 163, 216, 0.09), rgba(148, 163, 216, 0.02));
  border: 1px solid var(--line);
  overflow: hidden;
}
.widget-panel .grid-bg { background-size: 28px 28px; mask-image: none; -webkit-mask-image: none; opacity: 0.7; }
.widget-panel > * { position: relative; z-index: 1; }
.widget-panel svg { width: 100%; height: auto; }

.widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.widget-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-low);
}
.widget-title b { color: var(--accent-2); font-weight: 500; }

.widget-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 216, 0.06);
  color: var(--ink-hi);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s, transform 0.3s var(--ease-out);
}
.widget-btn:hover, .widget-btn:focus-visible {
  border-color: rgba(63, 140, 255, 0.5);
  background: rgba(63, 140, 255, 0.12);
  transform: translateY(-1px);
}
.widget-btn svg { width: 13px; height: 13px; }
.widget-btn[disabled] { opacity: 0.55; cursor: wait; }

.ctl-row { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }
.ctl-row .lbl {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  color: var(--ink-low);
  text-transform: uppercase;
  white-space: nowrap;
}
.ctl-val {
  font-family: var(--font-mono);
  font-size: 0.77rem;
  color: var(--accent-2);
  min-width: 5.5ch;
  text-align: right;
}

/* readout strip under widgets */
.readout {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--ink-low);
}
.readout b { color: var(--ink-mid); font-weight: 500; }
.readout .on { color: var(--accent-2); }

/* toggle chips (discipline layers) — keyboard focus made visible on the chip */
.layer-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.layer-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(148, 163, 216, 0.05);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  color: var(--ink-mid);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.3s, background 0.3s, color 0.3s;
}
.layer-chip input { position: absolute; opacity: 0; pointer-events: none; }
.layer-chip .sw {
  width: 9px; height: 9px;
  border-radius: 3px;
  background: var(--chip, var(--accent-2));
  flex: none;
}
.layer-chip:has(input:checked) {
  border-color: rgba(63, 140, 255, 0.5);
  background: rgba(63, 140, 255, 0.12);
  color: var(--ink-hi);
}
.layer-chip:has(input:not(:checked)) .sw { background: var(--ink-low); }
.layer-chip:focus-within {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

[data-layer] { transition: opacity 0.5s var(--ease-out); }

/* clash status chip */
.clash-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  letter-spacing: 0.07em;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.1);
  color: #fda4a4;
  transition: all 0.4s;
}
.clash-status .ind {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--bad);
  animation: blink 1.2s infinite;
}
.clash-status.ok {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.1);
  color: #86efac;
}
.clash-status.ok .ind { background: var(--ok); animation: none; }
.clash-status.busy {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.08);
  color: #fcd34d;
}
.clash-status.busy .ind { background: var(--warn); }
/* Idle: nothing has been tested yet, so stay neutral rather than alarming */
.clash-status.idle {
  border-color: var(--line);
  background: rgba(148, 163, 216, 0.06);
  color: var(--ink-mid);
}
.clash-status.idle .ind { background: var(--ink-low); animation: none; }
@keyframes blink { 50% { opacity: 0.3; } }

/* clash issue list */
.clash-list {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.73rem;
}
/* the class rule outranks the UA [hidden] rule, so restate it */
.clash-list[hidden] { display: none; }
.clash-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: rgba(148, 163, 216, 0.04);
  color: var(--ink-mid);
  transition: border-color 0.35s, background 0.35s, color 0.35s, opacity 0.35s;
}
.clash-list li::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--bad);
  flex: none;
  transition: background 0.35s;
}
.clash-list li.done { color: var(--ink-low); }
.clash-list li.done::before { background: var(--ok); }
.clash-list li .st { margin-left: auto; color: var(--bad); letter-spacing: 0.06em; }
.clash-list li.done .st { color: var(--ok); }

.sweep-line { opacity: 0; }
.sweeping .sweep-line { opacity: 1; animation: sweep 1.1s linear; }
@keyframes sweep { from { transform: translateX(0); } to { transform: translateX(340px); } }

/* measured line-draw for widgets (triggered on scroll) */
.dline { stroke-dasharray: var(--len, 400); stroke-dashoffset: var(--len, 400); }
.dline.draw { animation: draw 1.3s var(--ease-out) forwards; animation-delay: var(--d, 0s); }

/* 5D takeoff table — rows are focusable, active state works by hover, focus or tap */
.qto-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.85rem; }
.qto-table th {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-low);
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
.qto-table td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line-soft); color: var(--ink-mid); }
.qto-table td:last-child, .qto-table th:last-child { text-align: right; font-family: var(--font-mono); }
.qto-table tbody tr { transition: background 0.25s; cursor: pointer; }
.qto-table tbody tr:hover, .qto-table tr.row-active { background: rgba(63, 140, 255, 0.1); }
.qto-table tr.row-active td { color: var(--ink-hi); }
.qto-table tfoot td { color: var(--ink-hi); font-weight: 600; border-bottom: 0; }
[data-qto-el] { transition: opacity 0.3s, filter 0.3s; }
[data-qto-el].dim { opacity: 0.22; }
[data-qto-el].lit { filter: drop-shadow(0 0 5px rgba(45, 212, 255, 0.7)); }

/* automation / model-check runner */
.check-lines { display: grid; gap: 0.4rem; margin-top: 0.9rem; font-family: var(--font-mono); font-size: 0.73rem; }
.check-lines li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.48rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: rgba(148, 163, 216, 0.04);
  color: var(--ink-low);
  transition: color 0.3s, border-color 0.3s;
}
.check-lines li .st { margin-left: auto; letter-spacing: 0.06em; color: var(--ink-low); }
.check-lines li.running { color: var(--ink-mid); border-color: rgba(63, 140, 255, 0.35); }
.check-lines li.running .st { color: var(--accent-2); }
.check-lines li.pass .st { color: var(--ok); }
.check-lines li.pass { color: var(--ink-mid); }
.check-lines li.flag .st { color: var(--warn); }
.check-lines li.flag { color: var(--ink-mid); border-color: rgba(251, 191, 36, 0.35); }
.check-note {
  margin-top: 0.85rem;
  font-size: 0.8rem;
  color: var(--ink-low);
}

/* ==========================================================================
   PROJECTS page
   ========================================================================== */
.case-study {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 3.75rem);
  align-items: center;
  padding-block: clamp(2.4rem, 5vw, 3.75rem);
  border-top: 1px solid var(--line-soft);
}
.case-study:first-of-type { border-top: 0; }
.case-study.flip .case-media { order: 2; }
@media (max-width: 900px) {
  .case-study { grid-template-columns: 1fr; }
  .case-study.flip .case-media { order: 0; }
}

.case-media { position: relative; }
.case-media .frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 26px 54px -28px rgba(0, 0, 0, 0.8);
}
.case-media .frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(4, 7, 14, 0.5));
  pointer-events: none;
}
.case-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  transition: transform 1.1s var(--ease-out);
}
.case-media:hover img { transform: scale(1.07); }
.case-media .frame svg { width: 100%; height: auto; }
.case-media .badge {
  position: absolute;
  top: 1rem; left: 1rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  background: rgba(4, 7, 14, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-hi);
}
.case-media .badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); }
.credit {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  color: var(--ink-low);
  text-align: right;
}

.case-body h2 { font-size: clamp(1.45rem, 2.6vw, 2.05rem); margin-bottom: 0.4rem; }
.case-body .case-sub {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-low);
  margin-bottom: 1.15rem;
}
.case-body p.desc { font-size: 0.97rem; }

.fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  overflow: hidden;
  margin-block: 1.35rem;
}
.fact-cell {
  background: var(--bg-1);
  padding: 0.85rem 0.9rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.35rem;
}
.fact-cell b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--ink-hi);
  line-height: 1.1;
}
.fact-cell b small { font-size: 0.7em; color: var(--accent-2); }
.fact-cell span {
  font-family: var(--font-mono);
  font-size: 0.61rem;
  letter-spacing: 0.07em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--ink-low);
  text-wrap: balance;
}

.role-line {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--ink-low);
  margin-bottom: 0.55rem;
}
.scope-note {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.7rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px dashed rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.06);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: #fcd34d;
}
.disclaimer { font-size: 0.8rem; color: var(--ink-low); max-width: 68ch; }

/* project teasers (home) */
.teaser-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.3rem; }
.teaser-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-soft);
  min-height: 300px;
  display: flex;
  align-items: flex-end;
  transition: transform 0.45s var(--ease-out), border-color 0.45s;
}
.teaser-card:hover { transform: translateY(-5px); border-color: rgba(63, 140, 255, 0.4); }
.teaser-card img, .teaser-card picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.teaser-card img { object-fit: cover; transition: transform 1.1s var(--ease-out); }
.teaser-card:hover img { transform: scale(1.06); }
.teaser-card .shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(185deg, rgba(4, 7, 14, 0.05) 30%, rgba(4, 7, 14, 0.92) 85%);
}
.teaser-card .info { position: relative; padding: 1.35rem 1.45rem; }
.teaser-card .info h3 { font-size: 1.08rem; margin-bottom: 0.25rem; }
.teaser-card .info p {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-mid);
}

/* ==========================================================================
   ABOUT page
   ========================================================================== */
/* Markets-served graphic */
.map-panel { max-width: 520px; margin-inline: auto; width: 100%; }
.map-panel svg { width: 100%; height: auto; overflow: visible; }
.dash-arc { stroke-dasharray: 6 8; animation: dash-move 2.4s linear infinite; }
@keyframes dash-move { to { stroke-dashoffset: -14; } }

/* CDE flow: below ~720px the four-stage diagram becomes unreadable if it
   is squeezed, so it scrolls horizontally inside its own panel instead. */
.cde-panel { overflow-x: auto; }
.cde-panel svg { width: 100%; height: auto; }
@media (max-width: 720px) {
  .cde-panel svg { width: 660px; max-width: none; }
  .cde-panel::after {
    content: "Scroll to see the full flow →";
    display: block;
    margin-top: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    color: var(--ink-low);
  }
}

.stat-inline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 1.15rem;
  margin-top: 2.1rem;
}
.stat-inline .cell {
  padding: 1.25rem 1.35rem;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(148, 163, 216, 0.04);
}
.stat-inline b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--ink-hi);
  line-height: 1.1;
}
.stat-inline b .suffix { color: var(--accent-2); }
.stat-inline span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-low);
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 1.3rem;
}
.value-card { padding: 1.9rem; }
.value-card .glyph, .contact-card .glyph {
  width: 46px; height: 46px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(63, 140, 255, 0.12);
  border: 1px solid rgba(63, 140, 255, 0.28);
  color: var(--accent-2);
}
.value-card .glyph { margin-bottom: 1.25rem; }
.value-card .glyph svg, .contact-card .glyph svg { width: 22px; height: 22px; }
.value-card h3 { font-size: 1.16rem; margin-bottom: 0.5rem; }
.value-card p { font-size: 0.94rem; }

/* ==========================================================================
   CONTACT page
   ========================================================================== */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: clamp(2.4rem, 5vw, 4.25rem);
  align-items: start;
}
@media (max-width: 900px) { .contact-layout { grid-template-columns: 1fr; } }

.contact-cards { display: grid; gap: 1.05rem; }
.contact-card {
  display: flex;
  gap: 1.15rem;
  align-items: start;
  padding: 1.45rem 1.55rem;
}
.contact-card h2 { font-size: 1.04rem; margin-bottom: 0.25rem; }
.contact-card p, .contact-card a.val { font-size: 0.95rem; color: var(--ink-mid); }
.contact-card a.val:hover { color: var(--accent-2); }

.contact-form {
  padding: clamp(1.7rem, 4vw, 2.6rem);
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, rgba(148, 163, 216, 0.08), rgba(148, 163, 216, 0.02));
  border: 1px solid var(--line);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.15rem; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-low);
  margin-bottom: 0.5rem;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 0.82rem 1rem;
  border-radius: 10px;
  background: rgba(4, 7, 14, 0.6);
  border: 1px solid var(--line);
  color: var(--ink-hi);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.field ::placeholder { color: var(--ink-low); opacity: 0.75; }
.field select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-low) 50%),
    linear-gradient(135deg, var(--ink-low) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(63, 140, 255, 0.18);
}
.field textarea { min-height: 140px; resize: vertical; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] {
  border-color: rgba(248, 113, 113, 0.6);
}
.field .err-msg {
  display: none;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #fda4a4;
}
.field input[aria-invalid="true"] ~ .err-msg,
.field textarea[aria-invalid="true"] ~ .err-msg { display: block; }
.form-note { font-size: 0.82rem; color: var(--ink-low); margin-top: 1rem; }

.form-status {
  display: none;
  margin-top: 1.2rem;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  font-size: 0.92rem;
}
.form-status.ok {
  display: block;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #86efac;
}
.form-status.err {
  display: block;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fda4a4;
}
.form-status a { color: var(--accent-2); text-decoration: underline; }

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
  transition-delay: var(--rd, 0s);
}
.reveal.in { opacity: 1; transform: none; }

.reveal-l { opacity: 0; transform: translateX(-32px); transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out); transition-delay: var(--rd, 0s); }
.reveal-r { opacity: 0; transform: translateX(32px); transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out); transition-delay: var(--rd, 0s); }
.reveal-l.in, .reveal-r.in { opacity: 1; transform: none; }

/* ---------- 404 ---------- */
.err-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem;
  position: relative;
}
.err-code {
  font-family: var(--font-mono);
  font-size: clamp(5rem, 16vw, 9.5rem);
  font-weight: 600;
  line-height: 1;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Utilities ---------- */
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.center { text-align: center; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .draw, .dline { stroke-dasharray: none !important; stroke-dashoffset: 0 !important; }
  .node-dot { opacity: 1; }
  .reveal, .reveal-l, .reveal-r { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
  .packet, .asm-pulse { display: none; }
  .asm .asm-plate { transform: none !important; opacity: 1 !important; }
  .asm .asm-label { opacity: 0; }
  .asm .asm-resolved, .asm .asm-outputs { opacity: 1; }
  .asm .asm-clash { opacity: 0; }
  .asm .asm-branch { opacity: 0; }
}

/* ---------- Global delivery globe (about) ---------- */
.reach-arc {
  stroke-dasharray: 4 7;
  animation: reach-flow 3.4s linear infinite;
}
.reach-arc:nth-child(2n) { animation-duration: 4.2s; }
.reach-arc:nth-child(3n) { animation-duration: 5s; }
@keyframes reach-flow { to { stroke-dashoffset: -22; } }

.reach-node { animation: reach-blink 3.6s ease-in-out infinite; }
.reach-node:nth-child(2n) { animation-delay: 0.7s; }
.reach-node:nth-child(3n) { animation-delay: 1.5s; }
@keyframes reach-blink { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

.reach-pulse {
  transform-origin: center;
  transform-box: fill-box;
  animation: reach-ring 3s ease-out infinite;
}
@keyframes reach-ring {
  0%   { transform: scale(0.5); opacity: 0.9; }
  80%, 100% { transform: scale(2.1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .reach-arc, .reach-node, .reach-pulse { animation: none; }
  .reach-arc { stroke-dasharray: none; }
  .reach-node { opacity: 1; }
  .reach-pulse { opacity: 0.35; }
}
