:root {
  --bg: #070b14;
  --surface: #0f1626;
  --surface-elevated: #162036;
  --surface-subtle: rgba(22, 32, 54, 0.55);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;
  --accent-glow: rgba(99, 102, 241, 0.16);
  --grid-opacity: 0.035;
  --code-bg: #050811;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-elevated: #f1f5f9;
  --surface-subtle: rgba(241, 245, 249, 0.85);
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.2);
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-cyan: #0891b2;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --accent-purple: #9333ea;
  --accent-glow: rgba(79, 70, 229, 0.1);
  --grid-opacity: 0.05;
  --code-bg: #0f172a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  transition: background-color 0.25s, color 0.25s;
  position: relative;
  max-width: 100vw;
  overflow-x: hidden;
}

code, pre, .mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Inline code wrapping so long paths/hashes never push container width */
:not(pre) > code {
  font-size: 0.86em;
  padding: 0.12rem 0.36rem;
  border-radius: 5px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--text) 1px, transparent 1px),
    linear-gradient(to bottom, var(--text) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: var(--grid-opacity);
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  top: 22%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(820px, 100vw);
  height: min(820px, 100vw);
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Header & Navigation */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.95rem 1.75rem;
  max-width: 1320px;
  margin: 0 auto;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.brand-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  background: var(--surface-elevated);
  color: var(--accent-cyan);
  border: 1px solid var(--border);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  transition: all 0.18s;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-links a.active {
  color: var(--text);
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.theme-btn, .mobile-menu-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.52rem;
  min-width: 38px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.theme-btn:hover, .mobile-menu-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mobile-menu-btn {
  display: none;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.85rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 0.68rem 0.85rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid transparent;
}

.mobile-nav a:hover {
  background: var(--surface-elevated);
}

.mobile-nav a.active {
  background: var(--surface-elevated);
  color: var(--accent);
  border-color: var(--border-strong);
}

.mobile-nav .mobile-nav-cta {
  margin-top: 0.45rem;
  background: var(--accent);
  color: #ffffff;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

/* Mobile Sticky Bottom App-Bar Template (shown ONLY on <= 768px) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(58px + env(safe-area-inset-bottom, 0px));
  z-index: 110;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-strong);
  padding: 0.3rem 0.35rem calc(0.3rem + env(safe-area-inset-bottom, 0px));
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.28);
}

.mobile-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 600;
  padding: 0.3rem 0.35rem;
  border-radius: 8px;
  flex: 1;
  min-width: 0;
  max-height: 48px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-bottom-nav a svg {
  width: 18px !important;
  height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  stroke-width: 2.1;
  flex-shrink: 0;
}

.mobile-bottom-nav a.active {
  color: var(--accent);
  background: var(--surface-elevated);
}

.mobile-bottom-nav a.foundry-tab {
  color: var(--accent-emerald);
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.65rem 1.25rem;
  border-radius: 9px;
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.28);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.65rem 1.25rem;
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.42rem 0.8rem;
  font-size: 0.78rem;
  border-radius: 7px;
}

.btn-danger {
  background: rgba(244, 63, 94, 0.14);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.38);
}

.btn-danger:hover, .btn-danger.active {
  background: var(--accent-rose);
  color: #ffffff;
}

/* Main Container */
main {
  position: relative;
  z-index: 10;
  max-width: 1280px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
  width: 100%;
  flex: 1;
  min-width: 0;
}

/* Hero & Status Pill */
.hero {
  text-align: center;
  max-width: 960px;
  margin: 0 auto 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0.38rem 1rem;
  border-radius: 9999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-emerald);
  margin-bottom: 1.5rem;
  max-width: 100%;
  text-align: center;
  flex-wrap: wrap;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulseGlow 2s infinite;
  flex-shrink: 0;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.18); }
}

h1.hero-title {
  font-size: clamp(2.1rem, 5.2vw, 4.1rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin-bottom: 1.25rem;
  overflow-wrap: break-word;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

p.hero-subtitle {
  font-size: clamp(0.98rem, 2vw, 1.22rem);
  color: var(--text-muted);
  max-width: 780px;
  margin-bottom: 2rem;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  margin-bottom: 2.5rem;
  width: 100%;
}

/* Hero Live Mini-HUD */
.hero-hud {
  width: 100%;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 1.35rem 1.5rem;
  text-align: left;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.hero-hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.hero-hud-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
  overflow-wrap: anywhere;
}

.hero-hud-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 195px), 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.hud-stat {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.95rem;
  min-width: 0;
}

.hud-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.hud-stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hud-wire-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: var(--code-bg);
  color: #e2e8f0;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  overflow-x: auto;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Metrics Bar */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1.2rem;
  width: 100%;
  margin-bottom: 4.5rem;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.4rem;
  text-align: left;
  min-width: 0;
}

.metric-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.metric-label {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Section Headers */
.section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 2.75rem;
  min-width: 0;
}

.section-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-cyan);
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
  overflow-wrap: anywhere;
}

.section-title {
  font-size: clamp(1.45rem, 3.2vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.65rem;
  overflow-wrap: break-word;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1rem;
  overflow-wrap: break-word;
}

/* Feature & SDK Cards */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  gap: 1.35rem;
  margin-bottom: 4.5rem;
}

.feature-card, .panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
  transition: border-color 0.2s, transform 0.2s;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
}

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

.feature-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.24rem 0.6rem;
  border-radius: 6px;
  background: var(--surface-elevated);
  color: var(--accent);
  display: inline-block;
  margin-bottom: 0.9rem;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Switchable Code Tabs */
.code-tabs-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 4.5rem;
  min-width: 0;
  max-width: 100%;
}

.code-tabs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.code-tab-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-width: 0;
  max-width: 100%;
}

.code-tab-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}

.code-tab-btn:hover {
  color: var(--text);
  background: var(--surface);
}

.code-tab-btn.active {
  background: var(--accent);
  color: #ffffff;
}

.code-tab-pane {
  display: none;
  padding: 1.5rem;
  min-width: 0;
  max-width: 100%;
}

.code-tab-pane.active {
  display: block;
}

.code-tab-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  min-width: 0;
}

.code-block-container {
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.code-snippet {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  background: var(--code-bg);
  color: #e2e8f0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.15rem 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  width: 100%;
}

.abi-card .code-snippet {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.copy-btn {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s;
  flex-shrink: 0;
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Tables (Comparison, Manifest, Errata, ABI) */
.table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 4.5rem;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  background: var(--surface-elevated);
  color: var(--text);
  font-weight: 700;
  padding: 0.95rem 1.2rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table td {
  padding: 0.95rem 1.2rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
  overflow-wrap: break-word;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table td strong {
  color: var(--text);
}

.badge-pass {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.73rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.14);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.32);
}

.badge-warn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.73rem;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.14);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.32);
}

.badge-fail {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.73rem;
  font-weight: 600;
  background: rgba(244, 63, 94, 0.14);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.32);
}

/* Pricing Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1.75rem;
  max-width: 960px;
  margin: 0 auto 4rem;
}

.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 35px rgba(99, 102, 241, 0.14);
}

.price-tag {
  font-size: 2.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0.65rem 0 0.2rem;
}

.price-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.4rem;
}

.price-list {
  list-style: none;
  margin-bottom: 1.85rem;
}

.price-list li {
  font-size: 0.91rem;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.check-icon {
  color: var(--accent-emerald);
  font-weight: 700;
  flex-shrink: 0;
}

/* Simulator 3-Panel Workbench */
.sim-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
  min-width: 0;
  width: 100%;
}

.sim-workbench > * {
  min-width: 0;
  max-width: 100%;
}

.sim-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 1.5rem;
  min-width: 0;
  width: 100%;
}

.sim-top-row > * {
  min-width: 0;
  max-width: 100%;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 1rem;
  margin-bottom: 1.15rem;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.panel-title {
  font-size: 1.08rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-wrap: break-word;
}

.demo-callout {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.32);
  color: var(--text);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  margin-bottom: 1rem;
  overflow-wrap: break-word;
}

.info-callout {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.32);
  color: var(--text);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  overflow-wrap: break-word;
}

.window-slots {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0.85rem 0 1.1rem;
}

.window-slot {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.25rem;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window-slot.current {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.13);
}

.slider-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.slider-box {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  min-width: 0;
}

.slider-box label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  gap: 0.4rem;
}

.slider-box input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Hex Byte Map */
.hex-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
}

.hex-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.18rem 0.5rem;
  border-radius: 5px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
}

.hex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 4px;
  background: var(--code-bg);
  padding: 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  margin-bottom: 0.85rem;
  max-width: 100%;
}

.hex-byte {
  padding: 0.28rem 0.15rem;
  border-radius: 4px;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s, border-color 0.12s;
}

.hex-byte:hover, .hex-byte.selected {
  transform: scale(1.12);
  border-color: #ffffff;
  z-index: 2;
}

.hb-netid     { background: rgba(99, 102, 241, 0.26); color: #c7d2fe; }
.hb-reserved  { background: rgba(100, 116, 139, 0.25); color: #94a3b8; }
.hb-flags     { background: rgba(245, 158, 11, 0.28); color: #fde68a; }
.hb-epoch     { background: rgba(6, 182, 212, 0.26); color: #a5f3fc; }
.hb-nonce     { background: rgba(168, 85, 247, 0.26); color: #e9d5ff; }
.hb-attlen    { background: rgba(16, 185, 129, 0.24); color: #a7f3d0; }
.hb-attest    { background: rgba(16, 185, 129, 0.36); color: #6ee7b7; }
.hb-attest.forged { background: rgba(244, 63, 94, 0.45); color: #fecdd3; }
.hb-cipher    { background: rgba(59, 130, 246, 0.25); color: #bfdbfe; }
.hb-tag       { background: rgba(244, 63, 94, 0.28); color: #fda4af; }

/* Attack Console */
.attack-buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr));
  gap: 0.65rem;
  margin-bottom: 1.15rem;
}

.attack-btn {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: all 0.16s;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.attack-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.attack-btn-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent-cyan);
  font-weight: 700;
}

.attack-btn-title {
  font-size: 0.86rem;
  font-weight: 700;
}

.attack-btn-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  overflow-wrap: break-word;
}

.terminal-log {
  background: var(--code-bg);
  color: #e2e8f0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.77rem;
  height: 290px;
  overflow-y: auto;
  overflow-x: auto;
  line-height: 1.55;
  max-width: 100%;
}

.log-entry {
  padding: 0.3rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.07);
  overflow-wrap: anywhere;
}

.log-pass { color: #34d399; }
.log-drop { color: #fb7185; }
.log-info { color: #38bdf8; }

/* Docs & Whitepaper Two-Column Layout — FIXED: minmax(0, 1fr) prevents right-column blowout */
.portal-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.portal-layout > * {
  min-width: 0;
  max-width: 100%;
}

.portal-sidebar {
  position: sticky;
  top: 84px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.15rem;
  max-height: calc(100vh - 108px);
  overflow-y: auto;
  min-width: 0;
}

.mobile-toc-toggle {
  display: none;
  width: 100%;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.25rem;
}

.search-input-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.search-input {
  width: 100%;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.84rem;
  font-family: 'Inter', sans-serif;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.sidebar-group-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 0.9rem 0 0.4rem;
  font-weight: 700;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav a {
  display: block;
  padding: 0.42rem 0.65rem;
  border-radius: 7px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  transition: all 0.15s;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
  background: var(--surface-elevated);
  color: var(--text);
}

.doc-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 1.75rem;
  scroll-margin-top: 92px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.doc-section h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.45rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

.doc-section h3 {
  font-size: 1.08rem;
  font-weight: 700;
  margin: 1.35rem 0 0.55rem;
  overflow-wrap: break-word;
}

.doc-section p, .doc-section li {
  color: var(--text-muted);
  font-size: 0.94rem;
  overflow-wrap: break-word;
}

.doc-section ul, .doc-section ol {
  padding-left: 1.35rem;
  margin: 0.65rem 0 1rem;
}

.doc-section li {
  margin-bottom: 0.45rem;
}

.abi-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.85rem;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
}

.abi-fn-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent-cyan);
  overflow-wrap: anywhere;
}

/* Footer */
footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 2.5rem 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

footer a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

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

/* ============================================================================
   RESPONSIVE TABLET & MOBILE TEMPLATE BREAKPOINTS
   ============================================================================ */

/* Tablet & Compact Desktop (<= 1040px) */
@media (max-width: 1040px) {
  .sim-top-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .portal-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }
  .portal-sidebar {
    position: static;
    max-height: none;
    padding: 1rem;
  }
  .mobile-toc-toggle {
    display: flex;
  }
  .portal-sidebar .sidebar-collapsible {
    display: none;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
  }
  .portal-sidebar.toc-open .sidebar-collapsible {
    display: block;
  }
  .search-input-wrap {
    margin-bottom: 0.65rem;
  }
}

/* Mobile & Phablet Viewports (<= 860px) */
@media (max-width: 860px) {
  .nav-links {
    display: none;
  }
  .mobile-menu-btn {
    display: flex;
  }
  .nav-container {
    padding: 0.75rem 1rem;
  }
}

/* Smartphone Viewports (<= 768px) */
@media (max-width: 768px) {
  main {
    padding: 1.5rem 0.9rem 5.5rem;
  }
  footer {
    padding: 1.75rem 0.9rem 5.5rem;
  }
  .mobile-bottom-nav {
    display: flex;
  }
  .header-actions .btn-primary {
    display: none;
  }
  .btn-primary, .btn-secondary {
    white-space: normal;
    text-align: center;
    line-height: 1.35;
    max-width: 100%;
  }
  .hero {
    margin-bottom: 2.25rem;
  }
  .status-pill {
    font-size: 0.69rem;
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    line-height: 1.35;
  }
  .hero-cta-group {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-cta-group a {
    width: 100%;
  }
  .hero-hud {
    padding: 1rem;
    border-radius: 14px;
  }
  .hero-hud-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-hud-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }
  .hud-wire-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.7rem;
    word-break: break-all;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 3rem;
  }
  .metric-card {
    padding: 1rem;
  }
  .metric-value {
    font-size: 1.35rem;
  }
  .features-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    margin-bottom: 3rem;
  }
  .feature-card, .panel-card, .doc-section, .pricing-card {
    padding: 1.15rem 1rem;
    border-radius: 14px;
  }
  .code-tabs-header {
    padding: 0.75rem 0.9rem;
  }
  .code-tab-buttons {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    padding-bottom: 4px;
  }
  .code-tab-pane {
    padding: 0.95rem;
  }
  .code-snippet {
    font-size: 0.72rem;
    padding: 0.8rem 0.85rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .data-table {
    font-size: 0.76rem;
  }
  .data-table th, .data-table td {
    padding: 0.6rem 0.7rem;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .window-slots {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .hex-legend {
    font-size: 0.66rem;
    gap: 0.35rem;
  }
  .hex-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 3px;
    padding: 0.55rem;
    font-size: 0.68rem;
  }
  .abi-card {
    padding: 0.85rem 0.9rem;
  }
}

/* Compact Smartphones (<= 480px) */
@media (max-width: 480px) {
  main {
    padding: 1.25rem 0.75rem 5.5rem;
  }
  .brand {
    font-size: 1.05rem;
    gap: 8px;
  }
  .brand-icon {
    width: 30px;
    height: 30px;
  }
  .hero-hud-grid, .metrics-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .window-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .slider-group {
    grid-template-columns: minmax(0, 1fr);
  }
  .price-tag {
    font-size: 2.15rem;
  }
}
