/* ============================================================
   MURA MENASA FZCO — co-branding tokens, rotor mark, theme scope
   ============================================================
   Mirrors the CKS co-branding pattern:
     .theme-mm-full — whole-page rebrand of the Entropia chassis to
                      Mura Menasa's engineered-minimalism look:
                      ink + silver + one brand red, Saira display,
                      IBM Plex Sans/Mono. DARK base with LIGHT bands.
   Brand source: Mura Menasa Design System (helicopter engine MRO).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Saira:wght@400;500;600;700;800&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --mm-red:        #D8232A;
  --mm-red-deep:   #B01D23;
  --mm-red-bright: #F0353D;
  --mm-red-tint:   #FBE9EA;

  --mm-black:      #0E0E0F;
  --mm-ink:        #151516;
  --mm-ink-2:      #1D1E20;
  --mm-ink-3:      #2A2C2E;

  --mm-silver:     #D9DADA;
  --mm-silver-2:   #ECEDED;
  --mm-steel:      #9A9EA1;
  --mm-steel-dark: #6B6E70;
  --mm-graphite:   #3A3D3F;
  --mm-paper:      #F4F5F5;

  --mm-font-display: 'Saira', 'Arial Narrow', sans-serif;
  --mm-font-body:    'IBM Plex Sans', system-ui, sans-serif;
  --mm-font-mono:    'IBM Plex Mono', ui-monospace, monospace;
}

/* ============================================================
   ROTOR MARK — three swept red blades, slow rotation.
   Inline-SVG host: <span class="mm-rotor is-playing" data-mm-rotor></span>
   ============================================================ */

.mm-rotor {
  --mm-rotor-size: 200px;
  width: var(--mm-rotor-size);
  height: var(--mm-rotor-size);
  display: inline-block;
  vertical-align: middle;
}
.mm-rotor svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
.mm-rotor .mm-rotor-ring {
  fill: none;
  stroke: var(--mm-steel-dark);
  stroke-width: 1.5;
  opacity: 0.5;
}
.mm-rotor .mm-rotor-blades {
  /* Pivot on the rotor hub (= circle centre in viewBox units), NOT the
     blades' own bounding-box centre — otherwise the blades drift outside
     the ring as they spin. */
  transform-box: view-box;
  transform-origin: 195px 191px;
  transform: rotate(0deg);
}
.mm-rotor .mm-rotor-blades path { fill: var(--mm-red); }

/* Intro spin-up, then a slow continuous idle rotation. */
.mm-rotor.is-playing .mm-rotor-blades {
  animation:
    mm-rotor-intro 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) both,
    mm-rotor-spin 64s linear 1.2s infinite;
}
@keyframes mm-rotor-intro {
  0%   { transform: rotate(-260deg) scale(0.82); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: rotate(0deg) scale(1); opacity: 1; }
}
@keyframes mm-rotor-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.mm-rotor:hover .mm-rotor-blades { animation-duration: 1.2s, 8s; }

@media (prefers-reduced-motion: reduce) {
  .mm-rotor.is-playing .mm-rotor-blades { animation: none; transform: none; opacity: 1; }
  .mm-rotor:hover .mm-rotor-blades { animation: none; }
}

/* ============================================================
   HERO head row — title left, oversized animated rotor right
   ============================================================ */
.mm-hero-headrow {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) auto;
  align-items: center;
  gap: clamp(24px, 4vw, 72px);
  margin-top: 36px;
}
.mm-hero-siderotor { display: flex; justify-content: flex-end; }
.mm-hero-siderotor .mm-rotor { --mm-rotor-size: clamp(220px, 26vw, 380px); }

@media (max-width: 1080px) {
  .mm-hero-headrow { grid-template-columns: 1fr; gap: 28px; }
  .mm-hero-siderotor { justify-content: flex-start; }
  .mm-hero-siderotor .mm-rotor { --mm-rotor-size: clamp(180px, 44vw, 300px); }
}
@media (max-width: 720px) {
  .mm-hero-siderotor .mm-rotor { --mm-rotor-size: 168px; }
}

/* ============================================================
   CLIENT MARK — framed block in the context section
   ============================================================ */
.mm-client-mark {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 24px;
  border: 1.5px solid var(--mm-red);
  background: rgba(216, 35, 42, 0.06);
  border-radius: var(--r-sm);
}
.mm-client-id {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mm-font-mono);
  font-size: 9px;
  letter-spacing: 0.26em;
  color: var(--mm-red);
  text-transform: uppercase;
}
.mm-client-id .dash { width: 1px; height: 14px; background: rgba(216, 35, 42, 0.4); }
.mm-client-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.mm-client-row .mm-rotor { --mm-rotor-size: 76px; }
.mm-client-text {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  max-width: 360px;
}

/* ============================================================
   PROCESS LANE — AS-IS sequence for the BPM audit section
   ============================================================ */
.mm-lane {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0;
  border: var(--hairline);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.mm-lane-step {
  position: relative;
  padding: var(--s-5);
  border-right: var(--hairline);
  min-height: 150px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mm-lane-step:last-child { border-right: none; }
.mm-lane-step .mm-lane-id {
  font-family: var(--mm-font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--mm-steel);
}
.mm-lane-step h4 { font-family: var(--mm-font-display); font-size: 17px; letter-spacing: 0; }
.mm-lane-step p { font-size: 12.5px; line-height: 1.5; }
.mm-lane-step .mm-lane-arrow {
  position: absolute;
  right: -7px; top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  font-family: var(--mm-font-mono);
  font-size: 12px;
  color: var(--mm-steel);
}
.mm-lane-step.is-bottleneck { box-shadow: inset 3px 0 0 var(--mm-red); }
.mm-lane-step.is-bottleneck .mm-lane-id { color: var(--mm-red); }
@media (max-width: 860px) {
  .mm-lane { grid-auto-flow: row; grid-auto-columns: auto; }
  .mm-lane-step { border-right: none; border-bottom: var(--hairline); }
  .mm-lane-step:last-child { border-bottom: none; }
  .mm-lane-step .mm-lane-arrow { display: none; }
}

/* ============================================================
   BOTTLENECK GRID — "узкое место → решение автоматизацией"
   ============================================================ */
.mm-bottlenecks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border: var(--hairline);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.mm-bn-head, .mm-bn-row {
  display: grid;
  grid-template-columns: 48px 1.1fr 1.4fr;
  gap: var(--s-5);
  padding: var(--s-4) var(--s-5);
  align-items: start;
}
.mm-bn-head {
  font-family: var(--mm-font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.mm-bn-row .mm-bn-num { font-family: var(--mm-font-mono); font-size: 12px; color: var(--mm-red); }
.mm-bn-row .mm-bn-pain { font-weight: 500; line-height: 1.45; font-size: 14px; }
.mm-bn-row .mm-bn-fix { font-size: 13.5px; line-height: 1.5; }
.mm-bn-row .mm-bn-fix b { font-weight: 600; }
@media (max-width: 720px) {
  .mm-bn-head { display: none; }
  .mm-bn-row { grid-template-columns: 1fr; gap: 8px; }
}

/* ============================================================
   SCREENSHOT SLOT — placeholder frame for module UI shots
   ============================================================ */
.mm-shot {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: var(--hairline);
  border-radius: var(--r-sm);
  background:
    linear-gradient(135deg, rgba(154,158,161,0.10), transparent 60%),
    repeating-linear-gradient(45deg, rgba(154,158,161,0.06) 0 10px, transparent 10px 20px);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.mm-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mm-shot .mm-shot-label {
  font-family: var(--mm-font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mm-steel);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: var(--s-5);
}
.mm-shot .mm-shot-label .mm-rotor { --mm-rotor-size: 44px; opacity: 0.5; }

/* ============================================================
   FOOTER CO-SIGN — Entropia × Mura Menasa
   ============================================================ */
.mm-cosign {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mm-font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.mm-cosign .x { opacity: 0.45; }
.mm-cosign .mm-cosign-mark { display: inline-flex; align-items: center; gap: 8px; }
.mm-cosign .mm-rotor { --mm-rotor-size: 30px; }

/* ============================================================
   THEME FULL — whole-page rebrand to ink + silver + red
   ============================================================ */
.theme-mm-full {
  --color-bg: var(--mm-ink);
  --color-primary: var(--mm-paper);
  --color-accent: var(--mm-red);
  --color-accent-hover: var(--mm-red-deep);
  --accent: var(--mm-red);
  --accent-12: rgba(216, 35, 42, 0.16);
  --accent-30: rgba(216, 35, 42, 0.42);
  --accent-glow: rgba(216, 35, 42, 0.65);
  --titanium: var(--mm-paper);
  --titanium-dim: rgba(244, 245, 245, 0.76);
  --titanium-faint: rgba(244, 245, 245, 0.46);
  --titanium-mute: rgba(244, 245, 245, 0.56);
  --line: rgba(244, 245, 245, 0.10);
  --line-2: rgba(244, 245, 245, 0.18);
  --hairline: 1px solid rgba(244, 245, 245, 0.10);

  background: var(--mm-ink);
  color: var(--mm-paper);
  font-family: var(--mm-font-body);
}

.theme-mm-full .display,
.theme-mm-full h1,
.theme-mm-full h2,
.theme-mm-full h3,
.theme-mm-full h4 {
  font-family: var(--mm-font-display);
  text-transform: uppercase;
  letter-spacing: -0.005em;
  color: var(--mm-paper);
}
.theme-mm-full h1, .theme-mm-full .display { font-weight: 700; }
.theme-mm-full h2, .theme-mm-full h3 { font-weight: 600; }
.theme-mm-full .display .dim,
.theme-mm-full h1 .dim,
.theme-mm-full h2 .dim,
.theme-mm-full h3 .dim { opacity: 1; color: var(--mm-paper); }
.theme-mm-full .mono,
.theme-mm-full .eyebrow,
.theme-mm-full .chip,
.theme-mm-full .btn { font-family: var(--mm-font-mono); }

/* Title accent — red, ties heading to the rotor mark. */
.theme-mm-full .mm-title-accent { color: var(--mm-red); }
/* Caret — recolor the Entropia blue caret to brand red. */
.theme-mm-full .caret { background: var(--mm-red); }

/* ── NAV ─────────────────────────────────────────────────── */
.theme-mm-full .nav {
  background: rgba(21, 21, 22, 0.85);
  border-bottom: var(--hairline);
}
.theme-mm-full .nav-item { color: rgba(244, 245, 245, 0.7); }
.theme-mm-full .nav-item:hover,
.theme-mm-full .nav-item.is-active { color: var(--mm-red-bright); }
.theme-mm-full .logo { color: var(--mm-paper); font-family: var(--mm-font-display); }
.theme-mm-full .status { color: var(--mm-red-bright); }
.theme-mm-full .status-dot { background: var(--mm-red); box-shadow: 0 0 8px var(--mm-red); }
.theme-mm-full .nav-mark svg rect { fill: var(--mm-red) !important; }
.theme-mm-full .btn-primary {
  background: var(--mm-red);
  border-color: var(--mm-red);
  color: var(--mm-paper);
}
.theme-mm-full .btn-primary:hover {
  background: var(--mm-red-deep);
  border-color: var(--mm-red-deep);
  color: var(--mm-paper);
  box-shadow: 0 6px 20px rgba(216, 35, 42, 0.30);
}
.theme-mm-full .btn:hover { border-color: var(--mm-paper); background: var(--mm-paper); color: var(--mm-ink); }

/* ── SECTION RHYTHM — DARK base / MID cool / LIGHT silver ── */
.theme-mm-full .hero,
.theme-mm-full .section { background: transparent; color: var(--mm-paper); }
.theme-mm-full .section { border-top-color: rgba(244, 245, 245, 0.08); }

.theme-mm-full .section.tone-cool::before     { background: var(--mm-ink-2); }
.theme-mm-full .section.tone-cream::before    { background: var(--mm-ink); }
.theme-mm-full .section.tone-beige::before    { background: var(--mm-silver-2); }
.theme-mm-full .section.tone-clay::before     { background: rgba(216, 35, 42, 0.08); }
.theme-mm-full .section.tone-sand::before     { background: var(--mm-black); }
.theme-mm-full .section.tone-espresso::before { background: var(--mm-black); }

/* ── LIGHT band recolor — ink text on silver ─────────────── */
.theme-mm-full .section.tone-beige,
.theme-mm-full .section.tone-beige h1,
.theme-mm-full .section.tone-beige h2,
.theme-mm-full .section.tone-beige h3,
.theme-mm-full .section.tone-beige h4,
.theme-mm-full .section.tone-beige h1 .dim,
.theme-mm-full .section.tone-beige h2 .dim,
.theme-mm-full .section.tone-beige h3 .dim { color: var(--mm-ink); }
.theme-mm-full .section.tone-beige .mm-title-accent { color: var(--mm-red); }
.theme-mm-full .section.tone-beige .eyebrow { color: var(--mm-red); }
.theme-mm-full .section.tone-beige .dim,
.theme-mm-full .section.tone-beige p.dim,
.theme-mm-full .section.tone-beige .mute { color: var(--mm-graphite); }
.theme-mm-full .section.tone-beige .faint,
.theme-mm-full .section.tone-beige .mono.faint { color: var(--mm-steel-dark); }
.theme-mm-full .section.tone-beige b,
.theme-mm-full .section.tone-beige strong { color: var(--mm-ink); }
.theme-mm-full .section.tone-beige .mono.accent,
.theme-mm-full .section.tone-beige .accent { color: var(--mm-red); }
.theme-mm-full .section.tone-beige .chip {
  border-color: rgba(216, 35, 42, 0.35);
  color: var(--mm-red-deep);
  background: rgba(216, 35, 42, 0.05);
}
.theme-mm-full .section.tone-beige .mm-lane-step h4 { color: var(--mm-ink); }
.theme-mm-full .section.tone-beige .mm-lane-step .mm-lane-id { color: var(--mm-steel-dark); }
.theme-mm-full .section.tone-beige .mm-bn-row .mm-bn-pain { color: var(--mm-ink); }
/* Metric / panel tiles on light bands → white tiles, ink hairlines */
.theme-mm-full .section.tone-beige [style*="background: var(--line)"],
.theme-mm-full .section.tone-beige [style*="background:var(--line)"] { background: rgba(21, 22, 22, 0.12) !important; }
.theme-mm-full .section.tone-beige [style*="background: rgba(255,255,255,0.5)"],
.theme-mm-full .section.tone-beige [style*="background:rgba(255,255,255,0.5)"] { background: var(--mm-white, #fff) !important; }
.theme-mm-full .section.tone-beige [style*="border: var(--hairline)"] { border-color: rgba(21, 22, 22, 0.16) !important; }
.theme-mm-full .section.tone-beige .mm-bottlenecks,
.theme-mm-full .section.tone-beige .mm-lane { background: rgba(21, 22, 22, 0.14); border-color: rgba(21, 22, 22, 0.16); }
.theme-mm-full .section.tone-beige .mm-lane-step { background: #fff; }
.theme-mm-full .section.tone-beige .mm-bn-row { background: #fff; }
.theme-mm-full .section.tone-beige .mm-bn-head { background: #fff; color: var(--mm-steel-dark); }

/* ── Eyebrows / dim / chips on DARK ──────────────────────── */
.theme-mm-full .eyebrow { color: var(--mm-red-bright); }
.theme-mm-full .eyebrow::before { background: var(--mm-steel-dark); }
.theme-mm-full .dim { color: rgba(244, 245, 245, 0.78); }
.theme-mm-full .mute, .theme-mm-full .faint { color: rgba(244, 245, 245, 0.5); }
.theme-mm-full .mono.accent, .theme-mm-full .accent { color: var(--mm-red-bright); }
.theme-mm-full b, .theme-mm-full strong { color: var(--mm-paper); }
.theme-mm-full .chip {
  border-color: rgba(216, 35, 42, 0.4);
  color: var(--mm-red-bright);
  background: rgba(216, 35, 42, 0.08);
}

/* Hero dot grid — red-tinted */
.theme-mm-full .grid-bg {
  background-image:
    linear-gradient(to right, rgba(244,245,245,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(244,245,245,0.04) 1px, transparent 1px);
}

/* Metric tiles inside DARK sections → raised ink */
.theme-mm-full .section [style*="background: var(--line)"],
.theme-mm-full .section [style*="background:var(--line)"] { background: rgba(244, 245, 245, 0.08) !important; }
.theme-mm-full .section [style*="background: rgba(255,255,255,0.5)"],
.theme-mm-full .section [style*="background:rgba(255,255,255,0.5)"] { background: var(--mm-ink-2) !important; }

/* ── BLUEPRINT — recolor to ink/red ──────────────────────── */
.theme-mm-full .bp-svg rect[fill="url(#bp-dots)"] { opacity: 0.5; }
.theme-mm-full .bp-tick { stroke: rgba(244, 245, 245, 0.5); }
.theme-mm-full .bp-coord { fill: rgba(244, 245, 245, 0.5); }
.theme-mm-full .bp-core-box { stroke: var(--mm-red); fill: rgba(216, 35, 42, 0.16); }
.theme-mm-full .bp-core-corner { fill: var(--mm-red); }
.theme-mm-full .bp-core-sub { fill: var(--mm-red-bright); }
.theme-mm-full .bp-core-label { fill: var(--mm-paper); }
.theme-mm-full .bp-core-meta { fill: rgba(244, 245, 245, 0.7); }
.theme-mm-full .bp-pulse { stroke: rgba(216, 35, 42, 0.35); }
.theme-mm-full .bp-module-box { stroke: rgba(244, 245, 245, 0.25); fill: var(--mm-ink-2); }
.theme-mm-full .bp-mod-corner { stroke: rgba(244, 245, 245, 0.5); }
.theme-mm-full .bp-mod-name { fill: var(--mm-paper); }
.theme-mm-full .bp-mod-meta { fill: rgba(244, 245, 245, 0.6); }
.theme-mm-full .bp-mod-id { fill: var(--mm-red-bright); }
.theme-mm-full .bp-line { stroke: rgba(216, 35, 42, 0.45); }
.theme-mm-full .bp-endpoint { fill: var(--mm-red-bright); }
.theme-mm-full .bp-info {
  background: var(--mm-ink-2);
  border-color: rgba(216, 35, 42, 0.4);
}
.theme-mm-full .bp-info-eyebrow, .theme-mm-full .bp-info-cta { color: var(--mm-red-bright); }

/* ── BURST CTA ───────────────────────────────────────────── */
.theme-mm-full .section.tone-burst::before {
  background:
    radial-gradient(ellipse 70% 80% at 100% 0%, rgba(216, 35, 42, 0.28) 0%, transparent 55%),
    radial-gradient(ellipse 55% 65% at 0% 100%, rgba(42, 44, 46, 0.6) 0%, transparent 60%),
    var(--mm-black);
}
.theme-mm-full .section.tone-burst,
.theme-mm-full .section.tone-burst h2,
.theme-mm-full .section.tone-burst h3 { color: var(--mm-paper); }
.theme-mm-full .section.tone-burst .mono.faint,
.theme-mm-full .section.tone-burst .mono.mute,
.theme-mm-full .section.tone-burst .dim { color: rgba(244, 245, 245, 0.66) !important; }
.theme-mm-full .section.tone-burst .handoff,
.theme-mm-full .section.tone-burst .handoff-light {
  background: transparent;
  border-color: rgba(216, 35, 42, 0.35);
}
.theme-mm-full .section.tone-burst .btn.btn-primary {
  background: var(--mm-red);
  color: var(--mm-paper);
  border-color: transparent;
}
.theme-mm-full .section.tone-burst .btn.btn-primary:hover {
  background: var(--mm-paper);
  color: var(--mm-ink);
  box-shadow: 0 0 24px rgba(216, 35, 42, 0.4);
}

/* ── FOOTER ──────────────────────────────────────────────── */
.theme-mm-full .footer-dark { background: var(--mm-black); color: var(--mm-paper); }
.theme-mm-full .footer-dark a { color: rgba(244, 245, 245, 0.7); }
.theme-mm-full .footer-dark a:hover { color: var(--mm-paper); }
.theme-mm-full .footer-dark .logo { color: var(--mm-paper); }
.theme-mm-full .footer-dark .mono.faint { color: rgba(244, 245, 245, 0.5); }
