@font-face{font-family:Instrument;src:url(assets/fonts/instrument-sans-400.woff2) format("woff2");font-weight:400;font-display:swap}
@font-face{font-family:Instrument;src:url(assets/fonts/instrument-sans-600.woff2) format("woff2");font-weight:600;font-display:swap}
@font-face{font-family:Plex;src:url(assets/fonts/ibm-plex-mono-500.woff2) format("woff2");font-weight:500;font-display:swap}

:root {
  --color-primary: #262220;
  --color-secondary: #625a54;
  --color-accent: #a43f2b;
  --color-accent-hover: #8d3422;
  --color-accent-subtle: rgba(164, 63, 43, 0.08);
  --color-accent-glow: rgba(164, 63, 43, 0.18);
  --color-bg: #f7f7f5;
  --color-bg-rgb: 247, 247, 245;
  --color-surface: #ffffff;
  --color-surface-elevated: #ffffff;
  --color-surface-subtle: #f1efe9;
  --color-text: #262220;
  --color-muted: #625a54;
  --color-border: #817a74;
  --color-border-subtle: rgba(98, 90, 84, 0.72);
  --color-on-accent: #ffffff;
  --color-own: #a43f2b;
  --color-implementation: #315b70;
  --color-case: #4e6544;
  --font-heading: Instrument, system-ui, sans-serif;
  --font-body: Instrument, system-ui, sans-serif;
  --font-data: Plex, monospace;
  --shadow-sm: 0 1px 2px rgba(38, 34, 32, 0.04);
  --shadow-md: 0 6px 20px rgba(38, 34, 32, 0.07), 0 1px 3px rgba(38, 34, 32, 0.03);
  --shadow-lg: 0 16px 40px rgba(38, 34, 32, 0.09), 0 2px 6px rgba(38, 34, 32, 0.04);
  --shadow-glow: 0 0 32px rgba(164, 63, 43, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 999px;
  color-scheme: light;
}

[data-theme=dark] {
  --color-primary: #f5efe6;
  --color-secondary: #c9bfb3;
  --color-accent: #e06c4e;
  --color-accent-hover: #f07d61;
  --color-accent-subtle: rgba(224, 108, 78, 0.14);
  --color-accent-glow: rgba(224, 108, 78, 0.25);
  --color-bg: #171513;
  --color-bg-rgb: 23, 21, 19;
  --color-surface: #544b44;
  --color-surface-elevated: #5e544c;
  --color-surface-subtle: #171513;
  --color-text: #f5efe6;
  --color-muted: #c9bfb3;
  --color-border: #c9bfb3;
  --color-border-subtle: rgba(201, 191, 179, 0.72);
  --color-on-accent: #171513;
  --color-own: #e06c4e;
  --color-implementation: #9cc7df;
  --color-case: #b7cfaa;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 36px rgba(224, 108, 78, 0.18);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--color-bg);
  background-image: radial-gradient(rgba(38, 34, 32, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--color-text);
  font: 400 1rem/1.6 var(--font-body);
  transition: background-color 0.25s ease, color 0.25s ease;
}

[data-theme=dark] body {
  background-image: radial-gradient(rgba(245, 239, 230, 0.035) 1px, transparent 1px);
}

a { color: inherit; text-underline-offset: 0.25em; }

.skip {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  transform: translateY(-160%);
  padding: 0.75rem 1.25rem;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: transform 0.2s ease;
}
.skip:focus { transform: translateY(0); }

/* NAVBAR 2025 FROSTED GLASS */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  background: rgba(var(--color-bg-rgb), 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border-subtle);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.topbar-inner {
  width: min(1200px, calc(100% - 2.5rem));
  min-height: 76px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  width: clamp(140px, 16vw, 195px);
  line-height: 0;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.brand img, footer img {
  display: block;
  width: 100%;
  height: auto;
}
[data-theme=dark] .brand img,
[data-theme=dark] footer img {
  filter: invert(92%) sepia(7%) saturate(244%) hue-rotate(348deg) brightness(106%) contrast(92%);
}

nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
nav a {
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: color 0.18s ease, background-color 0.18s ease;
}
nav a:hover {
  color: var(--color-text);
  background-color: var(--color-accent-subtle);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text);
  font: 500 0.82rem var(--font-data);
  cursor: pointer;
}
.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  width: 14px;
  height: 2px;
  display: block;
  background: currentColor;
  border-radius: 2px;
}
.nav-toggle-icon { position: relative; }
.nav-toggle-icon::before, .nav-toggle-icon::after { content: ""; position: absolute; left: 0; }
.nav-toggle-icon::before { top: -5px; }
.nav-toggle-icon::after { top: 5px; }

.theme {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text);
  font: 500 0.82rem var(--font-data);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, transform 0.18s ease, background-color 0.2s ease;
}
.theme svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: currentColor;
}
.theme:hover {
  border-color: var(--color-accent);
  transform: translateY(-1px);
}

a:focus-visible, button:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

/* KICKER Y LABELS */
.kicker, .number, .kind, .stamp, dt, .mini-tag, .hud-step-tag, .node-badge, .step-badge, .status {
  font: 500 0.75rem/1.3 var(--font-data);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.kicker, .number, dt { color: var(--color-muted); }

/* MAIN CONTAINER */
main {
  width: min(1200px, calc(100% - 2.5rem));
  margin-inline: auto;
}

/* HERO SECTION 2025 */
.hero {
  padding: 4.5rem 0 3.5rem;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.hero-content {
  display: flex;
  flex-direction: column;
}

.kicker-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  width: fit-content;
  padding: 0.35rem 0.85rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}
.kicker-badge .kicker {
  margin: 0;
  font-size: 0.75rem;
  color: var(--color-text);
}
.kicker-sep {
  color: var(--color-border);
  font-size: 0.8rem;
}
.kicker-tag {
  font: 600 0.75rem var(--font-data);
  color: var(--color-accent);
}
.pulse-beacon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #276749;
  box-shadow: 0 0 0 0 rgba(39, 103, 73, 0.6);
  animation: pulse-ring 2.2s infinite ease-out;
}
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(39, 103, 73, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(39, 103, 73, 0); }
  100% { box-shadow: 0 0 0 0 rgba(39, 103, 73, 0); }
}

.hero h1 {
  margin: 0 0 2rem;
  max-width: 1040px;
  font-size: clamp(3.2rem, 7.8vw, 6.4rem);
  font-weight: 600;
  line-height: 0.92;
  letter-spacing: -0.045em;
  color: var(--color-text);
}

.hero-bottom {
  display: grid;
  grid-template-columns: minmax(0, 640px) auto;
  align-items: end;
  justify-content: space-between;
  gap: 2.5rem;
}

.hero-lead {
  margin: 0;
  color: var(--color-muted);
  font-size: clamp(1.1rem, 1.8vw, 1.32rem);
  line-height: 1.55;
  max-width: 620px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.85rem 1.6rem;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: 600;
  font-size: 0.98rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  box-shadow: 0 4px 14px var(--color-accent-glow);
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.button:hover {
  background: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--color-accent-glow);
}

.button-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.4rem;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.button-ghost:hover {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
  transform: translateY(-2px);
}

/* FIRMA VISUAL: CABINA DE MODOS OPERATIVOS */
.agent-hud {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.agent-hud:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--color-surface-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
  flex-wrap: wrap;
  gap: 1rem;
}

.hud-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.hud-prompt {
  font: 700 0.9rem var(--font-data);
  color: var(--color-accent);
}
.hud-title {
  font: 600 0.8rem var(--font-data);
  letter-spacing: 0.08em;
  color: var(--color-text);
}
.hud-tabs {
  display: flex;
  gap: 0.4rem;
}
.hud-tab {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-muted);
  font: 500 0.78rem var(--font-data);
  cursor: pointer;
  transition: all 0.18s ease;
}
.hud-tab:hover {
  color: var(--color-text);
  border-color: var(--color-accent);
}
.hud-tab.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: 600;
}

.hud-body {
  padding: 1.75rem 1.5rem;
}

.hud-pipeline {
  display: grid;
  grid-template-columns: 1fr auto 1.2fr auto 1.4fr;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.hud-node {
  padding: 1rem 1.15rem;
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.hud-node.highlight {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
}
.hud-node.warning {
  border-color: var(--color-accent);
}
.hud-node.locked {
  border-color: var(--color-case);
  background: rgba(39, 103, 73, 0.08);
}
.node-badge {
  color: var(--color-muted);
  font-size: 0.75rem;
}
.node-badge.alert { color: var(--color-accent); }
.node-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
}
.hud-arrow {
  color: var(--color-accent);
  font-weight: 700;
  font-size: 1.2rem;
  text-align: center;
}

.hud-indicators {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px dashed var(--color-border-subtle);
}
.hud-item {
  font: 500 0.8rem var(--font-data);
  color: var(--color-muted);
}

.hud-footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--color-border);
  border-top: 1px solid var(--color-border);
}
.hud-principle {
  padding: 1rem 1.5rem;
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.principle-key {
  font: 600 0.75rem var(--font-data);
  letter-spacing: 0.08em;
  color: var(--color-accent);
}
.principle-value {
  font: 400 0.8rem var(--font-body);
  color: var(--color-muted);
}

.hero-route {
  width: 100%;
  color: var(--color-accent);
  opacity: 0.7;
}
.hero-route path { fill: none; stroke: currentColor; stroke-width: 2; }
.hero-route circle { fill: var(--color-bg); stroke: currentColor; stroke-width: 2; }

/* SECCIONES COMPARTIDAS */
.agent-feature, .projects, .possibilities, .method, .about {
  padding: 6.5rem 0;
  border-top: 1px solid var(--color-border);
  scroll-margin-top: 4rem;
}

.section-head, .section-heading-wrap, .ecosystem-header, .method-intro {
  margin-bottom: 3.5rem;
}
.section-head h2, .section-heading-wrap h2, .ecosystem-header h2, .possibilities h2, .method-intro h2, .about h2 {
  margin: 0.75rem 0 0;
  max-width: 860px;
  font-size: clamp(2.3rem, 5vw, 4.4rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: var(--color-text);
}
.section-head {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: end;
}
.section-intro, .ecosystem-intro, .lead {
  color: var(--color-muted);
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  line-height: 1.55;
  margin-top: 0.75rem;
}
.lead { max-width: 820px; }

/* LOLOAGENT BENTO 2025 */
.agent-states {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.state-card {
  padding: 2.2rem 1.8rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.state-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.live-card { border-top: 4px solid var(--color-case); }
.building-card { border-top: 4px solid var(--color-implementation); }
.possible-card { border-top: 4px solid var(--color-own); }

.state-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.state-step-num {
  font: 500 0.75rem var(--font-data);
  color: var(--color-muted);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.status.live { color: var(--color-case); }
.status.building { color: var(--color-implementation); }
.status.possible { color: var(--color-own); }
.status-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: currentColor;
}

.state-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text);
}
.state-card p {
  margin: 0;
  color: var(--color-muted);
  font-size: 1rem;
  line-height: 1.55;
}
.state-tag-wrap {
  padding-top: 1rem;
  border-top: 1px solid var(--color-border-subtle);
}
.state-tag {
  font: 500 0.72rem var(--font-data);
  color: var(--color-muted);
  text-transform: uppercase;
}

.boundary {
  margin-top: 2rem;
  padding: 1.4rem 1.8rem;
  border-left: 4px solid var(--color-accent);
  background: var(--color-surface);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.boundary-badge {
  color: var(--color-accent);
  flex-shrink: 0;
  display: flex;
}
.boundary p {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text);
  line-height: 1.55;
}

/* PROYECTOS PRINCIPALES BENTO 2025 */
.cards {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.card {
  display: grid;
  grid-template-columns: 220px 1fr;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-lg);
}

.card > header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.2rem 1.6rem;
  background: var(--color-surface-subtle);
  border-right: 1px solid var(--color-border);
}

.kind-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.kind-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--kind-color);
}
.kind { color: var(--kind-color); }
.stamp { color: var(--color-muted); font-size: 0.68rem; }

[data-kind=propio] { --kind-color: var(--color-own); }
[data-kind=implementacion] { --kind-color: var(--color-implementation); }
[data-kind=caso] { --kind-color: var(--color-case); }

.card-main {
  padding: clamp(2rem, 4vw, 3.2rem);
  display: flex;
  flex-direction: column;
}

.card-meta-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.card-chip {
  font: 500 0.7rem var(--font-data);
  padding: 0.25rem 0.6rem;
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  border-radius: var(--radius-full);
}

.card-main h3 {
  margin: 0.25rem 0 1rem;
  font-size: clamp(2.6rem, 5.5vw, 4.5rem);
  font-weight: 600;
  line-height: 0.96;
  letter-spacing: -0.04em;
  color: var(--color-text);
}

.summary {
  max-width: 760px;
  font-size: clamp(1.1rem, 1.8vw, 1.28rem);
  line-height: 1.55;
  color: var(--color-muted);
  margin: 0 0 2rem;
}

/* DL MATRIX TECH SPEC */
dl {
  margin: 0 0 2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.dl-cell {
  padding: 1.25rem 1.4rem;
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  transition: border-color 0.18s ease;
}
.dl-cell:hover {
  border-color: var(--color-border);
}
dt {
  margin: 0;
  display: block;
}
dd {
  margin: 0.55rem 0 0;
  color: var(--color-text);
  font-size: 0.96rem;
  line-height: 1.5;
}

.card-footer-action {
  margin-top: auto;
  padding-top: 1rem;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--color-accent);
  text-decoration: none;
  transition: gap 0.2s ease, color 0.2s ease;
}
.text-link:hover {
  color: var(--color-accent-hover);
  gap: 0.9rem;
}
.arrow-out {
  transition: transform 0.2s ease;
}
.text-link:hover .arrow-out {
  transform: translate(3px, -3px);
}

/* ECOSISTEMA DE 12 PROYECTOS 2025 */
.ecosystem {
  margin-top: 6rem;
  padding-top: 6rem;
  border-top: 1px solid var(--color-border);
}
.ecosystem-header {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
  align-items: end;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 3.5rem;
}
.mini-card {
  padding: 1.75rem 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.mini-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
}
.mini-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.mini-tag { color: var(--color-muted); font-size: 0.75rem; }
.mini-index { font: 500 0.72rem var(--font-data); color: var(--color-border); }
.mini-card h3 {
  margin: 0 0 0.65rem;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text);
}
.mini-card p {
  margin: 0 0 1rem;
  color: var(--color-muted);
  font-size: 0.92rem;
  line-height: 1.5;
  flex-grow: 1;
}
.mini-link {
  margin-top: auto;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--color-accent);
  text-decoration: none;
}
.mini-link:hover { text-decoration: underline; }

.infra-callout {
  margin-top: 2rem;
  padding: 1.4rem 1.8rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.infra-icon {
  color: var(--color-muted);
  display: flex;
  flex-shrink: 0;
}
.infra-text {
  font-size: 0.95rem;
  color: var(--color-muted);
  line-height: 1.55;
}
.infra-text strong {
  color: var(--color-text);
}

/* POSIBILIDADES GRID */
.possibility-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3.5rem;
}
.possibility-card {
  padding: 2.2rem 1.8rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.possibility-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-accent);
}
.possibility-num {
  font: 700 0.85rem var(--font-data);
  color: var(--color-accent);
}
.possibility-card h3 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text);
}
.possibility-card p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* MÉTODO PIPELINE */
.method {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4.5rem;
}
.method-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.method-step {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 1.8rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  align-items: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.method-step:hover {
  border-color: var(--color-accent);
  transform: translateX(4px);
}
.step-badge {
  width: 48px;
  height: 48px;
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 1rem var(--font-data);
}
.step-body h3 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--color-text);
}
.step-body p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ACERCA DE LA CASA */
.about {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 3.5rem;
  align-items: start;
}
.about-content h2 {
  margin: 0 0 1.5rem;
}
.about-content p {
  max-width: 680px;
  margin: 0 0 2rem;
  color: var(--color-muted);
  font-size: 1.15rem;
  line-height: 1.6;
}

/* FOOTER 2025 */
footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-subtle);
  padding: 3rem 0;
}
.footer-wrap {
  width: min(1200px, calc(100% - 2.5rem));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 200px 1fr auto;
  align-items: center;
  gap: 2.5rem;
}
.footer-statement, .footer-copyright {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* 404 NOT FOUND PAGE */
.not-found {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}
.not-found h1 {
  font-size: clamp(3rem, 10vw, 8rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
}

/* RESPONSIVE BREAKPOINTS (375 / 768 / 1024 / 1440) */
@media (max-width: 1024px) {
  .section-head, .ecosystem-header, .method, .about {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hud-pipeline {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .hud-arrow {
    transform: rotate(90deg);
    padding: 0.25rem 0;
  }
  .hud-footer {
    grid-template-columns: 1fr;
  }
  .mini-grid, .possibility-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 800px) {
  .nav-toggle { display: inline-flex; }
  .topbar-inner { position: relative; }
  .topbar nav {
    position: absolute;
    top: calc(100% + 0.65rem);
    right: 0;
    width: min(320px, calc(100vw - 1.5rem));
    padding: 0.75rem;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
  }
  .topbar nav[data-open="true"] { display: flex; }
  .topbar nav a { padding: 0.8rem 0.9rem; }
  .hero-bottom {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .agent-states {
    grid-template-columns: 1fr;
  }
  .card {
    grid-template-columns: 1fr;
  }
  .card > header {
    flex-direction: row;
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
    padding: 1.5rem;
  }
  dl {
    grid-template-columns: 1fr;
  }
  .footer-wrap {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 600px) {
  .theme span { display: none; }
  .theme { padding-inline: 0.7rem; }
  .topbar-actions { gap: 0.5rem; }
  .mini-grid, .possibility-grid {
    grid-template-columns: 1fr;
  }
  .hud-tabs {
    width: 100%;
    flex-direction: column;
  }
  .hud-tab {
    width: 100%;
    text-align: center;
  }
  .hero h1 {
    font-size: clamp(2.6rem, 12vw, 3.6rem);
  }
  .hero-actions .button, .hero-actions .button-ghost {
    width: 100%;
  }
  .topbar-inner {
    width: calc(100% - 1.5rem);
  }
  main, .footer-wrap {
    width: calc(100% - 1.5rem);
  }
}

/* ACCESSIBILITY: PREFERS REDUCED MOTION */
@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;
  }
  .pulse-beacon {
    animation: none !important;
  }
}

/* EVOLUCIÓN E18 · CARTOGRAFÍA ORBITAL */
:root {
  --motion-fast: 140ms;
  --motion-default: 260ms;
  --motion-slow: 480ms;
}

body {
  background-image:
    linear-gradient(90deg, transparent 49.95%, rgba(38,34,32,.045) 50%, transparent 50.05%),
    radial-gradient(rgba(38,34,32,.05) .75px, transparent .75px);
  background-size: 100% 100%, 22px 22px;
}

.topbar {
  top: .75rem;
  width: min(1200px, calc(100% - 1.5rem));
  margin-inline: auto;
  border: 1px solid var(--color-border-subtle);
  border-radius: 18px;
  background: rgba(var(--color-bg-rgb), .76);
  box-shadow: 0 10px 40px rgba(38,34,32,.08);
}
.topbar-inner { width: 100%; min-height: 64px; padding-inline: 1rem; }
.brand { width: clamp(132px, 14vw, 178px); }

.nav-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-bg);
  box-shadow: 0 8px 22px rgba(38,34,32,.2);
  transition: transform var(--motion-fast) ease-out, background var(--motion-fast) ease-out;
}
.nav-toggle:hover { transform: scale(1.05); background: var(--color-accent); }
.nav-toggle:active { transform: scale(.94); }
.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after { width: 18px; height: 1.5px; transition: transform var(--motion-default) ease, opacity var(--motion-fast) ease; }
.nav-toggle-icon::before { top: -6px; }
.nav-toggle-icon::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after { transform: translateY(-6px) rotate(-45deg); }

main { width: min(1320px, calc(100% - 3rem)); }
.hero {
  min-height: calc(100svh - 76px);
  padding: clamp(5rem, 10vh, 8rem) 0 2rem;
  position: relative;
  justify-content: space-between;
  isolation: isolate;
  overflow: clip;
}
.hero-content { position: relative; min-height: 420px; z-index: 2; }
.hero h1 {
  max-width: 1000px;
  font-size: clamp(4.4rem, 9.4vw, 8.6rem);
  line-height: .82;
  letter-spacing: -.072em;
  text-wrap: balance;
  position: relative;
  z-index: 2;
}
.hero h1::after {
  content: "";
  display: inline-block;
  width: .18em;
  height: .18em;
  margin-left: .08em;
  border-radius: 50%;
  background: var(--color-accent);
}
.hero-bottom { position: relative; z-index: 3; grid-template-columns: minmax(0, 600px) auto; }
.hero-lead { font-size: clamp(1.1rem, 1.6vw, 1.35rem); }

.hero-orbit {
  position: absolute;
  z-index: 1;
  right: -5%;
  top: -18%;
  width: min(52vw, 660px);
  aspect-ratio: 1;
  opacity: .82;
  pointer-events: none;
}
/* La firma es un mapa, no una forma cerrada: evita el triángulo negro ambiguo. */
.hero-orbit::after { content: ""; position: absolute; inset: 35% 20%; border: 1px solid color-mix(in srgb, var(--color-accent) 35%, transparent); border-radius: 50% 42% 58% 48%; transform: rotate(-24deg); }
.orbit, .orbit-core { position: absolute; inset: 50%; border-radius: 50%; transform: translate(-50%,-50%); }
.orbit { border: 1px solid var(--color-border); }
.orbit::before {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 8px var(--color-accent-subtle);
}
.orbit-a { width: 100%; height: 100%; transform: translate(-50%,-50%) rotate(-18deg); }
.orbit-a::before { left: 12%; top: 12%; }
.orbit-b { width: 67%; height: 67%; transform: translate(-50%,-50%) rotate(36deg); border-style: dashed; }
.orbit-b::before { right: 3%; bottom: 25%; }
.orbit-core { width: 25%; height: 25%; background: var(--color-primary); box-shadow: 0 0 0 20px var(--color-accent-subtle), var(--shadow-lg); }
.orbit-core::after { content: "LOLO"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--color-bg); font: 600 1rem var(--font-data); letter-spacing: .18em; }
.orbit-label { position: absolute; padding: .35rem .65rem; border-radius: 999px; background: var(--color-bg); border: 1px solid var(--color-border); font: 500 .75rem var(--font-data); text-transform: uppercase; letter-spacing: .08em; }
.label-a { top: 7%; right: 23%; }
.label-b { bottom: 20%; left: 0; }
.label-c { bottom: 7%; right: 14%; }

.agent-hud {
  width: min(980px, 86%);
  margin-left: auto;
  border-radius: 28px;
  box-shadow: 0 34px 90px rgba(38,34,32,.18), 0 2px 0 rgba(255,255,255,.55) inset;
  transform: rotate(-1deg);
}
.hud-header { padding: 1rem 1.25rem; }
.hud-body { padding: 1.4rem; }
.hud-node { border-radius: 14px; }
.hero-route { position: absolute; inset: auto 0 3.4rem; opacity: .42; z-index: -1; }
.scroll-cue { align-self: flex-start; display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; font: 500 .78rem var(--font-data); text-transform: uppercase; letter-spacing: .08em; }
.scroll-cue svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.agent-feature, .projects, .possibilities, .method, .about { padding: clamp(6rem, 11vw, 10rem) 0; border-top: 0; }
.agent-feature, .possibilities, .about { position: relative; }
.agent-feature::before, .possibilities::before, .about::before { content: ""; position: absolute; inset: 0 calc(50% - 50vw); z-index: -1; background: var(--color-surface-subtle); }
.section-heading-wrap h2, .section-head h2, .ecosystem-header h2, .possibilities h2, .method-intro h2, .about h2 { line-height: .92; letter-spacing: -.055em; }

.agent-states { grid-template-columns: 1.25fr .9fr .9fr; align-items: stretch; }
.state-card { border: 0; border-radius: 24px; box-shadow: 0 22px 60px rgba(38,34,32,.1); }
.state-card:first-child { min-height: 360px; padding: 3rem; }
.state-card:first-child h3 { font-size: clamp(2rem, 3.4vw, 3.4rem); line-height: .96; }

.cards { gap: 4rem; }
.card { width: 92%; border: 0; border-radius: 28px; box-shadow: 0 28px 80px rgba(38,34,32,.11); }
.card:nth-child(even) { margin-left: auto; }
.card > header { background: var(--color-primary); color: var(--color-bg); border: 0; }
.card > header .stamp, .card > header .kind { color: var(--color-bg); }
.card-main { padding: clamp(2.5rem, 5vw, 4.5rem); }
.card-main h3 { font-size: clamp(3.6rem, 7vw, 6.6rem); }
.dl-cell { border: 0; border-radius: 16px; }

.ecosystem { margin-top: 8rem; padding-top: 0; border: 0; }
.mini-grid { grid-template-columns: repeat(12, 1fr); grid-auto-flow: dense; }
.mini-card { grid-column: span 3; min-height: 210px; border: 0; border-radius: 22px; box-shadow: 0 15px 45px rgba(38,34,32,.08); }
.mini-card:nth-child(1), .mini-card:nth-child(2) { grid-column: span 6; min-height: 280px; }
.mini-card:nth-child(3), .mini-card:nth-child(8) { grid-column: span 4; }
.mini-card:nth-child(5), .mini-card:nth-child(10) { transform: translateY(2rem); }
.mini-card:nth-child(1) h3, .mini-card:nth-child(2) h3 { font-size: 2.2rem; }

.possibility-grid { grid-template-columns: repeat(12, 1fr); gap: 1.25rem; }
.possibility-card { grid-column: span 4; border: 0; border-radius: 28px; min-height: 230px; padding: 2.4rem; box-shadow: 0 18px 50px rgba(38,34,32,.09); }
.possibility-card:nth-child(2), .possibility-card:nth-child(5) { transform: translateY(2.5rem); }
.possibility-card h3 { font-size: 1.65rem; }

.method { min-height: 760px; align-items: start; }
.method-intro { position: sticky; top: 8rem; }
.method-list { gap: 0; }
.method-step { min-height: 145px; border-radius: 0; border: 0; border-bottom: 1px solid var(--color-border); background: transparent; box-shadow: none; }
.method-step:first-child { border-top: 1px solid var(--color-border); }
.method-step:hover { transform: translateX(10px); box-shadow: none; }

.about { grid-template-columns: .65fr 1.35fr; min-height: 70vh; align-items: center; }
.about h2 { font-size: clamp(3.5rem, 7vw, 7rem); }

/* Demo lab: sala de demostraciones interactiva con formato de cabina */
.demo-lab {
  padding: clamp(5rem, 10vw, 8.5rem) 0;
  display: grid;
  grid-template-columns: minmax(280px, .75fr) minmax(0, 1.25fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.demo-intro { position: sticky; top: 7.5rem; }
.demo-intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--color-accent-subtle);
  border: 1px solid rgba(164, 63, 43, 0.25);
  font: 600 0.72rem var(--font-data);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 1.2rem;
}
.demo-badge-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--color-accent);
}
.demo-intro h2 {
  margin: 0 0 1.2rem;
  max-width: 12ch;
  font-size: clamp(2.4rem, 4.5vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -.05em;
}
.demo-intro-lead {
  max-width: 30rem;
  color: var(--color-muted);
  font-size: 1.05rem;
  line-height: 1.55;
  margin: 0 0 2rem;
}
.demo-intro-pillars {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 30rem;
}
.pillar-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.pillar-num {
  font: 600 0.78rem var(--font-data);
  color: var(--color-accent);
  padding-top: 0.15rem;
}
.pillar-item strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.2rem;
}
.pillar-item p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--color-muted);
  line-height: 1.4;
}

.demo-shell {
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: 24px;
  background: var(--color-surface);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.demo-shell-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.4rem;
  background: var(--color-surface-subtle);
  border-bottom: 1px solid var(--color-border);
  font: 500 0.74rem var(--font-data);
}
.demo-shell-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}
.demo-private {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--color-accent);
  font: 600 0.72rem var(--font-data);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.demo-private .pulse-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--color-accent);
  animation: pxPulse 2s infinite ease-in-out;
}
.demo-picker {
  display: flex;
  gap: 0.45rem;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--color-border);
  scrollbar-width: thin;
  background: var(--color-surface);
}
.demo-tab {
  flex: 0 0 auto;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: transparent;
  color: var(--color-muted);
  padding: 0.5rem 0.9rem;
  font: 500 0.78rem var(--font-data);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.demo-tab:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
  transform: translateY(-1px);
}
.demo-tab.is-selected {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-bg);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
[data-theme=dark] .demo-tab.is-selected {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-bg);
}
.demo-tab:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

.demo-panel { padding: clamp(1.2rem, 3vw, 2rem); }
.demo-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.demo-head-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.demo-index {
  font: 600 0.75rem var(--font-data);
  color: var(--color-accent);
}
.demo-archetype {
  font: 500 0.72rem var(--font-data);
  color: var(--color-muted);
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
}
.demo-tag-mode {
  font: 500 0.68rem var(--font-data);
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.demo-canvas {
  margin-top: 0.5rem;
  min-height: 360px;
  padding: clamp(1.2rem, 3vw, 1.8rem);
  border-radius: 18px;
  background: #141a19;
  color: #e8eee9;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 12px 36px rgba(0,0,0,0.35);
}
.demo-window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: #a9b8b1;
  font: 500 0.72rem var(--font-data);
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.demo-window-bar .window-dots {
  display: inline-flex;
  gap: 0.4rem;
}
.demo-window-bar .window-dots span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
}
.demo-window-bar .window-dots span:nth-child(1) { background: #e06c4e; }
.demo-window-bar .window-dots span:nth-child(2) { background: #d3a856; }
.demo-window-bar .window-dots span:nth-child(3) { background: #4ea899; }
.demo-window-bar strong {
  color: #ffffff;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-right: auto;
}
.demo-status-pill {
  font: 500 0.68rem var(--font-data);
  color: #4ea899;
  background: rgba(78, 168, 153, 0.15);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.demo-query {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.4rem 0;
  padding: 0.85rem 1.1rem;
  border: 1px solid #3b4745;
  border-radius: 12px;
  background: #0d1212;
  color: #dbe7df;
  font: 500 0.86rem var(--font-data);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}
.demo-command {
  color: #e28a62;
  font-weight: 600;
}
.demo-query span:nth-child(2) {
  flex: 1;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.demo-query b, .demo-query-action {
  margin-left: auto;
  color: #ffffff;
  background: #a43f2b;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
}

.demo-columns {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.2rem;
  margin-top: 1rem;
}
.demo-source-col small, .demo-answer small {
  display: block;
  color: #92a49b;
  font: 600 0.66rem var(--font-data);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}
.demo-source {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #1c2423;
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid #e28a62;
  margin-bottom: 0.65rem;
  font-size: 0.8rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.demo-source:hover {
  transform: translateX(3px);
  border-color: rgba(255,255,255,0.12);
}
.demo-source-tag {
  font: 600 0.64rem var(--font-data);
  color: #e28a62;
  background: rgba(226, 138, 98, 0.14);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}
.demo-source-title {
  display: block;
  color: #ffffff;
  font-weight: 500;
  line-height: 1.25;
}
.demo-source em {
  display: block;
  color: #92a49b;
  font-size: 0.7rem;
  font-style: normal;
  margin-top: 0.15rem;
}
.demo-source b {
  font: 500 0.72rem var(--font-data);
  color: #b7cfaa;
}

.demo-answer {
  padding: 1.2rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: #192120;
  display: flex;
  flex-direction: column;
}
.demo-answer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.demo-verified-chip {
  font: 500 0.65rem var(--font-data);
  color: #4ea899;
  background: rgba(78, 168, 153, 0.15);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.demo-answer-p {
  margin: 0 0 1rem;
  font-size: 0.98rem;
  line-height: 1.55;
  color: #f0f5f2;
}
.demo-guardrail-box {
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: #111716;
  border-left: 3px solid #d8aa58;
  font-size: 0.8rem;
  color: #cad5d0;
  line-height: 1.45;
  margin-top: auto;
}
.demo-guardrail-box strong { color: #d8aa58; }

.demo-panel-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}
.demo-caption {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

[data-theme=dark] .demo-shell { background: #312b27; }
[data-theme=dark] .pillar-item { background: #24201e; border-color: var(--color-border); }
[data-theme=dark] .demo-shell-top { background: #282320; }
[data-theme=dark] .demo-archetype { background: #282320; }

.js .reveal { opacity: 0; transform: translateY(34px); transition: opacity var(--motion-slow) ease-out, transform var(--motion-slow) ease-out; }
.js .reveal.revealed { opacity: 1; transform: translateY(0); }
.js .mini-card.reveal:nth-child(5), .js .mini-card.reveal:nth-child(10),
.js .possibility-card.reveal:nth-child(2), .js .possibility-card.reveal:nth-child(5) { transform: translateY(54px); }
.js .mini-card.revealed:nth-child(5), .js .mini-card.revealed:nth-child(10),
.js .possibility-card.revealed:nth-child(2), .js .possibility-card.revealed:nth-child(5) { transform: translateY(2rem); }

[data-theme=dark] body { background-image: linear-gradient(90deg, transparent 49.95%, rgba(245,239,230,.06) 50%, transparent 50.05%), radial-gradient(rgba(245,239,230,.06) .75px, transparent .75px); }
[data-theme=dark] .agent-feature::before, [data-theme=dark] .possibilities::before, [data-theme=dark] .about::before { background: #0e0d0c; }
[data-theme=dark] .card > header { background: #0e0d0c; }
[data-theme=dark] .nav-toggle { background: var(--color-text); color: var(--color-bg); }

@media (max-width: 1024px) {
  .hero-orbit { right: -14%; top: -8%; opacity: .55; }
  .agent-hud { width: 96%; }
  .agent-states { grid-template-columns: 1fr 1fr; }
  .state-card:first-child { grid-column: 1 / -1; }
  .mini-card { grid-column: span 4; }
  .mini-card:nth-child(1), .mini-card:nth-child(2) { grid-column: span 6; }
  .possibility-card { grid-column: span 6; }
}

@media (max-width: 800px) {
  main { width: min(100% - 2rem, 680px); }
  .topbar nav { top: calc(100% + .5rem); right: 0; border-radius: 20px; padding: .7rem; }
  .topbar nav a { font-size: 1.05rem; border-radius: 14px; }
  .hero { min-height: auto; padding-top: 5.5rem; gap: 2.5rem; }
  .hero-content { min-height: 500px; }
  .hero h1 { font-size: clamp(4rem, 16vw, 7rem); max-width: 10ch; }
  .hero-bottom { grid-template-columns: 1fr; }
  .hero-orbit { width: 86vw; right: -34%; top: 15%; opacity: .48; }
  .agent-hud { width: 100%; transform: none; border-radius: 22px; }
  .card { width: 100%; }
  .mini-card, .mini-card:nth-child(1), .mini-card:nth-child(2), .mini-card:nth-child(3), .mini-card:nth-child(8) { grid-column: span 6; transform: none; }
  .possibility-card:nth-child(2), .possibility-card:nth-child(5) { transform: none; }
  .method { min-height: auto; }
  .method-intro { position: static; }
  .demo-lab { grid-template-columns: 1fr; gap: 2.5rem; }
  .demo-intro { position: static; }
  .demo-intro h2 { max-width: 14ch; }
  .demo-columns { grid-template-columns: 1fr; }
  .demo-shell-top { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .demo-panel-head { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}

@media (max-width: 600px) {
  .topbar { width: calc(100% - 1rem); top: .5rem; border-radius: 16px; }
  .topbar-inner { min-height: 58px; padding-inline: .7rem; }
  .brand { width: 124px; }
  .nav-toggle { width: 40px; height: 40px; }
  .theme { width: 40px; height: 40px; justify-content: center; padding: 0; border-radius: 50%; }
  .hero-content { min-height: 450px; }
  .hero h1 { font-size: clamp(3.65rem, 17.3vw, 5.2rem); }
  .hero-bottom { margin-top: auto; }
  .hero-actions { gap: .75rem; }
  .hud-header { align-items: flex-start; }
  .hud-title { font-size: .72rem; }
  .hud-body { padding: 1rem; }
  .hud-footer { display: block; }
  .hud-principle { border-top: 1px solid var(--color-border); }
  .agent-feature, .projects, .possibilities, .method, .about { padding: 6rem 0; }
  .agent-states { grid-template-columns: 1fr; }
  .state-card:first-child { grid-column: auto; min-height: 0; padding: 2.2rem 1.8rem; }
  .card-main h3 { font-size: clamp(3.1rem, 15vw, 4.6rem); }
  .mini-grid, .possibility-grid { grid-template-columns: 1fr; }
  .mini-card, .mini-card:nth-child(1), .mini-card:nth-child(2), .mini-card:nth-child(3), .mini-card:nth-child(8), .possibility-card { grid-column: auto; min-height: 0; }
  .about { min-height: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .reveal.revealed { opacity: 1; transform: none; }
  .nav-toggle-icon, .nav-toggle-icon::before, .nav-toggle-icon::after { transition-duration: .001ms; }
}
