/* Nasamat Ultra Prototype — Cryo-Steel Night & Paper Architecture */

:root {
  /* Core Cryo-Steel Palette (aligned with company emblem) */
  --night: #07111e;
  --obsidian: #050c16;
  --dusk: #0e1d32;
  --surface: #11233c;
  --seam: #1e3556;

  --cyan: #0ea5e9;
  --cryo: #38bdf8;
  --ice: #bae6fd;
  --brass: #d4b475;
  --hot: #f8fcff;
  --muted: #93abc7;

  --paper-bg: #f4f7fa;
  --paper-ink: #0a1628;
  --paper-muted: #4b5e78;
  --paper-line: rgb(10 22 40 / 0.14);
  --paper-accent: #0369a1;

  /* Active chapter tokens */
  --ink: var(--hot);
  --text: var(--muted);
  --line: var(--seam);
  --accent: var(--cryo);
  --panel: var(--surface);

  --font-display: "Alexandria", system-ui, -apple-system, sans-serif;
  --font-sans: "IBM Plex Sans Arabic", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --ease: cubic-bezier(0.2, 0.9, 0.25, 1.08);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --cut: 10px;
  --dir: -1;
  --scroll-progress: 0;

  color-scheme: dark;
}

[dir="ltr"] {
  --dir: 1;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background: var(--night);
  color: var(--text);
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

[lang="en"] body {
  line-height: 1.62;
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.28;
}

p {
  margin: 0;
}

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

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: 0;
}

::selection {
  background: rgb(14 165 233 / 0.35);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--cryo);
  outline-offset: 3px;
}

/* Skip Link */
.skip-link {
  position: fixed;
  top: -100px;
  inset-inline-start: 16px;
  z-index: 200;
  background: var(--cyan);
  color: #031323;
  padding: 10px 18px;
  font-weight: 700;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 12px;
}

/* Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  inset-inline: 0;
  height: 2.5px;
  z-index: 120;
  background: linear-gradient(90deg, var(--cyan), var(--cryo), var(--brass));
  transform-origin: left center;
  transform: scaleX(var(--scroll-progress));
  pointer-events: none;
}
[dir="rtl"] .scroll-progress {
  transform-origin: right center;
}
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    @keyframes grow-scroll-progress {
      from { transform: scaleX(0); }
      to { transform: scaleX(1); }
    }
    .scroll-progress {
      animation: grow-scroll-progress auto linear;
      animation-timeline: scroll(root block);
    }
  }
}

/* Layout Helpers */
.container-x {
  width: 100%;
  max-width: 1260px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4.5vw, 56px);
}

.chapter {
  position: relative;
  padding-block: clamp(64px, 8.5vw, 128px);
  overflow-x: clip;
}

.paper {
  --ink: var(--paper-ink);
  --text: var(--paper-muted);
  --line: var(--paper-line);
  --accent: var(--paper-accent);
  --panel: #ffffff;
  background: var(--paper-bg);
  color: var(--text);
  color-scheme: light;
}

.lit-field {
  background: radial-gradient(65% 75% at 75% 45%, rgb(14 165 233 / 0.34) 0%, rgb(11 45 84 / 0.85) 45%, #07111e 100%);
  --text: #c7dff5;
  --line: rgb(186 230 253 / 0.22);
}
[dir="ltr"] .lit-field {
  background: radial-gradient(65% 75% at 25% 45%, rgb(14 165 233 / 0.34) 0%, rgb(11 45 84 / 0.85) 45%, #07111e 100%);
}

.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Typography */
.display-1 { font-size: clamp(26px, 4vw, 56px); line-height: 1.24; text-wrap: balance; }
.display-2 { font-size: clamp(24px, 3.1vw, 44px); line-height: 1.28; }
.lead { font-size: clamp(16px, 1.35vw, 18.5px); line-height: 1.8; color: var(--text); max-width: 62ch; }
.mono, .mono-num { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.index { font-family: var(--font-mono); font-size: 13px; color: var(--accent); letter-spacing: 0.06em; }
.nobr { white-space: nowrap; }
@media (max-width: 480px) { .nobr { white-space: normal; } }
.lit {
  color: var(--hot);
  text-shadow: 0 0 20px rgb(56 189 248 / 0.75), 0 0 42px rgb(14 165 233 / 0.45);
}

/* 45-deg Chamfers & Seams */
.cut { clip-path: polygon(var(--cut) 0, 100% 0, 100% 100%, 0 100%, 0 var(--cut)); }
[dir="rtl"] .cut { clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%); }
.cut-lg { --cut: 24px; }
.cut-md { --cut: 14px; }
.cut-sm { --cut: 8px; }

.cut-line {
  box-shadow: inset 0 0 0 1px var(--line);
  background-image: linear-gradient(to bottom right, transparent calc(50% - 0.6px), var(--line) 50%, transparent calc(50% + 0.6px));
  background-size: var(--cut) var(--cut);
  background-repeat: no-repeat;
  background-position: top left;
}
[dir="rtl"] .cut-line {
  background-image: linear-gradient(to bottom left, transparent calc(50% - 0.6px), var(--line) 50%, transparent calc(50% + 0.6px));
  background-position: top right;
}

.seam {
  position: relative;
  height: 1px;
  background: var(--line);
  margin-top: 22px;
}
.seam::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--lit, 22%);
  background: var(--cyan);
  box-shadow: 0 0 12px rgb(56 189 248 / 0.8);
  transition: width 0.8s var(--ease-out);
}
.paper .seam::after {
  background: var(--paper-accent);
  box-shadow: none;
}
.js [data-seam]::after { width: 0; }
.js [data-seam].is-in::after { width: var(--lit, 22%); }

/* Rhombic Nuqta */
.nq {
  display: inline-block;
  flex-shrink: 0;
  width: var(--nq, 8px);
  height: var(--nq, 8px);
  transform: rotate(45deg);
  background: var(--cyan);
}
.nq.hollow {
  background: transparent;
  outline: 1.5px solid var(--text);
  outline-offset: -1.5px;
}
.nq.live {
  background: var(--hot);
  box-shadow: 0 0 0 2px var(--cyan), 0 0 14px 2px rgb(56 189 248 / 0.85);
}
@media (prefers-reduced-motion: no-preference) {
  .nq.live { animation: nq-breathe 2.6s ease-in-out infinite; }
}
@keyframes nq-breathe {
  50% { box-shadow: 0 0 0 2px var(--cyan), 0 0 22px 5px rgb(56 189 248 / 0.95); }
}

.chip {
  --cut: 7px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  font-size: 13.5px;
  color: var(--ink);
  background: rgb(14 29 50 / 0.72);
}

/* Buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 11px 22px;
  font-weight: 600;
  font-size: 15.5px;
  color: var(--ink);
  transition: transform 0.2s var(--ease-out), background-color 0.25s, color 0.2s;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% 100%, 0 100%, 0 var(--cut));
}
[dir="rtl"] .btn {
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
}
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 14px; --cut: 8px; }
.btn-primary { background: var(--cyan); color: #041322; }
.btn-primary:hover { background: var(--cryo); }
.btn-outline {
  box-shadow: inset 0 0 0 1px var(--line);
  background: rgb(17 35 60 / 0.35);
}
.btn-outline:hover { background: rgb(56 189 248 / 0.14); }
.paper .btn-outline { background: transparent; }
.paper .btn-outline:hover { background: rgb(3 105 161 / 0.08); }
.glow-pool { position: relative; isolation: isolate; display: inline-flex; }
.glow-pool::before {
  content: "";
  position: absolute;
  inset: 30% 8% -30%;
  z-index: -1;
  background: radial-gradient(closest-side, rgb(14 165 233 / 0.55), transparent);
  filter: blur(12px);
}
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

/* Header & Responsive Navbar (single nav landmark + popover fallback) */
.site-header {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 100;
  height: 70px;
  display: flex;
  align-items: center;
  background: rgb(7 17 30 / 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgb(56 189 248 / 0.14);
  transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}
.site-header.paper {
  background: rgb(244 247 250 / 0.9);
  border-bottom-color: var(--paper-line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.header-inner > * {
  flex-shrink: 0;
  white-space: nowrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-emblem {
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgb(0 0 0 / 0.4));
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-text strong { font-size: 16px; color: var(--ink); font-family: var(--font-display); }
.brand-text small { font-size: 11.5px; color: var(--text); }

.site-nav {
  display: flex;
  align-items: center;
}
.menu-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  background: rgb(17 35 60 / 0.5);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}
.site-header.paper .menu-button { background: #fff; }
.menu-button { anchor-name: --menu-button; }

.site-menu {
  position: fixed;
  inset: auto;
  inset-block-start: 4.75rem;
  inset-block-start: anchor(--menu-button bottom);
  inset-inline-end: 1rem;
  inline-size: min(82dvw, 21rem);
  max-inline-size: calc(100dvw - 2rem);
  margin-block-start: 0.5rem;
  padding: 10px;
  background: var(--dusk);
  border: 1px solid var(--seam);
  color: var(--hot);
  box-shadow: 0 20px 50px rgb(0 0 0 / 0.5);
}
.site-menu a {
  display: block;
  padding: 11px 14px;
  font-weight: 500;
  border-bottom: 1px solid rgb(56 189 248 / 0.1);
}
.site-menu li:last-child a { border-bottom: 0; }
.site-menu a:is(:target-current, .target-current) {
  color: var(--cryo);
  font-weight: 700;
  border-inline-start: 3px solid var(--cryo);
  padding-inline-start: 11px;
}

.site-header.is-wide .menu-button { display: none; }
.site-header.is-wide .site-menu {
  position: static;
  display: flex;
  align-items: center;
  gap: 6px;
  inline-size: auto;
  max-inline-size: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  scroll-target-group: auto;
}
.site-header.is-wide .site-menu a {
  padding: 7px 12px;
  border: 0;
  font-size: 14.5px;
  color: var(--text);
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.site-header.is-wide .site-menu a:hover { color: var(--ink); }
.site-header.is-wide .site-menu a:is(:target-current, .target-current) {
  color: var(--ink);
  font-weight: 700;
  border-bottom: 2px solid var(--accent);
  border-inline-start: 0;
  padding-inline-start: 12px;
}
.site-header.is-measuring * { transition: none !important; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lang-toggle {
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink);
  background: rgb(17 35 60 / 0.35);
}
.site-header.paper .lang-toggle { background: #fff; }
@media (max-width: 540px) {
  .header-cta { display: none; }
}

/* HERO */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--night);
  padding-top: 88px;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.blueprint-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(to right, rgb(56 189 248 / 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(56 189 248 / 0.08) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 35%, transparent 90%);
}
.pool { position: absolute; border-radius: 50%; pointer-events: none; filter: blur(14px); }
.pool-a {
  width: 66vmax; height: 66vmax; inset-inline-end: -16vmax; top: -12vmax;
  background: radial-gradient(closest-side, rgb(14 165 233 / 0.26), rgb(3 105 161 / 0.12) 48%, transparent 72%);
}
.pool-b {
  width: 44vmax; height: 44vmax; inset-inline-start: -12vmax; bottom: -18vmax;
  background: radial-gradient(closest-side, rgb(212 180 117 / 0.13), transparent 70%);
}
@media (prefers-reduced-motion: no-preference) {
  .pool-a { animation: hero-drift 18s ease-in-out infinite alternate; }
  .pool-b { animation: hero-drift 22s ease-in-out infinite alternate-reverse; }
}
@keyframes hero-drift { to { transform: translate3d(3vmax, 2vmax, 0) scale(1.05); } }

.grid-hero {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding-block: 24px 32px;
}
.copy { display: grid; gap: 18px; justify-items: start; max-width: 660px; min-width: 0; }
[data-settle] { animation: hero-rise 0.75s var(--ease-out) both; animation-delay: calc(var(--d, 0) * 70ms); }
@keyframes hero-rise { from { translate: 0 14px; } }
.eyebrow { color: var(--cryo); font-weight: 500; max-width: 100%; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13.5px; color: var(--text); }
.trust li { display: inline-flex; align-items: center; gap: 8px; }
.trust .nq { background: var(--brass); }

/* Hero 3D Stage */
.stage {
  --k: 0.52;
  position: relative;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  height: min(35svh, 285px);
  perspective: 1400px;
  order: -1;
}
.rig {
  position: absolute;
  top: 0;
  left: 50%;
  width: 560px;
  height: 500px;
  margin-left: -280px;
  transform-style: preserve-3d;
  transform-origin: 50% 0;
  transform: scale(var(--k)) rotateX(8deg) rotateY(15deg);
  transition: transform 0.55s var(--ease-out);
}
[dir="ltr"] .rig { transform: scale(var(--k)) rotateX(8deg) rotateY(-15deg); }
.layer {
  position: absolute;
  z-index: 2;
  background: linear-gradient(155deg, rgb(18 40 70 / 0.95), rgb(9 21 38 / 0.97));
  box-shadow: inset 0 0 0 1px rgb(186 230 253 / 0.16), 0 24px 50px rgb(0 0 0 / 0.45);
  color: var(--hot);
}
@media (prefers-reduced-motion: no-preference) {
  .layer { animation: hero-float 8.5s ease-in-out var(--fd, 0s) infinite alternate; }
}
@keyframes hero-float { to { translate: 0 -8px; } }

.dash { top: 20px; left: 26px; width: 410px; padding: 16px; --fd: 0s; }
.dash-bar { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px solid rgb(186 230 253 / 0.14); font-size: 11px; color: var(--ice); }
.dots { display: flex; gap: 5px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: rgb(186 230 253 / 0.25); }
.dash-body { display: grid; grid-template-columns: 124px 1fr; gap: 14px; padding-top: 14px; }
.side li { font-size: 12px; padding: 6px 8px; color: var(--muted); border-inline-start: 2px solid transparent; }
.side li.on { color: var(--hot); background: rgb(14 165 233 / 0.14); border-inline-start-color: var(--cryo); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.kpi { padding: 8px; background: rgb(7 17 30 / 0.6); border: 1px solid rgb(186 230 253 / 0.12); display: grid; gap: 2px; }
.kpi span { font-size: 10px; color: var(--muted); }
.kpi b { font-size: 14px; color: var(--hot); }
.kpi.on b { color: var(--cryo); }
.chart { width: 100%; height: 74px; display: block; }
.chart .area { fill: rgb(14 165 233 / 0.16); }
.chart .line { fill: none; stroke: var(--cryo); stroke-width: 2; }
.rows { display: grid; gap: 6px; margin-top: 8px; }
.rows i { display: block; height: 7px; background: rgb(186 230 253 / 0.12); width: 82%; }
.rows i:last-child { width: 58%; }

.phone { top: 96px; left: 318px; width: 215px; padding: 14px; --fd: 1.2s; }
.notch { width: 48px; height: 4px; margin: 0 auto 10px; background: rgb(186 230 253 / 0.25); }
.app-title { font-size: 10.5px; text-align: center; color: var(--ice); margin-bottom: 8px; }
.progress-ring { width: 56px; height: 56px; display: block; margin: 0 auto 10px; transform: rotate(-90deg); }
.progress-ring .track { fill: none; stroke: rgb(186 230 253 / 0.15); stroke-width: 5; }
.progress-ring .arc { fill: none; stroke: var(--cryo); stroke-width: 5; stroke-dasharray: 201; stroke-dashoffset: 56; }
.rig-steps { display: grid; gap: 7px; font-size: 11.5px; }
.rig-steps li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.rig-steps li.done { color: var(--ice); }
.rig-steps li.now { color: var(--hot); font-weight: 600; }

.api { top: 344px; left: 105px; width: 278px; padding: 14px; --fd: 2.1s; }
.api-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--brass); margin-bottom: 6px; }
.api code { display: block; font-family: var(--font-mono); font-size: 11.5px; color: var(--ice); background: rgb(7 17 30 / 0.6); padding: 5px 8px; }
.api .verb { color: var(--cryo); font-weight: 600; }
.api-ok { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 11.5px; color: var(--hot); }
.api-ok code { display: inline; padding: 2px 6px; background: rgb(14 165 233 / 0.18); color: var(--cryo); }

.links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.seam-line { fill: none; stroke: rgb(186 230 253 / 0.2); stroke-width: 1.5; }
.links .pulse { fill: none; stroke: var(--cryo); stroke-width: 2; stroke-dasharray: 18 82; }
@media (prefers-reduced-motion: no-preference) {
  .links .pulse { animation: pulse-run 7s linear infinite; }
}
@keyframes pulse-run { from { stroke-dashoffset: 100; } to { stroke-dashoffset: -100; } }
.links .node { fill: var(--cyan); }
.links .node.hot { fill: var(--hot); }

@media (min-width: 1024px) {
  .grid-hero { grid-template-columns: 1.05fr 0.95fr; gap: 36px; }
  .stage { order: 0; --k: 0.92; height: 470px; overflow: visible; }
  .stage:hover .rig { transform: scale(var(--k)) rotateX(4deg) rotateY(9deg); }
  [dir="ltr"] .stage:hover .rig { transform: scale(var(--k)) rotateX(4deg) rotateY(-9deg); }
}

/* Readout bar */
.readout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
  padding-block: 18px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}
.readout > div { display: inline-flex; align-items: center; gap: 9px; }
.readout b { color: var(--ink); font-size: 15px; }
.pause {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink);
}
.ico-play { display: none; }
.motion-paused .ico-pause { display: none; }
.motion-paused .ico-play { display: block; }

/* Section Head */
.section-head { margin-bottom: clamp(32px, 5vw, 56px); display: grid; gap: 12px; }
.section-head-meta { display: flex; align-items: center; gap: 14px; }
.eyebrow-tag { font-size: 13.5px; font-weight: 600; color: var(--accent); }

/* Services Chambers */
.services { background: var(--night); overflow: clip; }
.services .glow {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 55%;
  pointer-events: none;
  background: radial-gradient(closest-side, rgb(14 165 233 / 0.14), transparent);
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}
.chamber {
  --c: 18px;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  padding: 28px 24px 24px;
  background: rgb(14 29 50 / 0.55);
}
.edge { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.edge::before { content: ""; position: absolute; top: 0; inset-inline-start: var(--c); inset-inline-end: 0; height: 1px; background: var(--line); }
.edge::after { content: ""; position: absolute; top: var(--c); bottom: 0; inset-inline-start: 0; width: 1px; background: linear-gradient(var(--line), rgb(30 53 86 / 0.25)); }
.corner {
  position: absolute; top: 0; inset-inline-start: 0; width: var(--c); height: var(--c);
  background: linear-gradient(to bottom right, transparent calc(50% - 0.6px), var(--line) 50%, transparent calc(50% + 0.6px));
}
[dir="rtl"] .corner {
  background: linear-gradient(to bottom left, transparent calc(50% - 0.6px), var(--line) 50%, transparent calc(50% + 0.6px));
}
.ignite {
  position: absolute; top: 0; inset-inline-start: var(--c); width: 42%; height: 1px;
  background: var(--cryo); box-shadow: 0 0 12px 1px rgb(56 189 248 / 0.85);
  transform-origin: left; transition: transform 0.85s var(--ease-out) calc(var(--d, 0) * 70ms);
}
[dir="rtl"] .ignite { transform-origin: right; }
.js .chamber:not(.is-in) .ignite { transform: scaleX(0); }

.chamber .pool {
  position: absolute; inset-inline: 0; bottom: 0; height: 60%; z-index: -1; pointer-events: none;
  background: radial-gradient(75% 65% at 50% 100%, rgb(14 165 233 / 0.28), transparent 76%);
  opacity: 0.28; transition: opacity 0.4s;
}
.chamber:hover .pool, .chamber:focus-within .pool { opacity: 1; }

.machine { margin-bottom: 16px; }
.mach-svg { width: 100%; height: 56px; display: block; }
.m-frame { fill: rgb(7 17 30 / 0.6); stroke: rgb(186 230 253 / 0.24); stroke-width: 1.2; }
.m-line { fill: none; stroke: rgb(186 230 253 / 0.35); stroke-width: 1.5; }
.m-pulse { fill: none; stroke: var(--cryo); stroke-width: 2; stroke-dasharray: 16 84; }
.m-ring { fill: none; stroke: var(--cryo); stroke-width: 1.6; }
.m-ring.hot { stroke: var(--brass); }
.m-node { fill: var(--cyan); }
.m-node.hot { fill: var(--hot); }
@media (prefers-reduced-motion: no-preference) {
  .m-pulse { animation: pulse-run 5.5s linear infinite; }
  .spin-slow { transform-origin: 110px 32px; animation: spin-gear 16s linear infinite; }
}
@keyframes spin-gear { to { transform: rotate(360deg); } }

.chamber .num { margin-bottom: 6px; display: block; }
.chamber h3 { font-size: 20px; margin-bottom: 10px; }
.chamber .short { font-size: 14.5px; color: var(--text); margin-bottom: 18px; }
.bullets {
  display: grid; gap: 8px; padding-top: 14px; margin-bottom: 22px;
  border-top: 1px solid var(--line); font-size: 14px; color: var(--ice);
}
.bullets li { display: flex; align-items: baseline; gap: 10px; }
.go {
  position: relative; margin-top: auto; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 9px; min-height: 40px;
  font-size: 14.5px; font-weight: 600; color: var(--hot);
}
.go .arrow { color: var(--cryo); transition: transform 0.25s; }
.go:hover .arrow { transform: translateX(calc(var(--dir) * 4px)); }
.go .rail { position: absolute; bottom: 2px; inset-inline: 0; height: 1px; background: var(--line); }
.go .rail::after {
  content: ""; position: absolute; inset: 0; background: var(--cryo);
  transform: scaleX(0.22); transform-origin: left; transition: transform 0.35s var(--ease-out);
}
[dir="rtl"] .go .rail::after { transform-origin: right; }
.chamber:hover .go .rail::after { transform: scaleX(1); }

/* Sectors Strip */
.sectors-strip {
  margin-top: 32px;
  padding: 24px 28px;
  background: var(--dusk);
  border: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.sectors-head h3 { font-size: 20px; margin-top: 4px; }
.sectors-list {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
}
.sectors-list li {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  color: var(--hot);
}

/* Featured Case Study & Gallery (Paper) */
.featured-case {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  padding: clamp(20px, 3vw, 34px);
  background: #ffffff;
  border: 1px solid var(--paper-line);
  margin-bottom: 48px;
}
.featured-case > * { min-width: 0; }
@media (min-width: 960px) {
  .featured-case { grid-template-columns: 1fr 1.15fr; align-items: center; }
}
.case-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--paper-accent);
  margin-bottom: 10px;
}
.case-title { font-size: clamp(22px, 2.2vw, 28px); margin-bottom: 12px; }
.case-desc { font-size: 15.5px; color: var(--paper-muted); margin-bottom: 20px; }

.case-steps {
  display: grid;
  gap: 8px;
}
.case-step-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: start;
  padding: 10px 14px;
  border: 1px solid var(--paper-line);
  background: var(--paper-bg);
  color: var(--paper-ink);
  font-size: 14.5px;
  font-weight: 600;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.case-step-btn:hover { border-color: var(--paper-accent); }
.case-step-btn.is-active {
  background: var(--night);
  border-color: var(--night);
  color: var(--hot);
}
.case-step-btn .mono { color: var(--paper-accent); font-size: 12.5px; }
.case-step-btn.is-active .mono { color: var(--cryo); }

.case-viewer { display: grid; gap: 10px; }
.case-frame {
  position: relative;
  height: clamp(280px, 42vw, 440px);
  background: #091525;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.case-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.zoom-pill {
  position: absolute;
  bottom: 14px;
  inset-inline-end: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: rgb(7 17 30 / 0.85);
  border: 1px solid rgb(56 189 248 / 0.45);
  color: var(--hot);
  font-size: 13px;
  font-weight: 600;
}
.zoom-pill:hover { background: var(--cyan); color: #041322; }
.case-caption-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  color: var(--paper-ink);
}

/* Gallery */
.gallery-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.gallery-title { font-size: 22px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-btn {
  padding: 8px 14px;
  border: 1px solid var(--paper-line);
  background: #fff;
  color: var(--paper-ink);
  font-size: 13.5px;
  font-weight: 600;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.filter-btn.is-active {
  background: var(--night);
  border-color: var(--night);
  color: var(--hot);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.g-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--paper-line);
  overflow: hidden;
  text-align: start;
  padding: 0;
  transition: transform 0.25s var(--ease-out), border-color 0.25s;
}
.g-card:hover { transform: translateY(-3px); border-color: var(--paper-accent); }
.g-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #0c1829;
  overflow: hidden;
}
.g-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--ease-out);
}
.g-card:hover .g-thumb img { transform: scale(1.04); }
.g-meta {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.g-meta strong { font-size: 14.5px; color: var(--paper-ink); font-weight: 600; }
.g-meta .mono { font-size: 12px; color: var(--paper-accent); }

/* HOW WE WORK (Sticky Stage) */
.steps { background: var(--night); overflow: clip; }
.dusk-seam {
  position: absolute; top: 0; inset-inline: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgb(56 189 248 / 0.85) 20%, var(--hot) 50%, rgb(56 189 248 / 0.85) 80%, transparent);
}
.dusk-light {
  position: absolute; top: 0; inset-inline: 0; height: 220px; pointer-events: none;
  background: radial-gradient(48% 100% at 50% 0, rgb(14 165 233 / 0.16), transparent 72%);
}
.steps-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: center; }
.steps-layout > * { min-width: 0; }
@media (min-width: 960px) {
  .steps { min-height: 175vh; padding-block: 0; overflow-x: visible; }
  .pin { position: sticky; top: 70px; min-height: calc(100svh - 70px); display: flex; align-items: center; padding-block: 48px; }
  .steps-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; }
}
.steps-head { display: grid; gap: 10px; margin-bottom: 28px; }
.steps-body { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 16px; }
.rail { position: relative; display: flex; justify-content: center; }
.rail::before { content: ""; position: absolute; top: 12px; bottom: 12px; width: 1px; background: var(--line); }
.rail-lit {
  position: absolute; top: 12px; width: 2px; background: var(--cryo);
  box-shadow: 0 0 10px rgb(56 189 248 / 0.8);
  height: calc((var(--active-step, 0) / 3) * (100% - 24px));
  transition: height 0.45s var(--ease-out);
}
.dots { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding-block: 8px; }
.dots .r { display: grid; place-items: center; width: 24px; height: 24px; background: var(--night); }
.dots .dot { width: 8px; height: 8px; transform: rotate(45deg); background: var(--line); transition: background-color 0.25s, box-shadow 0.25s; }
.dots b { display: none; }

.steps-list { display: grid; gap: 12px; }
.step-item-btn {
  width: 100%;
  text-align: start;
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid transparent;
  background: rgb(14 29 50 / 0.35);
  transition: border-color 0.25s, background-color 0.25s;
}
.step-item-btn .num { font-size: 12px; color: var(--cryo); }
.step-item-btn strong { font-size: 18px; color: var(--ink); font-family: var(--font-display); }
.step-item-btn .txt { font-size: 14px; color: var(--text); }

[data-step="0"] [data-step-trigger="0"] .step-item-btn,
[data-step="1"] [data-step-trigger="1"] .step-item-btn,
[data-step="2"] [data-step-trigger="2"] .step-item-btn,
[data-step="3"] [data-step-trigger="3"] .step-item-btn {
  border-color: var(--cryo);
  background: rgb(14 165 233 / 0.12);
}

[data-step="0"] [data-step-jump="0"] .dot,
[data-step="1"] [data-step-jump="1"] .dot,
[data-step="2"] [data-step-jump="2"] .dot,
[data-step="3"] [data-step-jump="3"] .dot {
  background: var(--hot);
  box-shadow: 0 0 0 2px var(--cyan), 0 0 12px rgb(56 189 248 / 0.9);
}

/* Blueprint System Visual */
.sys {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  background: rgb(10 22 40 / 0.72);
}
@media (min-width: 520px) {
  .sys { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 20px; }
}
.sys .frame { position: absolute; inset: 0; pointer-events: none; }
.m .face {
  position: relative;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0.45;
  transition: opacity 0.35s, border-color 0.35s, box-shadow 0.35s;
}
.m .mh { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; color: var(--hot); }
.m .mh b { font-family: var(--font-mono); color: var(--cryo); }
[data-step="0"] .m1 .face,
[data-step="1"] .m1 .face, [data-step="1"] .m2 .face,
[data-step="2"] .m1 .face, [data-step="2"] .m2 .face, [data-step="2"] .m3 .face,
[data-step="3"] .m .face {
  opacity: 1;
  border-color: rgb(56 189 248 / 0.55);
  box-shadow: 0 0 24px rgb(14 165 233 / 0.14);
}
.mod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mod-grid span { height: 22px; border: 1px dashed rgb(56 189 248 / 0.4); }
.mod-bars { display: grid; gap: 6px; }
.mod-bars i { display: block; height: 7px; width: var(--w); background: var(--cyan); }
.mod-stages { display: flex; gap: 8px; }
.mod-stages i { flex: 1; height: 10px; background: var(--line); }
.mod-stages i.on { background: var(--brass); }
.mod-pulse svg { width: 100%; height: 34px; }
.mod-pulse .base { fill: none; stroke: rgb(186 230 253 / 0.25); stroke-width: 1.5; }
.mod-pulse .run { fill: none; stroke: var(--cryo); stroke-width: 2; }

/* ABOUT */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; align-items: start; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1.1fr 0.9fr; } }
.about-copy { display: grid; gap: 16px; }
.about-body { font-size: 16px; color: var(--paper-muted); max-width: 60ch; }
.credentials {
  padding: 28px;
  background: #fff;
  border: 1px solid var(--paper-line);
  box-shadow: 0 18px 42px rgb(10 22 40 / 0.06);
}
.cred-head { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--paper-line); margin-bottom: 18px; }
.cred-head strong { display: block; color: var(--paper-ink); font-size: 16px; }
.cred-head span { font-size: 13px; color: var(--paper-accent); font-weight: 600; }
.cred-list { display: grid; gap: 14px; margin: 0; }
.cred-list dt { font-size: 12.5px; color: var(--paper-muted); margin-bottom: 2px; }
.cred-list dd { margin: 0; font-size: 15.5px; font-weight: 600; color: var(--paper-ink); }

/* QUOTE BUILDER */
.quote-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
@media (min-width: 960px) { .quote-grid { grid-template-columns: 1.15fr 0.85fr; } }
.quote-form, .quote-preview {
  min-width: 0;
  padding: clamp(20px, 3vw, 30px);
  background: rgb(7 17 30 / 0.78);
  border: 1px solid rgb(186 230 253 / 0.22);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
.field-group { display: grid; gap: 8px; }
.field-row { display: grid; gap: 16px; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field-label { font-size: 14px; font-weight: 600; color: var(--hot); }
.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.type-pill {
  padding: 8px 13px;
  border: 1px solid rgb(186 230 253 / 0.24);
  background: rgb(14 29 50 / 0.65);
  color: var(--ice);
  font-size: 13.5px;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.type-pill.is-active {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #041322;
  font-weight: 700;
}
.field {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 15.5px;
  color: var(--hot);
  background: rgb(5 12 22 / 0.72);
  border: 1px solid rgb(186 230 253 / 0.24);
}
.field::placeholder { color: rgb(147 171 199 / 0.68); }
.field:focus { outline: none; border-color: var(--cryo); box-shadow: 0 0 0 3px rgb(56 189 248 / 0.25); }
.form-hint { font-size: 13.5px; color: var(--brass); min-height: 20px; }

.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.preview-head .mono { font-size: 11.5px; color: var(--cryo); }
.copy-btn {
  padding: 6px 12px;
  border: 1px solid rgb(186 230 253 / 0.28);
  font-size: 12.5px;
  color: var(--hot);
  background: rgb(14 29 50 / 0.8);
}
.preview-body {
  margin: 0;
  padding: 16px;
  background: rgb(5 12 22 / 0.78);
  border: 1px solid rgb(186 230 253 / 0.14);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ice);
  white-space: pre-wrap;
  min-height: 160px;
}
.preview-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.preview-actions .btn { flex: 1 1 180px; }

/* CONTACT & FOOTER */
.contact { background: var(--obsidian); border-top: 1px solid var(--line); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 0.9fr 1.1fr; } }
.contact-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.c-card {
  padding: 20px;
  background: var(--night);
  border: 1px solid var(--line);
  display: grid;
  gap: 6px;
  transition: border-color 0.2s;
}
.c-card:hover { border-color: var(--cryo); }
.c-card-wide { grid-column: 1 / -1; }
.c-label { font-size: 13px; color: var(--cryo); font-weight: 600; }
.c-card strong { font-size: 16px; color: var(--hot); }

.site-footer {
  background: #030810;
  border-top: 1px solid var(--line);
  padding-block: 22px;
  font-size: 13.5px;
  color: var(--muted);
}
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--hot); font-weight: 600; }

/* LIGHTBOX DIALOG (modern-web-guidance compliant) */
dialog.lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(94vw, 980px);
  width: 100%;
  margin: auto;
  color: var(--hot);
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.25s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}
@media (prefers-reduced-motion: no-preference) {
  dialog.lightbox { transform: scale(0.95); }
}
dialog.lightbox:modal {
  overscroll-behavior: contain;
}
dialog.lightbox::backdrop {
  background-color: rgb(3 8 16 / 0);
  overflow: hidden;
  overscroll-behavior: contain;
  transition-property: background-color, display, overlay;
  transition-duration: 0.25s;
  transition-behavior: allow-discrete;
}
dialog.lightbox[open]:where(:not([data-closing])) {
  opacity: 1;
  @starting-style { opacity: 0; }
  @media (prefers-reduced-motion: no-preference) {
    transform: scale(1);
    @starting-style { transform: scale(0.95); }
  }
}
dialog.lightbox[open]:where(:not([data-closing]))::backdrop {
  background-color: rgb(3 8 16 / 0.86);
  @starting-style { background-color: rgb(3 8 16 / 0); }
}
.lightbox-shell {
  background: var(--night);
  border: 1px solid rgb(56 189 248 / 0.35);
  padding: 18px;
  display: grid;
  gap: 14px;
}
.lightbox-top { display: flex; align-items: center; justify-content: space-between; }
.lb-close {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--dusk); color: var(--hot);
}
.lightbox-media {
  background: #030810;
  height: min(68dvh, 560px);
  display: grid;
  place-items: center;
}
.lightbox-media img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.lightbox-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.lightbox-title { font-size: 18px; }
.lightbox-nav { display: flex; gap: 8px; }

/* Reveal motion */
.js [data-lock] {
  opacity: 0;
  transform: translate(calc(var(--dir) * -16px), 16px);
  transition: opacity 0.52s var(--ease-out), transform 0.52s var(--ease);
  transition-delay: calc(var(--d, 0) * 65ms);
}
.js [data-lock].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js [data-lock] { opacity: 1; transform: none; transition: none; }
  [data-settle] { animation: none; }
  dialog.lightbox { transition-duration: 0.1s; }
}
.motion-paused *, .motion-paused *::before, .motion-paused *::after {
  animation-play-state: paused !important;
}
