/* ============================================================
   BITDIVER — INDUSTRIAL BRUTALIST UI DESIGN SYSTEM
   Dual Mode: Tactical Telemetry (Dark) + Swiss Industrial Print (Light)
   ============================================================ */

/* ============================================================
   CUSTOM PROPERTIES — TACTICAL TELEMETRY (DARK)
   ============================================================ */
body[data-theme="tactical"] {
  --bg-primary: #0A0A0A;
  --bg-secondary: #121212;
  --bg-elevated: #1A1A1A;
  --fg-primary: #EAEAEA;
  --fg-secondary: #666666;
  --fg-dim: #444444;
  --accent-red: #E61919;
  --accent-red-hover: #FF2A2A;
  --accent-red-glow: rgba(230, 25, 25, 0.4);
  --border-color: #2A2A2A;
  --border-bright: #333333;
  --font-display: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --diagram-filter: brightness(0.9) contrast(1.1);
  --icon-filter: drop-shadow(0 0 8px rgba(230, 25, 25, 0.4));
  --hero-glow: 0 0 20px rgba(234, 234, 234, 0.15), 0 0 60px rgba(234, 234, 234, 0.05);
  --hero-glow-filter: drop-shadow(0 0 20px rgba(234, 234, 234, 0.15)) drop-shadow(0 0 60px rgba(234, 234, 234, 0.05));
  --nav-hover-glow: 0 0 8px rgba(234, 234, 234, 0.2);
  --logo-invert: none;
}

/* ============================================================
   CUSTOM PROPERTIES — SWISS INDUSTRIAL PRINT (LIGHT)
   ============================================================ */
body[data-theme="swiss"] {
  --bg-primary: #F4F4F0;
  --bg-secondary: #EAE8E3;
  --bg-elevated: #FFFFFF;
  --fg-primary: #050505;
  --fg-secondary: #444444;
  --fg-dim: #777777;
  --accent-red: #E61919;
  --accent-red-hover: #CC1414;
  --accent-red-glow: rgba(230, 25, 25, 0.15);
  --border-color: #C8C5BE;
  --border-bright: #A8A49C;
  --font-display: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --diagram-filter: none;
  --icon-filter: drop-shadow(0 0 4px rgba(230, 25, 25, 0.2));
  --hero-glow: none;
  --hero-glow-filter: none;
  --nav-hover-glow: none;
  --logo-invert: none;
}

/* ============================================================
   RESET & BASE (SHARED)
   ============================================================ */
body[data-theme="tactical"],
body[data-theme="swiss"] {
  margin: 0;
  padding: 0;
  background-color: var(--bg-primary);
  color: var(--fg-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body[data-theme="tactical"] *,
body[data-theme="tactical"] *::before,
body[data-theme="tactical"] *::after,
body[data-theme="swiss"] *,
body[data-theme="swiss"] *::before,
body[data-theme="swiss"] *::after {
  box-sizing: border-box;
  border-radius: 0 !important;
}

/* Kill inherited Docusaurus chrome (header + footer only) */
body[data-theme="tactical"] .fixedHeaderContainer,
body[data-theme="tactical"] .homeContainer,
body[data-theme="tactical"] .homeSplashFade,
body[data-theme="tactical"] .nav-footer,
body[data-theme="swiss"] .fixedHeaderContainer,
body[data-theme="swiss"] .homeContainer,
body[data-theme="swiss"] .homeSplashFade,
body[data-theme="swiss"] .nav-footer {
  display: none !important;
}

/* ============================================================
   DOCUSAURUS CONTENT PAGES — Brutalist Override
   ============================================================ */

/* Main content wrapper */
body[data-theme="tactical"] .navPusher,
body[data-theme="swiss"] .navPusher {
  background: var(--bg-primary);
  color: var(--fg-primary);
  min-height: 60vh;
}

body[data-theme="tactical"] .docMainWrapper,
body[data-theme="swiss"] .docMainWrapper {
  background: var(--bg-primary);
  display: flex !important;
  gap: 2rem;
  padding: 2rem 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

body[data-theme="tactical"] .navPusher,
body[data-theme="swiss"] .navPusher,
body[data-theme="tactical"] div.navPusher,
body[data-theme="swiss"] div.navPusher {
  max-width: 1400px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 2rem !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

body[data-theme="tactical"] .documentContainer,
body[data-theme="swiss"] .documentContainer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 2rem;
}

/* Sidebar navigation */
body[data-theme="tactical"] .docsNavContainer,
body[data-theme="swiss"] .docsNavContainer {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  width: 260px !important;
  min-width: 260px !important;
  flex-shrink: 0 !important;
}

body[data-theme="tactical"] .toc .navBreadcrumb,
body[data-theme="swiss"] .toc .navBreadcrumb {
  display: none !important;
}

body[data-theme="tactical"] .navGroups,
body[data-theme="swiss"] .navGroups {
  display: block !important;
  padding: 0 1rem !important;
}

body[data-theme="tactical"] .navGroup ul.hide,
body[data-theme="swiss"] .navGroup ul.hide {
  display: block !important;
}

/* Main content area takes remaining width */
body[data-theme="tactical"] .docsContainer,
body[data-theme="swiss"] .docsContainer {
  flex: 1 1 0% !important;
  min-width: 0 !important;
  max-width: none !important;
  padding: 0 !important;
  width: 100% !important;
}

/* Override Docusaurus .container and .wrapper max-width */
body[data-theme="tactical"] .container,
body[data-theme="swiss"] .container {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
}

body[data-theme="tactical"] .wrapper,
body[data-theme="swiss"] .wrapper {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

body[data-theme="tactical"] .docMainWrapper.wrapper,
body[data-theme="swiss"] .docMainWrapper.wrapper {
  padding: 2rem 0 !important;
  align-items: flex-start !important;
  max-width: 1400px !important;
  margin: 0 auto !important;
}

body[data-theme="tactical"] .mainContainer,
body[data-theme="swiss"] .mainContainer {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 !important;
  box-sizing: border-box !important;
}

body[data-theme="tactical"] .docsContainer .wrapper,
body[data-theme="swiss"] .docsContainer .wrapper {
  max-width: 100% !important;
  padding: 0 !important;
  overflow-wrap: break-word;
  width: 100% !important;
}

body[data-theme="tactical"] .docsContainer .post,
body[data-theme="swiss"] .docsContainer .post {
  max-width: 100% !important;
}

/* onPageNav — hide it, give space to content */
body[data-theme="tactical"] .onPageNav,
body[data-theme="swiss"] .onPageNav {
  display: none !important;
}

body[data-theme="tactical"] .navGroupCategoryTitle,
body[data-theme="swiss"] .navGroupCategoryTitle {
  color: var(--accent-red);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body[data-theme="tactical"] .navItem,
body[data-theme="swiss"] .navItem {
  color: var(--fg-secondary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}

body[data-theme="tactical"] .navItem:hover,
body[data-theme="swiss"] .navItem:hover {
  color: var(--fg-primary);
  border-left-color: var(--accent-red);
}

body[data-theme="tactical"] .navListItemActive .navItem,
body[data-theme="swiss"] .navListItemActive .navItem {
  color: var(--accent-red);
  border-left-color: var(--accent-red);
  font-weight: 700;
}

body[data-theme="tactical"] .navItem .nav-date,
body[data-theme="swiss"] .navItem .nav-date {
  display: block;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  margin-bottom: 0.15rem;
}

body[data-theme="tactical"] .navListItem,
body[data-theme="swiss"] .navListItem {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-color);
}

body[data-theme="tactical"] .navListItem:last-child,
body[data-theme="swiss"] .navListItem:last-child {
  border-bottom: none;
}

body[data-theme="tactical"] .navGroupSubcategoryTitle,
body[data-theme="swiss"] .navGroupSubcategoryTitle {
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Content area */
/* mainContainer colors (layout handled above) */
body[data-theme="tactical"] .mainContainer,
body[data-theme="swiss"] .mainContainer {
  background: var(--bg-primary) !important;
  color: var(--fg-primary) !important;
}

body[data-theme="tactical"] .post,
body[data-theme="swiss"] .post {
  color: var(--fg-primary);
}

body[data-theme="tactical"] .postHeaderTitle,
body[data-theme="swiss"] .postHeaderTitle {
  color: var(--fg-primary);
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.02em;
  border-bottom: 2px solid var(--accent-red);
  padding-bottom: 0.5rem;
}

body[data-theme="tactical"] .post h2,
body[data-theme="swiss"] .post h2 {
  color: var(--fg-primary);
  font-family: var(--font-display);
  font-weight: 800;
  margin-top: 2.5rem;
}

body[data-theme="tactical"] .post h3,
body[data-theme="swiss"] .post h3 {
  color: var(--fg-secondary);
  font-family: var(--font-display);
  font-weight: 700;
}

body[data-theme="tactical"] .post p,
body[data-theme="tactical"] .post li,
body[data-theme="swiss"] .post p,
body[data-theme="swiss"] .post li {
  color: var(--fg-secondary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.7;
}

body[data-theme="tactical"] .post a,
body[data-theme="swiss"] .post a {
  color: var(--accent-red);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-red-glow);
}

body[data-theme="tactical"] .post a:hover,
body[data-theme="swiss"] .post a:hover {
  color: var(--accent-red-hover);
}

/* Code blocks */
body[data-theme="tactical"] .post pre,
body[data-theme="swiss"] .post pre {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

body[data-theme="tactical"] .post code,
body[data-theme="swiss"] .post code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--bg-secondary);
  padding: 0.15em 0.4em;
  border: 1px solid var(--border-color);
}

body[data-theme="tactical"] .post pre code,
body[data-theme="swiss"] .post pre code {
  background: none;
  border: none;
  padding: 0;
}

/* Tables in docs */
body[data-theme="tactical"] .post table,
body[data-theme="swiss"] .post table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

body[data-theme="tactical"] .post th,
body[data-theme="swiss"] .post th {
  background: var(--bg-secondary);
  color: var(--accent-red);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  text-align: left;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

body[data-theme="tactical"] .post td,
body[data-theme="swiss"] .post td {
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  color: var(--fg-secondary);
}

/* Images in docs */
body[data-theme="tactical"] .post img,
body[data-theme="swiss"] .post img {
  filter: var(--diagram-filter);
  border: 1px solid var(--border-color);
  margin: 1rem 0;
}

/* Prev/Next navigation */
body[data-theme="tactical"] .docs-prevnext,
body[data-theme="swiss"] .docs-prevnext {
  border-top: 1px solid var(--border-color);
  margin-top: 3rem;
  padding-top: 1.5rem;
}

body[data-theme="tactical"] .docs-prevnext a,
body[data-theme="swiss"] .docs-prevnext a {
  color: var(--accent-red);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* On-page TOC */
body[data-theme="tactical"] .onPageNav,
body[data-theme="swiss"] .onPageNav {
  border-left: 1px solid var(--border-color);
}

body[data-theme="tactical"] .onPageNav a,
body[data-theme="swiss"] .onPageNav a {
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

body[data-theme="tactical"] .onPageNav a:hover,
body[data-theme="swiss"] .onPageNav a:hover {
  color: var(--accent-red);
}

/* Grid blocks (help page) */
body[data-theme="tactical"] .gridBlock .blockContent h2,
body[data-theme="swiss"] .gridBlock .blockContent h2 {
  color: var(--fg-primary);
  font-family: var(--font-display);
}

body[data-theme="tactical"] .gridBlock .blockContent p,
body[data-theme="swiss"] .gridBlock .blockContent p {
  color: var(--fg-secondary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* Blog styles */
body[data-theme="tactical"] .blogContainer,
body[data-theme="swiss"] .blogContainer {
  background: var(--bg-primary);
  color: var(--fg-primary);
}

/* Hash link icon color */
body[data-theme="tactical"] .hash-link-icon,
body[data-theme="swiss"] .hash-link-icon {
  fill: var(--accent-red);
}

/* ============================================================
   NOISE GRAIN OVERLAY (both modes, different opacity)
   ============================================================ */
body[data-theme="tactical"]::before,
body[data-theme="swiss"]::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

body[data-theme="tactical"]::before {
  opacity: 0.035;
}

body[data-theme="swiss"]::before {
  opacity: 0.025;
}

/* ============================================================
   CRT SCANLINE OVERLAY (dark mode only)
   ============================================================ */
.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

body[data-theme="tactical"] .crt-overlay {
  background: repeating-linear-gradient(0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.06) 2px,
      rgba(0, 0, 0, 0.06) 4px);
  opacity: 1;
}

body[data-theme="swiss"] .crt-overlay {
  opacity: 0;
}

/* ============================================================
   LINKS
   ============================================================ */
body[data-theme="tactical"] a,
body[data-theme="swiss"] a {
  color: var(--fg-primary);
  text-decoration: none;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}

body[data-theme="tactical"] a:hover:not(.btn-primary):not(.btn-secondary) {
  color: var(--accent-red-hover);
  text-shadow: 0 0 8px var(--accent-red-glow);
}

body[data-theme="swiss"] a:hover:not(.btn-primary):not(.btn-secondary) {
  color: var(--accent-red);
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.site-logo img {
  height: 32px;
  width: auto;
  filter: var(--logo-invert);
  transition: filter 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

body[data-theme="swiss"] .site-logo img {
  background-color: #111111;
  border-radius: 50% !important;
  padding: 4px;
  box-shadow: 0 0 0 2px #111111;
}

.site-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  color: var(--fg-primary);
  text-transform: uppercase;
}

/* Nav + toggle wrapper */
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.site-nav li {
  margin: 0 !important;
}

.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.5rem 0.75rem;
  color: var(--fg-secondary);
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.site-nav a:hover {
  color: var(--fg-primary);
  border-color: var(--border-bright);
  text-shadow: var(--nav-hover-glow);
}

/* ============================================================
   THEME TOGGLE
   ============================================================ */
.theme-toggle {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  background: none;
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.theme-toggle:hover {
  color: var(--fg-primary);
  border-color: var(--border-bright);
}

.theme-toggle-track {
  width: 28px;
  height: 14px;
  border: 1px solid var(--fg-dim);
  position: relative;
  transition: border-color 0.15s ease;
}

.theme-toggle-thumb {
  position: absolute;
  top: 1px;
  width: 10px;
  height: 10px;
  background-color: var(--accent-red);
  transition: left 0.2s ease;
}

body[data-theme="tactical"] .theme-toggle-thumb {
  left: 1px;
}

body[data-theme="swiss"] .theme-toggle-thumb {
  left: 15px;
}

.theme-toggle-label-dark,
.theme-toggle-label-light {
  transition: color 0.15s ease;
}

body[data-theme="tactical"] .theme-toggle-label-dark {
  color: var(--fg-primary);
}

body[data-theme="tactical"] .theme-toggle-label-light {
  color: var(--fg-dim);
}

body[data-theme="swiss"] .theme-toggle-label-dark {
  color: var(--fg-dim);
}

body[data-theme="swiss"] .theme-toggle-label-light {
  color: var(--fg-primary);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  max-width: 1400px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
  display: grid;
  grid-template-columns: 3fr 2fr;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4rem;
  align-items: center;
  min-height: 70vh;
  position: relative;
  overflow: hidden;
}

/* Dot-Matrix background */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.07;
  background-image: radial-gradient(circle, var(--fg-primary) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Oversized "N" watermark */
.hero-watermark {
  position: absolute;
  right: -5%;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(30rem, 50vw, 60rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--fg-primary);
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

body[data-theme="swiss"] .hero::after {
  opacity: 0.06;
}

body[data-theme="swiss"] .hero-watermark {
  opacity: 0.04;
}

.hero>*:not(.hero-watermark) {
  position: relative;
  z-index: 1;
}

.hero-meta {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
}

.hero-meta samp {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  text-transform: uppercase;
}

.hero-title {
  display: block;
  align-self: stretch;
  width: 100%;
  color: var(--fg-primary);
  margin: 0 0 1.5rem 0;
  line-height: 0;
  font-size: 0;
  transition: filter 0.3s ease;
}

.hero-wordmark {
  display: block;
  width: 100%;
  max-width: min(100%, 62rem);
  height: auto;
  filter: var(--hero-glow-filter, none);
  transition: filter 0.3s ease;
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-primary);
  margin: 0 0 0.75rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--accent-red);
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--fg-secondary);
  margin: 0 0 2.5rem 0;
  line-height: 1.6;
  max-width: 480px;
}

/* --- HERO ACTIONS --- */
.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.875rem 1.5rem;
  border: 2px solid var(--border-bright);
  background: transparent;
  color: var(--fg-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.btn-primary:hover {
  background-color: var(--accent-red);
  color: #FFFFFF;
  border-style: dashed;
  text-shadow: none;
  box-shadow: 0 0 20px var(--accent-red-glow);
}

.btn-secondary:hover {
  border-color: var(--fg-primary);
  background-color: var(--fg-primary);
  color: var(--bg-primary);
  text-shadow: none;
}

/* --- HERO DIAGRAM --- */
.hero-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
}

.diagram-frame {
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  position: relative;
  background-color: var(--bg-secondary);
  width: 100%;
  transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.4s ease, box-shadow 0.4s ease, z-index 0s;
  z-index: 1;
}


.diagram-frame img {
  max-width: 100%;
  height: auto;
  display: block;
  filter: var(--diagram-filter);
  transition: filter 0.3s ease;
}


.frame-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
  text-transform: uppercase;
  display: block;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  transition: opacity 0.3s ease;
}

/* Crosshair corners on diagram frame */
.diagram-frame::before,
.diagram-frame::after {
  content: '+';
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-dim);
  line-height: 1;
}

.diagram-frame::before {
  top: 4px;
  right: 8px;
}

.diagram-frame::after {
  bottom: 4px;
  left: 8px;
}

/* ============================================================
   FEATURES
   ============================================================ */
.features {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

.features-header {
  margin-bottom: 0;
}

.features-header samp {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  text-transform: uppercase;
}

.features-header hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 0.75rem 0 0 0;
}

/* Grid-gap-as-border technique */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background-color: var(--border-color);
  border: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.feature-card {
  background-color: var(--bg-primary);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: background-color 0.3s ease;
}

.feature-icon {
  margin-bottom: 1.5rem;
  width: 48px;
  height: 48px;
}

.feature-icon img {
  width: 48px;
  height: 48px;
  filter: var(--icon-filter);
  transition: filter 0.3s ease;
}

.feature-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--fg-primary);
  margin: 0 0 0.75rem 0;
}

.feature-card p {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--fg-secondary);
  margin: 0 0 1.5rem 0;
  flex: 1;
}

.feature-id {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
  text-transform: uppercase;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  margin-top: auto;
}

/* ============================================================
   STEP TYPES SECTION
   ============================================================ */
.step-types {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

.step-types-header {
  margin-bottom: 0;
}

.step-types-header samp {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  text-transform: uppercase;
}

.step-types-header hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 0.75rem 0 0 0;
}

/* Grid-gap-as-border technique */
.step-types-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background-color: var(--border-color);
  border: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.step-type-card {
  background-color: var(--bg-primary);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  position: relative;
  border-left: 3px solid transparent;
  transition: background-color 0.2s ease, border-left-color 0.2s ease;
}

.step-type-card:hover {
  background-color: var(--bg-secondary);
  border-left-color: var(--accent-red);
}

.step-type-icon {
  margin-bottom: 1.5rem;
  width: 48px;
  height: 48px;
}

.step-type-icon img {
  width: 48px;
  height: 48px;
  filter: var(--icon-filter);
  transition: filter 0.3s ease;
}

.step-type-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--fg-primary);
  margin: 0 0 0.75rem 0;
}

.step-type-card p {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--fg-secondary);
  margin: 0 0 1.5rem 0;
  flex: 1;
}

.step-type-id {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
  text-transform: uppercase;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  margin-top: auto;
}

/* ============================================================
   EXECUTION MODES SECTION
   ============================================================ */
.execution-modes {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

.execution-modes-header {
  margin-bottom: 0;
}

.execution-modes-header samp {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  text-transform: uppercase;
}

.execution-modes-header hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 0.75rem 0 0 0;
}

/* Grid-gap-as-border technique — 2-column layout */
.execution-modes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background-color: var(--border-color);
  border: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.execution-mode-card {
  background-color: var(--bg-primary);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  position: relative;
  border-left: 3px solid transparent;
  transition: background-color 0.2s ease, border-left-color 0.2s ease;
}

.execution-mode-card:hover {
  background-color: var(--bg-secondary);
  border-left-color: var(--accent-red);
}

.execution-mode-icon {
  margin-bottom: 1.5rem;
  width: 48px;
  height: 48px;
}

.execution-mode-icon img {
  width: 48px;
  height: 48px;
  filter: var(--icon-filter);
  transition: filter 0.3s ease;
}

.execution-mode-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--fg-primary);
  margin: 0 0 0.75rem 0;
}

.execution-mode-card p {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--fg-secondary);
  margin: 0 0 1.5rem 0;
  flex: 1;
}

.execution-mode-id {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
  text-transform: uppercase;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  margin-top: auto;
}

/* ============================================================
   SWISS MODE — Thick red structural dividers
   ============================================================ */
body[data-theme="swiss"] .features-header hr {
  border-top: 3px solid var(--accent-red);
}

body[data-theme="swiss"] .step-types-header hr {
  border-top: 3px solid var(--accent-red);
}

body[data-theme="swiss"] .execution-modes-header hr {
  border-top: 3px solid var(--accent-red);
}

body[data-theme="swiss"] .site-header {
  border-bottom: 2px solid var(--fg-primary);
}

body[data-theme="swiss"] .diagram-frame {
  background-color: #1A1A1A;
  border-color: #111111;
}

body[data-theme="swiss"] .diagram-frame::before,
body[data-theme="swiss"] .diagram-frame::after {
  color: #555555;
}

body[data-theme="swiss"] .frame-label {
  color: #888888;
  border-bottom-color: #333333;
}

/* ============================================================
   COOKIE CONSENT BANNER
   ============================================================ */
.cookie-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 2rem;
  background: rgba(0, 0, 0, 0.6);
  overflow-y: auto;
}

.cookie-inner {
  max-width: 700px;
  width: 100%;
  padding: 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-bright);
  border-top: 3px solid var(--accent-red);
}

.cookie-main {
  margin-bottom: 1.5rem;
}

.cookie-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-red);
  letter-spacing: 0.15em;
  display: block;
  margin-bottom: 0.75rem;
}

.cookie-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-secondary);
  line-height: 1.6;
  margin: 0 0 1rem 0;
}

.cookie-text a {
  color: var(--accent-red);
  text-decoration: none;
}

.cookie-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cookie-btn {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border-bright);
  background: transparent;
  color: var(--fg-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.cookie-accept {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.cookie-accept:hover {
  background: var(--accent-red);
  color: var(--bg-primary);
}

.cookie-save {
  border-color: var(--fg-dim);
  color: var(--fg-primary);
}

.cookie-save:hover {
  background: var(--fg-dim);
  color: var(--bg-primary);
}

.cookie-decline:hover {
  border-color: var(--fg-secondary);
  color: var(--fg-primary);
}

/* Cookie categories */
.cookie-categories {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cookie-category {
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.cookie-cat-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
}

.cookie-cat-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cookie-cat-name {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--fg-primary);
}

.cookie-cat-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--fg-dim);
  letter-spacing: 0.05em;
}

.cookie-expand {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--fg-dim);
  background: none;
  border: 1px solid var(--border-color);
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}

.cookie-expand:hover {
  color: var(--accent-red);
  border-color: var(--accent-red);
}

.cookie-category.open .cookie-expand {
  transform: rotate(45deg);
}

.cookie-cat-details {
  display: none;
  padding: 0 1rem 1rem;
}

.cookie-category.open .cookie-cat-details {
  display: block;
}

.cookie-table {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  border-collapse: collapse;
}

.cookie-table td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--fg-secondary);
  vertical-align: top;
}

.cookie-table td:first-child {
  width: 80px;
  color: var(--fg-dim);
}

.cookie-table code {
  background: var(--bg-secondary);
  padding: 0.1em 0.3em;
  font-size: 0.65rem;
  border: 1px solid var(--border-color);
}

.cookie-table a {
  color: var(--accent-red);
  text-decoration: none;
}

/* Toggle switch */
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 18px;
  flex-shrink: 0;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border-color);
  transition: 0.2s;
}

.cookie-slider::before {
  content: '';
  position: absolute;
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background: var(--fg-dim);
  transition: 0.2s;
}

.cookie-toggle input:checked+.cookie-slider {
  background: var(--accent-red);
}

.cookie-toggle input:checked+.cookie-slider::before {
  transform: translateX(18px);
  background: var(--bg-primary);
}

.cookie-slider-locked {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .cookie-main {
    text-align: center;
  }

  .cookie-actions {
    justify-content: center;
  }

  .cookie-cat-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 2px solid var(--accent-red);
  background-color: var(--bg-secondary);
  transition: background-color 0.3s ease;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2rem;
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 4rem;
}

.footer-logo a {
  display: block;
}

.footer-logo img {
  width: 50px;
  height: auto;
  opacity: 0.6;
  transition: opacity 0.15s ease, filter 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
  filter: var(--logo-invert);
}

body[data-theme="swiss"] .footer-logo img {
  background-color: #111111;
  border-radius: 50% !important;
  padding: 6px;
  box-shadow: 0 0 0 2px #111111;
}

.footer-logo img:hover {
  opacity: 1;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-heading {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.footer-col a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-secondary);
  letter-spacing: 0.04em;
}

.footer-col a:hover {
  color: var(--accent-red-hover);
}

.footer-copyright {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-color);
}

.footer-copyright samp {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  text-transform: uppercase;
}

/* ============================================================
   BUILT FOR — scenario cards
   ============================================================ */
.built-for {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

.built-for-header {
  margin-bottom: 0;
}

.built-for-header samp {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  text-transform: uppercase;
}

.built-for-header hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 0.75rem 0 0 0;
}

.built-for-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background-color: var(--border-color);
  border: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.built-for-card {
  background-color: var(--bg-primary);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  position: relative;
  border-left: 3px solid transparent;
  transition: background-color 0.3s ease, border-left-color 0.3s ease;
}

.built-for-card:hover {
  background-color: var(--bg-secondary);
  border-left-color: var(--accent-red);
}

.built-for-icon {
  margin-bottom: 1.5rem;
  width: 100%;
  max-width: 200px;
  align-self: flex-start;
}

.built-for-icon img {
  width: 100%;
  height: auto;
  display: block;
  filter: var(--diagram-filter);
  transition: filter 0.3s ease;
}

.built-for-card h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--fg-primary);
  margin: 0 0 0.75rem 0;
}

.built-for-card p {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--fg-secondary);
  margin: 0;
  flex: 1;
}

/* ============================================================
   USE CASES — 8 scenario cards
   ============================================================ */
.use-cases {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

.use-cases-header {
  margin-bottom: 0;
}

.use-cases-header samp {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  text-transform: uppercase;
}

.use-cases-header hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 0.75rem 0 0 0;
}

.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background-color: var(--border-color);
  border: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.use-case-card {
  background-color: var(--bg-primary);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  border-left: 3px solid transparent;
  transition: background-color 0.3s ease, border-left-color 0.3s ease;
}

.use-case-card:hover {
  background-color: var(--bg-secondary);
  border-left-color: var(--accent-red);
}

.use-case-id {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-red);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.use-case-card h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: var(--fg-primary);
  margin: 0 0 0.75rem 0;
  text-transform: uppercase;
}

.use-case-card p {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--fg-secondary);
  margin: 0 0 1.25rem 0;
  flex: 1;
}

.use-case-card .feature-id {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--fg-dim);
  text-transform: uppercase;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
  margin-top: auto;
}

/* ============================================================
   EXECUTION DIAGRAMS — inline into Execution Modes & Step Types
   ============================================================ */
.execution-mode-diagram,
.step-type-diagram {
  margin: 0 0 1.5rem 0;
  width: 100%;
}

.execution-mode-diagram img,
.step-type-diagram img {
  width: 100%;
  height: auto;
  display: block;
  filter: var(--diagram-filter);
  transition: filter 0.3s ease;
}

/* ============================================================
   FAILURE PROPAGATION — mini-section after Execution Modes
   ============================================================ */
.failure-prop {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

.failure-prop-header {
  margin-bottom: 0;
}

.failure-prop-header samp {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  text-transform: uppercase;
}

.failure-prop-header hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 0.75rem 0 0 0;
}

.failure-prop-inner {
  padding: 2.5rem 2rem;
  border: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.failure-prop-diagram img {
  width: 100%;
  height: auto;
  display: block;
  filter: var(--diagram-filter);
  transition: filter 0.3s ease;
}

.failure-prop-body h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  text-transform: uppercase;
  color: var(--fg-primary);
  margin: 0 0 0.5rem 0;
}

.failure-prop-body h3:not(:first-child) {
  margin-top: 1.25rem;
}

.failure-prop-body p {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--fg-secondary);
  margin: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 3rem;
    min-height: auto;
    padding: 3rem 2rem 4rem;
  }

  .hero-title {
    font-size: clamp(3.5rem, 14vw, 8rem);
  }

  .hero-diagram {
    order: -1;
  }

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

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

  .built-for-grid {
    grid-template-columns: 1fr;
  }

  .failure-prop-inner {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

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

@media (max-width: 640px) {
  .header-inner {
    padding: 0 1rem;
    height: 50px;
  }

  .site-name {
    font-size: 0.9rem;
  }

  .header-right {
    gap: 0.5rem;
  }

  .site-nav a {
    font-size: 0.65rem;
    padding: 0.4rem 0.5rem;
  }

  .theme-toggle {
    font-size: 0;
    padding: 0.35rem;
    gap: 0;
  }

  .theme-toggle-label-dark,
  .theme-toggle-label-light {
    display: none;
  }

  .hero {
    padding: 2rem 1rem 3rem;
  }

  .hero-meta {
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
  }

  .hero-title {
    font-size: clamp(3rem, 16vw, 5rem);
  }

  .hero-tagline {
    font-size: 0.85rem;
  }

  .hero-subtitle {
    font-size: 0.8rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    text-align: center;
    width: 100%;
  }

  .diagram-frame {
    padding: 1rem;
  }

  .features {
    padding: 0 1rem 4rem;
  }

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

  .feature-card {
    padding: 2rem 1.5rem;
  }

  .step-types {
    padding: 0 1rem 4rem;
  }

  .step-types-grid {
    grid-template-columns: 1fr;
  }

  .step-type-card {
    padding: 2rem 1.5rem;
  }

  .execution-modes {
    padding: 0 1rem 4rem;
  }

  .execution-modes-grid {
    grid-template-columns: 1fr;
  }

  .execution-mode-card {
    padding: 2rem 1.5rem;
  }

  .built-for {
    padding: 0 1rem 4rem;
  }

  .built-for-card {
    padding: 2rem 1.5rem;
  }

  .use-cases {
    padding: 0 1rem 4rem;
  }

  .use-cases-grid {
    grid-template-columns: 1fr;
  }

  .use-case-card {
    padding: 1.75rem 1.5rem;
  }

  .failure-prop {
    padding: 0 1rem 4rem;
  }

  .failure-prop-inner {
    padding: 2rem 1.5rem;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 1rem;
  }

  .footer-copyright {
    padding: 1rem;
  }
}

/* ============================================================
   SELECTION
   ============================================================ */
body[data-theme="tactical"] ::selection,
body[data-theme="swiss"] ::selection {
  background-color: var(--accent-red);
  color: #FFFFFF;
}

/* ============================================================
   SCROLLBAR (Webkit)
   ============================================================ */
body[data-theme="tactical"]::-webkit-scrollbar,
body[data-theme="swiss"]::-webkit-scrollbar {
  width: 8px;
}

body[data-theme="tactical"]::-webkit-scrollbar-track,
body[data-theme="swiss"]::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

body[data-theme="tactical"]::-webkit-scrollbar-thumb,
body[data-theme="swiss"]::-webkit-scrollbar-thumb {
  background: var(--border-bright);
}

body[data-theme="tactical"]::-webkit-scrollbar-thumb:hover,
body[data-theme="swiss"]::-webkit-scrollbar-thumb:hover {
  background: var(--fg-dim);
}

/* ============================================================
   ENTRANCE ANIMATIONS
   ============================================================ */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes terminalReveal {
  from {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
  }

  to {
    opacity: 1;
    clip-path: inset(0 0% 0 0);
  }
}

.hero-meta {
  opacity: 0;
  animation: terminalReveal 0.5s ease forwards;
  animation-delay: 0.2s;
}

.hero-title {
  opacity: 0;
  animation: fadeSlideUp 0.6s ease forwards;
  animation-delay: 0.4s;
}

.hero-tagline {
  opacity: 0;
  animation: terminalReveal 0.5s ease forwards;
  animation-delay: 0.7s;
}

.hero-subtitle {
  opacity: 0;
  animation: fadeSlideUp 0.5s ease forwards;
  animation-delay: 0.9s;
}

.hero-actions {
  opacity: 0;
  animation: fadeSlideUp 0.5s ease forwards;
  animation-delay: 1.1s;
}

.hero-diagram {
  opacity: 0;
  animation: fadeSlideUp 0.7s ease forwards;
  animation-delay: 0.6s;
}

.feature-card:nth-child(1) {
  opacity: 0;
  animation: fadeSlideUp 0.5s ease forwards;
  animation-delay: 0.3s;
}

.feature-card:nth-child(2) {
  opacity: 0;
  animation: fadeSlideUp 0.5s ease forwards;
  animation-delay: 0.5s;
}

.feature-card:nth-child(3) {
  opacity: 0;
  animation: fadeSlideUp 0.5s ease forwards;
  animation-delay: 0.7s;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {

  .hero-meta,
  .hero-title,
  .hero-tagline,
  .hero-subtitle,
  .hero-actions,
  .hero-diagram,
  .feature-card {
    opacity: 1 !important;
    animation: none !important;
  }

  .pulse-core,
  .data-dot {
    animation: none !important;
    display: none;
  }
}

/* ============================================================
   DIAGRAM ANIMATIONS — Pulse + Data Flow
   ============================================================ */
@keyframes corePulse {

  0%,
  100% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1.15);
  }
}

@keyframes dataFlow {
  0% {
    left: -5%;
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    left: 105%;
    opacity: 0;
  }
}

.pulse-core {
  position: absolute;
  top: 55%;
  left: 50%;
  width: 100px;
  height: 100px;
  border-radius: 50% !important;
  background: radial-gradient(circle, rgba(230, 25, 25, 0.3) 0%, transparent 70%);
  animation: corePulse 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

.data-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--accent-red);
  border-radius: 50% !important;
  animation: dataFlow 4s linear infinite;
  pointer-events: none;
  z-index: 1;
}

.data-dot:nth-child(2) {
  top: 35%;
  animation-delay: 0s;
}

.data-dot:nth-child(3) {
  top: 55%;
  animation-delay: 1.5s;
}

.data-dot:nth-child(4) {
  top: 75%;
  animation-delay: 3s;
}

/* ============================================================
   FEATURE CARD HOVER
   ============================================================ */
.feature-card {
  border-left: 3px solid transparent;
  transition: background-color 0.2s ease, border-left-color 0.2s ease;
}

.feature-card:hover {
  background-color: var(--bg-secondary);
  border-left-color: var(--accent-red);
}

/* ============================================================
   DEFINITION SECTION (AI-optimized)
   ============================================================ */
.definition {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.definition-inner {
  max-width: 800px;
  border-left: 3px solid var(--accent-red);
  padding-left: 1.5rem;
}

.definition h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--fg-primary);
  margin-bottom: 1rem;
}

.definition p {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--fg-secondary);
}

/* ============================================================
   HOW IT WORKS SECTION
   ============================================================ */
.how-it-works {
  max-width: 1400px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.how-header {
  margin-bottom: 3rem;
}

.how-header samp {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.how-header hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin-top: 0.75rem;
}

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

.how-step {
  border-left: 2px solid var(--accent-red);
  padding-left: 1.5rem;
}

.how-step-id {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-red);
  display: block;
  margin-bottom: 0.75rem;
  opacity: 0.6;
}

.how-step h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--fg-primary);
  margin-bottom: 0.75rem;
}

.how-step p {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--fg-secondary);
}

@media (max-width: 1024px) {
  .how-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Docs sidebar: collapse to full-width above content on tablet */
  body[data-theme="tactical"] .docMainWrapper,
  body[data-theme="swiss"] .docMainWrapper {
    flex-direction: column !important;
  }

  body[data-theme="tactical"] .docsNavContainer,
  body[data-theme="swiss"] .docsNavContainer {
    width: 100% !important;
    min-width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border-color);
    max-height: 50vh;
    overflow-y: auto;
  }
}

@media (max-width: 640px) {

  /* Cookie banner mobile */
  .cookie-banner {
    padding: 0 1rem;
  }

  .cookie-inner {
    padding: 1.5rem 1rem;
  }

  .cookie-actions {
    flex-wrap: wrap;
  }

  .cookie-btn {
    flex: 1;
    text-align: center;
    min-width: 80px;
  }
}

/* ============================================================
   BLOG DIAGRAMS
   ============================================================ */
.blog-diagram {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.5rem 0;
}

body[data-theme="swiss"] .blog-diagram {
  filter: invert(1) hue-rotate(180deg);
}

/* ============================================================
   FAQ SECTION
   ============================================================ */
.faq {
  max-width: 1400px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.faq-header {
  margin-bottom: 2rem;
}

.faq-header samp {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.faq-header hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin-top: 0.75rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.faq-item {
  border-bottom: 1px solid var(--border-color);
}

.faq-question {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 1.25rem 0;
  cursor: pointer;
  color: var(--fg-primary);
  list-style: none;
  transition: color 0.15s ease;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::before {
  content: '+';
  display: inline-block;
  width: 1.5rem;
  font-family: var(--font-mono);
  color: var(--accent-red);
  font-weight: 700;
}

.faq-item[open] .faq-question::before {
  content: '\2212';
}

.faq-question:hover {
  color: var(--accent-red);
}

.faq-answer {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--fg-secondary);
  padding: 0 0 1.25rem 1.5rem;
  max-width: 800px;
}

/* ============================================================
   TRUST LOGOS SECTION
   ============================================================ */
.trust {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

.trust-inner {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
}

.trust-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  text-transform: uppercase;
  display: block;
  margin-bottom: 1.5rem;
}

.trust-logos {
  display: flex;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.trust-logos img {
  height: 36px;
  width: auto;
  opacity: 0.4;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.trust-logos img[alt="invoice-api.xhub.io"] {
  height: 48px;
}

.trust-logos img:hover {
  opacity: 0.9;
}

body[data-theme="tactical"] .trust-logos img {
  filter: grayscale(1) brightness(0.8) invert(1);
}

body[data-theme="tactical"] .trust-logos img[alt="invoice-api.xhub.io"] {
  filter: grayscale(1) invert(1) brightness(1.5);
}

body[data-theme="swiss"] .trust-logos img {
  filter: grayscale(1) brightness(0.4);
}

body[data-theme="swiss"] .trust-logos img[alt="invoice-api.xhub.io"] {
  filter: grayscale(1) brightness(0.3) contrast(1.2);
}

.trust-logo-with-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.trust-logo-with-label samp {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--fg-primary);
  opacity: 0.4;
  transition: opacity 0.2s ease;
  text-transform: none;
}

.trust-logo-with-label:hover samp {
  opacity: 0.9;
}

.trust-logo-with-label:hover img {
  opacity: 0.9;
}
