:root {
  --background: #07100d;
  --panel: #0d1915;
  --panel-2: #11231d;
  --text: #e8fff5;
  --muted: #8da99d;
  --line: #264138;
  --line-soft: rgba(38, 65, 56, 0.6);
  --accent: #ff7a2f;
  --accent-2: #63d9ff;
  --accent-3: #65ff9f;
  --danger: #ff6b6b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  --glow-accent: 0 0 24px rgba(255, 122, 47, 0.28);
  --glow-cyan: 0 0 22px rgba(99, 217, 255, 0.22);
  /* Self/system-only monospace stack — no external font fetch (keeps CSP strict,
     removes the third-party Google Fonts dependency). "JetBrains Mono" is used
     only if a visitor already has it installed locally. */
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", "JetBrains Mono", monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: clip;
  background:
    linear-gradient(180deg, rgba(255, 122, 47, 0.1), transparent 360px),
    radial-gradient(circle at 12% 0%, rgba(99, 217, 255, 0.12), transparent 280px),
    var(--background);
  color: var(--text);
  font-family: var(--font-mono);
  font-feature-settings: "liga" 0;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

::selection {
  background: var(--accent);
  color: #04100b;
}

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Terminal scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #2c4a3f var(--background);
}

*::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

*::-webkit-scrollbar-track {
  background: var(--background);
}

*::-webkit-scrollbar-thumb {
  background: #2c4a3f;
  border: 3px solid var(--background);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #3c6557;
}

.site-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 13, 0.84);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: -0.01em;
  transition: filter 200ms var(--ease);
}

.brand:hover {
  filter: drop-shadow(0 0 14px rgba(255, 122, 47, 0.35));
}

.brand img {
  width: 52px;
  height: 52px;
  border-radius: 9px;
}

.command-nav {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13.5px;
  letter-spacing: -0.01em;
}

.command-nav a {
  border: 1px solid rgba(99, 217, 255, 0.28);
  border-radius: 999px;
  padding: 7px 13px;
  white-space: nowrap;
  background: rgba(13, 25, 21, 0.7);
  transition: color 180ms var(--ease), background 180ms var(--ease),
    border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.command-nav a:hover,
.command-nav a:focus-visible {
  color: var(--accent);
  background: rgba(255, 122, 47, 0.1);
  border-color: rgba(255, 122, 47, 0.55);
  box-shadow: var(--glow-accent);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: color 160ms var(--ease), border-color 160ms var(--ease),
    box-shadow 160ms var(--ease);
}

.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--glow-accent);
}

.hidden-editor-trigger {
  display: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(340px, 0.78fr);
  gap: 36px;
  align-items: center;
  padding: 40px 0 32px;
}

.terminal-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--accent-2);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-shadow: var(--glow-cyan);
}

.terminal-label::before {
  content: "▸";
  color: var(--accent);
  opacity: 0.85;
  text-shadow: none;
}

.hero-copy .terminal-label::after {
  content: "";
  width: 8px;
  height: 15px;
  background: var(--accent-2);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(40px, 6.6vw, 78px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.022em;
  text-shadow: 0 0 40px rgba(255, 122, 47, 0.1);
}

h2 {
  margin: 0;
  font-size: clamp(25px, 3.6vw, 40px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.018em;
}

.tagline {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--accent);
  font-size: clamp(19px, 2.6vw, 28px);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-shadow: 0 0 26px rgba(255, 122, 47, 0.16);
}

.heroText,
#submitText {
  max-width: 700px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.primary-action,
.secondary-action,
.danger-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform 160ms var(--ease), background 160ms var(--ease),
    border-color 160ms var(--ease), box-shadow 160ms var(--ease), color 160ms var(--ease);
}

.primary-action {
  background: var(--accent);
  border-color: var(--accent);
  color: #04100b;
}

.primary-action:hover {
  background: #ff8f4d;
  border-color: #ff8f4d;
  box-shadow: 0 8px 26px rgba(255, 122, 47, 0.32), 0 0 0 1px rgba(255, 122, 47, 0.4);
  transform: translateY(-1px);
}

.primary-action:active {
  transform: translateY(0);
}

.secondary-action {
  background: rgba(99, 217, 255, 0.05);
  color: var(--accent-2);
  border-color: rgba(99, 217, 255, 0.34);
}

.secondary-action:hover {
  background: rgba(99, 217, 255, 0.12);
  border-color: var(--accent-2);
  box-shadow: var(--glow-cyan);
  transform: translateY(-1px);
}

.danger-action {
  background: transparent;
  border-color: rgba(255, 107, 107, 0.55);
  color: var(--danger);
}

.danger-action:hover {
  background: rgba(255, 107, 107, 0.12);
  border-color: var(--danger);
}

.hero-console,
.submit-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)), var(--panel);
  box-shadow: var(--shadow);
}

.hero-console {
  overflow: hidden;
}

.console-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

.console-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
}

.console-bar span:nth-child(2) {
  background: var(--accent-2);
}

.console-bar span:nth-child(3) {
  background: var(--accent-3);
}

.console-bar::after {
  content: "crusherlabs.config";
  margin-left: 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
}

pre {
  margin: 0;
  padding: 24px;
  overflow: auto;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
}

#heroCode::after {
  content: "█";
  display: inline-block;
  margin-left: 2px;
  color: var(--accent-3);
  animation: blink 1.1s steps(1) infinite;
}

.ticker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 0 48px;
}

.ticker div {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 18px 20px;
  background: rgba(13, 25, 21, 0.78);
  transition: border-color 180ms var(--ease), transform 180ms var(--ease);
}

.ticker div:hover {
  border-color: rgba(255, 122, 47, 0.4);
  transform: translateY(-2px);
}

.ticker strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 30px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  text-shadow: var(--glow-accent);
}

.ticker span {
  color: var(--muted);
  font-size: 13px;
}

.section {
  padding: 56px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.filters,
.tabs,
.page-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter,
.engine-filter,
.tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  padding: 9px 13px;
  font-size: 13.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 150ms var(--ease), background 150ms var(--ease),
    border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

.filter:hover,
.tab:hover {
  color: var(--accent);
  border-color: rgba(255, 122, 47, 0.5);
}

.engine-filter:hover {
  color: var(--accent-2);
  border-color: var(--accent-2);
}

.filter.active,
.engine-filter.active,
.tab.active {
  color: #04100b;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--glow-accent);
}

.engine-filter {
  border-color: rgba(99, 217, 255, 0.45);
}

.engine-filter.active {
  background: var(--accent-2);
  border-color: var(--accent-2);
  box-shadow: var(--glow-cyan);
}

.page-links {
  margin: -8px 0 18px;
}

.page-links a {
  border: 1px solid rgba(99, 217, 255, 0.5);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--accent-2);
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
  transition: background 160ms var(--ease), border-color 160ms var(--ease),
    box-shadow 160ms var(--ease);
}

.page-links a:hover,
.page-links a:focus-visible {
  border-color: var(--accent-2);
  background: rgba(99, 217, 255, 0.11);
  box-shadow: var(--glow-cyan);
}

.search-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 16px;
  background: var(--panel);
  margin-bottom: 20px;
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.search-row:focus-within {
  border-color: var(--accent);
  box-shadow: var(--glow-accent);
}

.search-row label {
  color: var(--accent);
  font-weight: 600;
}

.search-row input,
.editor-body input,
.editor-body textarea,
.editor-body select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #07100d;
  color: var(--text);
  padding: 11px 12px;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.search-row input {
  border-color: transparent;
  background: transparent;
  padding: 0;
}

.editor-body input:focus,
.editor-body textarea:focus,
.editor-body select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--glow-accent);
}

.grid,
.engine-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.card,
.engine {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 230px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  background: var(--panel);
  overflow: hidden;
  transition: transform 200ms var(--ease), border-color 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

.card::before,
.engine::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity 200ms var(--ease);
}

.card:hover,
.engine:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 122, 47, 0.6);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), var(--glow-accent);
}

.card:hover::before,
.engine:hover::before {
  opacity: 1;
}

.card-type {
  color: var(--accent-2);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.card h3,
.engine h3 {
  margin: 12px 0 10px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.card p,
.engine p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.download-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  min-height: 38px;
  margin-top: auto;
  border: 1px solid rgba(255, 122, 47, 0.55);
  border-radius: 8px;
  padding: 8px 13px;
  color: var(--accent);
  font-weight: 700;
  font-size: 13.5px;
  transition: background 160ms var(--ease), border-color 160ms var(--ease),
    box-shadow 160ms var(--ease), transform 160ms var(--ease);
}

.download-link::before {
  content: "↓";
  font-weight: 800;
}

.download-link:hover,
.download-link:focus-visible {
  background: rgba(255, 122, 47, 0.14);
  border-color: var(--accent);
  box-shadow: var(--glow-accent);
  transform: translateY(-1px);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 16px 0;
}

.tags span {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--accent);
  background: rgba(255, 122, 47, 0.05);
  font-size: 11.5px;
  letter-spacing: 0.01em;
}

.band {
  margin-inline: calc((100vw - min(1180px, calc(100vw - 32px))) / -2);
  padding-inline: calc((100vw - min(1180px, calc(100vw - 32px))) / 2);
  background: rgba(17, 35, 29, 0.55);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
  align-items: start;
}

.submit-panel {
  padding: 24px;
}

.submit-panel p:first-child {
  color: var(--accent-3);
  font-weight: 600;
}

.submit-panel ul {
  margin: 16px 0 22px;
  padding-left: 20px;
  color: var(--muted);
  list-style: none;
}

.submit-panel li {
  position: relative;
  padding: 3px 0;
}

.submit-panel li::before {
  content: "└─";
  position: absolute;
  left: -20px;
  color: var(--line);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 28px 0 44px;
  color: var(--muted);
  font-size: 12.5px;
}

.footer span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer span:first-child::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 10px var(--accent-3);
}

.editor-panel {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 50;
  width: min(460px, 100%);
  padding: 20px;
  overflow: auto;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(100%);
  transition: transform 240ms var(--ease);
}

.editor-panel.open {
  transform: translateX(0);
}

.password-dialog {
  width: min(420px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.password-dialog[open] {
  animation: dialogIn 200ms var(--ease);
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

.password-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(3px);
}

.password-dialog form {
  display: grid;
  gap: 14px;
}

.password-dialog label {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.auth-error {
  min-height: 22px;
  margin: 0;
  color: var(--danger);
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms var(--ease);
}

.scrim.open {
  opacity: 1;
  pointer-events: auto;
}

.editor-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.editor-header h2 {
  font-size: 26px;
}

.editor-body {
  display: none;
  margin-top: 18px;
}

.editor-body.active {
  display: grid;
  gap: 14px;
}

.editor-body label {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.editor-note {
  color: var(--muted);
}

.mini-list {
  display: grid;
  gap: 8px;
}

.mini-list div {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
}

.mini-list button {
  margin-left: auto;
  border: 1px solid rgba(255, 107, 107, 0.4);
  border-radius: 6px;
  padding: 4px 9px;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  transition: background 150ms var(--ease);
}

.mini-list button:hover {
  background: rgba(255, 107, 107, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1024px) {
  .command-nav {
    display: none;
  }
}

@media (max-width: 900px) {
  .topbar {
    gap: 12px;
  }

  .command-nav {
    display: none;
  }

  .hero,
  .split {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .ticker,
  .grid,
  .engine-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .site-shell {
    width: min(100% - 20px, 1180px);
  }

  h1 {
    font-size: 40px;
  }

  .ticker,
  .grid,
  .engine-grid {
    grid-template-columns: 1fr;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
  }
}

/* --- Newsletter signup + download gate --- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.signup-form { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.signup-form input {
  background: var(--background, #07100d);
  border: 1px solid rgba(99, 217, 255, 0.4);
  color: inherit; padding: 10px 12px; border-radius: 8px; font: inherit;
}
.signup-form input:focus { outline: 2px solid var(--accent-2); }
.signup-note { font-size: 0.8rem; opacity: 0.7; margin: 0; }

/* Honeypot bot trap: kept in the DOM (so bots that auto-fill every field trip
   it) but removed from the layout and the accessibility tree so real users
   never see or tab into it. Paired with a JS submit guard in app.js. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.gate-modal {
  position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.7); z-index: 1000; padding: 20px;
}
.gate-modal.open { display: flex; }
.gate-box {
  position: relative; max-width: 440px; width: 100%;
  background: var(--panel, #0d1915);
  border: 1px solid rgba(99, 217, 255, 0.35);
  border-radius: 14px; padding: 28px;
}
.gate-close {
  position: absolute; top: 12px; right: 14px; background: none; border: none;
  color: inherit; font: inherit; cursor: pointer; opacity: 0.7;
}
.gate-close:hover { opacity: 1; }
