/* ============================================================
   REFLY — co-branding tokens, shield mark, theme scope
   ============================================================
   Mirrors the Mura Menasa co-branding pattern:
     .theme-rf-full — whole-page rebrand of the Entropia chassis to
                      REFLY's aviation look: deep navy + sky blue +
                      paper white, Unbounded display, Montserrat body.
                      DARK navy base with LIGHT sky bands.
   Brand source: REFLY brand book (airworthiness control platform).
   Palette from print logo set: navy #1D2C5A, sky #CCEBF6,
   brown #312825, paper #F1F2F2.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@400;500;600;700&family=Montserrat:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --rf-navy:         #1D2C5A;
  --rf-navy-deep:    #16224A;
  --rf-ink:          #0D1530;
  --rf-ink-2:        #142046;
  --rf-ink-3:        #1D2C5A;

  --rf-sky:          #CCEBF6;
  --rf-sky-band:     #DCEFF8;
  --rf-azure:        #6FB9E8;
  --rf-azure-bright: #8FD0F7;
  --rf-azure-deep:   #2F6AC0;
  --rf-paper:        #F1F2F2;
  --rf-brown:        #312825;

  --rf-font-display: 'Unbounded', 'Arial', sans-serif;
  --rf-font-body:    'Montserrat', system-ui, sans-serif;
  --rf-font-mono:    'JetBrains Mono', ui-monospace, monospace;
}

/* ============================================================
   SHIELD MARK — aircraft-window shield with a wing, radar pings.
   Inline-SVG host: <span class="rf-shield is-playing" data-rf-shield></span>
   ============================================================ */

.rf-shield {
  --rf-shield-size: 200px;
  position: relative;
  width: var(--rf-shield-size);
  height: var(--rf-shield-size);
  display: inline-block;
  vertical-align: middle;
  color: var(--rf-azure);
}
.rf-shield svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* Radar pings — two expanding rings behind the shield. */
.rf-shield::before,
.rf-shield::after {
  content: '';
  position: absolute;
  inset: 6%;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}
.rf-shield.is-playing::before { animation: rf-ping 4.8s ease-out 0.9s infinite; }
.rf-shield.is-playing::after  { animation: rf-ping 4.8s ease-out 3.3s infinite; }
@keyframes rf-ping {
  0%   { transform: scale(0.62); opacity: 0.55; }
  70%  { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1.18); opacity: 0; }
}

/* Intro — the shield rises into place once. */
.rf-shield svg { opacity: 0; }
.rf-shield.is-playing svg {
  animation: rf-shield-intro 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes rf-shield-intro {
  0%   { transform: translateY(14px) scale(0.86); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.rf-shield:hover::before { animation-duration: 1.8s; animation-delay: 0s; }

@media (prefers-reduced-motion: reduce) {
  .rf-shield.is-playing svg { animation: none; opacity: 1; transform: none; }
  .rf-shield.is-playing::before,
  .rf-shield.is-playing::after { animation: none; opacity: 0; }
}

/* ============================================================
   HERO head row — title left, oversized shield right
   ============================================================ */
.rf-hero-headrow {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto;
  align-items: center;
  gap: clamp(24px, 4vw, 72px);
  margin-top: 36px;
}
.rf-hero-sideshield { display: flex; justify-content: flex-end; }
.rf-hero-sideshield .rf-shield { --rf-shield-size: clamp(200px, 22vw, 330px); }

@media (max-width: 1080px) {
  .rf-hero-headrow { grid-template-columns: 1fr; gap: 28px; }
  .rf-hero-sideshield { justify-content: flex-start; }
  .rf-hero-sideshield .rf-shield { --rf-shield-size: clamp(160px, 38vw, 260px); }
}
@media (max-width: 720px) {
  .rf-hero-sideshield .rf-shield { --rf-shield-size: 150px; }
}

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

/* ============================================================
   PROCESS LANE — the airworthiness-control loop "as-is"
   ============================================================ */
.rf-lane {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0;
  border: var(--hairline);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.rf-lane-step {
  position: relative;
  padding: var(--s-5);
  border-right: var(--hairline);
  min-height: 150px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rf-lane-step:last-child { border-right: none; }
.rf-lane-step .rf-lane-id {
  font-family: var(--rf-font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(241, 242, 242, 0.45);
}
.rf-lane-step h4 { font-family: var(--rf-font-display); font-size: 14px; font-weight: 500; letter-spacing: 0; }
.rf-lane-step p { font-size: 12.5px; line-height: 1.5; }
.rf-lane-step .rf-lane-arrow {
  position: absolute;
  right: -7px; top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  font-family: var(--rf-font-mono);
  font-size: 12px;
  color: rgba(241, 242, 242, 0.45);
}
.rf-lane-step.is-bottleneck { box-shadow: inset 3px 0 0 var(--rf-azure); }
.rf-lane-step.is-bottleneck .rf-lane-id { color: var(--rf-azure-bright); }
@media (max-width: 860px) {
  .rf-lane { grid-auto-flow: row; grid-auto-columns: auto; }
  .rf-lane-step { border-right: none; border-bottom: var(--hairline); }
  .rf-lane-step:last-child { border-bottom: none; }
  .rf-lane-step .rf-lane-arrow { display: none; }
}

/* ============================================================
   CHALLENGE GRID — "разрыв контура → решение платформой"
   ============================================================ */
.rf-bottlenecks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border: var(--hairline);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.rf-bn-head, .rf-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;
}
.rf-bn-head {
  font-family: var(--rf-font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.rf-bn-row .rf-bn-num { font-family: var(--rf-font-mono); font-size: 12px; color: var(--rf-azure-deep); }
.rf-bn-row .rf-bn-pain { font-weight: 500; line-height: 1.45; font-size: 14px; }
.rf-bn-row .rf-bn-fix { font-size: 13.5px; line-height: 1.5; }
.rf-bn-row .rf-bn-fix b { font-weight: 600; }
@media (max-width: 720px) {
  .rf-bn-head { display: none; }
  .rf-bn-row { grid-template-columns: 1fr; gap: 8px; }
}

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

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

/* ============================================================
   THEME FULL — whole-page rebrand to navy + sky + paper
   ============================================================ */
.theme-rf-full {
  --color-bg: var(--rf-ink);
  --color-primary: var(--rf-paper);
  --color-accent: var(--rf-azure);
  --color-accent-hover: var(--rf-azure-bright);
  --accent: var(--rf-azure);
  --accent-12: rgba(111, 185, 232, 0.14);
  --accent-30: rgba(111, 185, 232, 0.40);
  --accent-glow: rgba(111, 185, 232, 0.6);
  --titanium: var(--rf-paper);
  --titanium-dim: rgba(241, 242, 242, 0.78);
  --titanium-faint: rgba(241, 242, 242, 0.46);
  --titanium-mute: rgba(241, 242, 242, 0.56);
  --line: rgba(241, 242, 242, 0.10);
  --line-2: rgba(241, 242, 242, 0.18);
  --hairline: 1px solid rgba(241, 242, 242, 0.10);

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

.theme-rf-full .display,
.theme-rf-full h1,
.theme-rf-full h2,
.theme-rf-full h3,
.theme-rf-full h4 {
  font-family: var(--rf-font-display);
  letter-spacing: 0;
  color: var(--rf-paper);
}
.theme-rf-full h1, .theme-rf-full .display { font-weight: 600; }
.theme-rf-full h2, .theme-rf-full h3 { font-weight: 500; }
.theme-rf-full .display .dim,
.theme-rf-full h1 .dim,
.theme-rf-full h2 .dim,
.theme-rf-full h3 .dim { opacity: 1; color: rgba(241, 242, 242, 0.6); }
.theme-rf-full .mono,
.theme-rf-full .eyebrow,
.theme-rf-full .chip,
.theme-rf-full .btn { font-family: var(--rf-font-mono); }

/* Title accent — sky blue, ties the heading to the shield mark. */
.theme-rf-full .rf-title-accent { color: var(--rf-azure-bright); }
/* Caret — recolor the Entropia caret to brand sky. */
.theme-rf-full .caret { background: var(--rf-azure-bright); }

/* ── NAV ─────────────────────────────────────────────────── */
.theme-rf-full .nav {
  background: rgba(13, 21, 48, 0.85);
  border-bottom: var(--hairline);
}
.theme-rf-full .nav-item { color: rgba(241, 242, 242, 0.7); }
.theme-rf-full .nav-item:hover,
.theme-rf-full .nav-item.is-active { color: var(--rf-azure-bright); }
.theme-rf-full .logo { color: var(--rf-paper); font-family: var(--rf-font-display); font-weight: 500; }
.theme-rf-full .nav-mark svg rect { fill: var(--rf-azure) !important; }
.theme-rf-full .btn-primary {
  background: var(--rf-sky);
  border-color: var(--rf-sky);
  color: var(--rf-navy);
}
.theme-rf-full .btn-primary:hover {
  background: #fff;
  border-color: #fff;
  color: var(--rf-navy);
  box-shadow: 0 6px 20px rgba(111, 185, 232, 0.35);
}
.theme-rf-full .btn:hover { border-color: var(--rf-paper); background: var(--rf-paper); color: var(--rf-ink); }

/* ── SECTION RHYTHM — DARK navy base / LIGHT sky bands ───── */
.theme-rf-full .hero,
.theme-rf-full .section { background: transparent; color: var(--rf-paper); }
.theme-rf-full .section { border-top-color: rgba(241, 242, 242, 0.08); }

.theme-rf-full .section.tone-cool::before     { background: var(--rf-ink-2); }
.theme-rf-full .section.tone-cream::before    { background: var(--rf-ink); }
.theme-rf-full .section.tone-beige::before    { background: var(--rf-sky-band); }
.theme-rf-full .section.tone-clay::before     { background: rgba(111, 185, 232, 0.08); }
.theme-rf-full .section.tone-sand::before     { background: var(--rf-navy-deep); }
.theme-rf-full .section.tone-espresso::before { background: var(--rf-navy-deep); }

/* ── LIGHT band recolor — navy text on sky ───────────────── */
.theme-rf-full .section.tone-beige,
.theme-rf-full .section.tone-beige h1,
.theme-rf-full .section.tone-beige h2,
.theme-rf-full .section.tone-beige h3,
.theme-rf-full .section.tone-beige h4,
.theme-rf-full .section.tone-beige h1 .dim,
.theme-rf-full .section.tone-beige h2 .dim,
.theme-rf-full .section.tone-beige h3 .dim { color: var(--rf-navy); }
.theme-rf-full .section.tone-beige h2 .dim,
.theme-rf-full .section.tone-beige h3 .dim { opacity: 0.55; }
.theme-rf-full .section.tone-beige .rf-title-accent { color: var(--rf-azure-deep); }
.theme-rf-full .section.tone-beige .eyebrow { color: var(--rf-azure-deep); }
.theme-rf-full .section.tone-beige .dim,
.theme-rf-full .section.tone-beige p.dim,
.theme-rf-full .section.tone-beige .mute { color: #33415F; }
.theme-rf-full .section.tone-beige .faint,
.theme-rf-full .section.tone-beige .mono.faint { color: #5A6B8C; }
.theme-rf-full .section.tone-beige b,
.theme-rf-full .section.tone-beige strong { color: var(--rf-navy); }
.theme-rf-full .section.tone-beige .mono.accent,
.theme-rf-full .section.tone-beige .accent { color: var(--rf-azure-deep); }
.theme-rf-full .section.tone-beige .chip {
  border-color: rgba(47, 106, 192, 0.35);
  color: var(--rf-azure-deep);
  background: rgba(47, 106, 192, 0.05);
}
.theme-rf-full .section.tone-beige .rf-shield { color: var(--rf-navy); }
.theme-rf-full .section.tone-beige .rf-client-mark {
  border-color: var(--rf-navy);
  background: rgba(29, 44, 90, 0.05);
}
.theme-rf-full .section.tone-beige .rf-client-id { color: var(--rf-navy); }
.theme-rf-full .section.tone-beige .rf-client-id .dash { background: rgba(29, 44, 90, 0.4); }
.theme-rf-full .section.tone-beige .rf-lane-step h4 { color: var(--rf-navy); }
.theme-rf-full .section.tone-beige .rf-lane-step .rf-lane-id { color: #5A6B8C; }
.theme-rf-full .section.tone-beige .rf-lane-step.is-bottleneck { box-shadow: inset 3px 0 0 var(--rf-azure-deep); }
.theme-rf-full .section.tone-beige .rf-lane-step.is-bottleneck .rf-lane-id { color: var(--rf-azure-deep); }
.theme-rf-full .section.tone-beige .rf-bn-row .rf-bn-pain { color: var(--rf-navy); }
.theme-rf-full .section.tone-beige .rf-shot {
  background:
    linear-gradient(135deg, rgba(29, 44, 90, 0.08), transparent 60%),
    repeating-linear-gradient(45deg, rgba(29, 44, 90, 0.05) 0 10px, transparent 10px 20px);
}
.theme-rf-full .section.tone-beige .rf-shot .rf-shot-label { color: #5A6B8C; }
/* Metric / panel tiles on light bands → white tiles, navy hairlines */
.theme-rf-full .section.tone-beige [style*="background: var(--line)"],
.theme-rf-full .section.tone-beige [style*="background:var(--line)"] { background: rgba(29, 44, 90, 0.14) !important; }
.theme-rf-full .section.tone-beige [style*="background: rgba(255,255,255,0.5)"],
.theme-rf-full .section.tone-beige [style*="background:rgba(255,255,255,0.5)"] { background: #fff !important; }
.theme-rf-full .section.tone-beige [style*="border: var(--hairline)"] { border-color: rgba(29, 44, 90, 0.18) !important; }
.theme-rf-full .section.tone-beige .rf-bottlenecks,
.theme-rf-full .section.tone-beige .rf-lane { background: rgba(29, 44, 90, 0.16); border-color: rgba(29, 44, 90, 0.18); }
.theme-rf-full .section.tone-beige .rf-lane-step { background: #fff; border-color: rgba(29, 44, 90, 0.14); }
.theme-rf-full .section.tone-beige .rf-lane-step .rf-lane-arrow { color: #5A6B8C; }
.theme-rf-full .section.tone-beige .rf-bn-row { background: #fff; }
.theme-rf-full .section.tone-beige .rf-bn-head { background: #fff; color: #5A6B8C; }
.theme-rf-full .section.tone-beige .rf-bn-row .rf-bn-num { color: var(--rf-azure-deep); }

/* ── Eyebrows / dim / chips on DARK ──────────────────────── */
.theme-rf-full .eyebrow { color: var(--rf-azure-bright); }
.theme-rf-full .eyebrow::before { background: rgba(111, 185, 232, 0.5); }
.theme-rf-full .dim { color: rgba(241, 242, 242, 0.78); }
.theme-rf-full .mute, .theme-rf-full .faint { color: rgba(241, 242, 242, 0.5); }
.theme-rf-full .mono.accent, .theme-rf-full .accent { color: var(--rf-azure-bright); }
.theme-rf-full b, .theme-rf-full strong { color: var(--rf-paper); }
.theme-rf-full .chip {
  border-color: rgba(111, 185, 232, 0.4);
  color: var(--rf-azure-bright);
  background: rgba(111, 185, 232, 0.08);
}

/* Hero grid — faint sky lines */
.theme-rf-full .grid-bg {
  background-image:
    linear-gradient(to right, rgba(204, 235, 246, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(204, 235, 246, 0.045) 1px, transparent 1px);
}

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

/* ── BLUEPRINT — recolor to navy/sky ─────────────────────── */
.theme-rf-full .bp-svg rect[fill="url(#bp-dots)"] { opacity: 0.5; }
.theme-rf-full .bp-tick { stroke: rgba(241, 242, 242, 0.5); }
.theme-rf-full .bp-coord { fill: rgba(241, 242, 242, 0.5); }
.theme-rf-full .bp-core-box { stroke: var(--rf-azure); fill: rgba(111, 185, 232, 0.14); }
.theme-rf-full .bp-core-corner { fill: var(--rf-azure); }
.theme-rf-full .bp-core-sub { fill: var(--rf-azure-bright); }
.theme-rf-full .bp-core-label { fill: var(--rf-paper); }
.theme-rf-full .bp-core-meta { fill: rgba(241, 242, 242, 0.7); }
.theme-rf-full .bp-pulse { stroke: rgba(111, 185, 232, 0.35); }
.theme-rf-full .bp-module-box { stroke: rgba(241, 242, 242, 0.25); fill: var(--rf-ink-2); }
.theme-rf-full .bp-mod-corner { stroke: rgba(241, 242, 242, 0.5); }
.theme-rf-full .bp-mod-name { fill: var(--rf-paper); }
.theme-rf-full .bp-mod-meta { fill: rgba(241, 242, 242, 0.6); }
.theme-rf-full .bp-mod-id { fill: var(--rf-azure-bright); }
.theme-rf-full .bp-line { stroke: rgba(111, 185, 232, 0.45); }
.theme-rf-full .bp-endpoint { fill: var(--rf-azure-bright); }
.theme-rf-full .bp-info {
  background: var(--rf-ink-2);
  border-color: rgba(111, 185, 232, 0.4);
}
.theme-rf-full .bp-info-eyebrow, .theme-rf-full .bp-info-cta { color: var(--rf-azure-bright); }

/* ── BURST CTA — the brand's blue sphere gradient ────────── */
.theme-rf-full .section.tone-burst::before {
  background:
    radial-gradient(ellipse 70% 90% at 85% 10%, rgba(111, 185, 232, 0.35) 0%, rgba(47, 106, 192, 0.25) 35%, transparent 65%),
    radial-gradient(ellipse 55% 65% at 0% 100%, rgba(29, 44, 90, 0.8) 0%, transparent 60%),
    var(--rf-navy-deep);
}
.theme-rf-full .section.tone-burst,
.theme-rf-full .section.tone-burst h2,
.theme-rf-full .section.tone-burst h3 { color: var(--rf-paper); }
.theme-rf-full .section.tone-burst .mono.faint,
.theme-rf-full .section.tone-burst .mono.mute,
.theme-rf-full .section.tone-burst .dim { color: rgba(241, 242, 242, 0.66) !important; }
.theme-rf-full .section.tone-burst .handoff,
.theme-rf-full .section.tone-burst .handoff-light {
  background: transparent;
  border-color: rgba(111, 185, 232, 0.35);
}
.theme-rf-full .section.tone-burst .btn.btn-primary {
  background: var(--rf-sky);
  color: var(--rf-navy);
  border-color: transparent;
}
.theme-rf-full .section.tone-burst .btn.btn-primary:hover {
  background: #fff;
  color: var(--rf-navy);
  box-shadow: 0 0 24px rgba(111, 185, 232, 0.45);
}

/* ── FOOTER ──────────────────────────────────────────────── */
.theme-rf-full .footer-dark { background: #0A1126; color: var(--rf-paper); }
.theme-rf-full .footer-dark a { color: rgba(241, 242, 242, 0.7); }
.theme-rf-full .footer-dark a:hover { color: var(--rf-paper); }
.theme-rf-full .footer-dark .logo { color: var(--rf-paper); }
.theme-rf-full .footer-dark .mono.faint { color: rgba(241, 242, 242, 0.5); }
.theme-rf-full .footer-dark .rf-shield { color: var(--rf-sky); }
