/* ==========================================================================
   CITADEL TRIAD — COMPONENT SYSTEM (Editorial & Motion Architecture)
   css/components.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. ROLL BUTTONS
   Double-label translateY roll animation with buttery cubic-bezier transitions.
   -------------------------------------------------------------------------- */
.roll-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-btn, 999px);
  padding: 0.75rem 1.625rem;
  font-family: var(--font-heading, sans-serif);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--duration-fast, 0.35s) var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
              border-color var(--duration-fast, 0.35s) var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
              color var(--duration-fast, 0.35s) var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
              box-shadow var(--duration-fast, 0.35s) var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
              transform var(--duration-fast, 0.35s) var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
  border: 1px solid transparent;
  user-select: none;
  white-space: nowrap;
}

.roll-btn:hover { transform: translateY(-1px); }
.roll-btn:active { transform: translateY(0); }

.roll-btn:focus-visible {
  outline: 2px solid var(--accent-blue-bright, #3B82F6);
  outline-offset: 3px;
}

.roll-btn-inner {
  display: inline-grid;
  grid-template-rows: 1fr;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  overflow: hidden;
  height: 1.25em;
  position: relative;
}

.roll-btn-label {
  grid-row: 1;
  grid-column: 1;
  display: block;
  transform: translateY(0);
  transition: transform var(--duration-fast, 0.35s) var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}

.roll-btn-duplicate {
  transform: translateY(115%);
  user-select: none;
  pointer-events: none;
}

.roll-btn:hover .roll-btn-label:not(.roll-btn-duplicate) {
  transform: translateY(-115%);
}

.roll-btn:hover .roll-btn-duplicate {
  transform: translateY(0);
}

.roll-btn-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  transition: transform var(--duration-fast, 0.35s) var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}

.roll-btn:hover .roll-btn-icon {
  transform: translateX(3px);
}

/* Button Variants */
.roll-btn-primary {
  background-color: var(--accent-blue, #2563EB);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 14px -2px rgba(37, 99, 235, 0.35);
}

.roll-btn-primary:hover {
  background-color: #1D4ED8;
  color: #FFFFFF;
  box-shadow: 0 8px 22px -4px rgba(37, 99, 235, 0.45);
}

.roll-btn-secondary {
  background-color: var(--surface-raised, #F0F0F1);
  color: var(--text-primary, #0A0A0A);
  border-color: var(--border-subtle, rgba(10, 10, 10, 0.09));
}

.roll-btn-secondary:hover {
  background-color: var(--surface-strong, #E7E7E9);
  border-color: var(--border-strong, rgba(10, 10, 10, 0.2));
}

.roll-btn-outline {
  background-color: transparent;
  color: var(--text-primary, #0A0A0A);
  border-color: var(--border-strong, rgba(10, 10, 10, 0.2));
}

.roll-btn-outline:hover {
  background-color: var(--surface-raised, #F0F0F1);
  border-color: var(--text-primary, #0A0A0A);
}

html[data-theme="dark"] .roll-btn-outline {
  color: var(--text-primary, #F8FAFC);
  border-color: var(--border-strong, rgba(148, 163, 184, 0.35));
}

html[data-theme="dark"] .roll-btn-outline:hover {
  background-color: var(--surface-strong, #16213A);
  border-color: #F8FAFC;
}

.roll-btn-light {
  background-color: #FFFFFF;
  color: #0A0A0A;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.roll-btn-light:hover {
  background-color: #F4F4F5;
  color: #000000;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.roll-btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.8125rem;
}

.roll-btn-lg {
  padding: 0.875rem 2rem;
  font-size: 0.9375rem;
}

/* WhatsApp Icon Chip Avatar */
.btn-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: currentColor;
  flex-shrink: 0;
  margin-right: -0.15rem;
}

.btn-avatar svg {
  width: 0.75rem;
  height: 0.75rem;
}

/* --------------------------------------------------------------------------
   2. SPLIT-TEXT REVEALS ([data-split])
   Word-level split only — 100% safe for Sinhala Unicode ligatures.
   -------------------------------------------------------------------------- */
[data-split] { opacity: 1; }

.split-word-wrapper {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.split-word {
  display: inline-block;
  transform: translateY(0);
  opacity: 1;
}

html[data-lang="si"] [data-split],
html[data-lang="si"] .split-word-wrapper,
html[data-lang="si"] .split-word {
  letter-spacing: 0 !important;
  line-height: 1.45 !important;
}

/* --------------------------------------------------------------------------
   3. PROGRESSIVE ELEMENT REVEALS ([data-reveal])
   Progressive enhancement:
   - Hidden ONLY when html.motion-ready is active.
   - Reduced motion or non-JS never leaves elements hidden.
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

html.motion-ready [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
}

html.motion-ready [data-reveal="fade"] {
  opacity: 0;
  transform: none;
}

html.motion-ready [data-reveal="scale"] {
  opacity: 0;
  transform: scale(0.96);
}

html.motion-ready [data-reveal="left"] {
  opacity: 0;
  transform: translateX(-24px);
}

html.motion-ready [data-reveal="right"] {
  opacity: 0;
  transform: translateX(24px);
}

html.motion-ready [data-reveal].is-revealed {
  opacity: 1 !important;
  transform: none !important;
}

/* Delays */
[data-reveal-delay="100"] { transition-delay: 100ms; }
[data-reveal-delay="150"] { transition-delay: 150ms; }
[data-reveal-delay="200"] { transition-delay: 200ms; }
[data-reveal-delay="240"] { transition-delay: 240ms; }
[data-reveal-delay="250"] { transition-delay: 250ms; }
[data-reveal-delay="300"] { transition-delay: 300ms; }
[data-reveal-delay="400"] { transition-delay: 400ms; }
[data-reveal-delay="500"] { transition-delay: 500ms; }

/* --------------------------------------------------------------------------
   4. MARQUEE BANDS
   -------------------------------------------------------------------------- */
.marquee {
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeRoll 32s linear infinite;
}

.marquee-track.is-offscreen { animation-play-state: paused; }

.marquee:hover .marquee-track { animation-play-state: paused; }

.marquee-slow .marquee-track { animation-duration: 48s; }

.marquee-content {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding-right: 2rem;
  flex-shrink: 0;
}

@keyframes marqueeRoll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* --------------------------------------------------------------------------
   5. LIVE STATUS INDICATORS (.live-dot)
   -------------------------------------------------------------------------- */
.live-dot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.625rem;
  height: 0.625rem;
  flex-shrink: 0;
}

.live-dot-ping {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--accent-blue-bright, #3B82F6);
  opacity: 0.75;
  animation: liveDotPing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.live-dot-core {
  position: relative;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background-color: var(--accent-blue-bright, #3B82F6);
}

.live-dot-cyan .live-dot-ping,
.live-dot-cyan .live-dot-core { background-color: var(--accent-cyan, #06B6D4); }

.live-dot-green .live-dot-ping,
.live-dot-green .live-dot-core { background-color: #10B981; }

@keyframes liveDotPing {
  75%, 100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   6. FLOATING CAPSULE HEADER (.site-header & .nav-capsule)
   Wide floating pill at top, condenses smoothly on scroll.
   -------------------------------------------------------------------------- */
#siteHeaderMount,
.chrome-header-mount {
  min-height: var(--header-min-height, 80px);
  display: block;
  position: relative;
  z-index: 50;
}

.site-header {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  z-index: 50;
  width: 100%;
  padding: 0 16px;
  pointer-events: none;
  opacity: 1;
  transform: translateY(0);
  transition: transform 0.4s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
              opacity 0.4s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}

.site-header.is-nav-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-120%);
}

.nav-capsule {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1360px;
  height: 64px;
  margin: 0 auto;
  padding: 0 0.4rem 0 24px;
  border-radius: 9999px;
  background: var(--nav-capsule-bg, rgba(255, 255, 255, 0.82));
  border: 1px solid var(--nav-capsule-border, rgba(10, 10, 10, 0.08));
  box-shadow: var(--nav-capsule-shadow, 0 8px 30px rgba(10, 10, 10, 0.07));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color 0.3s ease,
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

html[data-theme="dark"] .nav-capsule {
  background: var(--nav-capsule-bg, rgba(11, 17, 30, 0.85));
  border-color: var(--nav-capsule-border, #1E293B);
  box-shadow: var(--nav-capsule-shadow, 0 10px 30px rgba(0, 0, 0, 0.55));
}

/* Scrolled state: smoothly condenses into a compact centered floating pill */
.site-header.is-scrolled .nav-capsule {
  max-width: 1100px;
  height: 56px;
  padding: 0 12px 0 24px;
  box-shadow: 0 12px 36px -4px rgba(10, 10, 10, 0.12);
}

@media (max-width: 1023px) {
  .nav-capsule,
  .site-header.is-scrolled .nav-capsule {
    padding-left: 18px;
  }
}

html[data-theme="dark"] .site-header.is-scrolled .nav-capsule {
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.65);
}

.brand-dock {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  line-height: 0;
  text-decoration: none;
}

.brand-logo,
.brand-logo-hrz {
  display: block;
  width: auto;
  height: 35px;
  max-width: none;
  object-fit: contain;
}
.brand-logo-white { display: none; }
html[data-theme="dark"] .brand-logo-blue { display: none; }
html[data-theme="dark"] .brand-logo-white { display: block; }

.site-header .brand-logo,
.site-header .brand-logo-hrz {
  height: 35px;
}

.site-header.is-scrolled .brand-logo,
.site-header.is-scrolled .brand-logo-hrz {
  height: 30px;
}

/* Mobile & Tablet (<1024px): 28px unscrolled / 26px scrolled for optimal readability and breathing room */
@media (max-width: 1023px) {
  .site-header .brand-logo,
  .site-header .brand-logo-hrz {
    height: 28px;
  }
  .site-header.is-scrolled .brand-logo,
  .site-header.is-scrolled .brand-logo-hrz {
    height: 26px;
  }
}

/* Footer is always dark: force white logo in BOTH themes */
.site-footer .brand-logo-blue { display: none; }
.site-footer .brand-logo-white { display: block; }
.site-footer .brand-logo,
.site-footer .brand-logo-hrz { height: clamp(40px, 4.4vw, 58px); }

.mobile-nav-header .brand-logo,
.mobile-nav-header .brand-logo-hrz { height: 32px; }

.footer-top {
  padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 4vw, 3.5rem) 0;
}

/* Primary Nav */
.primary-nav {
  display: none;
  align-items: center;
}

@media (min-width: 1024px) {
  .primary-nav { display: flex; }
}

.primary-nav-links {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-pill-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.45rem 0.875rem;
  border-radius: 9999px;
  font-family: var(--font-heading, sans-serif);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--nav-link-color, #3F3F46);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s, background-color 0.2s;
}

.nav-pill-item:hover {
  color: var(--text-primary, #0A0A0A);
  background-color: var(--nav-hover-bg, rgba(10, 10, 10, 0.05));
}

.nav-pill-item.active,
.nav-pill-item[aria-current="page"] {
  color: var(--accent-blue, #2563EB);
  background-color: var(--nav-active-bg, rgba(37, 99, 235, 0.08));
}

/* Nav Count circular 15 badge */
.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-family: var(--font-mono, monospace);
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--surface-strong, #E7E7E9);
  color: var(--text-secondary, #3F3F46);
  margin-left: 0.25rem;
}

html[data-theme="dark"] .nav-count {
  background: #1E293B;
  color: #CBD5E1;
}

/* Dropdown trigger and caret */
.nav-dropdown { position: relative; }

.nav-dropdown-caret {
  display: inline-flex;
  width: 9px;
  height: 9px;
  transition: transform 0.25s;
  opacity: 0.65;
}

.nav-dropdown:hover .nav-dropdown-caret,
.nav-dropdown.is-open .nav-dropdown-caret {
  transform: rotate(180deg);
  opacity: 1;
}

/* Mega Menu */
.nav-mega-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 680px;
  max-width: 90vw;
  padding: 1.35rem;
  border-radius: 24px;
  background: var(--menu-bg, #FFFFFF);
  border: 1px solid var(--border-subtle, rgba(10, 10, 10, 0.09));
  box-shadow: 0 16px 48px -12px rgba(10, 10, 10, 0.14);
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1.25rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out), visibility 0.25s;
  z-index: 60;
}

.nav-dropdown:hover .nav-mega-menu,
.nav-dropdown.is-open .nav-mega-menu,
.nav-dropdown:focus-within .nav-mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

html[data-theme="dark"] .nav-mega-menu {
  background: var(--menu-bg, #0B111E);
  border-color: var(--border-subtle, #1E293B);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
}

.mega-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mega-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.6rem 0.8rem;
  border-radius: 14px;
  text-decoration: none;
  transition: background-color 0.2s;
}

.mega-item:hover {
  background-color: var(--surface-raised, #F0F0F1);
}

html[data-theme="dark"] .mega-item:hover {
  background-color: var(--surface-strong, #16213A);
}

.mega-item-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mega-item-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.mega-feature-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.25rem 0.6rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.badge-hot {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-family: var(--font-mono, monospace);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent-blue-bright, #3B82F6);
}

.mega-cards {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.mega-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 16px;
  background: var(--surface-raised, #F0F0F1);
  border: 1px solid var(--border-subtle, rgba(10, 10, 10, 0.06));
  text-decoration: none;
  transition: background-color 0.2s, transform 0.2s;
}

@media (hover: hover) {
  .mega-card:hover {
    background: var(--surface-strong, #E7E7E9);
    transform: translateY(-1px);
  }
}

html[data-theme="dark"] .mega-card {
  background: var(--surface-raised, #0F172A);
  border-color: var(--border-subtle, #1E293B);
}

html[data-theme="dark"] .mega-card:hover {
  background: var(--surface-strong, #16213A);
}

.mega-card-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mega-card-desc {
  font-size: 0.6875rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 0.2rem;
}

.mega-card-visual {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Utility Dock */
.utility-dock {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.nav-roll-cta {
  display: none;
}
@media (min-width: 640px) {
  .nav-roll-cta { display: inline-flex; }
}

.header-lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 9999px;
  background: var(--language-switch-bg, #FFFFFF);
  border: 1px solid var(--language-switch-border, rgba(10, 10, 10, 0.1));
}

html[data-theme="dark"] .header-lang-switch {
  background: var(--language-switch-bg, #0B111E);
  border-color: var(--language-switch-border, rgba(59, 130, 246, 0.25));
}

.language-switch-option {
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-family: var(--font-heading, sans-serif);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #3F3F46);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.language-switch-option.is-active {
  background: var(--accent-blue, #2563EB);
  color: #FFFFFF;
}

.theme-toggle-header {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--nav-control-bg, #FFFFFF);
  border: 1px solid var(--nav-control-border, rgba(10, 10, 10, 0.1));
  color: var(--text-primary, #0A0A0A);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.theme-toggle-header:hover {
  background: var(--nav-control-hover-bg, #F0F0F1);
  transform: rotate(15deg);
}

html[data-theme="dark"] .theme-toggle-header {
  background: var(--nav-control-bg, #131C31);
  border-color: var(--nav-control-border, rgba(51, 65, 85, 0.8));
  color: var(--text-primary, #F8FAFC);
}

.theme-icon {
  width: 16px;
  height: 16px;
}

.theme-icon-sun { display: none; }
.theme-icon-moon { display: block; }

html[data-theme="dark"] .theme-icon-sun { display: block; }
html[data-theme="dark"] .theme-icon-moon { display: none; }

/* Mobile nav toggle button with clean 2-bar animation */
.mobile-nav-toggle {
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-subtle, rgba(10, 10, 10, 0.1));
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  .mobile-nav-toggle { display: none; }
}

.menu-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 16px;
}

.menu-bars span {
  display: block;
  width: 16px;
  height: 2px;
  background-color: currentColor;
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
  transform-origin: center;
}

.mobile-nav-toggle[aria-expanded="true"] .menu-bars span:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.mobile-nav-toggle[aria-expanded="true"] .menu-bars span:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   7. FULL-SCREEN MOBILE NAVIGATION PANEL (.mobile-nav-panel)
   -------------------------------------------------------------------------- */
.mobile-nav-panel {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--mobile-menu-bg, rgba(250, 250, 250, 0.98));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
}

html[data-theme="dark"] .mobile-nav-panel {
  background: var(--mobile-menu-bg, rgba(5, 7, 10, 0.98));
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-nav-header-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.mobile-nav-close-btn {
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
}

.mobile-nav-links-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.75rem 0;
}

.mobile-nav-link {
  font-family: var(--font-heading, sans-serif);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
}

.mobile-nav-sublinks {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-left: 0.85rem;
  margin-top: 0.6rem;
  border-left: 2px solid var(--border-subtle);
}

.mobile-nav-sublink {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.mobile-nav-footer-dock {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.mobile-lang-switch {
  align-self: flex-start;
}

/* --------------------------------------------------------------------------
   8. STICKY PILLAR CARDS & FLOATING TAB PILL
   -------------------------------------------------------------------------- */
.pillars-wrap {
  position: relative;
  width: 100%;
}

.sticky-stack {
  position: relative;
  width: 100%;
}

/* Desktop: pure sticky cards with stacking offset */
@media (min-width: 1024px) {
  .sticky-card {
    position: sticky;
    top: calc(var(--header-min-height, 80px) + 14px + (var(--stack-index, 0) * 12px));
    margin-bottom: 2.5rem;
    z-index: calc(10 + var(--stack-index, 0));
  }

  .sticky-card-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: center;
    border-radius: var(--radius-card, 32px);
    background: var(--card-bg, #FFFFFF);
    border: 1px solid var(--border-subtle, rgba(10, 10, 10, 0.09));
    padding: clamp(1.75rem, 3.2vw, 2.75rem);
    box-shadow: 0 16px 40px -8px rgba(10, 10, 10, 0.06);
    transform-origin: 50% 0;
    will-change: transform, opacity;
  }

  html[data-theme="dark"] .sticky-card-layout {
    background: var(--card-bg, #0B111E);
    border-color: var(--border-subtle, #1E293B);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  }

  /* Floating pill bar sticks to bottom of viewport on desktop */
  .pillar-tabs {
    position: sticky;
    bottom: 1.25rem;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 2rem auto 0;
    width: fit-content;
    padding: 6px;
    border-radius: 9999px;
    background: rgba(10, 10, 11, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.32);
  }
}

/* Mobile & Tablet (< 1024px): clean normal vertical stack, ZERO overlap */
@media (max-width: 1023px) {
  .sticky-card {
    position: static !important;
    top: auto !important;
    margin-bottom: 1.25rem !important;
    z-index: auto !important;
  }

  .sticky-card-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border-radius: var(--radius-card, 24px);
    background: var(--card-bg, #FFFFFF);
    border: 1px solid var(--border-subtle, rgba(10, 10, 10, 0.09));
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(10, 10, 10, 0.04);
    transform: none !important;
    opacity: 1 !important;
  }

  html[data-theme="dark"] .sticky-card-layout {
    background: var(--card-bg, #0B111E);
    border-color: var(--border-subtle, #1E293B);
  }

  .pillar-tabs {
    display: none !important;
  }
}

.sticky-card-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
}

.pillar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pillar-badge-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.pillar-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--text-primary);
}

.pillar-tagline {
  margin: 0.6rem 0 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.pillar-bullets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.1rem;
}

.pillar-bullet-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.pillar-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.pillar-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s;
}

.pillar-link-pill:hover {
  background: var(--surface-strong);
  border-color: var(--accent-blue-bright);
}

/* Pillar Stages (Visual Mockup Containers) */
.pillar-stage {
  position: relative;
  border-radius: 24px;
  padding: 1.25rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stage-0 {
  background: radial-gradient(circle at 75% 25%, rgba(37, 99, 235, 0.22), transparent 70%),
              linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(6, 182, 212, 0.04)),
              #070A14;
}

.stage-1 {
  background: radial-gradient(circle at 75% 25%, rgba(6, 182, 212, 0.22), transparent 70%),
              linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(59, 130, 246, 0.04)),
              #070A14;
}

.stage-2 {
  background: radial-gradient(circle at 75% 25%, rgba(99, 102, 241, 0.22), transparent 70%),
              linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(37, 99, 235, 0.04)),
              #070A14;
}

.stage-3 {
  background: radial-gradient(circle at 75% 25%, rgba(16, 185, 129, 0.22), transparent 70%),
              linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(6, 182, 212, 0.04)),
              #070A14;
}

/* Mockup Frame */
.css-mockup-frame {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
}

.mockup-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mockup-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mockup-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-red { background: #EF4444; }
.dot-yellow { background: #F59E0B; }
.dot-green { background: #10B981; }

.mockup-title {
  font-family: var(--font-mono, monospace);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: #CBD5E1;
  flex: 1;
}

.mockup-status {
  font-family: var(--font-mono, monospace);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}

.mockup-body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.mockup-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.mockup-metric-card {
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.mockup-metric-label {
  font-family: var(--font-mono, monospace);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94A3B8;
  margin-bottom: 0.2rem;
}

.mockup-metric-val {
  font-family: var(--font-mono, monospace);
  font-size: 0.9375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #F8FAFC;
}

.mockup-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  font-family: var(--font-mono, monospace);
  font-size: 0.6875rem;
  color: #93C5FD;
}

/* Telemetry Value Colors */
.val-blue { color: #60A5FA !important; }
.val-cyan { color: #22D3EE !important; }
.val-green { color: #34D399 !important; }
.val-indigo { color: #818CF8 !important; }
.val-purple { color: #C084FC !important; }

/* Pillar Tab Buttons (inside floating bottom pill) */
.pillar-tab {
  padding: 0.4rem 0.95rem;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: #A1A1AA;
  font-family: var(--font-heading, sans-serif);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.25s, color 0.25s;
}

.pillar-tab:hover {
  color: #FFFFFF;
}

.pillar-tab.is-active,
.pillar-tab[aria-current="true"] {
  background: #FFFFFF;
  color: #0A0A0B;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   9. METHODOLOGY CARDS
   -------------------------------------------------------------------------- */
.methodology-teaser-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) {
  .methodology-teaser-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .methodology-teaser-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.methodology-step-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 220px;
  padding: clamp(1.25rem, 2vw, 1.75rem);
  border-radius: 24px;
  background: var(--card-bg, #FFFFFF);
  border: 1px solid var(--border-subtle, rgba(10, 10, 10, 0.09));
  transition: transform 0.4s var(--ease-out), border-color 0.3s;
}

.methodology-step-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

html[data-theme="dark"] .methodology-step-card {
  background: var(--card-bg, #0B111E);
  border-color: var(--border-subtle, #1E293B);
}

.step-num-badge {
  display: inline-block;
  font-family: var(--font-mono, monospace);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent-blue, #2563EB);
  margin-bottom: 0.75rem;
}

.step-card-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.step-card-desc {
  margin: 0.6rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.step-name-pill {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   10. 5-COLUMN DARK FOOTER (.site-footer & .footer-grid)
   -------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--ink-bg, #0A0A0B);
  color: var(--ink-text, #F5F5F6);
  width: 100%;
}

.footer-bg-stack {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.footer-bg-picture {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.footer-bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  transform: scaleX(-1);
  filter: contrast(1.1) brightness(0.9);
  will-change: opacity;
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

:root .footer-bg-image-light,
html[data-theme="light"] .footer-bg-image-light {
  opacity: 1;
}

:root .footer-bg-image-dark,
html[data-theme="light"] .footer-bg-image-dark {
  opacity: 0;
}

html[data-theme="dark"] .footer-bg-image-light {
  opacity: 0;
}

html[data-theme="dark"] .footer-bg-image-dark {
  opacity: 1;
}

.footer-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(18, 12, 16, 0.72) 0%, rgba(10, 8, 12, 0.88) 100%);
}

.footer-bg-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 11, 20, 0.76) 0%, rgba(5, 7, 12, 0.92) 100%);
  opacity: 0;
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

html[data-theme="dark"] .footer-bg-overlay::after {
  opacity: 1;
}

.footer-marquee-band {
  position: relative;
  z-index: 2;
  padding: clamp(1.5rem, 3vw, 2.5rem) 0 clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-marquee-item {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2.5vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #F8FAFC;
  white-space: nowrap;
}

.footer-marquee-item.is-outline {
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.45);
  color: transparent;
}

.footer-marquee-dot {
  color: var(--accent-blue, #2563EB);
  font-size: 1.25rem;
}

.footer-main-container {
  position: relative;
  z-index: 2;
  max-width: calc(var(--container-max) + 2 * clamp(12px, 1.6vw, 24px));
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 4rem) clamp(16px, 2.4vw, 32px);
}

.footer-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8125rem;
  color: #94A3B8;
  letter-spacing: 0.04em;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.25rem;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr));
    gap: clamp(1.5rem, 2.8vw, 3rem);
  }
}

.footer-brand-summary {
  margin: 1rem 0 0;
  max-width: 32ch;
  color: #94A3B8;
  font-size: 0.8125rem;
  line-height: 1.6;
}

.footer-col-title {
  font-family: var(--font-mono, monospace);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #CBD5E1;
  margin-bottom: 1.1rem;
}

.footer-links-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-links-list a {
  font-size: 0.8125rem;
  color: #94A3B8;
  text-decoration: none;
  transition: color 0.2s, transform 0.2s;
  display: inline-block;
}

.footer-links-list a:hover {
  color: #FFFFFF;
  transform: translateX(2px);
}

.footer-bottom-bar {
  margin-top: clamp(2.5rem, 4.5vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.75rem;
  color: #94A3B8;
}

@media (min-width: 768px) {
  .footer-bottom-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   11. SUB-PAGE CARD SKINS (.card--bento, .card--terminal, .card--blueprint, .card--chat)
   -------------------------------------------------------------------------- */
.card--bento {
  position: relative;
  border-radius: var(--radius-card, 28px);
  background: var(--card-bg, #FFFFFF);
  border: 1px solid var(--border-subtle);
  padding: clamp(1.25rem, 2.5vw, 2rem);
  overflow: hidden;
  box-shadow: 0 4px 20px -2px rgba(10, 10, 10, 0.04);
  transition: transform 0.35s var(--ease-out), border-color 0.35s;
}

.card--bento:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

html[data-theme="dark"] .card--bento {
  background: var(--card-bg, #0B111E);
  border-color: var(--border-subtle, #1E293B);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.card--terminal {
  position: relative;
  border-radius: 20px;
  background: #070914;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.25rem;
  font-family: var(--font-mono, monospace);
  color: #F8FAFC;
  overflow: hidden;
}

.card--blueprint {
  position: relative;
  border-radius: 20px;
  background: var(--surface-raised);
  border: 1px dashed var(--border-strong);
  padding: 1.5rem;
}

.card--chat {
  position: relative;
  border-radius: 22px;
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   12. ACCESSIBILITY & REDUCED MOTION (Phases 5 & 8)
   -------------------------------------------------------------------------- */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  background: var(--btn-bg, #0A0A0A);
  color: var(--btn-fg, #FFFFFF);
  font-family: var(--font-heading, sans-serif);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: top 0.15s ease;
}
.skip-to-content:focus {
  top: 16px;
  outline: 2px solid var(--accent-blue-bright, #3B82F6);
  outline-offset: 2px;
}

.footer-reduce-motion-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #CBD5E1;
  font-family: var(--font-heading, sans-serif);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.footer-reduce-motion-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.32);
}
.footer-reduce-motion-btn[aria-pressed="true"] {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(59, 130, 246, 0.5);
  color: #FFFFFF;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal], [data-reveal].is-revealed {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .marquee-track { animation: none !important; }
  .live-dot-ping { animation: none !important; }
  .split-word { transition: none !important; }
  .roll-btn { transition: none !important; }
}
