/*
 * Afflatus adaptive wordmark — full word at the document origin, page-specific
 * AI intelligence glyph everywhere else. The compact mark is drawn entirely
 * with type and CSS telemetry; it deliberately contains no slash/backslash.
 */

.afflatus-brand-sentinel {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  inline-size: 1px;
  block-size: 1px;
  pointer-events: none;
}

.site-header--follow {
  position: -webkit-sticky;
  position: sticky;
  inset-block-start: var(--safe-top, 0px);
  z-index: 48;
  isolation: isolate;
  background-color: color-mix(in srgb, var(--afflatus-header-bg, #05070b) 88%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
  backdrop-filter: blur(18px) saturate(1.12);
  transition: border-color 420ms ease, box-shadow 420ms ease, background-color 420ms ease;
}

/* Home is a continuous flight deck with pinned 3D stages. Sticky headers stop
   following when an ancestor establishes a containing block, so this route
   deliberately uses a viewport-fixed command bar. Other site sections retain
   the generic sticky contract above. */
.home-page .site-header--follow {
  position: fixed;
  inset-inline: 0;
  inline-size: 100%;
  z-index: 1200;
}

/* Portfolio's interactive deck must leave iPhone landscape edges usable. */
.home-page.starfield-layout .site-header--follow {
  inset-inline-start: env(safe-area-inset-left, 0px);
  inset-inline-end: env(safe-area-inset-right, 0px);
  inline-size: calc(100% - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
}

:root[data-afflatus-brand-state="compact"] .site-header--follow {
  background-color: color-mix(in srgb, var(--afflatus-header-bg, #05070b) 95%, transparent);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, .2),
    inset 0 -1px 0 color-mix(in srgb, var(--afflatus-brand-accent, currentColor) 24%, transparent);
}

.afflatus-brand {
  --afflatus-brand-ink: currentColor;
  --afflatus-brand-accent: #9ae5ff;
  --afflatus-brand-accent-2: #e8b380;
  --afflatus-brand-font: ui-monospace, "SFMono-Regular", "Cascadia Code", "JetBrains Mono", monospace;
  --afflatus-brand-ease: cubic-bezier(.22, 1, .36, 1);
  --afflatus-brand-duration: 620ms;
  position: relative;
  inline-size: 132px;
  min-inline-size: 132px;
  min-block-size: var(--touch-target);
  display: inline-flex;
  align-items: center;
  justify-self: start;
  flex: 0 0 auto;
  color: var(--afflatus-brand-ink);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.afflatus-brand:focus-visible {
  outline: var(--focus-ring-width) solid var(--afflatus-brand-accent);
  outline-offset: var(--focus-ring-offset);
}

.afflatus-mobile-nav-toggle {
  display: none;
}

.afflatus-brand__stage {
  position: relative;
  inline-size: 132px;
  block-size: 34px;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: inherit;
  font-family: var(--afflatus-brand-font);
  font-size: 19px;
  font-weight: 680;
  line-height: 32px;
  letter-spacing: -.045em;
  font-variant-ligatures: none;
  white-space: nowrap;
  contain: layout paint;
}

.afflatus-brand__stage::before,
.afflatus-brand__stage::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transition: opacity 260ms ease, transform var(--afflatus-brand-duration) var(--afflatus-brand-ease);
}

.afflatus-brand__stage::after {
  inset-inline-start: 1px;
  inset-block-end: 1px;
  inline-size: 106px;
  block-size: 1px;
  background: linear-gradient(90deg, var(--afflatus-brand-accent), transparent 88%);
  opacity: .48;
  transform-origin: left center;
}

.afflatus-brand__a,
.afflatus-brand__before,
.afflatus-brand__l,
.afflatus-brand__after,
.afflatus-brand__signal,
.afflatus-brand__core {
  display: block;
  transition:
    transform var(--afflatus-brand-duration) var(--afflatus-brand-ease),
    max-inline-size var(--afflatus-brand-duration) var(--afflatus-brand-ease),
    opacity 260ms ease,
    filter 360ms ease,
    color 360ms ease,
    border-color 360ms ease,
    background-color 360ms ease;
}

.afflatus-brand__a,
.afflatus-brand__before,
.afflatus-brand__l,
.afflatus-brand__after {
  position: relative;
  inset: auto;
  flex: 0 0 auto;
  overflow: hidden;
}

.afflatus-brand__a {
  color: var(--afflatus-brand-accent);
  font-weight: 900;
  transform-origin: right center;
}

.afflatus-brand__before {
  max-inline-size: 2.4em;
  transform-origin: left center;
}

.afflatus-brand__l {
  color: var(--afflatus-brand-accent);
  font-weight: 900;
  transform-origin: center bottom;
}

/* The source word keeps its real lowercase l for the expanded Afflatus
   wordmark. In compact mode this drawn uppercase I takes its place, so the
   intelligence monogram reads as AI instead of the ambiguous Al. */
.afflatus-brand__l::after {
  content: "I";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--afflatus-brand-accent-2);
  font: inherit;
  font-weight: 900;
  opacity: 0;
  transform: translateY(7px) scaleY(.62);
  transform-origin: center bottom;
  text-shadow: 0 0 11px color-mix(in srgb, var(--afflatus-brand-accent-2) 55%, transparent);
  transition:
    opacity 260ms ease,
    transform var(--afflatus-brand-duration) var(--afflatus-brand-ease),
    color 360ms ease;
}

.afflatus-brand__after {
  max-inline-size: 4.8em;
  transform-origin: left center;
}

.afflatus-brand__signal,
.afflatus-brand__core {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.afflatus-brand__sr {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:root[data-afflatus-brand-state="compact"] .afflatus-brand__stage::after {
  inline-size: 45px;
  opacity: .92;
}

:root[data-afflatus-brand-state="compact"] .afflatus-brand__before,
:root[data-afflatus-brand-state="compact"] .afflatus-brand__after {
  max-inline-size: 0;
  opacity: 0;
  filter: blur(4px);
  transform: scaleX(.04);
}

:root[data-afflatus-brand-state="compact"] .afflatus-brand__after {
  transform: scaleX(.04);
}

:root[data-afflatus-brand-state="compact"] .afflatus-brand__a {
  transform: scaleX(.94);
}

:root[data-afflatus-brand-state="compact"] .afflatus-brand__l {
  inline-size: .68em;
  overflow: visible;
  color: transparent;
  transform: scaleY(1.08);
}

:root[data-afflatus-brand-state="compact"] .afflatus-brand__l::after {
  opacity: 1;
  transform: translateY(0) scaleY(.96);
}

:root[data-afflatus-brand-state="compact"] .afflatus-brand__signal,
:root[data-afflatus-brand-state="compact"] .afflatus-brand__core,
:root[data-afflatus-brand-state="compact"] .afflatus-brand__stage::before {
  opacity: 1;
}

/* ── HOME / deep-space navigation computer ─────────────────────── */

.home-page {
  --afflatus-header-bg: #03060b;
}

[data-brand-persona="home"] {
  --afflatus-brand-ink: #eaf6ff;
  --afflatus-brand-accent: #8fe9ff;
  --afflatus-brand-accent-2: #e7b77a;
  --afflatus-brand-font: "Orbitron", "Rajdhani", ui-monospace, monospace;
}

[data-brand-persona="home"] .afflatus-brand__stage {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .015em;
  text-shadow: 0 0 16px rgba(143, 233, 255, .2);
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="home"] .afflatus-brand__stage::before {
  inset: 3px auto auto 0;
  inline-size: 48px;
  block-size: 26px;
  border-block: 1px solid rgba(143, 233, 255, .24);
  box-shadow: inset 8px 0 12px -12px var(--afflatus-brand-accent);
  animation: afflatus-home-scan 2.8s ease-in-out infinite;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="home"] .afflatus-brand__signal {
  inset: 8px auto auto 43px;
  inline-size: 23px;
  block-size: 15px;
  border-block: 1px solid rgba(143, 233, 255, .72);
  background: repeating-linear-gradient(90deg, transparent 0 4px, rgba(143, 233, 255, .74) 4px 5px);
  filter: drop-shadow(0 0 5px rgba(143, 233, 255, .5));
  animation: afflatus-home-telemetry 1.9s steps(4, end) infinite;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="home"] .afflatus-brand__core {
  inset: 14px auto auto 71px;
  inline-size: 5px;
  block-size: 5px;
  border: 1px solid var(--afflatus-brand-accent-2);
  border-radius: 50%;
  box-shadow: 0 0 7px var(--afflatus-brand-accent-2), 0 0 18px rgba(231, 183, 122, .5);
  animation: afflatus-core-pulse 1.8s ease-in-out infinite;
}

@keyframes afflatus-home-scan {
  50% { border-block-color: rgba(231, 183, 122, .38); transform: scaleX(1.04); }
}

@keyframes afflatus-home-telemetry {
  50% { clip-path: inset(0 22% 0 0); }
}

@keyframes afflatus-core-pulse {
  50% { opacity: .45; transform: scale(.72); }
}

/* ── SHOWCASE / quiet tactical atlas ───────────────────────────── */

.showcase-page { --afflatus-header-bg: #06080c; }

[data-brand-persona="showcase"] {
  --afflatus-brand-ink: #efefe9;
  --afflatus-brand-accent: #7ee3ff;
  --afflatus-brand-accent-2: #a8f346;
  --afflatus-brand-font: "IBM Plex Mono", ui-monospace, monospace;
}

[data-brand-persona="showcase"] .afflatus-brand__stage {
  animation: afflatus-showcase-resolve 760ms var(--afflatus-brand-ease) both;
}

@keyframes afflatus-showcase-resolve {
  0% { transform: translateY(3px); opacity: .35; filter: blur(1px); }
  64% { transform: translateY(-1px); opacity: 1; filter: blur(0); }
  100% { transform: none; }
}

/* ── ARENA / execution terminal ────────────────────────────────── */

.arena-page { --afflatus-header-bg: #05070e; }

[data-brand-persona="arena"] {
  --afflatus-brand-ink: #effff6;
  --afflatus-brand-accent: #3dff9a;
  --afflatus-brand-accent-2: #ff4fbd;
  --afflatus-brand-font: "Rajdhani", "Chakra Petch", ui-monospace, monospace;
}

[data-brand-persona="arena"] .afflatus-brand__stage {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.02em;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="arena"] .afflatus-brand__stage::before {
  inset: 5px auto auto 0;
  inline-size: 54px;
  block-size: 23px;
  border: 1px solid rgba(61, 255, 154, .38);
  border-inline-end-color: var(--afflatus-brand-accent-2);
  box-shadow: 0 0 14px rgba(61, 255, 154, .12);
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="arena"] .afflatus-brand__signal {
  inset: 8px auto auto 47px;
  inline-size: 17px;
  block-size: 17px;
  background: linear-gradient(to top, var(--afflatus-brand-accent) 0 32%, transparent 32% 45%, var(--afflatus-brand-accent-2) 45% 72%, transparent 72%);
  clip-path: polygon(0 100%, 0 52%, 26% 52%, 26% 18%, 48% 18%, 48% 70%, 70% 70%, 70% 0, 100% 0, 100% 100%);
  animation: afflatus-arena-tick 1.2s steps(2, end) infinite;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="arena"] .afflatus-brand__core {
  inset: 12px auto auto 69px;
  inline-size: 12px;
  block-size: 8px;
  border-block: 1px solid var(--afflatus-brand-accent-2);
  box-shadow: 0 0 9px rgba(255, 79, 189, .5);
}

@keyframes afflatus-arena-tick {
  50% { transform: translateY(-1px) scaleY(.86); filter: brightness(1.35); }
}

/* ── SECTORS / two-bloc model foundry ──────────────────────────── */

.sectors-page { --afflatus-header-bg: #080806; }

[data-brand-persona="sectors"] {
  --afflatus-brand-ink: #f1eee6;
  --afflatus-brand-accent: #5b8dff;
  --afflatus-brand-accent-2: #ff6161;
  --afflatus-brand-font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-brand-persona="sectors"] .afflatus-brand__stage {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.055em;
}

[data-brand-persona="sectors"] .afflatus-brand__l { color: var(--afflatus-brand-accent-2); }

:root[data-afflatus-brand-state="compact"] [data-brand-persona="sectors"] .afflatus-brand__stage::before {
  inset: 4px auto auto 0;
  inline-size: 53px;
  block-size: 25px;
  border-block: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--afflatus-brand-accent) 0 49%, var(--afflatus-brand-accent-2) 51% 100%) 1;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="sectors"] .afflatus-brand__signal {
  inset: 8px auto auto 49px;
  inline-size: 25px;
  block-size: 17px;
  background:
    linear-gradient(var(--afflatus-brand-accent), var(--afflatus-brand-accent)) 0 3px / 10px 2px no-repeat,
    linear-gradient(var(--afflatus-brand-accent-2), var(--afflatus-brand-accent-2)) 15px 12px / 10px 2px no-repeat,
    radial-gradient(circle, #f1eee6 0 1px, transparent 2px) 11px 7px / 4px 4px no-repeat;
  animation: afflatus-sectors-bridge 2.4s ease-in-out infinite;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="sectors"] .afflatus-brand__core {
  inset: 13px auto auto 78px;
  inline-size: 7px;
  block-size: 7px;
  background: linear-gradient(90deg, var(--afflatus-brand-accent) 50%, var(--afflatus-brand-accent-2) 50%);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(241, 238, 230, .38);
}

@keyframes afflatus-sectors-bridge {
  50% { filter: saturate(1.45) brightness(1.2); transform: translateX(2px); }
}

/* ── SIGNAL / classified policy intelligence ───────────────────── */

.signal-page { --afflatus-header-bg: #0c0d0a; }

[data-brand-persona="signal"] {
  --afflatus-brand-ink: #f4f1e6;
  --afflatus-brand-accent: #f5c400;
  --afflatus-brand-accent-2: #c5483c;
  --afflatus-brand-font: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="signal"] .afflatus-brand__stage::before {
  inset: 3px auto auto 0;
  inline-size: 52px;
  block-size: 27px;
  border: 1px solid rgba(245, 196, 0, .44);
  box-shadow: inset 0 0 0 3px rgba(245, 196, 0, .035);
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="signal"] .afflatus-brand__signal {
  inset: 7px auto auto 45px;
  inline-size: 30px;
  block-size: 18px;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(245, 196, 0, .68) 3px 4px);
  clip-path: inset(0 0 0 0);
  animation: afflatus-signal-scan 1.65s steps(5, end) infinite;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="signal"] .afflatus-brand__core {
  inset: 11px auto auto 79px;
  inline-size: 9px;
  block-size: 9px;
  border: 2px solid var(--afflatus-brand-accent-2);
  box-shadow: 0 0 8px rgba(197, 72, 60, .42);
}

@keyframes afflatus-signal-scan {
  50% { clip-path: inset(35% 0 25% 0); opacity: .55; }
}

/* ── COURSE / censored microfilm terminal ──────────────────────── */

.course-page { --afflatus-header-bg: #090909; }

[data-brand-persona="course"] {
  --afflatus-brand-ink: #f2ede8;
  --afflatus-brand-accent: #ff3f8f;
  --afflatus-brand-accent-2: #ff5b4d;
  --afflatus-brand-font: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;
}

[data-brand-persona="course"] .afflatus-brand__stage { text-shadow: 1px 0 rgba(255, 63, 143, .45); }

:root[data-afflatus-brand-state="compact"] [data-brand-persona="course"] .afflatus-brand__stage::before {
  inset: 4px auto auto 0;
  inline-size: 53px;
  block-size: 25px;
  border-block: 3px double rgba(255, 63, 143, .48);
  background: repeating-linear-gradient(0deg, transparent 0 4px, rgba(255, 255, 255, .06) 4px 5px);
  animation: afflatus-course-jitter 2.6s steps(1, end) infinite;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="course"] .afflatus-brand__signal {
  inset: 8px auto auto 46px;
  inline-size: 29px;
  block-size: 17px;
  background: repeating-linear-gradient(0deg, var(--afflatus-brand-accent-2) 0 2px, transparent 2px 5px);
  clip-path: polygon(0 0, 73% 0, 73% 26%, 100% 26%, 100% 72%, 48% 72%, 48% 100%, 0 100%);
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="course"] .afflatus-brand__core {
  inset: 12px auto auto 78px;
  inline-size: 12px;
  block-size: 8px;
  background: var(--afflatus-brand-accent);
  box-shadow: 0 0 10px rgba(255, 63, 143, .52);
  animation: afflatus-course-redact 2.1s steps(2, end) infinite;
}

@keyframes afflatus-course-jitter {
  48% { transform: none; }
  49% { transform: translateX(2px); }
  51% { transform: translateX(-1px); }
  52% { transform: none; }
}

@keyframes afflatus-course-redact {
  50% { inline-size: 4px; opacity: .38; }
}

/* ── HOROSCOPE / celestial inference seal ──────────────────────── */

.horoscope-page { --afflatus-header-bg: #f6f1e6; }

[data-brand-persona="horoscope"] {
  --afflatus-brand-ink: #4a453d;
  --afflatus-brand-accent: #667a59;
  --afflatus-brand-accent-2: #c96f4a;
  --afflatus-brand-font: "Spectral", "Noto Serif SC", Georgia, serif;
}

[data-brand-persona="horoscope"] .afflatus-brand__stage {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.025em;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="horoscope"] .afflatus-brand__stage::before {
  inset: 2px auto auto 0;
  inline-size: 48px;
  block-size: 29px;
  border: 1px solid rgba(102, 122, 89, .52);
  border-radius: 50%;
  transform: scaleY(.64);
  box-shadow: inset 0 0 0 4px rgba(102, 122, 89, .04);
  animation: afflatus-horoscope-orbit 5.5s ease-in-out infinite;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="horoscope"] .afflatus-brand__signal {
  inset: 10px auto auto 45px;
  inline-size: 26px;
  block-size: 12px;
  border-block: 1px solid rgba(201, 111, 74, .58);
  border-radius: 50%;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="horoscope"] .afflatus-brand__core {
  inset: 13px auto auto 73px;
  inline-size: 7px;
  block-size: 7px;
  border-radius: 50%;
  background: var(--afflatus-brand-accent-2);
  box-shadow: 0 0 0 3px rgba(201, 111, 74, .12);
}

@keyframes afflatus-horoscope-orbit {
  50% { transform: scaleY(.78) translateX(2px); border-color: rgba(201, 111, 74, .52); }
}

/* ── GAMES / broadcast prediction engine ───────────────────────── */

.games-page { --afflatus-header-bg: #080d2a; }

[data-brand-persona="games"] {
  --afflatus-brand-ink: #f2f5ff;
  --afflatus-brand-accent: #25e9ff;
  --afflatus-brand-accent-2: #d4af37;
  --afflatus-brand-font: "Chakra Petch", "Share Tech Mono", ui-monospace, monospace;
}

[data-brand-persona="games"] .afflatus-brand__stage { font-size: 21px; font-weight: 700; }

:root[data-afflatus-brand-state="compact"] [data-brand-persona="games"] .afflatus-brand__stage::before {
  inset: 4px auto auto 0;
  inline-size: 53px;
  block-size: 25px;
  border: 2px solid rgba(37, 233, 255, .5);
  border-inline-color: var(--afflatus-brand-accent-2);
  box-shadow: 0 0 12px rgba(37, 233, 255, .16);
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="games"] .afflatus-brand__signal {
  inset: 8px auto auto 47px;
  inline-size: 27px;
  block-size: 17px;
  background:
    linear-gradient(var(--afflatus-brand-accent-2), var(--afflatus-brand-accent-2)) 0 0 / 9px 4px no-repeat,
    linear-gradient(var(--afflatus-brand-accent), var(--afflatus-brand-accent)) 12px 7px / 15px 3px no-repeat,
    linear-gradient(var(--afflatus-brand-accent-2), var(--afflatus-brand-accent-2)) 3px 13px / 18px 2px no-repeat;
  animation: afflatus-games-score 1.35s steps(3, end) infinite;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="games"] .afflatus-brand__core {
  inset: 11px auto auto 78px;
  inline-size: 10px;
  block-size: 10px;
  border: 1px solid var(--afflatus-brand-accent);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(37, 233, 255, .12);
}

@keyframes afflatus-games-score {
  50% { filter: brightness(1.5); transform: translateX(1px); }
}

/* ── LEAGUE / tournament strategy core ─────────────────────────── */

.leagues-page { --afflatus-header-bg: #111820; }

[data-brand-persona="league"] {
  --afflatus-brand-ink: #edf3f4;
  --afflatus-brand-accent: #d8bc72;
  --afflatus-brand-accent-2: #6ad6d4;
  --afflatus-brand-font: "Rajdhani", "Cinzel", ui-monospace, monospace;
}

[data-brand-persona="league"] .afflatus-brand__stage { font-size: 21px; font-weight: 700; }

:root[data-afflatus-brand-state="compact"] [data-brand-persona="league"] .afflatus-brand__stage::before {
  inset: 4px auto auto 0;
  inline-size: 53px;
  block-size: 25px;
  border-block: 2px solid rgba(216, 188, 114, .52);
  box-shadow: inset 0 0 12px rgba(106, 214, 212, .08);
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="league"] .afflatus-brand__signal {
  inset: 7px auto auto 47px;
  inline-size: 28px;
  block-size: 19px;
  background:
    linear-gradient(90deg, var(--afflatus-brand-accent) 0 70%, transparent 70%) 0 1px / 100% 2px no-repeat,
    linear-gradient(90deg, var(--afflatus-brand-accent-2) 0 52%, transparent 52%) 0 8px / 100% 2px no-repeat,
    linear-gradient(90deg, var(--afflatus-brand-accent) 0 84%, transparent 84%) 0 15px / 100% 2px no-repeat;
  animation: afflatus-league-bracket 2s ease-in-out infinite;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="league"] .afflatus-brand__core {
  inset: 12px auto auto 78px;
  inline-size: 8px;
  block-size: 8px;
  border: 1px solid var(--afflatus-brand-accent-2);
  box-shadow: 0 0 9px rgba(106, 214, 212, .4);
}

@keyframes afflatus-league-bracket {
  50% { transform: scaleX(.8); transform-origin: left; }
}

/* ── SERIAL / archival film intelligence ───────────────────────── */

.novels-page { --afflatus-header-bg: #281815; }

[data-brand-persona="serial"] {
  --afflatus-brand-ink: #ddd2c2;
  --afflatus-brand-accent: #d4935d;
  --afflatus-brand-accent-2: #67c5bd;
  --afflatus-brand-font: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="serial"] .afflatus-brand__stage::before {
  inset: 4px auto auto 0;
  inline-size: 53px;
  block-size: 25px;
  border-block: 1px solid rgba(212, 147, 93, .56);
  background: repeating-linear-gradient(90deg, transparent 0 6px, rgba(103, 197, 189, .22) 6px 8px);
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="serial"] .afflatus-brand__signal {
  inset: 8px auto auto 47px;
  inline-size: 29px;
  block-size: 17px;
  border-block: 4px dotted var(--afflatus-brand-accent);
  opacity: .75;
  animation: afflatus-serial-film 1.8s steps(4, end) infinite;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="serial"] .afflatus-brand__core {
  inset: 11px auto auto 79px;
  inline-size: 10px;
  block-size: 10px;
  border: 1px solid var(--afflatus-brand-accent-2);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(103, 197, 189, .13);
}

@keyframes afflatus-serial-film {
  50% { transform: translateX(4px); }
}

/* ── BOOT / bridge operating intelligence ──────────────────────── */

.boot-page { --afflatus-header-bg: #04060a; }

[data-brand-persona="boot"] {
  --afflatus-brand-ink: #dff8ff;
  --afflatus-brand-accent: #9ae5ff;
  --afflatus-brand-accent-2: #e8b380;
  --afflatus-brand-font: "Rajdhani", "JetBrains Mono", ui-monospace, monospace;
}

[data-brand-persona="boot"] .afflatus-brand__stage { font-size: 20px; font-weight: 600; letter-spacing: .02em; }

:root[data-afflatus-brand-state="compact"] [data-brand-persona="boot"] .afflatus-brand__stage::before {
  inset: 3px auto auto 0;
  inline-size: 54px;
  block-size: 27px;
  border: 1px solid rgba(154, 229, 255, .34);
  box-shadow: inset 0 0 10px rgba(154, 229, 255, .06), 0 0 12px rgba(154, 229, 255, .08);
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="boot"] .afflatus-brand__signal {
  inset: 7px auto auto 47px;
  inline-size: 27px;
  block-size: 19px;
  background:
    linear-gradient(var(--afflatus-brand-accent), var(--afflatus-brand-accent)) 0 0 / 7px 1px no-repeat,
    linear-gradient(var(--afflatus-brand-accent), var(--afflatus-brand-accent)) 0 0 / 1px 7px no-repeat,
    linear-gradient(var(--afflatus-brand-accent), var(--afflatus-brand-accent)) 20px 12px / 7px 1px no-repeat,
    linear-gradient(var(--afflatus-brand-accent), var(--afflatus-brand-accent)) 26px 12px / 1px 7px no-repeat;
  animation: afflatus-boot-lock 2.2s ease-in-out infinite;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="boot"] .afflatus-brand__core {
  inset: 12px auto auto 78px;
  inline-size: 9px;
  block-size: 9px;
  background: radial-gradient(circle, var(--afflatus-brand-accent-2) 0 1px, transparent 2px);
  border: 1px solid rgba(232, 179, 128, .6);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(232, 179, 128, .35);
}

@keyframes afflatus-boot-lock {
  50% { transform: scale(.88); filter: brightness(1.35); }
}

/* ── Page-native transformation choreography ─────────────────────
   Every route resolves the same accessible wordmark into the same AI idea,
   but the motion and instrument language belong to that page. */

:root[data-afflatus-brand-state="compact"] [data-brand-persona] .afflatus-brand__a,
:root[data-afflatus-brand-state="compact"] [data-brand-persona] .afflatus-brand__l {
  z-index: 3;
  filter: drop-shadow(0 0 7px color-mix(in srgb, var(--afflatus-brand-accent) 36%, transparent));
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="home"] .afflatus-brand__stage {
  animation: afflatus-home-resolve 820ms var(--afflatus-brand-ease) both;
}

:root:not([data-afflatus-brand-state="compact"]) [data-brand-persona="home"] .afflatus-brand__stage::after {
  animation: afflatus-home-flightline 3.4s ease-in-out infinite;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="home"] .afflatus-brand__stage::before {
  background:
    linear-gradient(var(--afflatus-brand-accent), var(--afflatus-brand-accent)) 50% 0 / 1px 5px no-repeat,
    linear-gradient(var(--afflatus-brand-accent), var(--afflatus-brand-accent)) 50% 100% / 1px 5px no-repeat,
    linear-gradient(90deg, var(--afflatus-brand-accent), var(--afflatus-brand-accent)) 0 50% / 5px 1px no-repeat,
    linear-gradient(90deg, var(--afflatus-brand-accent), var(--afflatus-brand-accent)) 100% 50% / 5px 1px no-repeat;
  border: 1px solid rgba(143, 233, 255, .24);
  clip-path: polygon(0 0, 30% 0, 30% 5%, 70% 5%, 70% 0, 100% 0, 100% 30%, 95% 30%, 95% 70%, 100% 70%, 100% 100%, 70% 100%, 70% 95%, 30% 95%, 30% 100%, 0 100%, 0 70%, 5% 70%, 5% 30%, 0 30%);
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="home"] .afflatus-brand__signal {
  inset: 9px auto auto 48px;
  inline-size: 23px;
  block-size: 14px;
  border: 0;
  background:
    linear-gradient(90deg, transparent 0 42%, var(--afflatus-brand-accent-2) 43% 57%, transparent 58%) 50% 50% / 100% 2px no-repeat,
    var(--afflatus-brand-accent);
  clip-path: polygon(0 50%, 38% 34%, 54% 0, 64% 38%, 100% 50%, 64% 62%, 54% 100%, 38% 66%);
  filter: drop-shadow(0 0 5px rgba(143, 233, 255, .72));
  animation: afflatus-home-fighter 2.45s ease-in-out infinite;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="home"] .afflatus-brand__core {
  inset: 14px auto auto 76px;
  inline-size: 12px;
  block-size: 2px;
  border: 0;
  border-radius: 0 50% 50% 0;
  background: linear-gradient(90deg, var(--afflatus-brand-accent-2), #fff6d8);
  box-shadow: 0 0 8px var(--afflatus-brand-accent-2);
  animation: afflatus-home-shot 1.5s ease-out infinite;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="arena"] .afflatus-brand__stage {
  animation: afflatus-arena-resolve 560ms steps(4, end) both;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="sectors"] .afflatus-brand__stage {
  animation: afflatus-sectors-resolve 720ms var(--afflatus-brand-ease) both;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="signal"] .afflatus-brand__stage {
  animation: afflatus-signal-resolve 680ms steps(5, end) both;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="course"] .afflatus-brand__stage {
  animation: afflatus-course-resolve 640ms steps(4, end) both;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="horoscope"] .afflatus-brand__stage {
  animation: afflatus-horoscope-resolve 920ms cubic-bezier(.2, .72, .2, 1) both;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="games"] .afflatus-brand__stage {
  animation: afflatus-games-resolve 620ms steps(3, end) both;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="league"] .afflatus-brand__stage {
  animation: afflatus-league-resolve 760ms var(--afflatus-brand-ease) both;
}

:root:not([data-afflatus-brand-state="compact"]) [data-brand-persona="serial"] .afflatus-brand__before {
  transform-origin: right center;
  animation: afflatus-serial-left-page 3.8s ease-in-out infinite;
}

:root:not([data-afflatus-brand-state="compact"]) [data-brand-persona="serial"] .afflatus-brand__after {
  transform-origin: left center;
  animation: afflatus-serial-right-page 3.8s ease-in-out infinite;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="serial"] .afflatus-brand__stage {
  perspective: 120px;
  animation: afflatus-serial-resolve 900ms var(--afflatus-brand-ease) both;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="serial"] .afflatus-brand__stage::before {
  inset: 3px auto auto 0;
  inline-size: 50px;
  block-size: 28px;
  border: 1px solid rgba(212, 147, 93, .48);
  border-radius: 2px 2px 4px 4px;
  background:
    linear-gradient(90deg, transparent 49%, rgba(103, 197, 189, .56) 49% 51%, transparent 51%),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(212, 147, 93, .12) 5px 6px);
  box-shadow: inset 0 -3px 7px rgba(40, 24, 21, .25);
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="serial"] .afflatus-brand__signal,
:root[data-afflatus-brand-state="compact"] [data-brand-persona="serial"] .afflatus-brand__core {
  inset-block-start: 7px;
  inline-size: 19px;
  block-size: 19px;
  border: 1px solid color-mix(in srgb, var(--afflatus-brand-accent) 64%, transparent);
  border-radius: 1px 3px 3px 1px;
  background:
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(212, 147, 93, .28) 4px 5px),
    color-mix(in srgb, var(--afflatus-header-bg) 86%, var(--afflatus-brand-ink));
  box-shadow: none;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="serial"] .afflatus-brand__signal {
  inset-inline-start: 50px;
  transform-origin: right center;
  animation: afflatus-serial-page-left 2.8s ease-in-out infinite;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="serial"] .afflatus-brand__core {
  inset-inline-start: 70px;
  transform-origin: left center;
  animation: afflatus-serial-page-right 2.8s ease-in-out infinite;
}

:root[data-afflatus-brand-state="compact"] [data-brand-persona="boot"] .afflatus-brand__stage {
  animation: afflatus-boot-resolve 780ms var(--afflatus-brand-ease) both;
}

@keyframes afflatus-home-resolve {
  0% { transform: translateX(-5px); filter: blur(2px) brightness(1.6); }
  52% { transform: translateX(2px) scaleX(.96); filter: blur(0) brightness(1.3); }
  100% { transform: none; filter: none; }
}

@keyframes afflatus-home-flightline {
  0%, 100% { transform: scaleX(.28); opacity: .22; }
  48% { transform: translateX(12px) scaleX(.94); opacity: .68; }
  52% { transform: translateX(12px) scaleX(.06); opacity: .18; }
}

@keyframes afflatus-home-fighter {
  0%, 100% { transform: translateX(-3px) scale(.9); }
  46% { transform: translateX(3px) scale(1); }
  54% { transform: translateX(3px) scale(.96); filter: drop-shadow(0 0 8px rgba(231, 183, 122, .8)); }
}

@keyframes afflatus-home-shot {
  0%, 42% { transform: translateX(-5px) scaleX(.15); opacity: 0; }
  50% { opacity: 1; }
  78%, 100% { transform: translateX(16px) scaleX(1); opacity: 0; }
}

@keyframes afflatus-arena-resolve {
  0% { transform: translate(4px, -1px); clip-path: inset(0 0 72% 0); }
  50% { transform: translate(-2px, 1px); clip-path: inset(32% 0 25% 0); }
  100% { transform: none; clip-path: inset(0); }
}

@keyframes afflatus-sectors-resolve {
  0% { transform: scaleX(1.18); filter: saturate(.2); }
  58% { transform: scaleX(.94); filter: saturate(1.5); }
  100% { transform: none; filter: none; }
}

@keyframes afflatus-signal-resolve {
  0% { clip-path: inset(0 100% 0 0); opacity: .2; }
  100% { clip-path: inset(0); opacity: 1; }
}

@keyframes afflatus-course-resolve {
  0%, 25% { transform: translateX(4px); filter: contrast(1.6); }
  50% { transform: translateX(-3px); clip-path: inset(28% 0 30% 0); }
  100% { transform: none; clip-path: inset(0); filter: none; }
}

@keyframes afflatus-horoscope-resolve {
  0% { transform: rotate(-10deg) scale(.72); opacity: .28; }
  62% { transform: rotate(2deg) scale(1.04); opacity: 1; }
  100% { transform: none; }
}

@keyframes afflatus-games-resolve {
  0% { transform: scaleY(.12); filter: brightness(2); }
  55% { transform: scaleY(1.16); }
  100% { transform: none; filter: none; }
}

@keyframes afflatus-league-resolve {
  0% { transform: translateX(-7px) scaleX(.8); }
  58% { transform: translateX(2px) scaleX(1.04); }
  100% { transform: none; }
}

@keyframes afflatus-serial-left-page {
  0%, 76%, 100% { transform: perspective(90px) rotateY(0); }
  84% { transform: perspective(90px) rotateY(8deg); }
}

@keyframes afflatus-serial-right-page {
  0%, 76%, 100% { transform: perspective(90px) rotateY(0); }
  88% { transform: perspective(90px) rotateY(-9deg); }
}

@keyframes afflatus-serial-resolve {
  0% { transform: rotateX(18deg) scale(.78); filter: blur(1px); }
  64% { transform: rotateX(-3deg) scale(1.03); filter: blur(0); }
  100% { transform: none; }
}

@keyframes afflatus-serial-page-left {
  0%, 100% { transform: rotateY(9deg); }
  46% { transform: rotateY(54deg); }
  58% { transform: rotateY(5deg); }
}

@keyframes afflatus-serial-page-right {
  0%, 100% { transform: rotateY(-9deg); }
  52% { transform: rotateY(-56deg); }
  64% { transform: rotateY(-4deg); }
}

@keyframes afflatus-boot-resolve {
  0% { transform: translateX(-6px) scale(.9); opacity: .35; }
  60% { transform: translateX(1px) scale(1.02); opacity: 1; }
  100% { transform: none; }
}

/* ── Header integrations ───────────────────────────────────────── */

.page-hero > .afflatus-brand,
.seal > .afflatus-brand {
  margin-inline-end: 2px;
}

.horoscope-page .page-hero > .afflatus-brand,
.games-page .page-hero > .afflatus-brand,
.leagues-page .page-hero > .afflatus-brand,
.novels-page .seal > .afflatus-brand {
  inline-size: 118px;
  min-inline-size: 118px;
}

#osTag {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

#osTag .osTagMeta {
  display: inline-block;
  white-space: nowrap;
}

#osTag .afflatus-brand {
  inline-size: 118px;
  min-inline-size: 118px;
}

@media (max-width: 760px) {
  .afflatus-brand,
  .horoscope-page .page-hero > .afflatus-brand,
  .games-page .page-hero > .afflatus-brand,
  .leagues-page .page-hero > .afflatus-brand,
  .novels-page .seal > .afflatus-brand,
  #osTag .afflatus-brand {
    inline-size: 108px;
    min-inline-size: 108px;
  }

  .afflatus-brand__stage {
    inline-size: 108px;
    font-size: 16px;
  }

  [data-brand-persona="home"] .afflatus-brand__stage,
  [data-brand-persona="arena"] .afflatus-brand__stage,
  [data-brand-persona="games"] .afflatus-brand__stage,
  [data-brand-persona="league"] .afflatus-brand__stage,
  [data-brand-persona="boot"] .afflatus-brand__stage {
    font-size: 17px;
  }

  [data-brand-persona="horoscope"] .afflatus-brand__stage { font-size: 19px; }

  .site-header--follow {
    min-block-size: 64px;
  }

  /* The home WebGL canvas can briefly clear to a light frame while its mobile
     renderer is negotiating. Keep the flight-computer identity readable over
     every frame instead of inheriting the legacy transparent mobile nav. */
  .home-page .site-header--follow {
    background: rgba(3, 6, 11, .94) !important;
    box-shadow: inset 0 -1px 0 rgba(143, 233, 255, .22) !important;
  }

  .site-header--follow > .nav {
    min-inline-size: 0;
    max-inline-size: 100%;
  }

  #osTag {
    inset-inline-start: 16px;
    gap: 6px;
  }

  #osTag .osTagMeta {
    max-inline-size: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 620px) {
  /* Shared compact disclosure for every inner route. The home showcase and
     portfolio keep their own command-deck headers; all research/tools pages
     now reserve the first row for identity instead of shrinking six labels. */
  body:not(.showcase-page):not(.home-page) .site-header--follow,
  body.course-page .site-top.site-header--follow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-2) var(--space-3);
    min-block-size: 64px;
  }

  body:not(.showcase-page):not(.home-page) .site-header--follow > [data-afflatus-nav] {
    grid-column: 1 / -1;
    inline-size: 100%;
    overflow-x: auto;
  }

  /* The botanical identity nests its title next to the wordmark. Give the
     title a full row instead of squeezing it between wordmark and toggle. */
  body.horoscope-page .site-header--follow > .page-hero {
    display: contents;
  }

  body.horoscope-page .site-header--follow > .page-hero > div {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  body.horoscope-page .site-header--follow > .afflatus-mobile-nav-toggle {
    grid-column: 2;
    grid-row: 1;
  }

  html.afflatus-nav-enhanced body:not(.showcase-page):not(.home-page) .afflatus-mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: end;
    min-inline-size: 64px;
    min-block-size: var(--touch-target);
    padding-inline: var(--space-3);
    border: 1px solid color-mix(in srgb, var(--afflatus-brand-accent, currentColor) 42%, transparent);
    background: color-mix(in srgb, var(--afflatus-header-bg, #05070b) 92%, transparent);
    color: inherit;
    font: 700 var(--control-font-size)/var(--control-line-height) var(--afflatus-brand-font, ui-sans-serif, system-ui, sans-serif);
    letter-spacing: .09em;
    text-transform: uppercase;
    cursor: pointer;
  }

  html.afflatus-nav-enhanced body:not(.showcase-page):not(.home-page) .afflatus-mobile-nav-toggle:focus-visible {
    outline: var(--focus-ring-width) solid var(--afflatus-brand-accent, currentColor);
    outline-offset: var(--focus-ring-offset);
  }

  html.afflatus-nav-enhanced body:not(.showcase-page):not(.home-page) .site-header--follow > [data-afflatus-nav],
  html.afflatus-nav-enhanced body.course-page .site-top.site-header--follow > [data-afflatus-nav] {
    position: fixed;
    z-index: 99000;
    inset-block-start: var(--afflatus-mobile-nav-top, 72px);
    inset-inline-end: 10px;
    inline-size: min(340px, calc(100vw - 20px));
    max-block-size: calc(100dvh - var(--afflatus-mobile-nav-top, 72px) - 12px);
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
    margin: 0;
    padding: var(--space-3);
    overflow: auto;
    border: 1px solid color-mix(in srgb, var(--afflatus-brand-accent, currentColor) 36%, transparent);
    background: color-mix(in srgb, var(--afflatus-header-bg, #05070b) 96%, #000 4%);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .42);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
    backdrop-filter: blur(18px) saturate(1.08);
  }

  html.afflatus-nav-enhanced body:not(.showcase-page):not(.home-page) .site-header--follow.mobile-nav-open > [data-afflatus-nav],
  html.afflatus-nav-enhanced body.course-page .site-top.site-header--follow.mobile-nav-open > [data-afflatus-nav] {
    display: grid;
  }

  html.afflatus-nav-enhanced body:not(.showcase-page):not(.home-page) [data-afflatus-nav] > *,
  html.afflatus-nav-enhanced body:not(.showcase-page):not(.home-page) [data-afflatus-nav] > .nav-labs {
    min-inline-size: 0;
    inline-size: 100%;
  }

  html.afflatus-nav-enhanced body:not(.showcase-page):not(.home-page) [data-afflatus-nav] > a,
  html.afflatus-nav-enhanced body:not(.showcase-page):not(.home-page) [data-afflatus-nav] .nav-labs__trigger,
  html.afflatus-nav-enhanced body:not(.showcase-page):not(.home-page) [data-afflatus-nav] > .lang-toggle,
  html.afflatus-nav-enhanced body:not(.showcase-page):not(.home-page) [data-afflatus-nav] > .hbtn {
    inline-size: 100%;
    min-inline-size: 0;
    min-block-size: var(--touch-target);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-3);
    overflow: hidden;
    font-size: var(--control-font-size);
    line-height: var(--control-line-height);
    letter-spacing: .04em;
    text-align: center;
    white-space: normal;
  }

  html.afflatus-nav-enhanced body:not(.showcase-page):not(.home-page) [data-afflatus-nav] .nav-labs__trigger::after {
    margin-inline-start: 6px;
  }

  .home-page .site-header--follow #langBtn { display: none; }

  :root[data-afflatus-brand-state="compact"] .afflatus-brand__stage::after {
    inline-size: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header--follow,
  .afflatus-brand__stage,
  .afflatus-brand__stage::before,
  .afflatus-brand__stage::after,
  .afflatus-brand__a,
  .afflatus-brand__before,
  .afflatus-brand__l,
  .afflatus-brand__l::after,
  .afflatus-brand__after,
  .afflatus-brand__signal,
  .afflatus-brand__core {
    transition: none;
    animation: none !important;
  }
}
