:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #4d4d4d;
  --line: #d8d8d8;
  --line-strong: #bdbdbd;
  --surface: #fafafa;
  --surface-deep: #f3f3f3;
  --link: #111111;
  --accent: #232323;
  --maxw: 948px;
  --stripe-w: min(calc(var(--maxw) + 4.8rem), calc(100vw - 0.8rem));
  --header-h: 51.2px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #ededed;
  color: var(--ink);
  font-family: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  line-height: 1.58;
  position: relative;
  overflow-x: hidden;
  padding-top: var(--header-h);
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: var(--stripe-w);
  background:
    radial-gradient(circle at 16% 14%, rgba(255, 255, 255, 0.95) 0 22%, rgba(252, 252, 252, 0.9) 22% 52%, rgba(248, 248, 248, 0.65) 52% 74%, rgba(255, 255, 255, 0) 74%),
    repeating-linear-gradient(135deg, rgba(238, 238, 238, 0.45) 0 1px, rgba(255, 255, 255, 0.22) 1px 10px),
    linear-gradient(180deg, #ffffff 0%, #fcfcfc 52%, #ffffff 100%);
  box-shadow: 0 0 0 0.8px rgba(220, 220, 220, 0.65);
  z-index: 0;
}

.ambient {
  position: fixed;
  top: 0;
  height: 100vh;
  width: max(72px, calc((100vw - var(--stripe-w)) / 2));
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
  background: linear-gradient(180deg, rgba(236, 236, 236, 0.78), rgba(229, 229, 229, 0.55));
}

.ambient-left {
  left: 0;
}

.ambient-right {
  right: 0;
}

body[data-profile="guarded"] {
  --surface: #f7f5f2;
  --surface-deep: #f0ece6;
}

body[data-profile="guarded"] .ambient {
  background: linear-gradient(180deg, rgba(239, 233, 224, 0.82), rgba(228, 220, 209, 0.58));
}

body[data-profile="guarded"] .status-pill {
  background: #f6f0e8;
}

body[data-profile="flexible"] {
  --surface: #f8faf9;
  --surface-deep: #eef5f2;
}

body[data-profile="flexible"] .ambient {
  background: linear-gradient(180deg, rgba(228, 236, 233, 0.78), rgba(219, 230, 226, 0.54));
}

body[data-profile="flexible"] .status-pill {
  background: #edf5f1;
}

a {
  color: var(--link);
}

.container {
  width: min(var(--maxw), calc(100% - 1.6rem));
  margin: 0 auto;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 40;
  border-bottom: 0.8px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  transition: box-shadow 0.2s ease;
}

.site-header.scrolled {
  box-shadow: 0 4px 14px rgba(30, 30, 30, 0.08);
}

main,
.site-footer {
  position: relative;
  z-index: 3;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 51.2px;
  gap: 0.8rem;
}

.brand {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.688rem;
  padding: 0.176rem 0.32rem;
  border: 0.8px solid transparent;
}

.site-nav a:hover,
.site-nav a.is-active {
  border-color: #8e8e8e;
  background: #f3f3f3;
}

.menu-toggle {
  display: none;
  font: inherit;
  font-size: 0.68rem;
  border: 0.8px solid var(--line-strong);
  background: #fff;
  padding: 0.24rem 0.48rem;
}

.hero {
  padding: 1.76rem 0 1.28rem;
  border-bottom: 0.8px solid var(--line);
}

.kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.576rem;
  color: var(--muted);
}

h1,
h2,
h3 {
  font-family: "Libre Baskerville", Georgia, serif;
  margin: 0;
  line-height: 1.25;
}

h1 {
  margin-top: 0.4rem;
  font-size: clamp(1.44rem, 3.4vw, 2rem);
}

h2 {
  font-size: clamp(1.08rem, 2.4vw, 1.4rem);
  margin-bottom: 0.44rem;
}

h3 {
  font-size: 0.816rem;
}

.lead {
  margin: 0.52rem 0 0.4rem;
  color: var(--muted);
}

.hero-framework {
  margin: 0.2rem 0 0.56rem;
  max-width: 72ch;
  color: #1d1d1d;
}

.formula {
  margin: 0.28rem 0 0.36rem;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.752rem;
  background: #f6f6f6;
  border: 0.8px solid var(--line);
  display: inline-block;
  padding: 0.24rem 0.4rem;
}

.formula-secondary {
  display: block;
  margin-top: 0.16rem;
  margin-bottom: 0.2rem;
  background: #f9f9f9;
}

.novelty-block,
.process-card,
.note-card,
.metric-card,
.panel-block,
.chat-shell,
.governance-panel {
  border: 0.8px solid var(--line);
  background: var(--surface);
}

.novelty-block {
  margin-top: 0.68rem;
  padding: 0.56rem 0.64rem;
}

.table-caption {
  margin: 0 0 0.36rem;
  font-size: 0.672rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.framework-novelty {
  margin: 0;
  padding-left: 0.88rem;
}

.framework-novelty li {
  margin: 0.272rem 0;
}

.section {
  padding: 1.44rem 0;
  border-bottom: 0.8px solid var(--line);
}

section[id] {
  scroll-margin-top: calc(var(--header-h) + 10px);
}

.process-grid,
.notes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
  margin-top: 0.72rem;
}

.reading-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
  margin-top: 0.72rem;
}

.process-card,
.note-card {
  padding: 0.72rem;
}

.demo-section {
  padding-bottom: 1.7rem;
}

.demo-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.72rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border: 0.8px solid var(--line-strong);
  background: #fff;
  padding: 0.26rem 0.54rem;
  font-size: 0.67rem;
  font-weight: 600;
  white-space: nowrap;
}

.section-pill {
  max-width: 28ch;
  white-space: normal;
  text-align: right;
}

.demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(320px, 0.78fr);
  gap: 1rem;
  align-items: start;
}

.chat-shell,
.governance-panel {
  padding: 0.8rem;
}

.product-shell {
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 250, 0.98)),
    radial-gradient(circle at top right, rgba(246, 246, 246, 0.9), rgba(255, 255, 255, 0) 45%);
  box-shadow: 0 18px 34px rgba(20, 20, 20, 0.05);
}

.window-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.82rem 0.92rem;
  border-bottom: 0.8px solid var(--line);
  background: rgba(248, 248, 248, 0.92);
}

.window-dots {
  display: inline-flex;
  gap: 0.34rem;
}

.window-dots span {
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 999px;
  background: #d4d4d4;
  display: inline-block;
}

.window-title .table-caption {
  margin-bottom: 0.12rem;
}

.window-status {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
}

.window-chip,
.thread-pill,
.decision-chip {
  display: inline-flex;
  align-items: center;
  border: 0.8px solid var(--line-strong);
  background: #fff;
  padding: 0.22rem 0.5rem;
  font-size: 0.648rem;
  font-weight: 600;
  border-radius: 999px;
}

.thread-summary {
  display: flex;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.86rem 0.92rem;
  border-bottom: 0.8px solid var(--line);
  background:
    linear-gradient(180deg, rgba(251, 251, 251, 1), rgba(245, 245, 245, 0.95)),
    repeating-linear-gradient(135deg, rgba(236, 236, 236, 0.28) 0 1px, rgba(255, 255, 255, 0) 1px 12px);
}

.thread-label {
  margin: 0 0 0.14rem;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.thread-copy {
  margin: 0;
  max-width: 56ch;
}

.thread-pill-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
  justify-content: flex-end;
  align-content: flex-start;
}

.chat-shell-header,
.compare-header {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
}

.micro-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.664rem;
  max-width: 24ch;
}

.chat-log {
  min-height: 420px;
  max-height: 620px;
  overflow-y: auto;
  margin: 0;
  padding: 1rem 0.92rem 0.7rem;
  border: none;
  background:
    radial-gradient(circle at top left, rgba(244, 244, 244, 0.72), rgba(255, 255, 255, 0) 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 248, 248, 0.98)),
    repeating-linear-gradient(180deg, rgba(230, 230, 230, 0.16) 0 1px, rgba(255, 255, 255, 0) 1px 44px);
}

.message {
  display: flex;
  gap: 0.58rem;
  align-items: flex-start;
  max-width: 100%;
  margin-bottom: 0.56rem;
  padding: 0;
  border: none;
}

.message-user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 0.86rem;
  border: 0.8px solid var(--line);
  background: #f1f1f1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.73rem;
  font-weight: 700;
  flex-shrink: 0;
}

.message-user .message-avatar {
  background: #111111;
  color: #ffffff;
}

.message-card {
  max-width: min(88%, 42rem);
  border: 0.8px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  border-radius: 1.1rem;
  padding: 0.7rem 0.82rem;
  box-shadow: 0 10px 22px rgba(24, 24, 24, 0.04);
}

.message-user .message-card {
  background: #f6f6f6;
}

.message-label {
  margin: 0 0 0.18rem;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.message-text,
.message p:last-child {
  margin-bottom: 0;
}

.composer-panel {
  padding: 0.86rem 0.92rem 0.92rem;
  border-top: 0.8px solid var(--line);
  background: rgba(249, 249, 249, 0.97);
}

.sample-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.64rem;
}

.sample-prompt,
.submit-button,
.toggle-button,
.mode-button,
.activation-button {
  font: inherit;
  font-size: 0.688rem;
  line-height: 1.3;
  border: 0.8px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
}

.sample-prompt {
  padding: 0.34rem 0.62rem;
  border-radius: 999px;
}

.sample-prompt:hover,
.submit-button:hover,
.toggle-button:hover,
.mode-button:hover,
.activation-button:hover {
  background: #f4f4f4;
}

.submit-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.chat-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 108px;
  border: 0.8px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 0.64rem;
  border-radius: 1.05rem;
}

.chat-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.56rem;
}

.submit-button {
  padding: 0.42rem 0.74rem;
  font-weight: 600;
  border-radius: 999px;
}

.panel-block + .panel-block {
  margin-top: 0.72rem;
}

.governance-panel {
  position: sticky;
  top: calc(var(--header-h) + 0.9rem);
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.38rem;
  margin-top: 0.56rem;
}

.mode-button {
  padding: 0.42rem 0.46rem;
  font-weight: 600;
  text-align: center;
}

.mode-button.is-active {
  background: #efefef;
  border-color: #8c8c8c;
}

.mode-description {
  margin: 0.52rem 0 0;
  color: var(--muted);
  font-size: 0.674rem;
}

.activation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.38rem;
  margin-top: 0.56rem;
}

.activation-button {
  padding: 0.42rem 0.5rem;
  font-weight: 600;
  text-align: center;
}

.activation-button.is-active {
  background: #efefef;
  border-color: #8c8c8c;
}

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

.metric-card {
  padding: 0.64rem;
}

.metric-label {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-card strong {
  font-size: 1rem;
  font-family: "Libre Baskerville", Georgia, serif;
  display: block;
}

.metric-meter {
  display: block;
  width: 100%;
  height: 0.38rem;
  margin-top: 0.5rem;
  background: #e8e8e8;
  border-radius: 999px;
  overflow: hidden;
}

.metric-fill {
  display: block;
  height: 100%;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b8b8b8, #5f5f5f);
}

#potential-bar {
  background: linear-gradient(90deg, #c7ccc9, #5f7468);
}

#load-bar {
  background: linear-gradient(90deg, #d8cbc2, #8c6251);
}

#delta-bar {
  background: linear-gradient(90deg, #d9ddd8, #41604b);
}

.decision-chip {
  margin-top: 0.5rem;
}

.decision-chip[data-state="allow"] {
  background: #eef4f0;
  border-color: #b8c9bd;
}

.decision-chip[data-state="rewrite"] {
  background: #f6f1e6;
  border-color: #d0c1a0;
}

.decision-chip[data-state="clarify"] {
  background: #f5efe8;
  border-color: #d8c4aa;
}

.decision-chip[data-state="contain"] {
  background: #f5eaea;
  border-color: #d3b1b1;
}

#grace-chip[data-state="surplus"] {
  background: #eef4f0;
  border-color: #b8c9bd;
}

#grace-chip[data-state="grace"] {
  background: #f4f0e8;
  border-color: #d3c4a6;
}

#grace-chip[data-state="deficit"] {
  background: #f5ebe3;
  border-color: #d2b69f;
}

#grace-chip[data-state="irreversible"] {
  background: #f5e8e8;
  border-color: #d2b0b0;
}

#recovery-chip[data-state="nominal"] {
  background: #eef4f0;
  border-color: #b8c9bd;
}

#recovery-chip[data-state="rewrite"] {
  background: #f6f1e6;
  border-color: #d0c1a0;
}

#recovery-chip[data-state="clarify"] {
  background: #f5efe8;
  border-color: #d8c4aa;
}

#recovery-chip[data-state="contain"] {
  background: #f5e8e8;
  border-color: #d2b0b0;
}

.table-wrap {
  overflow-x: auto;
  border: 0.8px solid var(--line);
  margin: 0.6rem 0 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 300px;
}

th,
td {
  border-bottom: 0.8px solid var(--line);
  border-right: 0.8px solid var(--line);
  padding: 0.416rem 0.44rem;
  text-align: left;
  vertical-align: top;
  font-size: 0.704rem;
}

th:last-child,
td:last-child {
  border-right: none;
}

th {
  background: #f4f4f4;
  font-weight: 600;
}

tbody tr:last-child td {
  border-bottom: none;
}

.baseline-panel {
  margin-top: 0.56rem;
  border: 0.8px solid var(--line);
  background: #fff;
  padding: 0.64rem;
}

.decision-notes {
  margin: 0;
  padding-left: 1rem;
}

.decision-notes li {
  margin: 0.28rem 0;
}

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

.capability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
  margin-top: 0.76rem;
}

.capability-card {
  border: 0.8px solid var(--line);
  background: var(--surface);
  padding: 0.82rem;
}

.native-grid {
  margin-top: 0.76rem;
}

.code-grid {
  margin-top: 0.76rem;
}

.code-block {
  margin: 0.6rem 0 0.7rem;
  padding: 0.72rem 0.8rem;
  border: 0.8px solid var(--line);
  background: #f7f7f7;
  overflow-x: auto;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.684rem;
  line-height: 1.55;
}

.code-block code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: inherit;
}

.activation-map {
  margin-top: 0.76rem;
}

.native-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
  margin-top: 0.76rem;
}

.activation-story {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
  margin-top: 0.76rem;
}

.site-footer {
  padding: 0.8rem;
  text-align: center;
  border-top: 0.8px solid var(--line);
}

.site-footer p {
  margin: 0.176rem 0;
  font-size: 0.672rem;
}

.patent {
  font-weight: 600;
}

.contact-note {
  font-size: 0.664rem;
}

.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;
}

.dust {
  position: absolute;
  left: var(--x);
  bottom: -8vh;
  width: var(--size);
  height: var(--size);
  border-radius: 999px;
  opacity: var(--alpha);
  filter: blur(var(--blur));
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.97) 0%, rgba(204, 204, 204, 0.78) 58%, rgba(190, 190, 190, 0) 100%);
  animation: dustFloat var(--dur) linear infinite;
  animation-delay: var(--delay);
  will-change: transform, opacity;
}

@keyframes dustFloat {
  0% {
    transform: translate3d(0, 9vh, 0);
    opacity: calc(var(--alpha) * 0.7);
  }
  15% {
    transform: translate3d(calc(var(--wind) * 0.3), -12vh, 0);
    opacity: var(--alpha);
  }
  35% {
    transform: translate3d(calc(var(--wind) * -0.22), -38vh, 0);
    opacity: calc(var(--alpha) * 0.95);
  }
  58% {
    transform: translate3d(calc(var(--wind) * 0.55), -64vh, 0);
    opacity: calc(var(--alpha) * 0.92);
  }
  78% {
    transform: translate3d(calc(var(--wind) * -0.08), -95vh, 0);
    opacity: calc(var(--alpha) * 0.8);
  }
  92% {
    transform: translate3d(calc(var(--wind) * 0.62), -114vh, 0);
    opacity: calc(var(--alpha) * 0.55);
  }
  100% {
    transform: translate3d(calc(var(--wind) * 0.88), -134vh, 0);
    opacity: 0;
  }
}

@media (max-width: 860px) {
  .demo-grid,
  .process-grid,
  .notes-grid,
  .reading-grid,
  .capability-grid,
  .native-summary,
  .compare-grid,
  .activation-story {
    grid-template-columns: 1fr;
  }

  .governance-panel {
    position: static;
  }

  .window-toolbar,
  .thread-summary {
    grid-template-columns: 1fr;
  }

  .window-status,
  .thread-pill-wrap {
    justify-content: flex-start;
  }
}

@media (max-width: 608px) {
  .menu-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 51.2px;
    left: 0.8rem;
    right: 0.8rem;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    background: #fff;
    border: 0.8px solid var(--line);
    padding: 0.48rem;
    gap: 0.36rem;
  }

  .site-nav.is-open {
    display: flex;
  }

  body {
    font-size: 11.2px;
  }

  .demo-heading,
  .chat-shell-header,
  .compare-header,
  .chat-form-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-pill {
    text-align: left;
  }

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

  .mode-switch {
    grid-template-columns: 1fr;
  }

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

  .chat-log {
    min-height: 320px;
  }

  .message-card {
    max-width: 100%;
  }
}
