@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/inter-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/inter-700.woff2") format("woff2");
}

:root {
  --ink: #161616;
  --ink-soft: #3a3a3a;
  --muted: #707070;
  --faint: #a3a3a3;
  --line: #e4e4e7;
  --line-strong: #c8c8ce;
  --surface: #ffffff;
  --surface-alt: #fafafa;
  --chip: #f2f3f5;
  --accent: #1f9d6a;
  --accent-soft: rgba(31, 157, 106, 0.11);
  --ok: #147a50;
  --ok-bg: #edf8f3;
  --ok-line: #bce5d2;
  --bad: #b42318;
  --bad-bg: #fef3f2;
  --bad-line: #f6c4be;
  --warn: #8a5a10;
  --warn-bg: #fef9ec;
  --warn-line: #f0dba6;
  --info: #1d4ed8;
  --info-bg: #eff6ff;
  --info-line: #bfdbfe;
  --feel: #6d28d9;
  --feel-bg: #f5f3ff;
  --feel-line: #ddd6fe;
  --theory: #0f766e;
  --theory-bg: #f0fdfa;
  --theory-line: #99f6e4;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.05);
  --shadow-focus: 0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 28px rgba(0, 0, 0, 0.08);
  --radius-pill: 40px;
  --max: 980px;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

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

html, body {
  background-color: #ecebe9;
  background-image: radial-gradient(ellipse 90% 80% at 50% 38%,
    #f7f6f5 0%,
    #f1f0ee 42%,
    #e9e8e6 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

/* Landing: no page scroll. Workspace: document can grow and scroll. */
html.is-home-screen,
html.is-home-screen body {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
html:not(.is-home-screen),
html:not(.is-home-screen) body {
  height: auto;
  max-height: none;
  overflow: auto;
}

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.page {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  padding: 52px 0 72px;
  display: flex;
  flex-direction: column;
  transition: padding 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.page.has-results { padding-top: 22px; }

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 4px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: none;
  flex: 0 0 auto;
}

.brand.has-mark .brand-mark { display: block; }

.brand-select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #2c2c32;
  cursor: pointer;
}

.brand-wordmark-row {
  display: inline-flex;
  align-items: flex-start;
  position: relative;
  padding-right: 14px;
  overflow: visible;
}
.brand-wordmark-row::after {
  content: "";
  position: absolute;
  right: 0;
  top: 6px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #8b8b8b;
  pointer-events: none;
}
.brand-wordmark-row .tm {
  font-size: 8px;
  top: 1px;
  margin-left: 1px;
  font-weight: 700;
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  min-width: 0;
}

.tm {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.42em;
  font-weight: 600;
  font-style: normal;
  line-height: 1;
  letter-spacing: 0;
  vertical-align: super;
  position: relative;
  top: -0.12em;
  margin-left: 0.08em;
  color: inherit;
}

.hero-name .tm,
.brand-wordmark-row .tm {
  color: #2c2c32;
  font-weight: 700;
}

.brand-full-name .tm,
.hero-tagline .tm {
  color: #111111;
  font-size: 0.55em;
  top: -0.2em;
}

.brand-full-name {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.2;
  color: #111111;
  white-space: nowrap;
  max-width: 100%;
}

/* Landing already has the hero tagline; keep the header compact. Hide when the topbar is tight. */
.page.is-home .brand-full-name { display: none; }

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.spec-tag {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
}

.v1-link {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--line-strong);
  font-size: 12px;
}
.v1-link:hover { color: var(--ink); }

/* Ask Pill */
.ask-box {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
  min-height: 76px;
  padding: 10px 10px 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    min-height 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    padding 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    border-radius 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.ask-box:focus-within {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-focus);
}

.attach { flex: 0 0 auto; position: relative; }
.attach input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  transition: width 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    height 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover, .icon-btn:focus-visible { background: #f3f4f6; outline: none; }
.icon-btn svg { width: 20px; height: 20px; }

.ask-submit {
  background: var(--ink);
  color: #ffffff;
}
.ask-submit:hover, .ask-submit:focus-visible { background: var(--accent); color: #ffffff; }

.ask-fields {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 4px;
}

.ask-fields textarea {
  width: 100%;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  min-height: 24px;
  max-height: 140px;
  transition: font-size 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    line-height 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    min-height 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--chip);
  font-size: 12px;
  color: var(--ink-soft);
}
.clear-file {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
}

/* Demo bar */
.demos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 4px 0;
}

.demos-label {
  font-size: 12px;
  color: var(--muted);
  margin-right: 4px;
}

.demo-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  padding: 6px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.demo-btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-alt);
  color: var(--ink);
}

.demo-btn.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 500;
}

/* Kicker */
.results-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 18px 2px 10px;
}

.kicker-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--chip);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

.kicker-note {
  font-size: 12px;
  color: var(--muted);
}

/* Flowchart Cascade */
.cascade {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-top: 4px;
}

.cascade-item {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.cascade-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Block-diagram connector between dropdown boxes */
.flow-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 30px;
  margin: 0;
}

.flow-connector::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 6px;
  width: 2px;
  transform: translateX(-50%);
  background: var(--line-strong);
}

.flow-connector::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--line-strong);
}

.flow-connector.is-halted::before { background: var(--bad); }
.flow-connector.is-halted::after { border-top-color: var(--bad); }

.flow-tag {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.flow-connector.is-halted .flow-tag {
  color: var(--bad);
  border-color: var(--bad-line);
  background: var(--bad-bg);
}

/* Shared card / block-diagram node styling */
.block-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}

.block-card.is-breakdown {
  border-left: 4px solid var(--accent);
}

.block-card.is-pass {
  border-left: 4px solid var(--ink-soft);
}

.block-card.is-pass.status-closed { border-left-color: var(--ok); }
.block-card.is-pass.status-rotating { border-left-color: var(--warn); }
.block-card.is-pass.status-killed { border-left-color: var(--bad); }

.block-card.is-terminal {
  border-left: 4px solid var(--ink);
}
.block-card.is-terminal.verdict-ACCEPT { border-left-color: var(--ok); }
.block-card.is-terminal.verdict-CONDITIONAL { border-left-color: var(--warn); }
.block-card.is-terminal.verdict-REJECT { border-left-color: var(--bad); }

/* Breakdown Box */
.breakdown-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 14px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--line);
}

.block-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.breakdown-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.neutral-restatement {
  font-size: 14px;
  line-height: 1.48;
  color: var(--ink);
}

.segments-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.segment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  font-size: 12px;
  line-height: 1.35;
}

.ontology-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  padding-top: 4px;
  border-top: 1px dashed var(--line);
}

.ontology-path {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-soft);
}

/* Badges / Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-kind-fact { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.badge-kind-theory { background: var(--theory-bg); color: var(--theory); border-color: var(--theory-line); }
.badge-kind-feeling { background: var(--feel-bg); color: var(--feel); border-color: var(--feel-line); }
.badge-kind-mixed { background: var(--chip); color: var(--ink-soft); border-color: var(--line); }
.badge-kind-question { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }

.badge-val-valid { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.badge-val-invalid { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.badge-val-unresolved { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }

.badge-status-closed { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.badge-status-rotating { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.badge-status-killed { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }

/* Dropdown Pass Box */
details.pass-details > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface-alt);
  border-bottom: 1px solid transparent;
  user-select: none;
}

details.pass-details[open] > summary {
  border-bottom-color: var(--line);
}

details.pass-details > summary::-webkit-details-marker { display: none; }

.pass-summary-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.pass-num {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--ink);
  color: #ffffff;
}

.pass-ring {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.pass-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.pass-summary-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.chevron {
  font-size: 11px;
  color: var(--muted);
  transition: transform 0.15s ease;
}

details.pass-details[open] .chevron { transform: rotate(90deg); }

.pass-body {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 12px;
}

@media (max-width: 780px) {
  .pass-body { grid-template-columns: 1fr; }
}

.sub-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sub-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.glyph-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.glyph-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-alt);
  font-size: 12px;
}

.glyph-sym {
  font-family: "Noto Sans", "DejaVu Sans", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  min-width: 16px;
  text-align: center;
}

.glyph-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.glyph-name { font-weight: 600; font-size: 11.5px; color: var(--ink); }
.glyph-role { font-size: 10.5px; color: var(--muted); }

.axioms-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.axiom-line {
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink-soft);
  padding: 4px 8px;
  border-left: 2px solid var(--line-strong);
  background: #fcfcfd;
}

.axiom-id {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 11px;
  color: var(--ink);
  margin-right: 4px;
}

.axiom-page {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  margin-left: 4px;
}

/* Syllogism chain */
.syllogism-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fcfcfd;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.syl-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  border-bottom: 1px dashed var(--line);
  padding-bottom: 5px;
}

.syl-form {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
}

.premise-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.38;
  padding: 3px 0;
}

.premise-row.is-conclusion {
  border-top: 1px solid var(--line);
  padding-top: 6px;
  margin-top: 2px;
  font-weight: 600;
}

.premise-text {
  flex: 1 1 auto;
  min-width: 0;
}

.premise-slot {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  margin-right: 5px;
}

.premise-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  flex: 0 0 auto;
}

.cites-row {
  font-size: 11px;
  color: var(--muted);
  padding-top: 4px;
  border-top: 1px dotted var(--line);
}

/* Terminal Box: Domains + 12-Check Verdict + Σ₆₀ Footprint */
.terminal-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.verdict-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
}

.verdict-banner.verdict-ACCEPT { background: var(--ok-bg); border-color: var(--ok-line); }
.verdict-banner.verdict-CONDITIONAL { background: var(--warn-bg); border-color: var(--warn-line); }
.verdict-banner.verdict-REJECT { background: var(--bad-bg); border-color: var(--bad-line); }

.verdict-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.verdict-word {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.verdict-ACCEPT .verdict-word { color: var(--ok); }
.verdict-CONDITIONAL .verdict-word { color: var(--warn); }
.verdict-REJECT .verdict-word { color: var(--bad); }

.verdict-stats {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
}

.terminal-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 14px;
}

@media (max-width: 780px) {
  .terminal-grid { grid-template-columns: 1fr; }
}

.domain-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.domain-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
}

.domain-state {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.state-supported { color: var(--ok); }
.state-partial { color: var(--warn); }
.state-unsupported { color: var(--bad); }
.state-missing, .state-pending { color: var(--muted); }

.checks-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

@media (max-width: 520px) {
  .checks-grid { grid-template-columns: 1fr; }
}

.check-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11.5px;
}

.check-mark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 11px;
}
.check-cell.is-pass .check-mark { color: var(--ok); }
.check-cell.is-fail .check-mark { color: var(--bad); }

/* Σ₆₀ 5x12 Footprint Matrix */
.sigma-matrix {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ring-strip {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  gap: 8px;
}

@media (max-width: 640px) {
  .brand-full-name { display: none; }
  .ring-strip { grid-template-columns: 1fr; }
}

.ring-strip-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.ring-cells {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 4px;
}

.sigma-cell {
  text-align: center;
  padding: 3px 2px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  font-size: 12px;
  color: var(--faint);
}

.sigma-cell.is-fired {
  border-color: var(--ok-line);
  background: var(--ok-bg);
  color: var(--ink);
  font-weight: 700;
}

.sigma-cell.is-failed {
  border-color: var(--bad-line);
  background: var(--bad-bg);
  color: var(--bad);
  font-weight: 700;
}

.reason-box {
  font-size: 13px;
  line-height: 1.48;
  color: var(--ink-soft);
  padding: 10px 12px;
  background: var(--surface-alt);
  border-radius: 8px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .cascade-item { transition: none; opacity: 1; transform: none; }
  .logo-core-pulse {
    animation: none !important;
    filter: none;
    opacity: 0.45;
  }
  .tagline-si {
    animation: none !important;
    opacity: 1;
    filter: none;
    color: var(--si-pulse, #62d987);
  }
  .home-hero,
  .hero-name,
  .hero-tagline,
  .hero-lockup,
  .brand-full-name,
  .brand-mark-wrap,
  .ask-box,
  .ask-fields textarea,
  .icon-btn,
  .page,
  .stage {
    transition: none !important;
  }
}

/* Live brand pill mark (Cookie Tush SI) */
.brand-pill-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  flex: 0 0 auto;
}

.ask-submit.is-busy {
  opacity: 0.65;
  cursor: progress;
}

.loading-card, .error-card {
  padding: 16px 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  font-size: 13.5px;
  color: var(--ink-soft);
}

.error-card {
  border-color: var(--bad-line);
  background: var(--bad-bg);
  color: var(--bad);
}

/* Context & Kernel Layer Cards */
.block-card.is-kernel { border-left: 4px solid #0284c7; }
.block-card.is-religious { border-left: 4px solid #7c3aed; }
.block-card.is-race { border-left: 4px solid #0f766e; }
.block-card.is-slavery { border-left: 4px solid #b45309; }
.block-card.is-policy-reject { border-left: 4px solid var(--bad); }

.context-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kernel-headline {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.visual-grid {
  display: grid;
  grid-template-columns: 1fr 1.65fr;
  gap: 12px;
  align-items: start;
}

@media (max-width: 720px) {
  .visual-grid { grid-template-columns: 1fr; }
}

.visual-frame {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.visual-frame img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
  object-fit: contain;
}

.visual-caption {
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
}

.steps-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.step-card {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-alt);
  font-size: 12px;
  line-height: 1.35;
}

.step-card strong {
  display: block;
  font-size: 11.5px;
  color: var(--ink);
  margin-bottom: 2px;
}

.layer-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.layer-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fcfcfd;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.layer-box.is-fact {
  border-color: var(--ok-line);
  background: var(--ok-bg);
}

.layer-box.is-interp {
  border-color: var(--warn-line);
  background: var(--warn-bg);
}

.layer-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.layer-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}

.layer-text {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.quote-box {
  padding: 6px 9px;
  border-left: 3px solid var(--line-strong);
  background: #ffffff;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-soft);
}

.amn-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-alt);
  font-size: 12px;
}

.amn-axis {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.amn-axis.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
}

.axiom-status {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
}
.axiom-status.is-pass { background: var(--ok-bg); color: var(--ok); }
.axiom-status.is-fail { background: var(--bad-bg); color: var(--bad); }
.axiom-status.is-policy { background: var(--chip); color: var(--muted); }

/* Retrieved Corpus Evidence */
.evidence-panel {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.evidence-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.evidence-row {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  background: #fcfcfd;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
}

.evidence-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.evidence-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.evidence-snippet {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--ink-soft);
}

.writer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

/* Direct answer first, reasoning collapsed */
.answer-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 30px 26px;
  box-shadow: var(--shadow);
}

.answer-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.direct-answer {
  font-size: 1.45rem;
  line-height: 1.4;
  letter-spacing: -0.025em;
  font-weight: 600;
  color: var(--ink);
  white-space: pre-wrap;
}

.reasoning-fold {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
}

.reasoning-fold > summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  user-select: none;
}

.reasoning-fold > summary::-webkit-details-marker { display: none; }
.reasoning-fold > summary::marker { content: ""; }

.reasoning-fold > summary::after {
  content: "▸";
  float: right;
  color: var(--faint);
}

.reasoning-fold[open] > summary::after { content: "▾"; }

.reasoning-fold > summary:hover { background: var(--surface-alt); }

.reasoning-body {
  padding: 4px 14px 18px;
  border-top: 1px solid var(--line);
}

.reasoning-body .cascade-item {
  opacity: 1;
  transform: none;
}


/* -------------------------------------------------------------------------
   Landing (search-home) layout, studio sweep, and inner-core pulse
   ------------------------------------------------------------------------- */

.stage {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.page.is-home {
  /* Fill the visible viewport and never scroll; children size to this height. */
  --home-reserve: 27.5rem;
  height: 100vh;
  height: 100svh;
  max-height: 100vh;
  max-height: 100svh;
  min-height: 0;
  overflow: hidden;
  padding-top: clamp(8px, 1.6vh, 20px);
  padding-bottom: clamp(8px, 1.8vh, 24px);
}

.page.is-home .stage {
  flex: 1 1 auto;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}

.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 28px;
  max-height: 580px;
  opacity: 1;
  transform: scale(1);
  transform-origin: center top;
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    max-height 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    margin 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.page.is-home .home-hero {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  margin-bottom: clamp(8px, 2vh, 28px);
  gap: clamp(6px, 1.2vh, 12px);
}

.page:not(.is-home) .home-hero {
  max-height: 0;
  opacity: 0;
  margin: 0;
  transform: scale(0.42);
  pointer-events: none;
  overflow: hidden;
}

.logo-core-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.hero-logo {
  width: 400px;
  height: auto;
  aspect-ratio: var(--logo-aspect, 0.9746);
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
  /* The cube itself never scales or moves (no pulse translation). */
  transform: none;
}

.page.is-home .logo-core-wrap-hero {
  flex: 0 1 auto;
  min-width: 0;
  min-height: 0;
  width: min(calc(400px * var(--logo-scale, 1)), var(--logo-vw, 86vw), calc((100svh - var(--home-reserve)) * var(--logo-aspect, 0.9746)));
  height: auto;
  aspect-ratio: var(--logo-aspect, 0.9746);
  max-height: calc(100svh - var(--home-reserve));
}

.page.is-home .hero-logo {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.home-hero,
.hero-lockup {
  --wordmark-size: clamp(28px, 5.8vw, 50px);
}

.hero-lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.24em;
  width: 100%;
  flex: 0 0 auto;
  font-size: var(--wordmark-size);
}

/* IKnowItAll and other brands can place the spelled-out line above the mark.
   TOTALintellect stays at the default (below) and is visually unchanged. */
.home-hero[data-tagline-position="above"] .hero-lockup {
  display: contents;
}
.home-hero[data-tagline-position="above"] .hero-tagline {
  order: -1;
  flex: 0 0 auto;
  font-size: calc(var(--wordmark-size) * 0.48);
}
.home-hero[data-tagline-position="above"] .logo-core-wrap-hero {
  order: 1;
}
.home-hero[data-tagline-position="above"] .hero-name {
  order: 2;
  flex: 0 0 auto;
  font-size: var(--wordmark-size);
}

.page[data-tagline-position="above"] .brand-full-name {
  order: -1;
}

.hero-name {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1em;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #2c2c32;
  line-height: 1;
  text-align: center;
  width: 100%;
  margin: 0;
  transition: opacity 0.4s ease;
}

.hero-tagline {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.48em;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.2;
  color: #111111;
  text-align: center;
  width: 100%;
  white-space: nowrap;
  transition: opacity 0.4s ease;
}

.tagline-name {
  color: #111111;
  font-weight: 600;
}

.tagline-si {
  color: var(--si-pulse, #62d987);
  font-weight: 600;
  /* thin black outline; the fill pulses, the outline never does */
  -webkit-text-stroke: max(0.9px, 0.05em) #111111;
  paint-order: stroke fill;
  animation: si-tagline-pulse 5s ease-in-out infinite;
}

/* browsers without paint-order on HTML text: tight 1px outline via shadows instead */
@supports not (paint-order: stroke fill) {
  .tagline-si {
    -webkit-text-stroke: 0;
    text-shadow:
      -1px 0 #111, 1px 0 #111, 0 -1px #111, 0 1px #111,
      -0.7px -0.7px #111, 0.7px -0.7px #111, -0.7px 0.7px #111, 0.7px 0.7px #111;
  }
}

/* Pulse fill colour + soft glow. Opacity stays 1 so the black outline is never dimmed;
   the glow sits behind the stroke (paint-order: stroke fill) and cannot wash it out. */
@keyframes si-tagline-pulse {
  0%, 100% {
    color: var(--si-pulse-dim, color-mix(in srgb, var(--si-pulse, #62d987) 74%, #4a4a4a));
    filter: none;
  }
  50% {
    color: var(--si-pulse, #62d987);
    filter: drop-shadow(0 0 5px color-mix(in srgb, var(--si-pulse, #62d987) 70%, white))
            drop-shadow(0 0 12px var(--si-pulse, #62d987));
  }
}

.page:not(.is-home) .hero-name,
.page:not(.is-home) .hero-tagline { opacity: 0; }

/* Inner-core pulse only: clipped to the glass interior, no outer halo, no plate. */
.logo-core-pulse {
  position: absolute;
  pointer-events: none;
  z-index: 2;
  border-radius: 48%;
  background: radial-gradient(circle at 50% 46%,
    rgba(210, 255, 220, 0.95) 0%,
    rgba(90, 230, 150, 0.55) 32%,
    rgba(40, 190, 110, 0.18) 58%,
    rgba(40, 190, 110, 0) 74%);
  mix-blend-mode: screen;
  filter: blur(1.5px);
}

.logo-core-pulse-hero {
  /* Fractions measured from the studio cube crop's green core, slightly inset. */
  left: 25.5%;
  top: 28%;
  width: 47%;
  height: 46%;
  animation: si-core-pulse 5s ease-in-out infinite;
}

.logo-core-pulse-sm {
  left: 24.5%;
  top: 26%;
  width: 51%;
  height: 48%;
}

.brand-mark-wrap {
  display: none;
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.45s ease, width 0.45s ease;
}

.brand.has-mark .brand-mark-wrap { display: inline-flex; }

.brand-mark-wrap .brand-mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
  transform: none;
}

.page.is-home .brand-mark-wrap {
  width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.page:not(.is-home) .logo-core-pulse-sm {
  animation: si-core-pulse-soft 5s ease-in-out infinite;
}

@keyframes si-core-pulse {
  0%, 100% { opacity: 0.0; filter: blur(1.5px) brightness(1); }
  50% { opacity: 1; filter: blur(2px) brightness(1.45); }
}

@keyframes si-core-pulse-soft {
  0%, 100% { opacity: 0.18; filter: blur(0.6px) brightness(0.95); }
  50% { opacity: 0.55; filter: blur(0.8px) brightness(1.2); }
}

.page.is-home .ask-box {
  flex: 0 0 auto;
  min-height: clamp(120px, 18vh, 168px);
  padding: 22px 18px 22px 22px;
  border-radius: 28px;
  align-items: center;
}

.page.is-home .ask-fields {
  padding: 10px 8px;
}

.page.is-home .ask-fields textarea {
  font-size: 28px;
  line-height: 1.35;
  min-height: 88px;
  max-height: 240px;
  letter-spacing: -0.02em;
}

.page.is-home .icon-btn {
  width: 56px;
  height: 56px;
}

.page.is-home .icon-btn svg {
  width: 24px;
  height: 24px;
}

.page.is-home .demos {
  flex: 0 0 auto;
  margin-top: clamp(8px, 1.6vh, 18px);
  justify-content: center;
}

@media (max-width: 780px) {
  .page {
    width: min(var(--max), calc(100% - 24px));
  }
  .hero-logo {
    width: 280px;
  }
  .page.is-home .logo-core-wrap-hero {
    width: min(calc(280px * var(--logo-scale, 1)), var(--logo-vw, 86vw), calc((100svh - var(--home-reserve)) * var(--logo-aspect, 0.9746)));
  }
  .home-hero,
  .hero-lockup {
    --wordmark-size: clamp(24px, 7vw, 36px);
  }
  .page.is-home .ask-fields textarea {
    font-size: 24px;
  }
  .page.is-home .ask-box {
    min-height: clamp(112px, 18vh, 148px);
  }
}

@media (max-width: 520px) {
  .topbar {
    margin-bottom: 8px;
  }
  .spec-tag {
    display: none;
  }
  .hero-logo {
    width: 220px;
  }
  .page.is-home {
    --home-reserve: 26.25rem;
    padding-top: 8px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }
  .page.is-home .logo-core-wrap-hero {
    width: min(calc(220px * var(--logo-scale, 1)), var(--logo-vw, 86vw), calc((100svh - var(--home-reserve)) * var(--logo-aspect, 0.9746)));
  }
  .home-hero,
  .hero-lockup {
    --wordmark-size: clamp(22px, 7.4vw, 28px);
  }
  .page.is-home .home-hero {
    margin-bottom: clamp(8px, 1.8vh, 20px);
  }
  .page.is-home .ask-box {
    min-height: clamp(108px, 18vh, 132px);
    padding: 14px 12px 14px 14px;
    border-radius: 24px;
  }
  .page.is-home .ask-fields textarea {
    font-size: 22px;
    min-height: 48px;
  }
  .page.is-home .icon-btn {
    width: 48px;
    height: 48px;
  }
  .page.is-home .demos {
    justify-content: flex-start;
  }
}

/* Short viewports: shrink reserved chrome so the ask box stays fully on screen. */
@media (max-height: 780px) {
  .page.is-home {
    --home-reserve: 25.25rem;
  }
  .page.is-home .home-hero,
  .page.is-home .hero-lockup {
    --wordmark-size: clamp(24px, 4.6vh, 40px);
  }
}

@media (max-height: 680px) {
  .page.is-home {
    --home-reserve: 22.25rem;
  }
  .page.is-home .demos-label { display: none; }
  .page.is-home .demo-btn { padding: 4px 9px; font-size: 12px; }
  .page.is-home .ask-box { padding: 14px 14px 14px 16px; }
  .page.is-home .ask-fields textarea {
    font-size: 20px;
    min-height: 44px;
  }
}

@media (max-height: 580px) {
  .page.is-home {
    --home-reserve: 18.25rem;
  }
  .page.is-home .demos { display: none; }
}

@media (max-height: 500px) {
  .page.is-home {
    --home-reserve: 17.85rem;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .page.is-home .home-hero,
  .page.is-home .hero-lockup {
    --wordmark-size: clamp(22px, 4.4vh, 32px);
  }
  .page.is-home .home-hero {
    margin-bottom: 6px;
    gap: 4px;
  }
  .page.is-home .ask-box {
    min-height: 108px;
    padding: 12px 12px 12px 14px;
  }
  .page.is-home .ask-fields textarea {
    font-size: 18px;
    min-height: 40px;
  }
}



/* ---------------------------------------------------------------------------
   Multi-brand landing.  One layout for all eight SI brands; only the logo layers,
   accent colour and (for SEXAMATH / PerfectMATH) the dark backdrop change.
   Logo kinds on .logo-core-wrap-hero[data-kind]:
     cube  - TOTALintellect studio cube + radial core pulse (default)
     art   - dim base logo + lit glow layer faded 0 -> 1 -> 0 on a 5s cycle (inner light only)
     space - PerfectMATH: emblem + glow layer (screen blend) 30% -> 100% -> 30% on a 5s sine
     video - SEXAMATH / PerfectMATH / IKnowItAll: the approved animated lockup plays as-is (no extra pulse)
   --------------------------------------------------------------------------- */
.hero-glow,
.hero-video { display: none; }

.logo-core-wrap-hero[data-kind="art"] .logo-core-pulse-hero,
.logo-core-wrap-hero[data-kind="space"] .logo-core-pulse-hero,
.logo-core-wrap-hero[data-kind="video"] .logo-core-pulse-hero,
.logo-core-wrap-hero[data-kind="video"] .hero-logo { display: none; }

.logo-core-wrap-hero[data-kind="art"] .hero-glow,
/* PerfectMATH glow.webp is cropped from perfectmath-9cube-v1-emblem-inner-glow-only.png
   on the same 2048 canvas as the emblem (not the cube inside clean-logo-tm.png). */
.logo-core-wrap-hero[data-kind="space"] .hero-glow {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  animation: si-art-pulse 5s ease-in-out infinite;
}

.logo-core-wrap-hero[data-kind="space"] .hero-glow {
  mix-blend-mode: screen;
  opacity: 0.3;
  animation-name: si-space-pulse;
}

.logo-core-wrap-hero[data-kind="video"] .hero-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

@keyframes si-art-pulse {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

@keyframes si-space-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* SEXAMATH: wordmark is already part of the animated art. IKnowItAll: wordmark is in the mascot sticker. */
.hero-name.is-in-art {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* Dark brands (SEXAMATH on a flat navy, PerfectMATH on the space plate). Brand-name text goes light
   so it stays legible; "Super Intelligence" keeps its accent fill + thin black outline. */
html[data-theme="dark"],
html[data-theme="dark"] body {
  background-color: #070a15;
  background-image: radial-gradient(ellipse 90% 80% at 50% 38%, #0e1428 0%, #080b17 50%, #05070f 100%);
}

html[data-theme="space"],
html[data-theme="space"] body {
  background-color: #03050c;
  background-image: url("assets/brands/perfectmath/space-plate.webp");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

html[data-theme="dark"],
html[data-theme="space"] {
  color-scheme: dark;
  --ink: #eef0f8;
  --ink-soft: #cfd3e4;
  --muted: #a3a9c0;
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.32);
  --surface: rgba(12, 16, 32, 0.78);
  --surface-alt: rgba(24, 30, 54, 0.82);
  --chip: rgba(255, 255, 255, 0.08);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-focus: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 32px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .hero-name,
html[data-theme="space"] .hero-name,
html[data-theme="dark"] .hero-name .tm,
html[data-theme="space"] .hero-name .tm,
html[data-theme="dark"] .tagline-name,
html[data-theme="space"] .tagline-name,
html[data-theme="dark"] .hero-tagline .tm,
html[data-theme="space"] .hero-tagline .tm,
html[data-theme="dark"] .brand-full-name,
html[data-theme="space"] .brand-full-name,
html[data-theme="dark"] .brand-full-name .tm,
html[data-theme="space"] .brand-full-name .tm,
html[data-theme="dark"] .brand-select,
html[data-theme="space"] .brand-select,
html[data-theme="dark"] .brand-wordmark-row .tm,
html[data-theme="space"] .brand-wordmark-row .tm {
  color: #f4f5fb;
}

html[data-theme="dark"] .brand-select option,
html[data-theme="space"] .brand-select option { color: #111; background: #fff; }

html[data-theme="dark"] .ask-fields textarea,
html[data-theme="space"] .ask-fields textarea { color: #f4f5fb; caret-color: #f4f5fb; }
html[data-theme="dark"] .ask-fields textarea::placeholder,
html[data-theme="space"] .ask-fields textarea::placeholder { color: #b9bed3; opacity: 1; }
html[data-theme="dark"] .ask-box,
html[data-theme="space"] .ask-box { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
html[data-theme="dark"] .ask-submit,
html[data-theme="space"] .ask-submit { background: #f4f5fb; color: #0b0f1e; }
html[data-theme="dark"] .icon-btn:hover,
html[data-theme="space"] .icon-btn:hover,
html[data-theme="dark"] .icon-btn:focus-visible,
html[data-theme="space"] .icon-btn:focus-visible { background: rgba(255, 255, 255, 0.12); }
html[data-theme="dark"] .demo-btn,
html[data-theme="space"] .demo-btn { color: #dfe2f0; }
html[data-theme="dark"] .demo-btn:hover,
html[data-theme="space"] .demo-btn:hover { color: #fff; }
html[data-theme="dark"] .spec-tag,
html[data-theme="space"] .spec-tag { color: #cfd3e4; }

@media (prefers-reduced-motion: reduce) {
  .logo-core-wrap-hero[data-kind="art"] .hero-glow { animation: none !important; opacity: 0.6; }
  .logo-core-wrap-hero[data-kind="space"] .hero-glow { animation: none !important; opacity: 0.65; }
  .logo-core-wrap-hero[data-kind="video"] .hero-video { display: none !important; }
  .logo-core-wrap-hero[data-kind="video"] .hero-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}


/* Spelled-out name is ALWAYS one line: "<Name> Super Intelligence™". Never wraps; shrinks with the viewport. */
.hero-tagline,
.home-hero[data-tagline-position="above"] .hero-tagline {
  white-space: nowrap;
  max-width: 100%;
  font-size: min(calc(var(--wordmark-size) * 0.48), 4.3vw);
}
.hero-tagline .tagline-name,
.hero-tagline .tagline-si,
.brand-full-name .tagline-name,
.brand-full-name .tagline-si { white-space: nowrap; }
@media (max-width: 380px) {
  .hero-tagline { letter-spacing: 0.06em; }
}


/* SEXAMATH: the v6 animated lockup already contains SEXAMATH.si(TM) + SUPER INTELLIGENCE, so nothing is
   added around it (no spelled-out line, no extra wordmark). The page uses the lockup's own flat navy so the
   video sits seamlessly with no panel or band. */
.hero-tagline.is-in-art {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
html[data-brand="sexamath"][data-theme="dark"],
html[data-brand="sexamath"][data-theme="dark"] body {
  background-color: #060b14;
  background-image: none;
}

/* CookieTush: Super Intelligence pulses trough #C86BFA → peak #E87CFF, thin #000 outline. */
html[data-brand="cookietush"] .tagline-si {
  -webkit-text-stroke: max(0.9px, 0.05em) #000000;
}
html[data-brand="cookietush"] .tagline-name { color: #111111; }
@media (prefers-reduced-motion: reduce) { html[data-brand="cookietush"] .tagline-si { color: #E16BFA; } }

/* FreeIntellect: cyan #7FE2F0 Super Intelligence with a 2px black outline. */
html[data-brand="freeintellect"] .tagline-si {
  -webkit-text-stroke: 2px #000000;
  paint-order: stroke fill;
}
html[data-brand="freeintellect"] .hero-tagline .tm,
html[data-brand="freeintellect"] .brand-full-name .tm { color: #000000; }

/* MadIntellect: violet #C67CEB Super Intelligence, 2px black outline, pulse 70% → 100%. */
html[data-brand="madintellect"] .tagline-si {
  -webkit-text-stroke: 2px #000000;
  paint-order: stroke fill;
}
html[data-brand="madintellect"] .hero-tagline .tm,
html[data-brand="madintellect"] .brand-full-name .tm { color: #000000; }

/* Header wordmark: size the <select> to the current label so ™ and the caret sit tight after it. */
.brand-select {
  field-sizing: content;
  width: auto;
  max-width: 100%;
  margin: 0;
  flex: 0 0 auto;
}
.brand-wordmark-row {
  width: max-content;
  max-width: 100%;
  align-items: flex-start;
  padding-right: 12px;
  gap: 0;
}
.brand-wordmark-row .tm {
  flex: 0 0 auto;
  margin-left: 1px;
  position: relative;
  top: 1px;
}

/* PerfectMATH: original v1 clean animated lockup, no added wordmark or tagline.
   Page field matches the lockup's own space (not the separate emblem plate, whose stars don't register). */
html[data-brand="perfectmath"] .page.is-home {
  --home-reserve: 20.5rem;
}
@media (max-width: 520px) {
  html[data-brand="perfectmath"] .page.is-home { --home-reserve: 20rem; }
}
@media (max-height: 680px) {
  html[data-brand="perfectmath"] .page.is-home { --home-reserve: 18.5rem; }
}
@media (max-height: 580px) {
  html[data-brand="perfectmath"] .page.is-home { --home-reserve: 16.5rem; }
}
html[data-brand="perfectmath"][data-theme="space"],
html[data-brand="perfectmath"][data-theme="space"] body {
  background-color: #0c0818;
  background-image: radial-gradient(ellipse 90% 80% at 50% 38%, #16102c 0%, #0c0818 55%, #080510 100%);
}
html[data-brand="perfectmath"] .logo-core-wrap-hero[data-kind="video"] .hero-video {
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

/* HEXAD state indicator (M24): subtle, inside the verdict banner only (landing stays no-scroll). */
.hexad-pill{display:inline-flex;align-items:center;gap:6px;margin-top:4px;padding:2px 8px;border-radius:999px;
  font-size:11px;letter-spacing:.02em;opacity:.82;border:1px solid rgba(255,255,255,.18);background:rgba(0,0,0,.18);width:max-content}
.hexad-dots{display:inline-flex;gap:3px}
.hexad-dot{width:6px;height:6px;border-radius:50%;background:#888;display:inline-block}
.hexad-dot.hexad-stable{background:#62d987}.hexad-dot.hexad-rotating{background:#fcd208}
.hexad-dot.hexad-conflicting{background:#ff6b6b}.hexad-dot.hexad-unresolved{background:#9aa4b2}
.hexad-pill.hexad-stable{border-color:rgba(98,217,135,.5)}.hexad-pill.hexad-rotating{border-color:rgba(252,210,8,.5)}
.hexad-pill.hexad-conflicting{border-color:rgba(255,107,107,.5)}

/* Live writer status */
.writer-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--ink-soft);
}
.writer-chip.is-warn, .spec-tag.is-warn { color: #8a4b00; border-color: #e0b36a; background: #fff6e5; }
.writer-warning {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e0b36a;
  background: #fff6e5;
  color: #6b3b00;
  font-size: 13px;
  line-height: 1.4;
}
.direct-answer.is-long { font-size: 1.1rem; line-height: 1.55; font-weight: 500; letter-spacing: -0.01em; }

/* Hide the default cube if a non-cube brand still has that src (first-paint safety). */
html[data-brand]:not([data-brand="totalintellect"]) img.hero-logo[src*="logo-cube-studio"],
html[data-brand]:not([data-brand="totalintellect"]) img.brand-mark[src*="logo-cube-studio"] {
  visibility: hidden;
}


/* IKnowItAll.si only: enlarge the mascot lockup and erase the video square seam.
   Rendered 1280x800 measurements (2026-11-27): the 360px video was a darker
   radial vignette (corners #e6e6e6, inward #ededed) on a lighter page (~#f3f2f1).
   Page backdrop now matches that vignette, centered on the hero; video/poster
   edges are feathered so encoder/color-space drift cannot leave a hard edge. */
html[data-brand="iknowitall"],
html[data-brand="iknowitall"] body {
  background-color: #e6e6e6;
  background-image: radial-gradient(circle at 50% 36%,
    #ededed 0%,
    #e8e8e8 22%,
    #e6e6e6 42%,
    #e6e6e6 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* Let the large lockup push the ask box just below, and allow scroll if needed.
   Other brands keep the no-scroll 100svh landing. */
html[data-brand="iknowitall"].is-home-screen,
html[data-brand="iknowitall"].is-home-screen body {
  height: auto;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
}
html[data-brand="iknowitall"] .page.is-home {
  height: auto;
  max-height: none;
  min-height: 100svh;
  overflow: visible;
}
html[data-brand="iknowitall"] .page.is-home .stage {
  overflow: visible;
}

/* ~2.5x the previous ~280–360px render: 700px on desktop, 100vw (edge to edge) on mobile. */
html[data-brand="iknowitall"] .page.is-home .home-hero {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
html[data-brand="iknowitall"] .page.is-home .logo-core-wrap-hero {
  width: min(700px, 100vw);
  max-width: 100vw;
  max-height: min(700px, 100vw);
  aspect-ratio: 1;
}

html[data-brand="iknowitall"] .logo-core-wrap-hero[data-kind="video"] .hero-video,
html[data-brand="iknowitall"] .logo-core-wrap-hero[data-kind="video"] .hero-logo {
  /* Box-edge feather (~5% / side): hides the square seam without clipping the
     lockup line, which sits ~10–16% in from the edges. */
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, #000 5%, #000 95%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 5%, #000 95%, transparent 100%);
  -webkit-mask-composite: source-in;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-image:
    linear-gradient(to right, transparent 0%, #000 5%, #000 95%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 5%, #000 95%, transparent 100%);
  mask-composite: intersect;
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
}

/* IKnowItAll.si only: mascot greeting between the lockup and the ask box.
   Hidden on every other brand and once the page leaves the home screen.
   The bubble reserves its final size up front so word-by-word typing cannot
   shift the ask box. It pops in with a springy overshoot, types the greeting,
   then idles on a gentle float. prefers-reduced-motion shows the finished state. */
.hero-greeting {
  display: none;
}

html[data-brand="iknowitall"] .page.is-home .hero-greeting {
  display: flex;
  justify-content: center;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 100%;
  max-width: 36rem;
  margin: 0 auto clamp(16px, 2.4vh, 28px);
  padding: 16px 24px 0;
}

html[data-brand="iknowitall"] .hero-greeting-bubble {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  padding: 16px 22px 18px;
  background: #ffffff;
  border: 2px solid #111111;
  border-radius: 28px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.08);
  transform-origin: 50% 0%;
}

/* Comic tail pointing up toward the mascot: dark outline, then white fill. */
html[data-brand="iknowitall"] .hero-greeting-bubble::before,
html[data-brand="iknowitall"] .hero-greeting-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 22px;
  height: 14px;
  transform: translateX(-50%);
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
  pointer-events: none;
}
html[data-brand="iknowitall"] .hero-greeting-bubble::before {
  top: -14px;
  background: #111111;
  z-index: 0;
}
html[data-brand="iknowitall"] .hero-greeting-bubble::after {
  top: -11px;
  width: 16px;
  height: 12px;
  background: #ffffff;
  z-index: 1;
}

html[data-brand="iknowitall"] .hero-greeting-text {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: clamp(16px, 1.65vw, 20px);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: #161616;
  text-align: center;
  text-wrap: pretty;
}

html[data-brand="iknowitall"] .hero-greeting-name {
  font-weight: 700;
  color: #111111;
}

html[data-brand="iknowitall"] .hero-greeting-brand {
  color: var(--si-pulse, #fcd208);
  font-weight: 700;
  -webkit-text-stroke: max(0.7px, 0.04em) #111111;
  paint-order: stroke fill;
}

/* Reserve the finished typography while words are still unspoken. */
html[data-brand="iknowitall"] .page.is-home .hero-greeting.is-awaiting .hero-greeting-text,
html[data-brand="iknowitall"] .page.is-home .hero-greeting.is-typing .hero-greeting-word:not(.is-spoken) {
  visibility: hidden;
}

html[data-brand="iknowitall"] .page.is-home .hero-greeting.is-awaiting .hero-greeting-bubble {
  opacity: 0;
}

html[data-brand="iknowitall"] .page.is-home .hero-greeting.is-popping .hero-greeting-bubble {
  animation: hero-greeting-pop 0.72s cubic-bezier(0.22, 1.45, 0.32, 1) both;
}

html[data-brand="iknowitall"] .page.is-home .hero-greeting.is-idle .hero-greeting-bubble {
  animation: hero-greeting-float 3.8s ease-in-out infinite;
}

@keyframes hero-greeting-pop {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.45);
  }
  52% {
    opacity: 1;
    transform: translateY(-10px) scale(1.14);
  }
  72% {
    transform: translateY(4px) scale(0.94);
  }
  86% {
    transform: translateY(-2px) scale(1.04);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hero-greeting-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@media (max-width: 520px) {
  html[data-brand="iknowitall"] .page.is-home .hero-greeting {
    margin-bottom: clamp(12px, 2vh, 20px);
    padding: 14px 16px 0;
  }
  html[data-brand="iknowitall"] .hero-greeting-bubble {
    padding: 14px 16px 16px;
    border-radius: 24px;
  }
  html[data-brand="iknowitall"] .hero-greeting-text {
    font-size: 16px;
    line-height: 1.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-brand="iknowitall"] .page.is-home .hero-greeting .hero-greeting-bubble,
  html[data-brand="iknowitall"] .page.is-home .hero-greeting.is-popping .hero-greeting-bubble,
  html[data-brand="iknowitall"] .page.is-home .hero-greeting.is-idle .hero-greeting-bubble,
  html[data-brand="iknowitall"] .page.is-home .hero-greeting.is-awaiting .hero-greeting-bubble {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  html[data-brand="iknowitall"] .page.is-home .hero-greeting.is-awaiting .hero-greeting-text,
  html[data-brand="iknowitall"] .page.is-home .hero-greeting.is-typing .hero-greeting-word:not(.is-spoken),
  html[data-brand="iknowitall"] .page.is-home .hero-greeting .hero-greeting-word {
    visibility: visible !important;
  }
}
