:root {
  --paper: #f2eee3;
  --paper-2: #e9e2d1;
  --paper-3: #fbf8ee;
  --ink: #111711;
  --ink-2: #223028;
  --green: #0b6e4f;
  --green-2: #0f8b62;
  --terracotta: #bc432e;
  --gold: #9a7b2f;
  --mist: rgba(17, 23, 17, 0.1);
  --muted: rgba(17, 23, 17, 0.64);
  --white: #ffffff;
  --shadow: 0 18px 60px rgba(17, 23, 17, 0.18);
  --header-h: 76px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Noto Kufi Arabic", system-ui, sans-serif;
  line-height: 1.5;
  letter-spacing: 0;
}

body[dir="rtl"],
html[dir="rtl"] body {
  font-family: "Noto Kufi Arabic", "Noto Naskh Arabic", Inter, system-ui, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

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

img {
  display: block;
  max-width: 100%;
}

.skip-link,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  width: auto;
  height: auto;
  clip: auto;
  margin: 1rem;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--paper);
  z-index: 1000;
}

.site-header {
  position: fixed;
  top: 0;
  inset-inline: 0;
  height: var(--header-h);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 2rem;
  color: var(--paper-3);
  background: rgba(17, 23, 17, 0.28);
  border-bottom: 1px solid rgba(242, 238, 227, 0.18);
  backdrop-filter: blur(18px);
}

.site-header.is-scrolled {
  color: var(--ink);
  background: rgba(242, 238, 227, 0.92);
  border-bottom-color: var(--mist);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: max-content;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: inline-block;
  flex: 0 0 auto;
  /* Match the SVG tile fill so any anti-alias seams from the rotated
     star geometry don't reveal the header background through the mark. */
  background: #0A2A22;
  border-radius: 1px;
  overflow: hidden;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-copy {
  display: grid;
  gap: 0.1rem;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-copy small {
  font-size: 0.74rem;
  color: currentColor;
  opacity: 0.92;
  font-weight: 500;
  letter-spacing: 0.01em;
  display: block;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-size: 0.88rem;
}

.desktop-nav a {
  opacity: 0.88;
}

.desktop-nav a:hover {
  opacity: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.lang-toggle,
.menu-toggle,
.icon-button,
.chat-launcher,
.chat-chips button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.lang-toggle {
  padding: 0.7rem 0.8rem;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-size: 0.82rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: 6px;
  padding: 0.86rem 1rem;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.9rem;
  min-height: 44px;
  cursor: pointer;
}

.button-dark {
  background: var(--ink);
  color: var(--paper-3);
}

.button-light {
  background: var(--paper-3);
  color: var(--ink);
}

.button-ghost-light {
  border-color: rgba(242, 238, 227, 0.64);
  color: var(--paper-3);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid currentColor;
  border-radius: 6px;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  margin: 4px auto;
}

.mobile-nav {
  display: none;
}

.hero {
  min-height: 86vh;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-items: end;
  padding: calc(var(--header-h) + 4rem) 2rem 5.5rem;
  color: var(--paper-3);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -5;
  background-image: url("/hero-madinah.jpg");
  background-size: cover;
  background-position: center;
  transform: scale(1.04);
  animation: heroDrift 28s ease-in-out infinite alternate;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  opacity: 0.68;
  mix-blend-mode: screen;
  pointer-events: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(17, 23, 17, 0.92), rgba(17, 23, 17, 0.64) 48%, rgba(17, 23, 17, 0.28)),
    linear-gradient(0deg, rgba(17, 23, 17, 0.82), rgba(17, 23, 17, 0.08) 48%, rgba(17, 23, 17, 0.56));
  transition: background 8s ease;
}

.hero[data-tod="dawn"] .hero-overlay {
  background:
    linear-gradient(90deg, rgba(28, 18, 24, 0.86), rgba(40, 28, 32, 0.6) 48%, rgba(70, 40, 32, 0.32)),
    linear-gradient(0deg, rgba(28, 18, 24, 0.82), rgba(70, 50, 60, 0.12) 48%, rgba(120, 70, 60, 0.36));
}
.hero[data-tod="dusk"] .hero-overlay {
  background:
    linear-gradient(90deg, rgba(40, 18, 14, 0.88), rgba(60, 30, 20, 0.58) 48%, rgba(120, 60, 38, 0.32)),
    linear-gradient(0deg, rgba(40, 18, 14, 0.82), rgba(80, 40, 28, 0.14) 48%, rgba(140, 80, 56, 0.4));
}
.hero[data-tod="day"] .hero-overlay {
  background:
    linear-gradient(90deg, rgba(20, 28, 36, 0.82), rgba(28, 40, 50, 0.5) 48%, rgba(50, 70, 84, 0.22)),
    linear-gradient(0deg, rgba(20, 28, 36, 0.78), rgba(40, 60, 76, 0.08) 48%, rgba(40, 60, 76, 0.4));
}

html[dir="rtl"] .hero-overlay {
  background:
    linear-gradient(270deg, rgba(17, 23, 17, 0.92), rgba(17, 23, 17, 0.64) 48%, rgba(17, 23, 17, 0.28)),
    linear-gradient(0deg, rgba(17, 23, 17, 0.82), rgba(17, 23, 17, 0.08) 48%, rgba(17, 23, 17, 0.56));
}

.hero-glyph {
  position: absolute;
  inset-inline-end: 1rem;
  top: 7rem;
  z-index: -2;
  font-family: "Noto Kufi Arabic", sans-serif;
  font-size: 25rem;
  line-height: 1;
  color: rgba(242, 238, 227, 0.08);
  pointer-events: none;
  user-select: none;
}

.hero-inner {
  max-width: 940px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 1rem;
  color: var(--terracotta);
  font-weight: 800;
  font-size: 0.86rem;
}

.hero .eyebrow {
  color: #f2c089;
}

h1,
h2,
h3,
p {
  margin-block-start: 0;
}

h1,
h2 {
  font-family: Fraunces, "Noto Naskh Arabic", serif;
  font-weight: 650;
  line-height: 1.02;
  letter-spacing: 0;
}

h1 {
  font-size: 5.8rem;
  max-width: 11ch;
  margin-block-end: 1.25rem;
}

h2 {
  font-size: 3.8rem;
  margin-block-end: 1rem;
}

h3 {
  font-size: 1.05rem;
  margin-block-end: 0.65rem;
}

.hero-lede {
  max-width: 760px;
  color: rgba(251, 248, 238, 0.82);
  font-size: 1.22rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.fact-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--ink);
  color: var(--paper-3);
  border-block: 1px solid rgba(242, 238, 227, 0.16);
}

.fact {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  min-height: 122px;
  padding: 1.5rem 2rem;
  border-inline-end: 1px solid rgba(242, 238, 227, 0.16);
}

.fact:last-child {
  border-inline-end: 0;
}

.fact-k {
  font-family: Fraunces, serif;
  font-size: 3.6rem;
  line-height: 1;
  color: var(--paper);
}

.fact-l {
  color: rgba(251, 248, 238, 0.7);
  font-size: 0.92rem;
}

.section {
  padding: 6.5rem 2rem;
}

.section-head {
  max-width: 960px;
  margin-bottom: 2.5rem;
}

.section-head p,
.section-lede,
.intro-copy p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.8;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);
  gap: 4rem;
  align-items: start;
}

.intro {
  background: var(--paper-3);
  border-bottom: 1px solid var(--mist);
}

.intro-copy {
  max-width: 720px;
}

.mission-vision {
  background: var(--paper);
  border-bottom: 1px solid var(--mist);
}

.mission-grid,
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--mist);
  border-left: 1px solid var(--mist);
}

html[dir="rtl"] .mission-grid,
html[dir="rtl"] .why-grid {
  border-left: 0;
  border-right: 1px solid var(--mist);
}

.mission-grid article,
.why-grid article {
  min-height: 260px;
  padding: 1.6rem;
  background: rgba(251, 248, 238, 0.72);
  border-right: 1px solid var(--mist);
  border-bottom: 1px solid var(--mist);
}

html[dir="rtl"] .mission-grid article,
html[dir="rtl"] .why-grid article {
  border-right: 0;
  border-left: 1px solid var(--mist);
}

.mission-grid h3,
.why-grid h3 {
  margin-top: 2rem;
  font-size: 1.55rem;
  line-height: 1.2;
  font-family: Fraunces, "Noto Naskh Arabic", serif;
  font-weight: 500;
}

.mission-grid p,
.why-grid p {
  color: var(--muted);
}

.why-grid p {
  font-size: 1.05rem;
  line-height: 1.6;
  margin-top: 0.7rem;
}

.why-grid article {
  padding: 2.1rem 1.9rem;
  min-height: 280px;
}

.values-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.2rem;
}

.values-strip span {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--mist);
  background: var(--paper-3);
  border-radius: 6px;
  color: var(--ink-2);
  font-weight: 800;
  font-size: 0.84rem;
}

.delivery {
  background: var(--paper);
}

.delivery-rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--mist);
  background: var(--paper-3);
}

.delivery-step {
  min-height: 310px;
  padding: 2rem;
  border-inline-end: 1px solid var(--mist);
  display: flex;
  flex-direction: column;
}

.delivery-step:last-child {
  border-inline-end: 0;
}

.step-num {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--green);
  color: var(--green);
  margin-bottom: auto;
  font-weight: 800;
  font-size: 0.8rem;
}

.delivery-step h3 {
  margin-top: 2rem;
  font-size: 1.35rem;
}

.delivery-step p {
  color: var(--muted);
}

.architecture {
  background: var(--ink);
  color: var(--paper-3);
  position: relative;
  overflow: hidden;
}

.architecture::before {
  content: "";
  position: absolute;
  inset-inline-start: -14rem;
  top: -14rem;
  width: 34rem;
  height: 34rem;
  opacity: 0.16;
  border: 1px solid rgba(242, 238, 227, 0.28);
  background: repeating-conic-gradient(from 22deg, transparent 0deg 14deg, rgba(242, 238, 227, 0.45) 14deg 15deg);
  transform: rotate(45deg);
  animation: geometricTurn 52s linear infinite reverse;
}

.architecture .section-kicker {
  color: #f2c089;
}

.architecture .section-lede {
  color: rgba(251, 248, 238, 0.7);
}

.stack-diagram {
  position: relative;
  display: grid;
  gap: 0.55rem;
}

.stack-layer {
  border: 1px solid rgba(251, 248, 238, 0.18);
  background: rgba(251, 248, 238, 0.08);
  padding: 1.15rem;
  display: grid;
  gap: 0.35rem;
}

.stack-layer span {
  font-weight: 800;
}

.stack-layer small {
  color: rgba(251, 248, 238, 0.62);
}

.stack-secure {
  background: rgba(11, 110, 79, 0.3);
  border-color: rgba(15, 139, 98, 0.7);
}

.solutions {
  background: var(--paper-3);
}

.solution-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--mist);
  border-left: 1px solid var(--mist);
}

html[dir="rtl"] .solution-grid {
  border-left: 0;
  border-right: 1px solid var(--mist);
}

.solution-card {
  min-height: 320px;
  padding: 2rem 1.9rem 2rem;
  background: var(--paper-3);
  border-right: 1px solid var(--mist);
  border-bottom: 1px solid var(--mist);
  position: relative;
  overflow: hidden;
}

html[dir="rtl"] .solution-card {
  border-right: 0;
  border-left: 1px solid var(--mist);
}

.solution-card::after {
  content: "";
  position: absolute;
  width: 8rem;
  height: 8rem;
  inset-inline-end: -4rem;
  bottom: -4rem;
  background: radial-gradient(circle, rgba(11, 110, 79, 0.18), transparent 65%);
}

.solution-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  color: var(--terracotta);
  border: 1.5px solid rgba(188, 67, 46, 0.35);
  background: rgba(188, 67, 46, 0.04);
  margin-bottom: 1.8rem;
  font-size: 1.85rem;
  line-height: 1;
}

.solution-card h3 {
  font-size: 1.5rem;
  line-height: 1.2;
  margin-bottom: 0.7rem;
}

.solution-card p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.capability-library {
  background: var(--paper);
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--mist);
  border-left: 1px solid var(--mist);
}

html[dir="rtl"] .capability-grid {
  border-left: 0;
  border-right: 1px solid var(--mist);
}

.capability-card {
  min-height: 190px;
  padding: 1.35rem;
  background: rgba(251, 248, 238, 0.78);
  border-right: 1px solid var(--mist);
  border-bottom: 1px solid var(--mist);
  /* Hard isolate each card so cap-demo SVGs and reveal transforms can never
     bleed into siblings. Without this, mobile (single-column 1fr) renders
     can show text from later cards behind the focused one. */
  position: relative;
  isolation: isolate;
  contain: layout paint;
  min-width: 0;
}

html[dir="rtl"] .capability-card {
  border-right: 0;
  border-left: 1px solid var(--mist);
}

.capability-group {
  display: inline-flex;
  margin-bottom: 1.1rem;
  color: var(--terracotta);
  font-weight: 800;
  font-size: 0.72rem;
}

.capability-card h3 {
  font-size: 1.12rem;
  margin-bottom: 0.55rem;
}

.capability-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.madinah {
  min-height: 680px;
  background: var(--paper-2);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.82fr);
  gap: 4rem;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.madinah-map {
  margin: 0;
  position: relative;
}

.map-frame {
  position: relative;
  border: 1px solid rgba(17, 23, 17, 0.55);
  background:
    radial-gradient(circle at 24% 49%, rgba(15, 139, 98, 0.10), transparent 38%),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(17, 23, 17, 0.04) 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(17, 23, 17, 0.04) 23px 24px),
    var(--paper-3);
  padding: 1.25rem 1.25rem 1rem;
  box-shadow:
    inset 0 0 0 4px var(--paper-3),
    inset 0 0 0 5px rgba(17, 23, 17, 0.55),
    0 24px 60px rgba(17, 23, 17, 0.18);
}

.map-frame::before,
.map-frame::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(17, 23, 17, 0.7);
}
.map-frame::before { top: 10px; inset-inline-start: 10px; border-inline-end: 0; border-bottom: 0; }
.map-frame::after  { bottom: 10px; inset-inline-end: 10px; border-inline-start: 0; border-top: 0; }

.map-svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

.map-country-fill { opacity: 0.9; }
.map-country-outline {
  stroke-dasharray: 2400;
  stroke-dashoffset: 2400;
  animation: mapDraw 2.4s ease-out 0.2s forwards;
}

.map-route {
  stroke-dasharray: 0 6;
  opacity: 0;
  animation: mapRoute 1.2s ease-out forwards;
  animation-delay: var(--route-delay, 0s);
}

.madinah-glow-circle {
  transform-origin: 237px 341px;
  animation: madinahPulse 4.6s ease-in-out infinite;
}

.sweep-ring {
  transform-origin: 237px 341px;
  opacity: 0;
  animation: mapSweep 4.2s linear infinite;
}
.sweep-ring-1 { animation-delay: 0s; }
.sweep-ring-2 { animation-delay: 1.4s; }
.sweep-ring-3 { animation-delay: 2.8s; }

.map-cities text {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  fill: rgba(17, 23, 17, 0.85);
  pointer-events: none;
}

.map-city-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.map-city-coord {
  font-size: 8.5px;
  letter-spacing: 0.04em;
  fill: rgba(17, 23, 17, 0.55);
}

.map-city-primary .map-city-name {
  fill: var(--green);
  font-size: 12px;
  letter-spacing: 0.16em;
}

.map-city circle:nth-of-type(1) {
  transform-origin: center;
  animation: cityRing 3.4s ease-out infinite;
}

.map-city-primary circle:nth-of-type(1) {
  animation-duration: 2.2s;
}

.map-scale-tick {
  font-size: 8px;
  letter-spacing: 0.1em;
  fill: rgba(17, 23, 17, 0.6);
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

.map-meta {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(17, 23, 17, 0.74);
  z-index: 2;
}

.map-meta-tl { top: 1.5rem; inset-inline-start: 1.6rem; }
.map-meta-tr { top: 1.2rem; inset-inline-end: 1.4rem; color: rgba(17, 23, 17, 0.6); }
.map-meta-bl { bottom: 1.2rem; inset-inline-start: 1.6rem; }

.map-meta-line {
  font-weight: 700;
}

.map-meta-mono {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-weight: 500;
  font-size: 0.65rem;
  color: rgba(17, 23, 17, 0.58);
  letter-spacing: 0.18em;
}

.map-status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--green-2);
  margin-right: 0.45rem;
  vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(15, 139, 98, 0.55);
  animation: statusPulse 1.8s ease-out infinite;
}

@keyframes mapDraw {
  to { stroke-dashoffset: 0; }
}

@keyframes mapRoute {
  0%   { opacity: 0; stroke-dasharray: 0 6; }
  60%  { opacity: 0.85; }
  100% { opacity: 0.7; stroke-dasharray: 4 4; }
}

@keyframes madinahPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.08); }
}

@keyframes mapSweep {
  0%   { r: 14; opacity: 0.0; }
  10%  { opacity: 0.55; }
  100% { r: 320; opacity: 0; }
}

/* Older browsers ignore the r interpolation in @keyframes; CSS handles transform fallback */
@supports not (r: 14) {
  .sweep-ring { animation: mapSweepFallback 4.2s linear infinite; }
  @keyframes mapSweepFallback {
    0%   { transform: scale(0.05); opacity: 0; }
    10%  { opacity: 0.55; }
    100% { transform: scale(2.4); opacity: 0; }
  }
}

@keyframes cityRing {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 0.95; transform: scale(1.2); }
}

@keyframes statusPulse {
  0%   { box-shadow: 0 0 0 0 rgba(15, 139, 98, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(15, 139, 98, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 139, 98, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .map-country-outline,
  .map-route,
  .madinah-glow-circle,
  .sweep-ring,
  .map-city circle:nth-of-type(1),
  .map-status-dot {
    animation: none;
  }
  .map-country-outline { stroke-dashoffset: 0; }
  .map-route { opacity: 0.7; stroke-dasharray: 4 4; }
}

.madinah-content {
  max-width: 720px;
}

.madinah-content p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.8;
}

.route-list {
  display: grid;
  gap: 0.6rem;
  margin-top: 2rem;
}

.route-list span {
  padding: 0.95rem 1rem;
  border: 1px solid var(--mist);
  background: rgba(251, 248, 238, 0.58);
  font-weight: 800;
}

.partners {
  background:
    radial-gradient(circle at 6% 0%, rgba(15, 139, 98, 0.05), transparent 38%),
    radial-gradient(circle at 100% 100%, rgba(154, 123, 47, 0.06), transparent 40%),
    var(--paper);
  position: relative;
}

.partners-head {
  max-width: 880px;
  margin-bottom: 2.5rem;
}

.partners-tier {
  margin-bottom: 2rem;
  position: relative;
}

.partners-tier-label {
  display: inline-block;
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: var(--terracotta);
  padding: 0.32rem 0.6rem;
  border: 1px solid rgba(188, 67, 46, 0.32);
  background: rgba(188, 67, 46, 0.04);
  margin-bottom: 1rem;
}

.partners-grid {
  display: grid;
  gap: 0;
  border: 1px solid rgba(17, 23, 17, 0.18);
  background: var(--paper-3);
}

.partners-grid-cat   { grid-template-columns: repeat(3, 1fr); }
.partners-grid-named { grid-template-columns: repeat(4, 1fr); }

.partner-cell {
  position: relative;
  padding: 1.4rem 1.2rem 1.3rem;
  border-inline-end: 1px solid rgba(17, 23, 17, 0.14);
  border-bottom: 1px solid rgba(17, 23, 17, 0.14);
  background: var(--paper-3);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: background 0.4s ease, transform 0.3s ease;
}

.partner-cell:hover {
  background: rgba(188, 67, 46, 0.04);
}

/* outer-edge dedup — kill the right border on the rightmost cell of each row */
.partners-grid-cat .partner-cell:nth-child(3n)   { border-inline-end: 0; }
.partners-grid-named .partner-cell:nth-child(4n) { border-inline-end: 0; }
/* kill bottom border on last row */
.partners-grid-cat .partner-cell:nth-last-child(-n+3)   { border-bottom: 0; }
.partners-grid-named .partner-cell:nth-last-child(-n+4) { border-bottom: 0; }

.partner-cell::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 26px;
  height: 2px;
  background: var(--accent, var(--ink));
}

.partner-cat   { --accent: var(--green); }
.partner-named { --accent: var(--terracotta); }

.partner-mark {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 0.4rem;
  display: inline-block;
}

.partner-cell h4 {
  margin: 0;
  font-family: Fraunces, "Noto Naskh Arabic", serif;
  font-size: 1.18rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
}

.partner-cat h4 {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.partner-cell p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
}

.partners-foot {
  margin: 1.6rem 0 0;
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  max-width: 760px;
  border-inline-start: 2px solid var(--terracotta);
  padding: 0.5rem 0 0.5rem 1rem;
}

html[dir="rtl"] .partners-foot {
  padding: 0.5rem 1rem 0.5rem 0;
}

@media (max-width: 1100px) {
  .partners-grid-cat,
  .partners-grid-named { grid-template-columns: repeat(2, 1fr); }
  .partners-grid-cat .partner-cell:nth-child(3n)   { border-inline-end: 1px solid rgba(17, 23, 17, 0.14); }
  .partners-grid-cat .partner-cell:nth-child(2n)   { border-inline-end: 0; }
  .partners-grid-named .partner-cell:nth-child(4n) { border-inline-end: 1px solid rgba(17, 23, 17, 0.14); }
  .partners-grid-named .partner-cell:nth-child(2n) { border-inline-end: 0; }
}

@media (max-width: 760px) {
  .partners-grid-cat,
  .partners-grid-named { grid-template-columns: 1fr; }
  .partner-cell { border-inline-end: 0 !important; }
}

.use-cases {
  background: var(--ink);
  color: var(--paper-3);
}

.use-cases .section-kicker {
  color: #f2c089;
}

.use-cases .section-head p {
  color: rgba(251, 248, 238, 0.7);
}

.use-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(251, 248, 238, 0.18);
  border-left: 1px solid rgba(251, 248, 238, 0.18);
}

html[dir="rtl"] .use-grid {
  border-left: 0;
  border-right: 1px solid rgba(251, 248, 238, 0.18);
}

.use-grid article {
  min-height: 210px;
  padding: 1.6rem;
  border-right: 1px solid rgba(251, 248, 238, 0.18);
  border-bottom: 1px solid rgba(251, 248, 238, 0.18);
  background: rgba(251, 248, 238, 0.06);
}

html[dir="rtl"] .use-grid article {
  border-right: 0;
  border-left: 1px solid rgba(251, 248, 238, 0.18);
}

.use-grid h3 {
  color: var(--paper-3);
  font-size: 1.12rem;
}

.use-grid p {
  color: rgba(251, 248, 238, 0.66);
}

.why-bost {
  background: var(--paper-3);
}

.why-grid {
  grid-template-columns: repeat(4, 1fr);
}

.why-grid article {
  min-height: 220px;
}

.team {
  background:
    linear-gradient(90deg, rgba(17, 23, 17, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(17, 23, 17, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 42px 42px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--mist);
  border-left: 1px solid var(--mist);
}

html[dir="rtl"] .team-grid {
  border-left: 0;
  border-right: 1px solid var(--mist);
}

.team-card {
  min-height: 360px;
  padding: 1.4rem;
  background: rgba(251, 248, 238, 0.76);
  border-right: 1px solid var(--mist);
  border-bottom: 1px solid var(--mist);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

html[dir="rtl"] .team-card {
  border-right: 0;
  border-left: 1px solid var(--mist);
}

.team-avatar {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper-3);
  border-radius: 8px;
  font-family: Fraunces, "Noto Naskh Arabic", serif;
  font-size: 1.7rem;
  font-weight: 650;
}

.team-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.team-role {
  margin: -0.55rem 0 0;
  color: var(--terracotta);
  font-weight: 800;
  font-size: 0.85rem;
}

.team-card p {
  color: var(--muted);
  font-size: 0.92rem;
}

.team-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: auto;
}

.team-actions a,
.team-actions span {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--mist);
  font-size: 0.82rem;
  font-weight: 800;
}

.team-actions a {
  background: var(--ink);
  color: var(--paper-3);
  border-color: var(--ink);
}

.team-actions span {
  color: var(--muted);
}

.contact {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(360px, 0.75fr);
  gap: 4rem;
  background: var(--paper-3);
  align-items: start;
}

.contact-copy p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.8;
}

.contact-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.6rem;
}

.contact-lines a,
.contact-lines span {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  border: 1px solid var(--mist);
  padding: 0.75rem 0.9rem;
  border-radius: 6px;
  font-weight: 800;
}

.contact-lines span {
  color: var(--muted);
  background: var(--paper);
}

.reveal-item {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition:
    opacity 620ms ease var(--reveal-delay, 0ms),
    transform 620ms ease var(--reveal-delay, 0ms);
}

.reveal-item.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1.2rem;
  border: 1px solid var(--mist);
  background: var(--paper);
}

.contact-form label {
  display: grid;
  gap: 0.4rem;
}

.contact-form label span {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--ink-2);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(17, 23, 17, 0.18);
  border-radius: 6px;
  background: var(--paper-3);
  color: var(--ink);
  padding: 0.75rem;
}

.contact-form textarea {
  resize: vertical;
}

.full {
  grid-column: 1 / -1;
}

.form-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  padding: 2rem;
  background: var(--ink);
  color: var(--paper-3);
  border-top: 1px solid rgba(251, 248, 238, 0.14);
}

.site-footer p,
.footer-meta {
  color: rgba(251, 248, 238, 0.66);
  margin: 0.45rem 0 0;
  font-size: 0.86rem;
}

.footer-meta {
  display: grid;
  gap: 0.25rem;
  text-align: end;
  max-width: 480px;
}

.chatbot {
  position: fixed;
  inset-inline-end: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
}

.chat-launcher {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  background: var(--green);
  color: var(--paper-3);
  box-shadow: var(--shadow);
  font-weight: 800;
}

.chat-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #84f1b8;
}

.chat-panel {
  position: absolute;
  inset-inline-end: 0;
  bottom: 4rem;
  width: min(400px, calc(100vw - 2rem));
  max-height: min(680px, calc(100vh - 7rem));
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr) auto auto auto;
  background: var(--paper-3);
  color: var(--ink);
  border: 1px solid rgba(17, 23, 17, 0.16);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.chat-panel[hidden] {
  display: none;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: var(--ink);
  color: var(--paper-3);
}

.chat-head small {
  display: block;
  color: rgba(251, 248, 238, 0.66);
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-size: 1.2rem;
}

.chat-messages {
  overflow: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.message {
  max-width: 88%;
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--mist);
  background: var(--paper);
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.message.user {
  align-self: flex-end;
  background: var(--green);
  color: var(--paper-3);
  border-color: var(--green);
}

html[dir="rtl"] .message.user {
  align-self: flex-start;
}

.chat-chips {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.75rem 1rem 0;
}

.chat-chips button {
  flex: 0 0 auto;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--mist);
  border-radius: 6px;
  background: var(--paper);
  font-size: 0.8rem;
  color: var(--ink);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  padding: 0.75rem 1rem;
}

.chat-form textarea {
  resize: none;
  min-height: 46px;
  max-height: 120px;
  border: 1px solid var(--mist);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  padding: 0.7rem;
}

.send-button {
  align-self: end;
  background: var(--ink);
  color: var(--paper-3);
  border-color: var(--ink);
}

.chat-note {
  margin: 0;
  padding: 0 1rem 1rem;
  color: var(--muted);
  font-size: 0.76rem;
}

html[dir="rtl"] .desktop-nav,
html[dir="rtl"] .hero-actions,
html[dir="rtl"] .contact-lines,
html[dir="rtl"] .chat-chips {
  direction: rtl;
}

@media (max-width: 1100px) {
  .desktop-nav,
  .header-actions .button {
    display: none;
  }

  .menu-toggle {
    display: inline-block;
  }

  .mobile-nav {
    position: fixed;
    top: var(--header-h);
    inset-inline: 0;
    z-index: 70;
    display: none;
    grid-template-columns: 1fr;
    background: rgba(242, 238, 227, 0.96);
    color: var(--ink);
    border-bottom: 1px solid var(--mist);
    padding: 0.5rem 2rem 1rem;
  }

  .mobile-nav.is-open {
    display: grid;
  }

  .mobile-nav a {
    padding: 1rem 0;
    border-bottom: 1px solid var(--mist);
    font-weight: 800;
  }

  h1 {
    font-size: 4.5rem;
  }

  h2 {
    font-size: 3.1rem;
  }

  .split,
  .madinah,
  .contact {
    grid-template-columns: 1fr;
  }

  /* On narrow viewports the madinah section collapses to one column.
     The map is first in source order; force the title/content above it. */
  .madinah-content { order: 0; }
  .madinah-map { order: 1; }

  .delivery-rail,
  .solution-grid,
  .use-grid,
  .mission-grid,
  .why-grid,
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 760px) {
  .site-header {
    padding: 0 1rem;
  }

  .brand-copy small {
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    opacity: 0.7;
  }

  .hero {
    min-height: 88vh;
    padding: calc(var(--header-h) + 2rem) 1rem 3rem;
  }

  .hero-glyph {
    font-size: 13rem;
  }

  h1 {
    font-size: 3.2rem;
  }

  h2 {
    font-size: 2.35rem;
  }

  .hero-lede,
  .section-head p,
  .section-lede,
  .intro-copy p,
  .madinah-content p,
  .contact-copy p {
    font-size: 1rem;
  }

  .section {
    padding: 4rem 1rem;
  }

  .fact-band,
  .delivery-rail,
  .solution-grid,
  .use-grid,
  .mission-grid,
  .why-grid,
  .team-grid,
  .partner-list,
  .contact-form {
    grid-template-columns: 1fr;
  }

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

  .fact {
    border-inline-end: 0;
    border-bottom: 1px solid rgba(242, 238, 227, 0.16);
  }

  .fact:last-child {
    border-bottom: 0;
  }

  .delivery-step,
  .solution-card,
  .mission-grid article,
  .why-grid article,
  .capability-card,
  .use-grid article,
  .team-card {
    min-height: auto;
    border-inline-end: 0;
  }

  /* Fully opaque on mobile — alpha-blended cards over a 1fr column let
     reveal-animation transforms briefly overlap visually. */
  .capability-card {
    background: var(--paper-3);
  }

  .madinah-map {
    min-height: 360px;
  }

  .contact {
    gap: 2rem;
  }

  .site-footer {
    display: grid;
  }

  .footer-meta {
    text-align: start;
  }

  .chatbot {
    inset-inline-end: 0.75rem;
    bottom: 0.75rem;
  }

  .chat-launcher {
    width: 54px;
    min-width: 54px;
    padding: 0;
    justify-content: center;
  }

  .chat-launcher [data-i18n] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

@keyframes heroDrift {
  from {
    transform: scale(1.04) translate3d(0, 0, 0);
    filter: saturate(0.95) contrast(1);
  }
  to {
    transform: scale(1.08) translate3d(-1.6%, 1%, 0);
    filter: saturate(1.08) contrast(1.06);
  }
}

@keyframes geometricTurn {
  from {
    transform: rotate(45deg);
  }
  to {
    transform: rotate(405deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  .hero-canvas {
    display: none;
  }

  .reveal-item {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* === Hero mission console HUD === */
.hero-hud {
  position: absolute;
  top: calc(var(--header-h) + 0.85rem);
  inset-inline: 1.6rem;
  z-index: 3;
  display: grid;
  grid-template-columns: 1.4fr 1.1fr 0.95fr 1.1fr 1fr 0.9fr;
  gap: 0;
  border: 1px solid rgba(242, 238, 227, 0.22);
  background: rgba(10, 14, 11, 0.55);
  backdrop-filter: blur(10px);
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  pointer-events: none;
}

.hud-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 0.55rem 0.9rem;
  border-inline-end: 1px solid rgba(242, 238, 227, 0.14);
  min-height: 56px;
}

.hud-cell:last-child { border-inline-end: 0; }

.hud-label {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: rgba(251, 248, 238, 0.5);
  font-weight: 500;
}

.hud-value {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--paper);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-cell-status {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
}

.hud-cell-stacked .hud-value {
  font-size: 0.78rem;
}

.hud-value-sub {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: rgba(251, 248, 238, 0.62);
  font-weight: 500;
  margin-top: 1px;
}

.footer-dates {
  margin: 0.6rem 0 0;
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: rgba(251, 248, 238, 0.55);
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: baseline;
}

.footer-date-sep { color: rgba(251, 248, 238, 0.3); }

.hud-cell-status .hud-value {
  color: #9be4c5;
}

.hud-pulse {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green-2);
  box-shadow: 0 0 0 0 rgba(15, 139, 98, 0.7);
  animation: statusPulse 1.8s ease-out infinite;
}

/* === Cycling HUD cells (ENV / SIGNAL) ============================ */
/* Mac-LED breathing tile that fades between data feeds.            */

.hud-cell-cycle {
  position: relative;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  overflow: hidden;
}

.hud-cell-cycle .hud-cycle-stage {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
  transition: opacity 600ms ease, transform 600ms ease;
  opacity: 1;
  transform: translateY(0);
}

.hud-cell-cycle.is-fading .hud-cycle-stage {
  opacity: 0;
  transform: translateY(-2px);
}

.hud-cell-cycle .hud-label {
  transition: color 600ms ease;
}

.hud-cell-cycle .hud-value {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
}

.hud-led {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(251, 248, 238, 0.85);
  box-shadow: 0 0 6px rgba(251, 248, 238, 0.55),
              0 0 12px rgba(251, 248, 238, 0.25);
  animation: ledBreath 4s ease-in-out infinite;
}

.hud-cell-cycle:hover .hud-led { animation-play-state: paused; }

@keyframes ledBreath {
  0%, 100% { opacity: 0.40; transform: scale(1); }
  50%      { opacity: 1.00; transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .hud-cell-cycle .hud-cycle-stage { transition: opacity 120ms linear; transform: none; }
  .hud-cell-cycle.is-fading .hud-cycle-stage { transform: none; }
  .hud-led { animation: none; opacity: 0.85; }
}

/* === Prayer progress bar ========================================== */

.hud-prayer-progress {
  display: block;
  width: 100%;
  height: 2px;
  margin-top: 4px;
  background: rgba(251, 248, 238, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.hud-prayer-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green-2), var(--gold));
  border-radius: 999px;
  transition: width 1s linear;
}

/* === Sovereignty band === */
.sovereignty {
  background:
    radial-gradient(circle at 8% 0%, rgba(15, 139, 98, 0.16), transparent 40%),
    radial-gradient(circle at 96% 100%, rgba(188, 67, 46, 0.14), transparent 40%),
    var(--ink);
  color: var(--paper-3);
  position: relative;
  overflow: hidden;
}

.sovereignty::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(242, 238, 227, 0.04) 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(242, 238, 227, 0.04) 31px 32px);
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 50%, transparent 90%);
}

.sovereignty-head {
  position: relative;
  max-width: 760px;
  margin-bottom: 3rem;
}

.section-kicker-light {
  color: #f2c089;
}

.sovereignty h2 {
  color: var(--paper);
}

.sovereignty-head p {
  color: rgba(251, 248, 238, 0.7);
  font-size: 1.08rem;
  line-height: 1.7;
}

.sov-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid rgba(242, 238, 227, 0.18);
  position: relative;
}

.sov-card {
  padding: 1.75rem 1.6rem 1.85rem;
  border-inline-end: 1px solid rgba(242, 238, 227, 0.12);
  border-bottom: 1px solid rgba(242, 238, 227, 0.12);
  background: rgba(242, 238, 227, 0.02);
  transition: background 0.4s ease;
  position: relative;
}

.sov-card:nth-child(3n) { border-inline-end: 0; }
.sov-card:nth-last-child(-n+3) { border-bottom: 0; }

.sov-card:hover {
  background: rgba(15, 139, 98, 0.07);
}

.sov-tag {
  display: inline-block;
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: #f2c089;
  padding: 0.3rem 0.55rem;
  border: 1px solid rgba(242, 192, 137, 0.32);
  margin-bottom: 1.1rem;
}

.sov-card h3 {
  font-family: Fraunces, "Noto Naskh Arabic", serif;
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--paper);
  margin-bottom: 0.7rem;
  font-weight: 500;
}

.sov-card p {
  color: rgba(251, 248, 238, 0.66);
  font-size: 0.95rem;
  line-height: 1.65;
  margin: 0;
}

.sov-note {
  position: relative;
  margin-top: 2.5rem;
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: rgba(251, 248, 238, 0.45);
  max-width: 720px;
  border-left: 2px solid rgba(242, 192, 137, 0.45);
  padding: 0.5rem 0 0.5rem 1rem;
}

html[dir="rtl"] .sov-note {
  border-left: 0;
  border-right: 2px solid rgba(242, 192, 137, 0.45);
  padding: 0.5rem 1rem 0.5rem 0;
}

@media (max-width: 1100px) {
  .sov-grid { grid-template-columns: repeat(2, 1fr); }
  .sov-card:nth-child(3n) { border-inline-end: 1px solid rgba(242, 238, 227, 0.12); }
  .sov-card:nth-child(2n) { border-inline-end: 0; }
  .sov-card:nth-last-child(-n+3) { border-bottom: 1px solid rgba(242, 238, 227, 0.12); }
  .sov-card:nth-last-child(-n+2) { border-bottom: 0; }

  .hero-hud {
    grid-template-columns: 1.4fr 1.2fr 1fr;
    inset-inline: 1rem;
  }
  .hero-hud .hud-cell:nth-child(2),
  .hero-hud .hud-cell:nth-child(4),
  .hero-hud .hud-cell:nth-child(6) { display: none; }
}

/* === Capability demos === */
.capability-card.has-cap-demo { padding-top: 0; overflow: hidden; }

.cap-demo {
  width: calc(100% + 2.4rem);
  margin: 0 -1.2rem 1rem;
  height: 80px;
  background: linear-gradient(180deg, rgba(17, 23, 17, 0.04) 0%, transparent 100%);
  border-bottom: 1px solid rgba(17, 23, 17, 0.10);
  display: block;
}

.cap-demo svg { width: 100%; height: 100%; display: block; }

/* shared atoms */
.cap-edge   { stroke: rgba(17, 23, 17, 0.22); stroke-width: 0.6; }
.cap-node   { fill: var(--ink); }
.cap-frame  { fill: none; stroke: rgba(17, 23, 17, 0.32); stroke-width: 0.7; }
.cap-glyph  {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px;
  fill: var(--ink-2);
}

/* AI: pulse traveling left to right */
.cap-pulse-ai {
  fill: var(--terracotta);
  animation: capPulseAi 2.6s linear infinite;
}
@keyframes capPulseAi {
  0%   { transform: translate(0, 0); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translate(200px, 0); opacity: 0; }
}

/* Builder: blinking cursor */
.cap-cursor { fill: var(--terracotta); animation: capBlink 1.1s steps(2) infinite; }
@keyframes capBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* Data: pipes + flowing tokens */
.cap-pipe { fill: none; stroke: rgba(17, 23, 17, 0.32); stroke-width: 1; }
.cap-pipe-out { stroke: var(--terracotta); stroke-width: 1.2; }
.cap-token { fill: var(--terracotta); }
.cap-token-1 { animation: capTok1 3s linear infinite; }
.cap-token-2 { animation: capTok2 3s linear infinite; }
.cap-token-3 { animation: capTok3 3s linear infinite; }
@keyframes capTok1 { 0% { transform: translate(0,0); opacity:0; } 8%{opacity:1;} 50%{transform:translate(100px,22px);} 100%{transform:translate(200px,22px); opacity:0;} }
@keyframes capTok2 { 0% { transform: translate(0,0); opacity:0; } 8%{opacity:1;} 50%{transform:translate(100px,0);}    100%{transform:translate(200px,0);    opacity:0;} }
@keyframes capTok3 { 0% { transform: translate(0,0); opacity:0; } 8%{opacity:1;} 50%{transform:translate(100px,-22px);} 100%{transform:translate(200px,-22px); opacity:0;} }

/* Twin: grid + breathing core */
.cap-grid { stroke: rgba(17, 23, 17, 0.10); stroke-width: 0.5; }
.cap-twin-core { fill: var(--green); }
.cap-twin-pulse {
  fill: none;
  stroke: var(--green-2);
  stroke-width: 1;
  transform-origin: 100px 40px;
  animation: capTwin 3s ease-out infinite;
}
@keyframes capTwin { 0% { transform: scale(0.5); opacity: 0.8; } 100% { transform: scale(4); opacity: 0; } }

/* Vision: bounding boxes appearing */
.cap-vision-frame { stroke: rgba(17, 23, 17, 0.4); }
.cap-bbox {
  fill: none;
  stroke: var(--terracotta);
  stroke-width: 1;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: capBbox 2.4s ease-in-out infinite;
}
@keyframes capBbox {
  0%   { stroke-dashoffset: 200; opacity: 0; }
  20%  { stroke-dashoffset: 0; opacity: 1; }
  60%  { opacity: 1; }
  80%  { opacity: 0; }
  100% { stroke-dashoffset: 200; opacity: 0; }
}

/* Alerts: expanding rings */
.cap-alert-core { fill: var(--terracotta); }
.cap-alert-ring {
  fill: none;
  stroke: var(--terracotta);
  stroke-width: 1;
  transform-origin: 100px 40px;
  animation: capAlert 1.8s ease-out infinite;
}
@keyframes capAlert {
  0%   { transform: scale(0.5); opacity: 0.8; }
  100% { transform: scale(8); opacity: 0; }
}

/* Stream: dots flowing in lanes */
.cap-lane { stroke: rgba(17, 23, 17, 0.10); stroke-width: 0.5; stroke-dasharray: 2 3; }
.cap-streamdot { fill: var(--green); animation: capStream 2.4s linear infinite; }
@keyframes capStream { 0% { transform: translate(0, 0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translate(220px, 0); opacity: 0; } }

/* Pipeline: stages with traveling token */
.cap-stage { fill: none; stroke: rgba(17, 23, 17, 0.32); stroke-width: 1; }
.cap-link  { stroke: rgba(17, 23, 17, 0.32); stroke-width: 1; }
.cap-pipe-token { fill: var(--terracotta); animation: capPipeTok 3.6s ease-in-out infinite; }
@keyframes capPipeTok {
  0%   { transform: translate(0, 0); opacity: 0; }
  10%  { opacity: 1; }
  25%  { transform: translate(46px, 0); }
  50%  { transform: translate(92px, 0); }
  75%  { transform: translate(138px, 0); }
  100% { transform: translate(170px, 0); opacity: 0; }
}

/* Mining: branching with one active path */
.cap-trunk { fill: none; stroke: rgba(17, 23, 17, 0.32); stroke-width: 1; }
.cap-branch { fill: none; stroke: rgba(17, 23, 17, 0.18); stroke-width: 0.8; }
.cap-active { stroke: var(--green); stroke-width: 1.4; }
.cap-trunk.cap-active, .cap-branch.cap-active { animation: capActive 2.6s ease-in-out infinite; }
@keyframes capActive { 0%, 100% { stroke: var(--green); } 50% { stroke: var(--green-2); } }

/* Dispatch: spokes */
.cap-dispatch-core { fill: var(--ink); }
.cap-spoke { stroke: rgba(17, 23, 17, 0.18); stroke-width: 0.8; }
.cap-spoke-end { fill: rgba(17, 23, 17, 0.4); }
.cap-spoke.cap-active { stroke: var(--terracotta); stroke-width: 1.4; animation: capActive 1.8s ease-in-out infinite; }

/* Geo: concentric rings + pulsing pins */
.cap-geo-ring { fill: none; stroke: rgba(17, 23, 17, 0.18); stroke-width: 0.6; stroke-dasharray: 2 3; }
.cap-geo-center { fill: var(--green); }
.cap-geo-pin { fill: var(--terracotta); animation: capGeoPin 2.4s ease-in-out infinite; }
@keyframes capGeoPin { 0%, 100% { opacity: 0.5; r: 2.5; } 50% { opacity: 1; r: 3.6; } }

/* Governance: lock + scanning bar */
.cap-lock-body, .cap-lock-shackle { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.cap-lock-body { fill: rgba(17, 23, 17, 0.04); }
.cap-scan {
  fill: var(--green-2);
  opacity: 0.4;
  animation: capScan 2.6s ease-in-out infinite;
}
@keyframes capScan {
  0%   { transform: translate(0, 0); opacity: 0.5; }
  50%  { transform: translate(0, 24px); opacity: 0.9; }
  100% { transform: translate(0, 0); opacity: 0.5; }
}

/* slow demos by default; intensify on hover */
.cap-demo > svg { animation-play-state: running; }
.capability-card:hover .cap-demo { background: linear-gradient(180deg, rgba(188, 67, 46, 0.06) 0%, transparent 100%); }

/* Consult: lines from center light up in sequence */
.cap-consult-core { fill: var(--ink); }
.cap-consult-figure { fill: var(--terracotta); }
.cap-consult-line {
  stroke: rgba(17, 23, 17, 0.18); stroke-width: 0.8;
  animation: capConsultLine 2s ease-in-out infinite;
}
@keyframes capConsultLine {
  0%, 100% { stroke: rgba(17, 23, 17, 0.18); }
  20%, 40% { stroke: var(--terracotta); stroke-width: 1.4; }
}

/* Vitals: ECG-style trace */
.cap-vitals-base { stroke: rgba(17, 23, 17, 0.12); stroke-width: 0.6; }
.cap-vitals-trace {
  fill: none; stroke: var(--terracotta); stroke-width: 1.2; stroke-linejoin: round;
  stroke-dasharray: 600; stroke-dashoffset: 600;
  animation: capVitals 2.4s ease-out infinite;
}
.cap-vitals-dot { fill: var(--terracotta); animation: capVitalsDot 2.4s ease-out infinite; }
@keyframes capVitals { 0% { stroke-dashoffset: 600; } 60% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -600; } }
@keyframes capVitalsDot { 0% { transform: translate(0, 0); } 60% { transform: translate(200px, 0); opacity: 1; } 100% { transform: translate(200px, 0); opacity: 0; } }

/* Reach: concentric arcs from corner */
.cap-reach-arc {
  fill: none; stroke: var(--green-2); stroke-width: 0.8;
  transform-origin: 24px 40px; opacity: 0;
  animation: capReach 2.4s ease-out infinite;
}
.cap-reach-core { fill: var(--green); }
.cap-reach-target { fill: var(--terracotta); animation: capReachTarget 2.4s ease-in-out infinite; }
@keyframes capReach { 0% { transform: scale(0.4); opacity: 0; } 30% { opacity: 0.7; } 100% { transform: scale(2.4); opacity: 0; } }
@keyframes capReachTarget { 0%, 60% { opacity: 0.4; } 75% { opacity: 1; } 100% { opacity: 0.4; } }

/* Route: stops with traveling vehicle */
.cap-route-path { fill: none; stroke: rgba(17, 23, 17, 0.22); stroke-width: 0.8; stroke-dasharray: 3 3; }
.cap-route-stop { fill: rgba(17, 23, 17, 0.4); }
.cap-route-stop.cap-active { fill: var(--terracotta); }
.cap-route-vehicle {
  fill: var(--green); animation: capRouteVeh 4s ease-in-out infinite;
  offset-path: path("M16,40 L60,20 L110,52 L160,28 L196,48");
  offset-rotate: 0deg;
}
@keyframes capRouteVeh {
  0%   { offset-distance: 0%; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}
@supports not (offset-path: path("M0,0 L1,1")) {
  .cap-route-vehicle { animation: capRouteVehFallback 4s ease-in-out infinite; }
  @keyframes capRouteVehFallback { 0% { transform: translate(0,0); } 25% { transform: translate(44px,-20px); } 50% { transform: translate(94px,12px); } 75% { transform: translate(144px,-12px); } 100% { transform: translate(180px,8px); } }
}

/* Stack: bars filling left to right */
.cap-stack-track { stroke: rgba(17, 23, 17, 0.12); stroke-width: 1; }
.cap-stack-fill {
  stroke: var(--terracotta); stroke-width: 1.4;
  animation: capStack 2.6s ease-in-out infinite;
}
@keyframes capStack {
  0%   { x2: 14; opacity: 0; }
  10%  { opacity: 1; }
  60%  { x2: 186; opacity: 1; }
  100% { x2: 186; opacity: 0; }
}

/* Scholar: book with a page turning */
.cap-book-base { fill: rgba(17, 23, 17, 0.04); stroke: rgba(17, 23, 17, 0.32); stroke-width: 0.8; }
.cap-book-spine { stroke: rgba(17, 23, 17, 0.4); stroke-width: 0.8; }
.cap-book-line { stroke: rgba(17, 23, 17, 0.28); stroke-width: 0.6; }
.cap-book-page {
  fill: rgba(242, 192, 137, 0.4); stroke: var(--terracotta); stroke-width: 0.7;
  transform-origin: 100px 40px;
  animation: capBookPage 3.4s ease-in-out infinite;
}
@keyframes capBookPage {
  0%, 100% { transform: scaleX(1); }
  50%      { transform: scaleX(-1); }
}

/* Ecosystem: orbit rotation */
.cap-eco-core { fill: var(--green); }
.cap-eco-sat { fill: var(--terracotta); }
.cap-eco-link { stroke: rgba(17, 23, 17, 0.18); stroke-width: 0.6; }
.cap-eco-orbit {
  transform-origin: 100px 40px;
  animation: capEcoOrbit 12s linear infinite;
}
@keyframes capEcoOrbit { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Center the marketplace if it lands alone in column 1 — only on the 3-col desktop grid */
@media (min-width: 1101px) {
  .capability-grid .capability-card:last-child:nth-child(3n+1) {
    grid-column: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cap-demo svg * { animation: none !important; }
}

/* === Dossiers shelf === */
.dossiers {
  background: var(--paper);
  position: relative;
}

.dos-shelf {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}

.dos-card {
  display: grid;
  grid-template-columns: 60px 1fr;
  background: var(--paper-3);
  border: 1px solid rgba(17, 23, 17, 0.18);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.dos-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 28px 50px rgba(17, 23, 17, 0.16);
}

.dos-spine {
  background: var(--ink);
  color: var(--paper-3);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0.4rem;
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
}

html[dir="rtl"] .dos-spine {
  writing-mode: vertical-lr;
  transform: none;
}

.dos-spine span:first-child { color: #f2c089; font-weight: 700; }
.dos-spine .map-meta-mono { color: rgba(251, 248, 238, 0.7) !important; }

.dos-body {
  padding: 1.4rem 1.4rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.dos-status {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  color: var(--terracotta);
  font-weight: 600;
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border: 1px solid rgba(188, 67, 46, 0.32);
  background: rgba(188, 67, 46, 0.06);
  align-self: flex-start;
}

.dos-card h3 {
  font-family: Fraunces, "Noto Naskh Arabic", serif;
  font-size: 1.18rem;
  line-height: 1.25;
  font-weight: 500;
  margin: 0;
  color: var(--ink);
}

.dos-card p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink-2);
  flex: 1;
}

.dos-meta {
  font-size: 0.66rem !important;
  letter-spacing: 0.16em !important;
  color: var(--muted) !important;
  padding-top: 0.7rem;
  border-top: 1px dashed rgba(17, 23, 17, 0.18);
}

.dos-foot {
  margin-top: 2rem;
  padding-top: 1.4rem;
  border-top: 1px dashed rgba(17, 23, 17, 0.22);
}

.dos-foot p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-2);
}

.dos-foot a {
  color: var(--terracotta);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-inline-start: 0.4rem;
}

@media (max-width: 1100px) { .dos-shelf { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px)  { .dos-shelf { grid-template-columns: 1fr; } }

/* === Madinah Operating Center floor plan === */
.moc {
  background: var(--paper-3);
  position: relative;
}

.moc-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, 1fr);
  gap: 2.4rem;
  margin-top: 2.5rem;
  align-items: start;
}

.moc-floorplan-wrap {
  position: relative;
  background: var(--paper);
  border: 1px solid rgba(17, 23, 17, 0.32);
  padding: 1.4rem 1.4rem 1rem;
  box-shadow:
    inset 0 0 0 4px var(--paper),
    inset 0 0 0 5px rgba(17, 23, 17, 0.32);
}

.moc-meta {
  display: block;
  font-size: 0.66rem !important;
  letter-spacing: 0.18em !important;
  color: var(--muted) !important;
  margin-bottom: 0.6rem;
}

.moc-floorplan { display: block; width: 100%; height: auto; font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; }

.moc-room-rect {
  fill: rgba(17, 23, 17, 0.02);
  stroke: rgba(17, 23, 17, 0.55);
  stroke-width: 1.2;
  transition: fill 0.3s, stroke 0.3s;
}

.moc-room:hover .moc-room-rect {
  fill: rgba(188, 67, 46, 0.06);
  stroke: var(--terracotta);
  stroke-width: 1.6;
  cursor: pointer;
}

.moc-room-tag {
  font-size: 11px;
  letter-spacing: 0.2em;
  fill: var(--terracotta);
  font-weight: 700;
}

.moc-room-name {
  font-family: Fraunces, "Noto Naskh Arabic", serif;
  font-size: 18px;
  font-weight: 500;
  fill: var(--ink);
  letter-spacing: 0.02em;
}

.moc-room-name-ar {
  font-family: "Noto Naskh Arabic", serif;
  font-size: 14px;
  fill: rgba(17, 23, 17, 0.6);
}

.moc-room-area {
  font-size: 9px;
  letter-spacing: 0.16em;
  fill: var(--muted);
}

.moc-desk {
  fill: rgba(17, 23, 17, 0.06);
  stroke: rgba(17, 23, 17, 0.32);
  stroke-width: 0.6;
}

.moc-chair {
  fill: rgba(17, 23, 17, 0.4);
}

.moc-active-chair {
  fill: var(--green);
  animation: capBlink 1.4s steps(2) infinite;
}

.moc-screen,
.moc-videowall {
  fill: rgba(11, 110, 79, 0.18);
  stroke: var(--green);
  stroke-width: 0.8;
}

.moc-vw-label {
  font-size: 9px;
  letter-spacing: 0.18em;
  fill: var(--green);
  font-weight: 700;
}

.moc-door {
  stroke: var(--paper);
  stroke-width: 4;
}

.moc-entrance-label {
  font-size: 9px;
  letter-spacing: 0.16em;
  fill: var(--terracotta);
  font-weight: 700;
}

.moc-rooms {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.moc-card {
  background: var(--paper);
  border: 1px solid rgba(17, 23, 17, 0.16);
  padding: 1rem 1.1rem;
  border-inline-start: 3px solid var(--terracotta);
  transition: background 0.3s;
}

.moc-card:hover { background: rgba(188, 67, 46, 0.04); }

.moc-card-tag {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  color: var(--terracotta);
  font-weight: 600;
  display: block;
  margin-bottom: 0.4rem;
}

.moc-card h3 {
  font-family: Fraunces, "Noto Naskh Arabic", serif;
  font-size: 1.05rem;
  font-weight: 500;
  margin: 0 0 0.4rem;
  line-height: 1.3;
}

.moc-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.moc-foot {
  margin-top: 1.6rem;
  font-size: 0.7rem !important;
  letter-spacing: 0.04em !important;
  color: var(--muted) !important;
  max-width: 760px;
}

@media (max-width: 1100px) {
  .moc-stage { grid-template-columns: 1fr; }
}

/* === Operations Watch === */
.ops-watch {
  background:
    radial-gradient(circle at 6% 100%, rgba(15, 139, 98, 0.18), transparent 36%),
    var(--ink);
  color: var(--paper-3);
  position: relative;
  overflow: hidden;
}

.ops-watch::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 35px, rgba(242, 238, 227, 0.04) 35px 36px);
  pointer-events: none;
  mask-image: linear-gradient(180deg, black 30%, transparent 100%);
}

.ops-watch > * { position: relative; z-index: 1; }

.ops-head { max-width: 760px; margin-bottom: 2rem; }
.ops-watch h2 { color: var(--paper); }
.ops-head p { color: rgba(251, 248, 238, 0.7); font-size: 1rem; line-height: 1.65; }

/* Hide the leftmost two KPIs (commits + FDEs) until they have a real reference.
   Remove .is-hidden once a public BOST GitHub org and first engagement land. */
.ops-cell.is-hidden { display: none; }

.ops-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid rgba(242, 238, 227, 0.18);
}

.ops-cell {
  padding: 1.4rem 1.2rem 1.5rem;
  border-inline-end: 1px solid rgba(242, 238, 227, 0.12);
  background: rgba(242, 238, 227, 0.02);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  position: relative;
}

.ops-cell:last-child { border-inline-end: 0; }

.ops-cell::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 24px;
  height: 2px;
  background: var(--green-2);
}

.ops-label {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  color: rgba(251, 248, 238, 0.55);
  font-weight: 500;
}

.ops-value {
  font-family: Fraunces, serif;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--paper);
  font-weight: 500;
  margin-top: 0.3rem;
}

.ops-value small {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(251, 248, 238, 0.6);
  letter-spacing: 0.1em;
  margin-inline-start: 0.2rem;
}

.ops-sub {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: rgba(251, 248, 238, 0.45);
  margin-top: auto;
}

.ops-cell-uptime::before { background: #f2c089; }

.ops-note {
  margin-top: 1.4rem;
  font-size: 0.7rem !important;
  letter-spacing: 0.04em !important;
  color: rgba(251, 248, 238, 0.45) !important;
  max-width: 720px;
  line-height: 1.6;
}

@media (max-width: 1100px) { .ops-grid { grid-template-columns: repeat(3, 1fr); } .ops-cell:nth-child(3n) { border-inline-end: 0; } }
@media (max-width: 760px)  { .ops-grid { grid-template-columns: 1fr 1fr; } .ops-cell { border-inline-end: 1px solid rgba(242, 238, 227, 0.12) !important; } .ops-cell:nth-child(2n) { border-inline-end: 0 !important; } }

/* === Forward-Deployed Engineer Manifest === */
.fde {
  background: var(--ink);
  color: var(--paper-3);
  position: relative;
  overflow: hidden;
}

.fde::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 14% 12%, rgba(15, 139, 98, 0.18), transparent 40%),
    radial-gradient(circle at 88% 88%, rgba(188, 67, 46, 0.14), transparent 42%);
  pointer-events: none;
}

.fde-glyph {
  position: absolute;
  font-family: Fraunces, serif;
  font-weight: 500;
  font-size: 28rem;
  line-height: 0.85;
  color: rgba(242, 238, 227, 0.04);
  bottom: -4rem;
  inset-inline-end: -1rem;
  pointer-events: none;
  letter-spacing: -0.04em;
  user-select: none;
}

.fde > * { position: relative; z-index: 1; }

.fde-head { max-width: 880px; margin-bottom: 3rem; }
.fde h2   { color: var(--paper); }
.fde-head p { color: rgba(251, 248, 238, 0.72); font-size: 1.08rem; line-height: 1.7; }

.fde-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 0;
  border: 1px solid rgba(242, 238, 227, 0.18);
}

.fde-block {
  padding: 1.8rem 1.6rem 1.8rem;
  border-inline-end: 1px solid rgba(242, 238, 227, 0.12);
  background: rgba(242, 238, 227, 0.02);
}

.fde-block:last-child { border-inline-end: 0; }

.fde-block-tag {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: #f2c089;
  font-weight: 600;
  display: block;
  margin-bottom: 0.85rem;
}

.fde-block h3 {
  font-family: Fraunces, "Noto Naskh Arabic", serif;
  font-size: 1.32rem;
  font-weight: 500;
  margin: 0 0 1rem;
  color: var(--paper);
  line-height: 1.2;
}

.fde-block ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.fde-block ul li {
  font-size: 0.92rem;
  line-height: 1.55;
  color: rgba(251, 248, 238, 0.78);
  padding-inline-start: 1rem;
  position: relative;
}

.fde-block ul li::before {
  content: "·";
  position: absolute;
  inset-inline-start: 0;
  color: var(--terracotta);
  font-weight: 700;
  font-size: 1.4em;
  line-height: 1;
  top: -0.05em;
}

.fde-block-charter {
  background: rgba(8, 12, 9, 0.6);
}

.fde-charter-list {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  counter-reset: charter;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.fde-charter-list li {
  counter-increment: charter;
  position: relative;
  padding: 0.55rem 0 0.55rem 2rem;
  font-family: Fraunces, "Noto Naskh Arabic", serif;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--paper);
  border-bottom: 1px dashed rgba(242, 238, 227, 0.14);
}

html[dir="rtl"] .fde-charter-list li { padding: 0.55rem 2rem 0.55rem 0; }

.fde-charter-list li:last-child { border-bottom: 0; }

.fde-charter-list li::before {
  content: counter(charter, decimal-leading-zero);
  position: absolute;
  inset-inline-start: 0;
  top: 0.65rem;
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--terracotta);
  font-weight: 700;
}

.fde-charter-sig {
  display: block;
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  color: rgba(251, 248, 238, 0.45);
  margin-top: 0.3rem;
}

.fde-cadence {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.fde-cadence > div {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.7rem;
  align-items: start;
  padding-bottom: 0.7rem;
  border-bottom: 1px dashed rgba(242, 238, 227, 0.14);
}

.fde-cadence > div:last-child { border-bottom: 0; }

.fde-cadence dt {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: #f2c089;
  font-weight: 700;
}

.fde-cadence dd {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(251, 248, 238, 0.78);
}

.fde-cadence dd strong {
  color: var(--paper);
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  margin-inline-end: 0.4rem;
  font-weight: 700;
}

.fde-foot {
  margin-top: 2.4rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.4rem;
  align-items: center;
  padding: 1.4rem 1.6rem;
  border: 1px solid rgba(242, 192, 137, 0.4);
  background: rgba(242, 192, 137, 0.05);
}

.fde-status {
  font-size: 0.7rem !important;
  letter-spacing: 0.2em !important;
  color: #f2c089 !important;
  display: block;
  margin-bottom: 0.5rem;
}

.fde-call p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--paper);
}

.fde-call a {
  color: #f2c089;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-inline-start: 0.3rem;
}

.fde-roles {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: rgba(251, 248, 238, 0.6);
  line-height: 1.6;
  text-align: end;
}

html[dir="rtl"] .fde-roles { text-align: start; }

@media (max-width: 1100px) {
  .fde-grid { grid-template-columns: 1fr; }
  .fde-block { border-inline-end: 0; border-bottom: 1px solid rgba(242, 238, 227, 0.12); }
  .fde-block:last-child { border-bottom: 0; }
  .fde-foot { grid-template-columns: 1fr; }
  .fde-roles { text-align: start; }
}

@media (max-width: 760px) {
  .fde-glyph { font-size: 14rem; }
}

/* === Field Notes from the Kingdom === */
.field-notes {
  background: var(--paper-2);
  position: relative;
}

.fn-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  margin-top: 2.5rem;
}

.fn-card {
  background: var(--paper-3);
  border: 1px solid rgba(17, 23, 17, 0.16);
  padding: 1.6rem 1.5rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
}

.fn-card::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 60px;
  height: 3px;
  background: var(--accent, var(--ink));
}

.fn-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 50px rgba(17, 23, 17, 0.12);
}

.fn-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.fn-tag {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  font-weight: 600;
  padding: 0.28rem 0.5rem;
  border: 1px solid var(--accent, var(--ink));
  color: var(--accent, var(--ink));
}

.fn-tag-health   { --accent: var(--green); }
.fn-tag-cities   { --accent: var(--ink-2); }
.fn-tag-energy   { --accent: var(--gold); }
.fn-tag-hajj     { --accent: var(--terracotta); }
.fn-tag-doctrine { --accent: var(--ink); }

.fn-card.fn-tag-health,
.fn-card:has(.fn-tag-health)   { --accent: var(--green); }
.fn-card:has(.fn-tag-cities)   { --accent: var(--ink-2); }
.fn-card:has(.fn-tag-energy)   { --accent: var(--gold); }
.fn-card:has(.fn-tag-hajj)     { --accent: var(--terracotta); }
.fn-card:has(.fn-tag-doctrine) { --accent: var(--ink); }

.fn-date {
  font-size: 0.66rem !important;
  color: var(--muted) !important;
  letter-spacing: 0.16em !important;
}

.fn-card h3 {
  font-family: Fraunces, "Noto Naskh Arabic", serif;
  font-size: 1.18rem;
  font-weight: 500;
  line-height: 1.3;
  margin: 0;
  color: var(--ink);
}

.fn-card p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink-2);
  flex: 1;
}

.fn-cta {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--terracotta);
  font-weight: 600;
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px dashed rgba(17, 23, 17, 0.18);
}

.fn-foot {
  margin-top: 2rem;
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  max-width: 720px;
  border-left: 2px solid var(--terracotta);
  padding: 0.5rem 0 0.5rem 1rem;
}

html[dir="rtl"] .fn-foot {
  border-left: 0;
  border-right: 2px solid var(--terracotta);
  padding: 0.5rem 1rem 0.5rem 0;
}

@media (max-width: 1100px) { .fn-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px)  { .fn-grid { grid-template-columns: 1fr; } }

/* === First Principles doctrine === */
.principles {
  background:
    radial-gradient(circle at 92% 8%, rgba(11, 110, 79, 0.06), transparent 38%),
    var(--paper-3);
  position: relative;
  overflow: hidden;
}

.principles-mark {
  position: absolute;
  top: 1rem;
  inset-inline-end: 2rem;
  font-family: Fraunces, "Noto Naskh Arabic", serif;
  font-size: 22rem;
  line-height: 1;
  color: rgba(17, 23, 17, 0.05);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

html[dir="rtl"] .principles-mark { transform: scaleX(-1); }

.principles > * { position: relative; z-index: 1; }

.principles-head {
  max-width: 880px;
  margin-bottom: 3rem;
}

.principles-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid rgba(17, 23, 17, 0.18);
  border-left: 1px solid rgba(17, 23, 17, 0.18);
  counter-reset: principle;
}

html[dir="rtl"] .principles-grid {
  border-left: 0;
  border-right: 1px solid rgba(17, 23, 17, 0.18);
}

.principle {
  position: relative;
  padding: 1.85rem 1.6rem 1.7rem 4.2rem;
  border-right: 1px solid rgba(17, 23, 17, 0.18);
  border-bottom: 1px solid rgba(17, 23, 17, 0.18);
  background: var(--paper-3);
  transition: background 0.4s ease;
}

html[dir="rtl"] .principle {
  border-right: 0;
  border-left: 1px solid rgba(17, 23, 17, 0.18);
  padding: 1.85rem 4.2rem 1.7rem 1.6rem;
}

.principle:hover { background: rgba(17, 23, 17, 0.025); }

.principle-num {
  position: absolute;
  top: 1.85rem;
  left: 1.4rem;
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--terracotta);
  font-weight: 700;
}

html[dir="rtl"] .principle-num { left: auto; right: 1.4rem; }

.principle-rule {
  margin: 0 0 0.7rem;
  font-family: Fraunces, "Noto Naskh Arabic", serif;
  font-size: 1.32rem;
  line-height: 1.3;
  font-weight: 500;
  color: var(--ink);
}

.principle-body {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .principles-grid { grid-template-columns: 1fr; }
  .principles-mark { font-size: 14rem; top: 0.5rem; right: 1rem; }
}

@media (max-width: 760px) {
  .principle { padding-left: 3.4rem; padding-right: 1.2rem; }
  .principle-rule { font-size: 1.15rem; }
  .principles-mark { display: none; }
}

/* === Intake wizard: First Operating Problem === */
.intake {
  background:
    radial-gradient(circle at 90% 0%, rgba(11, 110, 79, 0.05), transparent 38%),
    var(--paper);
  display: block;
  padding-bottom: 5rem;
}

.intake-head {
  max-width: 820px;
  margin-bottom: 3rem;
}

.intake-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(290px, 1fr);
  gap: 2.4rem;
  align-items: start;
}

.intake-form {
  background: var(--paper-3);
  border: 1px solid rgba(17, 23, 17, 0.18);
  padding: 2rem 2rem 1.6rem;
  position: relative;
  box-shadow: 0 1px 0 rgba(17, 23, 17, 0.06);
}

.intake-progress {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.intake-progress-label {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--terracotta);
  font-weight: 600;
  white-space: nowrap;
}

.intake-progress-track {
  flex: 1;
  height: 2px;
  background: rgba(17, 23, 17, 0.12);
  position: relative;
  overflow: hidden;
}

.intake-progress-bar {
  height: 100%;
  background: var(--ink);
  transition: width 0.45s cubic-bezier(.2,.7,.2,1);
}

.intake-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.intake-step {
  display: none;
  animation: stepIn 0.4s cubic-bezier(.2,.7,.2,1) both;
}

.intake-step.is-active { display: block; }

@keyframes stepIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.intake-step-tag {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--terracotta);
  display: inline-block;
  margin-bottom: 0.7rem;
  font-weight: 600;
}

.intake-step h3 {
  font-family: Fraunces, "Noto Naskh Arabic", serif;
  font-size: 1.85rem;
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 1.4rem;
  color: var(--ink);
}

.intake-options {
  border: 0;
  margin: 0 0 1.4rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}

.intake-options-tight { grid-template-columns: repeat(3, 1fr); }

.intake-options legend.intake-sublegend {
  grid-column: 1 / -1;
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 0.45rem;
  text-transform: uppercase;
}

.intake-options label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(17, 23, 17, 0.18);
  background: var(--paper);
  cursor: pointer;
  font-size: 0.95rem;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.intake-options label:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.intake-options input[type="radio"] {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 1.5px solid rgba(17, 23, 17, 0.45);
  border-radius: 0;
  margin: 0;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.2s;
}

.intake-options input[type="radio"]:checked {
  border-color: var(--terracotta);
}

.intake-options input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: var(--terracotta);
}

.intake-options label:has(input:checked) {
  border-color: var(--terracotta);
  background: rgba(188, 67, 46, 0.06);
}

.intake-field {
  display: block;
  margin-bottom: 1.2rem;
}

.intake-field > span {
  display: block;
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.intake-field input,
.intake-field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(17, 23, 17, 0.18);
  background: var(--paper);
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  resize: vertical;
  transition: border-color 0.2s;
}

.intake-field input:focus,
.intake-field textarea:focus {
  outline: 0;
  border-color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--terracotta);
}

.intake-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.intake-controls {
  margin-top: 1.6rem;
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  align-items: center;
}

.button-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid rgba(17, 23, 17, 0.32);
  color: var(--ink);
  padding: 0.85rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: border-color 0.2s, background 0.2s;
}

.button-ghost:hover { border-color: var(--ink); background: rgba(17, 23, 17, 0.04); }
.button-ghost:disabled { opacity: 0.4; cursor: not-allowed; }

.intake-aside-panel {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  background: var(--ink);
  color: var(--paper-3);
  padding: 1.8rem 1.6rem;
  border: 1px solid rgba(17, 23, 17, 0.4);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.intake-aside-tag {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: #f2c089;
  font-weight: 600;
}

.intake-aside-panel h3 {
  font-family: Fraunces, "Noto Naskh Arabic", serif;
  font-size: 1.5rem;
  font-weight: 500;
  margin: 0;
  color: var(--paper);
  line-height: 1.2;
}

.intake-aside-panel p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(251, 248, 238, 0.78);
}

.intake-direct {
  margin-top: 0.6rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(242, 238, 227, 0.18);
  display: grid;
  gap: 0.45rem;
  font-size: 0.85rem;
}

.intake-direct span:first-child {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: rgba(251, 248, 238, 0.55);
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.intake-direct a {
  color: var(--paper);
  text-decoration: underline;
  text-decoration-color: rgba(242, 192, 137, 0.4);
  text-underline-offset: 3px;
}

/* === Generated brief === */
.intake-brief {
  margin-top: 3rem;
  background: var(--paper-3);
  border: 1px solid rgba(17, 23, 17, 0.32);
  padding: 2.4rem 2.4rem 2rem;
  box-shadow: 0 30px 80px rgba(17, 23, 17, 0.18);
  position: relative;
}

.intake-brief::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 6px;
  background:
    linear-gradient(90deg, var(--green-2) 0% 33.33%, var(--terracotta) 33.33% 66.66%, var(--gold) 66.66% 100%);
}

.intake-brief-head {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(17, 23, 17, 0.18);
  padding-bottom: 1.2rem;
  margin-bottom: 1.4rem;
}

.intake-brief-tag {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--terracotta);
  font-weight: 600;
  display: block;
  margin-bottom: 0.4rem;
}

.intake-brief-title {
  font-family: Fraunces, "Noto Naskh Arabic", serif;
  font-size: 1.85rem;
  line-height: 1.15;
  font-weight: 500;
  margin: 0 0 0.3rem;
  color: var(--ink);
}

.intake-brief-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.intake-brief-stamp {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-end;
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-align: end;
}

html[dir="rtl"] .intake-brief-stamp { align-items: flex-start; text-align: start; }

.intake-brief-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem 1.5rem;
  margin: 0 0 1.6rem;
}

.intake-brief-grid .full { grid-column: 1 / -1; }

.intake-brief-grid dt {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.intake-brief-grid dd {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
}

.intake-brief-platforms {
  margin-top: 1rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(17, 23, 17, 0.18);
}

.intake-brief-platforms h4 {
  font-family: Fraunces, "Noto Naskh Arabic", serif;
  font-size: 1.2rem;
  font-weight: 500;
  margin: 0 0 1rem;
}

.intake-brief-trinity {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}

.intake-brief-card {
  padding: 1.1rem 1rem;
  border: 1px solid rgba(17, 23, 17, 0.18);
  background: var(--paper);
  position: relative;
}

.intake-brief-card::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 3px;
  height: 100%;
  background: var(--accent, var(--ink));
}

.brief-marsad  { --accent: var(--green-2); }
.brief-maydan  { --accent: var(--terracotta); }
.brief-mashhad { --accent: var(--gold); }

.intake-brief-card-tag {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  color: var(--accent);
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
}

.intake-brief-card p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.intake-brief-foot {
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(17, 23, 17, 0.18);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.intake-brief-foot strong {
  display: block;
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  color: var(--ink);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.intake-brief-actions {
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px dashed rgba(17, 23, 17, 0.22);
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  align-items: center;
}

.intake-brief-primary {
  background: var(--green);
  color: var(--paper);
  border-color: var(--green);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.intake-brief-primary:hover {
  background: var(--green-2);
  border-color: var(--green-2);
}

.intake-brief-note {
  margin: 0.9rem 0 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 760px;
}

@media (max-width: 1100px) {
  .intake-stage { grid-template-columns: 1fr; }
  .intake-aside-panel { position: static; }
  .intake-options { grid-template-columns: 1fr 1fr; }
  .intake-options-tight { grid-template-columns: 1fr 1fr; }
  .intake-brief-grid { grid-template-columns: 1fr 1fr; }
  .intake-brief-trinity { grid-template-columns: 1fr; }
  .intake-brief-foot { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .intake-options,
  .intake-options-tight { grid-template-columns: 1fr; }
  .intake-grid { grid-template-columns: 1fr; }
  .intake-brief-grid { grid-template-columns: 1fr; }
  .intake-brief { padding: 1.6rem 1.2rem; }
}

/* Print stylesheet for the brief */
@media print {
  body * { visibility: hidden; }
  .intake-brief, .intake-brief * { visibility: visible; }
  .intake-brief {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 1cm 1.4cm;
    box-shadow: none;
    border: 0;
    font-size: 11pt;
  }
  [data-no-print] { display: none !important; }
}

/* === Intro aside: own the Palantir comparison === */
.intro-aside {
  margin-top: 3rem;
  padding: 1.6rem 1.8rem;
  border-inline-start: 3px solid var(--terracotta);
  background: linear-gradient(180deg, rgba(188, 67, 46, 0.06), rgba(188, 67, 46, 0.02));
  max-width: 920px;
}

html[dir="rtl"] .intro-aside {
  border-inline-start: 0;
  border-inline-end: 3px solid var(--terracotta);
}

.intro-aside-tag {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--terracotta);
  font-weight: 600;
  display: block;
  margin-bottom: 0.8rem;
}

.intro-aside p {
  margin: 0;
  font-family: Fraunces, "Noto Naskh Arabic", serif;
  font-size: 1.18rem;
  line-height: 1.55;
  color: var(--ink);
  font-weight: 500;
}

.intro-aside em {
  font-style: italic;
  color: var(--green);
}

/* === KSA Ontology. Interactive object graph === */
.ontology {
  background:
    radial-gradient(circle at 18% 14%, rgba(15, 139, 98, 0.14), transparent 42%),
    radial-gradient(circle at 88% 86%, rgba(154, 123, 47, 0.10), transparent 42%),
    var(--ink);
  color: var(--paper-3);
  position: relative;
  overflow: hidden;
}

.ontology::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 41px, rgba(242, 238, 227, 0.04) 41px 42px),
    repeating-linear-gradient(90deg, transparent 0 41px, rgba(242, 238, 227, 0.04) 41px 42px);
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 50%, transparent 92%);
}

.ontology > * { position: relative; z-index: 1; }

.ontology h2 { color: var(--paper); }

.ontology .section-head p {
  color: rgba(251, 248, 238, 0.72);
}

.ontology-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  gap: 2rem;
  margin-top: 2.5rem;
  align-items: stretch;
}

.ontology-canvas-wrap {
  position: relative;
  background: rgba(8, 12, 9, 0.55);
  border: 1px solid rgba(242, 238, 227, 0.16);
  padding: 1rem 1rem 0.6rem;
  min-height: 540px;
}

.ontology-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: rgba(251, 248, 238, 0.55);
}

.ontology-svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

.ontology-svg .onto-edge {
  stroke: rgba(242, 238, 227, 0.22);
  stroke-width: 1;
  fill: none;
  transition: stroke 0.25s, stroke-width 0.25s, opacity 0.25s;
}

.ontology-svg .onto-edge-label {
  fill: rgba(251, 248, 238, 0.45);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  pointer-events: none;
  transition: fill 0.25s, opacity 0.25s;
}

.ontology-svg.is-selecting .onto-edge { opacity: 0.18; }
.ontology-svg.is-selecting .onto-edge-label { opacity: 0.18; }
.ontology-svg .onto-edge.is-active {
  stroke: #f2c089;
  stroke-width: 1.6;
  opacity: 1;
}
.ontology-svg .onto-edge.is-active + .onto-edge-label,
.ontology-svg .onto-edge-label.is-active {
  fill: #f2c089;
  opacity: 1;
}

.ontology-svg .onto-node {
  cursor: pointer;
  transition: transform 0.25s, opacity 0.25s;
}

.ontology-svg .onto-node-bg {
  fill: rgba(8, 12, 9, 0.85);
  stroke: rgba(242, 238, 227, 0.45);
  stroke-width: 1;
  transition: stroke 0.25s, stroke-width 0.25s, fill 0.25s;
}

.ontology-svg .onto-node-label {
  fill: var(--paper);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  pointer-events: none;
}

.ontology-svg .onto-node-tag {
  fill: rgba(251, 248, 238, 0.5);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  pointer-events: none;
}

.ontology-svg .onto-node-glyph {
  font-family: "Noto Naskh Arabic", "Noto Kufi Arabic", serif;
  fill: rgba(251, 248, 238, 0.7);
  font-size: 11px;
  pointer-events: none;
}

.ontology-svg.is-selecting .onto-node { opacity: 0.28; }
.ontology-svg .onto-node.is-active,
.ontology-svg .onto-node.is-neighbour { opacity: 1; }
.ontology-svg .onto-node.is-active .onto-node-bg {
  stroke: #f2c089;
  stroke-width: 2.2;
  fill: rgba(188, 67, 46, 0.18);
}
.ontology-svg .onto-node.is-neighbour .onto-node-bg {
  stroke: rgba(242, 192, 137, 0.7);
}

/* node type accent stripe */
.ontology-svg .onto-node-stripe { transition: opacity 0.25s; }
.ontology-svg .onto-type-process .onto-node-stripe { fill: var(--green-2); }
.ontology-svg .onto-type-entity  .onto-node-stripe { fill: var(--paper); opacity: 0.65; }
.ontology-svg .onto-type-person  .onto-node-stripe { fill: #f2c089; }
.ontology-svg .onto-type-event   .onto-node-stripe { fill: var(--terracotta); }
.ontology-svg .onto-type-device  .onto-node-stripe { fill: #7fb5b5; }

.ontology-svg .onto-node.is-primary .onto-node-bg {
  stroke: var(--green-2);
  stroke-width: 1.6;
}

.ontology-svg .onto-pulse {
  fill: none;
  stroke: var(--green-2);
  stroke-width: 1;
  opacity: 0;
  animation: ontoPulse 3.6s ease-out infinite;
  pointer-events: none;
}

@keyframes ontoPulse {
  0%   { r: 22; opacity: 0; }
  10%  { opacity: 0.55; }
  100% { r: 80; opacity: 0; }
}

.ontology-panel {
  background: rgba(8, 12, 9, 0.65);
  border: 1px solid rgba(242, 238, 227, 0.16);
  padding: 1.6rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 540px;
}

.ontology-tag {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  color: rgba(242, 192, 137, 0.85);
  display: block;
}

.ontology-panel h3 {
  font-family: Fraunces, "Noto Naskh Arabic", serif;
  font-size: 1.7rem;
  line-height: 1.15;
  font-weight: 500;
  color: var(--paper);
  margin: 0;
}

.ontology-subtitle {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: rgba(251, 248, 238, 0.6);
  letter-spacing: 0.04em;
  margin: 0 0 0.5rem;
  border-bottom: 1px solid rgba(242, 238, 227, 0.14);
  padding-bottom: 0.85rem;
  line-height: 1.5;
}

.ontology-block {
  border-left: 2px solid var(--block-color, var(--green-2));
  padding: 0.1rem 0 0.1rem 0.85rem;
}

html[dir="rtl"] .ontology-block {
  border-left: 0;
  border-right: 2px solid var(--block-color, var(--green-2));
  padding: 0.1rem 0.85rem 0.1rem 0;
}

.ontology-block:nth-of-type(1) { --block-color: var(--green-2); }
.ontology-block:nth-of-type(2) { --block-color: var(--terracotta); }
.ontology-block:nth-of-type(3) { --block-color: var(--gold); }

.ontology-block-tag {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--block-color);
  font-weight: 600;
}

.ontology-block h4 {
  font-family: Fraunces, "Noto Naskh Arabic", serif;
  font-size: 1rem;
  font-weight: 500;
  margin: 0.15rem 0 0.4rem;
  color: var(--paper);
}

.ontology-block p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: rgba(251, 248, 238, 0.78);
}

.ontology-legend {
  margin-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  align-items: center;
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: rgba(251, 248, 238, 0.55);
}

.legend-item { display: inline-flex; align-items: center; gap: 0.45rem; }
.legend-spacer { flex: 1; }
.legend-foot { color: rgba(251, 248, 238, 0.4); }

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 1px;
}
.legend-process { background: var(--green-2); }
.legend-entity  { background: var(--paper); opacity: 0.65; }
.legend-person  { background: #f2c089; }
.legend-event   { background: var(--terracotta); }
.legend-device  { background: #7fb5b5; }

@media (max-width: 1100px) {
  .ontology-stage { grid-template-columns: 1fr; }
  .ontology-canvas-wrap { min-height: 400px; }
  .ontology-panel { min-height: auto; }
}

/* === Product trinity: Marsad / Maydan / Mashhad === */
.trinity {
  background:
    radial-gradient(circle at 12% 18%, rgba(15, 139, 98, 0.06), transparent 38%),
    radial-gradient(circle at 88% 86%, rgba(154, 123, 47, 0.07), transparent 40%),
    var(--paper);
  position: relative;
}

.trinity::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(17, 23, 17, 0.035) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(17, 23, 17, 0.035) 39px 40px);
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 35%, transparent 88%);
  z-index: 0;
}

.trinity > * { position: relative; z-index: 1; }

.trinity-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.trinity-card {
  position: relative;
  overflow: hidden;
  background: var(--paper-3);
  border: 1px solid rgba(17, 23, 17, 0.18);
  padding: 2rem 1.6rem 1.8rem;
  display: flex;
  flex-direction: column;
  min-height: 540px;
  transition: transform 0.4s cubic-bezier(.2,.7,.2,1), box-shadow 0.4s;
  box-shadow: 0 1px 0 rgba(17, 23, 17, 0.08);
}

.trinity-card::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 4px;
  background: var(--accent, var(--ink));
  z-index: 2;
}

.trinity-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 60px rgba(17, 23, 17, 0.18);
}

.trinity-marsad   { --accent: var(--green-2); }
.trinity-maydan   { --accent: var(--terracotta); }
.trinity-mashhad  { --accent: var(--gold); }

.trinity-glyph {
  position: absolute;
  inset-inline-end: -0.6rem;
  bottom: -2.5rem;
  font-family: "Noto Naskh Arabic", "Noto Kufi Arabic", serif;
  font-size: 17rem;
  font-weight: 500;
  line-height: 0.85;
  color: var(--accent);
  opacity: 0.10;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  letter-spacing: -0.02em;
}

.trinity-role {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--accent);
  display: inline-block;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  padding: 0.32rem 0.6rem;
  margin-bottom: 1.25rem;
  align-self: flex-start;
}

.trinity-name {
  font-family: Fraunces, "Noto Naskh Arabic", serif;
  font-weight: 500;
  font-size: 3.2rem;
  line-height: 1;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.trinity-translit {
  font-family: "Noto Naskh Arabic", "Noto Kufi Arabic", serif;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--muted);
  margin: 0 0 1.4rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(17, 23, 17, 0.12);
}

.trinity-body {
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0 0 1.3rem;
  position: relative;
  z-index: 1;
}

.trinity-list {
  margin: auto 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  position: relative;
  z-index: 1;
}

.trinity-list li {
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--ink-2);
  padding-inline-start: 1.1rem;
  position: relative;
}

.trinity-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.55rem;
  width: 6px;
  height: 6px;
  background: var(--accent);
  transform: rotate(45deg);
}

.trinity-foot {
  margin-top: 2.5rem;
  font-family: Fraunces, "Noto Naskh Arabic", serif;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 760px;
}

@media (max-width: 1100px) {
  .trinity-grid { grid-template-columns: 1fr; }
  .trinity-card { min-height: auto; }
  .trinity-glyph { font-size: 14rem; bottom: -2rem; }
}

@media (max-width: 760px) {
  .trinity-name { font-size: 2.6rem; }
  .trinity-glyph { font-size: 11rem; opacity: 0.08; }
}

@media (max-width: 760px) {
  .sov-grid { grid-template-columns: 1fr; }
  .sov-card { border-inline-end: 0 !important; border-bottom: 1px solid rgba(242, 238, 227, 0.12) !important; }
  .sov-card:last-child { border-bottom: 0 !important; }

  .hero-hud {
    position: static;
    margin: 0 1rem 1.5rem;
    grid-template-columns: 1fr 1fr;
  }
  .hero-hud .hud-cell { display: none; }
  .hero-hud .hud-cell:nth-child(1),
  .hero-hud .hud-cell:nth-child(3),
  .hero-hud .hud-cell:nth-child(5),
  .hero-hud .hud-cell:nth-child(6) { display: flex; }
  .hero-hud .hud-value {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.2;
  }

  .map-frame { padding: 1rem 0.7rem; }
  .map-meta { font-size: 0.6rem; letter-spacing: 0.1em; }
  .map-meta-tl { top: 0.7rem; left: 0.8rem; }
  .map-meta-tr { top: 0.5rem; right: 0.6rem; }
  .map-meta-bl { bottom: 0.6rem; left: 0.8rem; }
  .map-cities .map-city-name { font-size: 14px; }
  .map-cities .map-city-coord { font-size: 11px; }
  .map-city-primary .map-city-name { font-size: 16px; }
}
