/* ==========================================================
   jlalegredev.es
   Portfolio estático: HTML + CSS + JavaScript vanilla.
   Sin fuentes remotas, CDNs ni proceso de build; Three.js se sirve vendorizado en local.
   ========================================================== */

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  --bg: #070a12;
  --bg-deep: #05070c;
  --bg-soft: #0a0f19;
  --surface: rgba(15, 21, 34, 0.78);
  --surface-solid: #111827;
  --surface-soft: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --text: #f3f7fb;
  --text-soft: #dbe3ee;
  --muted: #a6b1c1;
  --muted-2: #7e8b9e;
  --line: rgba(173, 195, 222, 0.15);
  --line-strong: rgba(173, 195, 222, 0.28);

  --primary: #75f6d2;
  --primary-strong: #a5ffe6;
  --primary-soft: rgba(117, 246, 210, 0.12);
  --primary-ink: #07130f;
  --blue: #8ea7ff;
  --blue-soft: rgba(142, 167, 255, 0.13);
  --violet: #bd9cff;
  --violet-soft: rgba(189, 156, 255, 0.13);
  --lime: #b9ef70;
  --lime-soft: rgba(185, 239, 112, 0.12);
  --amber: #ffd27d;
  --amber-soft: rgba(255, 210, 125, 0.12);

  --shadow-sm: 0 12px 30px rgba(0, 0, 0, 0.22);
  --shadow-lg: 0 32px 100px rgba(0, 0, 0, 0.42);
  --glow: 0 0 50px rgba(117, 246, 210, 0.11);

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;

  --container: 1220px;
  --header-height: 70px;
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;

  --bg: #f4f6f8;
  --bg-deep: #eef1f5;
  --bg-soft: #e9edf2;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-solid: #ffffff;
  --surface-soft: rgba(20, 31, 48, 0.04);
  --surface-hover: rgba(20, 31, 48, 0.065);
  --text: #101722;
  --text-soft: #273445;
  --muted: #526174;
  --muted-2: #5f6e80;
  --line: rgba(28, 46, 68, 0.14);
  --line-strong: rgba(28, 46, 68, 0.26);

  --primary: #087f69;
  --primary-strong: #056451;
  --primary-soft: rgba(8, 127, 105, 0.1);
  --primary-ink: #ffffff;
  --blue: #355ed8;
  --blue-soft: rgba(53, 94, 216, 0.1);
  --violet: #7650c7;
  --violet-soft: rgba(118, 80, 199, 0.1);
  --lime: #4d7b0b;
  --lime-soft: rgba(77, 123, 11, 0.1);
  --amber: #8b5a00;
  --amber-soft: rgba(139, 90, 0, 0.1);

  --shadow-sm: 0 12px 34px rgba(38, 51, 69, 0.09);
  --shadow-lg: 0 32px 90px rgba(38, 51, 69, 0.14);
  --glow: 0 0 50px rgba(8, 127, 105, 0.09);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;

    --bg: #f4f6f8;
    --bg-deep: #eef1f5;
    --bg-soft: #e9edf2;
    --surface: rgba(255, 255, 255, 0.84);
    --surface-solid: #ffffff;
    --surface-soft: rgba(20, 31, 48, 0.04);
    --surface-hover: rgba(20, 31, 48, 0.065);
    --text: #101722;
    --text-soft: #273445;
    --muted: #526174;
    --muted-2: #5f6e80;
    --line: rgba(28, 46, 68, 0.14);
    --line-strong: rgba(28, 46, 68, 0.26);
    --primary: #087f69;
    --primary-strong: #056451;
    --primary-soft: rgba(8, 127, 105, 0.1);
    --primary-ink: #ffffff;
    --blue: #355ed8;
    --blue-soft: rgba(53, 94, 216, 0.1);
    --violet: #7650c7;
    --violet-soft: rgba(118, 80, 199, 0.1);
    --lime: #4d7b0b;
    --lime-soft: rgba(77, 123, 11, 0.1);
    --amber: #8b5a00;
    --amber-soft: rgba(139, 90, 0, 0.1);
    --shadow-sm: 0 12px 34px rgba(38, 51, 69, 0.09);
    --shadow-lg: 0 32px 90px rgba(38, 51, 69, 0.14);
    --glow: 0 0 50px rgba(8, 127, 105, 0.09);
  }
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--header-height) + 24px);
  scrollbar-color: var(--line-strong) var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% -10%, var(--primary-soft), transparent 28rem),
    radial-gradient(circle at 88% 16%, var(--violet-soft), transparent 32rem),
    linear-gradient(180deg, var(--bg-deep), var(--bg) 26%, var(--bg));
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 54px 54px;
  opacity: 0.22;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 75%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 49.8%, var(--line) 50%, transparent 50.2%) 0 0 / 180px 180px;
  opacity: 0.2;
}

main {
  outline: 0;
}

main:focus,
.hero:focus {
  outline: 0;
}

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

button,
input {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--text);
  line-height: 1.06;
  letter-spacing: -0.045em;
}

h1 {
  font-size: clamp(3.15rem, 7.1vw, 6.8rem);
}

h2 {
  font-size: clamp(2.25rem, 4.6vw, 4.75rem);
}

h3 {
  font-size: clamp(1.35rem, 2vw, 1.9rem);
}

p {
  color: var(--muted);
}

::selection {
  background: var(--primary);
  color: var(--primary-ink);
}

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

[hidden] {
  display: none !important;
}

.container {
  width: min(calc(100% - 40px), var(--container));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.js-only {
  display: none;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 11px 16px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transform: translateY(-160%);
  transition: transform 180ms var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------- Shared controls ---------- */
.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.91rem;
  font-weight: 780;
  line-height: 1;
  transition:
    transform 180ms var(--ease),
    border-color 180ms var(--ease),
    background-color 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

.button:hover {
  transform: translateY(-2px);
}

.button--primary {
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--primary) 18%, transparent);
}

.button--primary:hover {
  box-shadow: 0 18px 42px color-mix(in srgb, var(--primary) 25%, transparent);
}

.button--secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
}

.button--secondary:hover {
  border-color: color-mix(in srgb, var(--primary) 48%, var(--line));
  background: var(--surface-hover);
}

.status-chip {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.status-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.status-chip--live {
  border-color: color-mix(in srgb, var(--primary) 38%, var(--line));
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.status-chip--building {
  border-color: color-mix(in srgb, var(--amber) 38%, var(--line));
  background: var(--amber-soft);
  color: var(--amber);
}

.status-chip--lab {
  border-color: color-mix(in srgb, var(--violet) 38%, var(--line));
  background: var(--violet-soft);
  color: var(--violet);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip-list li,
.signal-list li {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 650;
}

.chip-list li {
  padding: 5px 9px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-height);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  backdrop-filter: blur(20px) saturate(135%);
  transition:
    background-color 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
}

.header-shell {
  position: relative;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.91rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.brand__prompt {
  color: var(--primary);
  text-shadow: 0 0 18px color-mix(in srgb, var(--primary) 55%, transparent);
}

.site-nav {
  --nav-progress-duration: 360ms;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2vw, 28px);
}

.site-nav a {
  --nav-progress: 0;

  position: relative;
  padding: 8px 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 720;
}

.site-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary);
  opacity: 0;
  transform: scaleX(var(--nav-progress));
  transform-origin: left center;
  will-change: transform;
}

.site-nav[data-scroll-direction="up"] a::after {
  transform-origin: right center;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.is-active,
.site-nav a.is-progressing {
  color: var(--text);
}

.site-nav a.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.site-nav:not(.is-sequencing):not(.is-sequence-complete) a.is-active::after {
  animation: nav-progress-fill var(--nav-progress-duration) linear both;
}

.site-nav.is-sequencing a.is-active:not(.is-progressing) {
  color: var(--muted);
}

.site-nav.is-sequencing a.is-active:not(.is-progressing)::after {
  opacity: 0;
}

.site-nav a.is-progressing::after {
  animation: none;
  opacity: 1;
  transform: scaleX(var(--nav-progress));
}

.site-nav.is-sequence-complete a.is-active::after {
  animation: none;
  opacity: 1;
  transform: scaleX(1);
}

@keyframes nav-progress-fill {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.palette-ready .command-trigger,
.theme-ready .theme-toggle {
  display: inline-flex;
}

.command-trigger,
.theme-toggle,
.nav-toggle {
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  transition:
    color 160ms var(--ease),
    border-color 160ms var(--ease),
    background-color 160ms var(--ease);
}

.command-trigger:hover,
.theme-toggle:hover,
.nav-toggle:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: var(--text);
}

.command-trigger {
  gap: 11px;
  padding: 0 9px 0 14px;
  font-size: 0.75rem;
  font-weight: 720;
}

.command-trigger kbd,
.command-palette kbd {
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-weight: 650;
  box-shadow: 0 2px 0 var(--line);
}

.command-trigger kbd {
  padding: 4px 6px;
}

.theme-toggle {
  gap: 8px;
  min-width: 92px;
  padding: 0 12px;
  font-size: 0.73rem;
  font-weight: 750;
}

.theme-toggle__glyph {
  position: relative;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.theme-toggle__glyph::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface-solid);
}

html[data-theme="light"] .theme-toggle__glyph::after {
  width: 4px;
  height: 4px;
  top: 3px;
  right: 3px;
  background: currentColor;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .theme-toggle__glyph::after {
    width: 4px;
    height: 4px;
    top: 3px;
    right: 3px;
    background: currentColor;
  }
}

.nav-toggle {
  width: 40px;
  padding: 0;
  border-radius: 50%;
}

.nav-toggle > span,
.nav-toggle > span::before,
.nav-toggle > span::after {
  content: "";
  position: relative;
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 180ms var(--ease), top 180ms var(--ease), opacity 180ms var(--ease);
}

.nav-toggle > span::before,
.nav-toggle > span::after {
  position: absolute;
  left: 0;
}

.nav-toggle > span::before {
  top: -6px;
}

.nav-toggle > span::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] > span {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] > span::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] > span::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  min-height: calc(100svh - var(--header-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(74px, 9vw, 126px) 0 54px;
  overflow: hidden;
}

.hero__glow {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}

.hero__glow--one {
  top: 10%;
  left: -14rem;
  width: 32rem;
  height: 32rem;
  background: radial-gradient(circle, var(--primary-soft), transparent 68%);
}

.hero__glow--two {
  top: 5%;
  right: -18rem;
  width: 42rem;
  height: 42rem;
  background: radial-gradient(circle, var(--violet-soft), transparent 68%);
}

/* ---------- Three.js product systems scene ---------- */
.hero-system-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  contain: layout paint;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.08) 28%,
    #000 52%,
    #000 100%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, 0.08) 28%,
    #000 52%,
    #000 100%
  );
  transition: opacity 500ms var(--ease);
}

.has-webgl-scene .hero-system-scene {
  opacity: 0.78;
}

html[data-theme="light"].has-webgl-scene .hero-system-scene {
  opacity: 0.46;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]).has-webgl-scene .hero-system-scene {
    opacity: 0.46;
  }
}

.hero-system-scene__canvas {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.07fr) minmax(410px, 0.93fr);
  align-items: center;
  gap: clamp(42px, 6vw, 88px);
}

.hero .build-loop {
  position: relative;
  z-index: 2;
}

.eyebrow,
.section-index {
  color: var(--primary-strong);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
}

.eyebrow__status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 5px var(--primary-soft), 0 0 18px var(--primary);
}

.hero-kicker {
  margin-bottom: 20px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1.2vw, 0.85rem);
  font-weight: 640;
}

.hero h1 {
  max-width: 850px;
  margin: 0;
  line-height: 1.08;
  text-wrap: balance;
}

.hero h1 span {
  display: block;
  padding-bottom: 0.12em;
  background: linear-gradient(105deg, var(--primary-strong), var(--blue) 52%, var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lede {
  max-width: 700px;
  margin: 28px 0 12px;
  color: var(--text-soft);
  font-size: clamp(1.04rem, 1.55vw, 1.22rem);
  line-height: 1.68;
}

.hero-note {
  max-width: 660px;
  margin-bottom: 30px;
  font-size: 0.91rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-bottom: 25px;
}

.signal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.signal-list li {
  position: relative;
  padding: 5px 10px 5px 21px;
}

.signal-list li::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 9px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
  transform: translateY(-50%);
}

/* ---------- Product runtime ---------- */
.runtime-panel {
  position: relative;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line));
  border-radius: var(--radius-lg);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.055), transparent 26%),
    color-mix(in srgb, var(--surface-solid) 88%, transparent);
  box-shadow: var(--shadow-lg), var(--glow), inset 0 1px rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.runtime-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, #000, transparent);
}

.runtime-panel__bar,
.project-visual__bar,
.contact-console__bar {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
}

.runtime-panel__bar {
  position: relative;
  padding: 0 16px;
}

.window-dots {
  display: flex;
  gap: 5px;
}

.window-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.window-dots span:nth-child(1) {
  background: var(--violet);
}

.window-dots span:nth-child(2) {
  background: var(--amber);
}

.window-dots span:nth-child(3) {
  background: var(--primary);
}

.runtime-replay {
  border: 0;
  background: transparent;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.63rem;
}

.runtime-replay:hover {
  color: var(--primary-strong);
}

.runtime-ready .runtime-replay {
  display: inline-flex;
}

.runtime-console {
  position: relative;
  padding: clamp(22px, 4vw, 34px);
}

.runtime-command,
.runtime-result {
  margin: 0;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1.25vw, 0.82rem);
}

.runtime-command span,
.runtime-result > span:first-child {
  color: var(--primary);
}

.runtime-output {
  display: grid;
  gap: 9px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.runtime-line {
  display: grid;
  grid-template-columns: 26px minmax(92px, 0.9fr) minmax(130px, 1.35fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 47px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.69rem;
  transition:
    border-color 220ms var(--ease),
    background-color 220ms var(--ease),
    transform 220ms var(--ease);
}

.runtime-line.is-current {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
  background: var(--primary-soft);
  transform: translateX(3px);
}

.runtime-line.is-complete {
  border-color: color-mix(in srgb, var(--primary) 22%, var(--line));
}

.runtime-line__code {
  color: var(--muted-2);
}

.runtime-line__name {
  color: var(--text);
  font-weight: 750;
}

.runtime-line__detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runtime-line__status {
  position: relative;
  padding-left: 11px;
  font-size: 0.61rem;
  font-weight: 750;
}

.runtime-line__status::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  transform: translateY(-50%);
}

.status-live {
  color: var(--primary-strong);
}

.status-building {
  color: var(--amber);
}

.status-lab {
  color: var(--violet);
}

.runtime-result {
  display: flex;
  align-items: center;
  gap: 8px;
}

.runtime-result i {
  display: inline-block;
  width: 7px;
  height: 1em;
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary);
  animation: runtime-cursor-blink 900ms steps(1, end) infinite;
  will-change: opacity, box-shadow;
}

.runtime-panel__footer {
  position: relative;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 17px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.61rem;
}

.runtime-pulse {
  position: relative;
  padding-left: 13px;
  color: var(--primary-strong);
}

.runtime-pulse::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
  transform: translateY(-50%);
}

@keyframes runtime-cursor-blink {
  0%,
  44% {
    opacity: 1;
    box-shadow: 0 0 16px var(--primary);
  }

  45%,
  100% {
    opacity: 0.08;
    box-shadow: 0 0 3px var(--primary);
  }
}

.build-loop {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 26px;
  margin-top: clamp(52px, 8vw, 92px);
  padding-top: 23px;
  border-top: 1px solid var(--line);
}

.build-loop__label {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 720;
  text-transform: uppercase;
}

.build-loop ol {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.build-loop li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
}

.build-loop li:not(:last-child)::after {
  content: "";
  width: clamp(18px, 3vw, 58px);
  height: 1px;
  margin-left: auto;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}

.build-loop b {
  color: var(--primary-strong);
  font-family: var(--font-mono);
  font-size: 0.62rem;
}

/* ---------- Sections ---------- */
.section {
  position: relative;
  padding: clamp(92px, 11vw, 150px) 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(290px, 0.58fr);
  align-items: end;
  gap: clamp(28px, 6vw, 90px);
  margin-bottom: clamp(48px, 7vw, 80px);
}

.section-index {
  margin-bottom: 15px;
}

.section-heading h2 {
  max-width: 820px;
  margin: 0;
  text-wrap: balance;
}

.section-heading > p {
  max-width: 470px;
  margin: 0 0 4px;
  font-size: 1rem;
  line-height: 1.72;
}

/* ---------- Main projects ---------- */
.projects-section {
  background: linear-gradient(180deg, transparent, var(--surface-soft) 48%, transparent);
}

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

.project-card {
  --project-accent: var(--blue);
  --project-soft: var(--blue-soft);

  grid-column: span 6;
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 95% 5%, var(--project-soft), transparent 20rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 30%),
    var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition:
    transform 220ms var(--ease),
    border-color 220ms var(--ease),
    box-shadow 220ms var(--ease);
}

.project-card:hover,
.project-card:focus-within {
  border-color: color-mix(in srgb, var(--project-accent) 40%, var(--line));
  box-shadow: var(--shadow-lg), 0 0 70px color-mix(in srgb, var(--project-accent) 8%, transparent);
  transform: translateY(-4px);
}

.project-card[data-project="trustlayer"] {
  --project-accent: var(--primary);
  --project-soft: var(--primary-soft);
}

.project-card[data-project="testcelador"] {
  --project-accent: var(--blue);
  --project-soft: var(--blue-soft);
}

.project-card[data-project="uagri"] {
  --project-accent: var(--lime);
  --project-soft: var(--lime-soft);
}

.project-card[data-project="grooves"] {
  --project-accent: var(--amber);
  --project-soft: var(--amber-soft);
}

.project-card[data-project="ritmoescuela"] {
  --project-accent: var(--primary);
  --project-soft: var(--primary-soft);
}

.project-card[data-project="barcode"] {
  --project-accent: var(--violet);
  --project-soft: var(--violet-soft);
}

.project-card[data-project="fieldstates"] {
  --project-accent: var(--blue);
  --project-soft: var(--blue-soft);
}

.project-card--flagship {
  grid-column: 1 / -1;
}

@media (min-width: 941px) {
  .project-card[data-project="testcelador"],
  .project-card[data-project="grooves"],
  .project-card[data-project="ritmoescuela"] {
    grid-column: span 4;
  }
}

.project-card__header {
  min-height: 73px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px clamp(20px, 3vw, 31px);
  border-bottom: 1px solid var(--line);
}

.project-card__header > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.project-card__index,
.project-card__type {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 720;
  letter-spacing: 0.035em;
}

.project-card__type {
  color: var(--project-accent);
  text-transform: uppercase;
}

.project-card__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(350px, 0.97fr);
  align-items: stretch;
  min-height: 540px;
}

.project-card__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(26px, 4vw, 46px);
}

.project-card > .project-card__content {
  padding-top: 29px;
}

.project-card h3 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 3.6vw, 3.6rem);
}

.project-card:not(.project-card--flagship) h3 {
  font-size: clamp(1.9rem, 3vw, 2.65rem);
}

.project-card__summary {
  max-width: 680px;
  margin-bottom: 25px;
  color: var(--text-soft);
  font-size: 1.02rem;
  line-height: 1.7;
}

.project-card__problem {
  max-width: 690px;
  margin-bottom: 24px;
  padding-left: 14px;
  border-left: 2px solid var(--project-accent);
}

.project-card__problem > span {
  display: block;
  margin-bottom: 4px;
  color: var(--project-accent);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 750;
  text-transform: uppercase;
}

.project-card__problem p {
  margin: 0;
  font-size: 0.87rem;
  line-height: 1.62;
}

.system-facts {
  width: 100%;
  display: grid;
  gap: 8px;
  margin: 0 0 25px;
  padding: 0;
  list-style: none;
}

.system-facts li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.81rem;
}

.system-facts li span {
  color: var(--project-accent);
  font-family: var(--font-mono);
  font-size: 0.62rem;
}

.project-card .chip-list {
  margin-bottom: 30px;
}

.project-card .chip-list li {
  border-color: color-mix(in srgb, var(--project-accent) 18%, var(--line));
}

.project-cta,
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.79rem;
  font-weight: 760;
}

.project-cta {
  position: relative;
  padding-bottom: 5px;
}

.project-cta::after,
.text-link::after {
  content: "";
  position: absolute;
  right: 100%;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--project-accent, var(--primary));
  transition: right 180ms var(--ease);
}

.project-cta:hover::after,
.project-cta:focus-visible::after,
.text-link:hover::after,
.text-link:focus-visible::after {
  right: 0;
}

.project-visual {
  position: relative;
  min-height: 270px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    color-mix(in srgb, var(--project-soft) 42%, transparent);
  background-size: 30px 30px;
  overflow: hidden;
}

.project-card--flagship .project-visual {
  min-height: 100%;
  border-bottom: 0;
  border-left: 1px solid var(--line);
}

.project-visual__bar {
  position: relative;
  padding: 0 15px;
  background: color-mix(in srgb, var(--surface-solid) 72%, transparent);
}

.project-visual__bar span:last-child {
  color: var(--project-accent);
}

/* TrustLayer schematic */
.trust-orbit {
  position: relative;
  width: min(72%, 330px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 32px auto 15px;
  border: 1px dashed color-mix(in srgb, var(--primary) 38%, var(--line));
  border-radius: 50%;
  box-shadow: inset 0 0 60px var(--primary-soft);
}

.trust-orbit::before,
.trust-orbit::after {
  content: "";
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--line));
  border-radius: 50%;
}

.trust-orbit::before {
  inset: 15%;
}

.trust-orbit::after {
  inset: 30%;
}

.trust-core {
  position: relative;
  z-index: 2;
  width: 104px;
  height: 104px;
  display: grid;
  place-content: center;
  border: 1px solid color-mix(in srgb, var(--primary) 48%, var(--line));
  border-radius: 26px;
  background: color-mix(in srgb, var(--surface-solid) 85%, transparent);
  box-shadow: 0 0 60px var(--primary-soft);
  text-align: center;
}

.trust-core span {
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

.trust-core b {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.orbit-node {
  position: absolute;
  z-index: 3;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
}

.orbit-node--one {
  top: 12%;
  left: 10%;
}

.orbit-node--two {
  right: -3%;
  bottom: 30%;
}

.orbit-node--three {
  bottom: 5%;
  left: 16%;
}

.evidence-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 24px 22px;
}

.evidence-flow span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
}

.evidence-flow i {
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, var(--primary), transparent);
}

.visual-log {
  display: grid;
  gap: 5px;
  margin: 0 28px 28px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-solid) 72%, transparent);
}

.visual-log span {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.58rem;
}

.visual-log i {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--primary);
}

/* TestCelador schematic */
.study-screen {
  width: calc(100% - 44px);
  max-width: 440px;
  margin: 27px auto;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--blue) 28%, var(--line));
  border-radius: 17px;
  background: color-mix(in srgb, var(--surface-solid) 80%, transparent);
  box-shadow: 0 20px 45px color-mix(in srgb, var(--blue) 10%, transparent);
}

.study-screen__question {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.study-screen__question span {
  margin-bottom: 4px;
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 0.62rem;
}

.study-screen__question i {
  height: 7px;
  border-radius: 999px;
  background: var(--line);
}

.study-screen__question i:nth-child(3) {
  width: 82%;
}

.study-screen__question i:nth-child(4) {
  width: 64%;
}

.study-screen__options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 22px;
}

.study-screen__options span {
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.67rem;
}

.study-screen__options span:nth-child(2) {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.study-screen__progress {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.55rem;
}

.study-screen__progress b {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue) 62%, var(--line) 62%);
}

/* uAgri schematic */
.context-map {
  position: relative;
  width: calc(100% - 44px);
  max-width: 460px;
  min-height: 200px;
  margin: 20px auto;
}

.context-node {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--lime) 35%, var(--line));
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  text-align: center;
  box-shadow: 0 0 35px var(--lime-soft);
}

.context-node--sensor,
.context-node--view {
  top: 70px;
  width: 63px;
  height: 63px;
}

.context-node--sensor {
  left: 4%;
}

.context-node--view {
  right: 4%;
}

.context-node--broker {
  top: 42px;
  left: 50%;
  width: 112px;
  height: 112px;
  border-width: 2px;
  color: var(--lime);
  transform: translateX(-50%);
}

.context-line {
  position: absolute;
  z-index: 1;
  top: 101px;
  width: 30%;
  height: 1px;
  background: linear-gradient(90deg, var(--line), var(--lime), var(--line));
}

.context-line--one {
  left: 17%;
}

.context-line--two {
  right: 17%;
}

.context-pulse {
  position: absolute;
  top: 96px;
  z-index: 2;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 15px var(--lime);
}

.context-pulse--one {
  left: 31%;
}

.context-pulse--two {
  right: 31%;
}

/* 1001 Grooves schematic */
.groove-score {
  width: calc(100% - 44px);
  max-width: 460px;
  margin: 27px auto;
  padding: 17px;
  border: 1px solid color-mix(in srgb, var(--amber) 30%, var(--line));
  border-radius: 17px;
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  box-shadow: 0 20px 45px color-mix(in srgb, var(--amber) 9%, transparent);
}

.groove-score__transport,
.groove-score__sources {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.56rem;
}

.groove-score__transport b {
  color: var(--amber);
  font-size: 1rem;
}

.groove-score__transport i {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.groove-score__grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  margin: 21px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.groove-score__grid span {
  aspect-ratio: 1.15;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
}

.groove-score__grid span:nth-child(1),
.groove-score__grid span:nth-child(4),
.groove-score__grid span:nth-child(6),
.groove-score__grid span:nth-child(9),
.groove-score__grid span:nth-child(12),
.groove-score__grid span:nth-child(15) {
  border-color: color-mix(in srgb, var(--amber) 55%, var(--line));
  background: var(--amber-soft);
}

.groove-score__grid i {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 56%;
  width: 1px;
  background: var(--amber);
  box-shadow: 0 0 11px var(--amber);
}

.groove-score__sources {
  justify-content: space-between;
}

.groove-score__sources span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* Ritmo Escuela schematic */
.rhythm-sequencer {
  position: relative;
  width: calc(100% - 36px);
  max-width: 470px;
  display: grid;
  gap: 8px;
  margin: 29px auto;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line));
  border-radius: 17px;
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
}

.rhythm-sequencer > div {
  display: grid;
  grid-template-columns: 52px repeat(7, minmax(0, 1fr));
  align-items: center;
  gap: 6px;
}

.rhythm-sequencer b {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.53rem;
}

.rhythm-sequencer span,
.rhythm-sequencer i {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.rhythm-sequencer span {
  border-color: color-mix(in srgb, var(--primary) 58%, var(--line));
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--surface-solid) 70%, transparent);
}

.rhythm-sequencer i {
  background: var(--surface-soft);
}

.rhythm-sequencer > em {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 59%;
  width: 1px;
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary);
}

/* Barcode Battler Nexus schematic */
.barcode-scanner {
  position: relative;
  width: calc(100% - 42px);
  max-width: 460px;
  min-height: 198px;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 18px;
  margin: 14px auto;
  padding: 24px;
}

.barcode-scanner::before,
.barcode-scanner::after {
  content: "";
  position: absolute;
  width: 38px;
  height: 38px;
  border-color: var(--violet);
  border-style: solid;
}

.barcode-scanner::before {
  top: 8px;
  left: 8px;
  border-width: 1px 0 0 1px;
}

.barcode-scanner::after {
  right: 8px;
  bottom: 8px;
  border-width: 0 1px 1px 0;
}

.barcode-scanner__code {
  height: 112px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-solid) 84%, transparent);
}

.barcode-scanner__code i {
  width: 100%;
  height: 70px;
  background: repeating-linear-gradient(
    90deg,
    var(--violet) 0 2px,
    transparent 2px 5px,
    var(--text-soft) 5px 6px,
    transparent 6px 10px
  );
  opacity: 0.76;
}

.barcode-scanner__beam {
  position: absolute;
  top: 50%;
  left: 18px;
  width: 42%;
  height: 1px;
  background: var(--violet);
  box-shadow: 0 0 14px var(--violet);
}

.barcode-entity {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--violet) 34%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-solid) 84%, transparent);
  box-shadow: 0 18px 40px var(--violet-soft);
}

.barcode-entity span,
.barcode-entity small {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.55rem;
}

.barcode-entity b {
  color: var(--violet);
  font-family: var(--font-mono);
  font-size: 0.83rem;
}

/* FIELD STATES schematic */
.field-compositor {
  position: relative;
  width: calc(100% - 42px);
  max-width: 460px;
  min-height: 205px;
  margin: 16px auto;
}

.field-layer {
  position: absolute;
  top: 25px;
  width: 56%;
  height: 132px;
  border: 1px solid color-mix(in srgb, var(--blue) 34%, var(--line));
  border-radius: 14px;
  background:
    radial-gradient(circle at 25% 35%, var(--blue-soft), transparent 32%),
    color-mix(in srgb, var(--surface-solid) 82%, transparent);
  overflow: hidden;
}

.field-layer--a {
  left: 2%;
  transform: rotate(-4deg);
}

.field-layer--b {
  right: 2%;
  transform: rotate(4deg);
}

.field-layer span {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 1px solid var(--blue);
  transform: rotate(45deg);
}

.field-layer span:nth-child(1) {
  top: 22px;
  left: 20%;
}

.field-layer span:nth-child(2) {
  top: 62px;
  right: 19%;
  width: 22px;
  height: 22px;
}

.field-layer span:nth-child(3) {
  bottom: 17px;
  left: 42%;
  width: 15px;
  height: 15px;
}

.field-layer i {
  position: absolute;
  inset: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
}

.field-layer--b span {
  border-color: var(--violet);
}

.field-mix {
  position: absolute;
  right: 15%;
  bottom: 4px;
  left: 15%;
  z-index: 3;
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.55rem;
}

.field-mix i {
  height: 1px;
  background: linear-gradient(90deg, var(--blue), var(--violet));
}

.field-mix b {
  color: var(--text);
}

/* ---------- Stack / capabilities ---------- */
.stack-section {
  overflow: hidden;
}

.system-map {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.system-map > i {
  width: clamp(30px, 5vw, 80px);
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), var(--primary), var(--line-strong));
}

.system-map__node {
  min-height: 104px;
  display: grid;
  align-content: center;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.system-map__node > span {
  color: var(--primary-strong);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
}

.system-map__node strong {
  margin: 4px 0;
  color: var(--text);
}

.system-map__node small {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.61rem;
}

.system-map__node--core {
  border-color: color-mix(in srgb, var(--primary) 38%, var(--line));
  box-shadow: 0 0 45px var(--primary-soft);
}

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

.capability-card {
  position: relative;
  min-height: 310px;
  display: flex;
  flex-direction: column;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 38%),
    var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition:
    border-color 200ms var(--ease),
    transform 200ms var(--ease),
    background-color 200ms var(--ease);
}

.capability-card::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -30px;
  width: 110px;
  height: 110px;
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow:
    0 0 0 18px transparent,
    0 0 0 19px var(--line),
    0 0 0 38px transparent,
    0 0 0 39px var(--line);
  opacity: 0.42;
}

.capability-card:hover,
.capability-card:focus-within {
  border-color: color-mix(in srgb, var(--primary) 32%, var(--line));
  background-color: var(--surface-hover);
  transform: translateY(-3px);
}

.capability-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 720;
}

.capability-card__top i {
  width: 34px;
  height: 7px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 3px 50%, var(--primary) 0 2px, transparent 3px),
    radial-gradient(circle at 13px 50%, var(--line-strong) 0 2px, transparent 3px),
    radial-gradient(circle at 23px 50%, var(--line-strong) 0 2px, transparent 3px);
}

.capability-card h3 {
  margin-bottom: 13px;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.capability-card p {
  margin-bottom: 22px;
  font-size: 0.88rem;
  line-height: 1.7;
}

.capability-card .chip-list {
  position: relative;
  z-index: 1;
  margin-bottom: 25px;
}

.capability-card__output {
  position: relative;
  z-index: 1;
  margin-top: auto;
  color: var(--primary-strong);
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-weight: 650;
}

/* ---------- Lab ---------- */
.lab-section {
  background:
    radial-gradient(circle at 90% 15%, var(--violet-soft), transparent 28rem),
    linear-gradient(180deg, transparent, var(--surface-soft), transparent);
}

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

.lab-card {
  --project-accent: var(--violet);

  position: relative;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  padding: clamp(25px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0, var(--violet-soft), transparent 22rem),
    var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition:
    transform 200ms var(--ease),
    border-color 200ms var(--ease);
}

.lab-card:hover,
.lab-card:focus-within {
  border-color: color-mix(in srgb, var(--violet) 38%, var(--line));
  transform: translateY(-4px);
}

.lab-card__signal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 26px;
}

.lab-card__signal > span:last-child {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.62rem;
}

.lab-card__icon {
  position: absolute;
  top: 82px;
  right: 30px;
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--violet) 32%, var(--line));
  border-radius: 24px;
  background: var(--violet-soft);
  color: var(--violet);
  font-family: var(--font-mono);
  box-shadow: 0 0 40px var(--violet-soft);
  transform: rotate(4deg);
}

.lab-card__icon--bot span {
  font-weight: 850;
}

.lab-card__icon--music {
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 3px;
  padding: 23px;
}

.lab-card__icon--music span {
  position: absolute;
  top: 7px;
  right: 10px;
}

.lab-card__icon--music i {
  display: block;
  width: 5px;
  border-radius: 999px;
  background: currentColor;
}

.lab-card__icon--music i:nth-of-type(1) {
  height: 20px;
}

.lab-card__icon--music i:nth-of-type(2) {
  height: 38px;
}

.lab-card__icon--music i:nth-of-type(3) {
  height: 28px;
}

.lab-card__icon--music i:nth-of-type(4) {
  height: 45px;
}

.lab-card h3 {
  max-width: calc(100% - 115px);
  margin: 34px 0 18px;
  font-size: clamp(2rem, 3.4vw, 3rem);
}

.lab-card > p {
  max-width: 570px;
  margin-bottom: 15px;
  color: var(--text-soft);
  font-size: 0.96rem;
  line-height: 1.72;
}

.lab-card .lab-card__detail {
  color: var(--muted);
  font-size: 0.82rem;
}

.lab-card .chip-list {
  margin: 10px 0 32px;
}

.text-link {
  --project-accent: var(--violet);
  position: relative;
  align-self: flex-start;
  padding-bottom: 5px;
}

.explorations {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.explorations summary {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 18px 24px;
  cursor: pointer;
  list-style: none;
}

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

.explorations summary > span:first-child {
  display: grid;
}

.explorations summary b {
  color: var(--text);
}

.explorations summary small {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

.explorations__action {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--primary-strong);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.explorations__action i {
  width: 9px;
  height: 9px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 180ms var(--ease);
}

.explorations[open] .explorations__action i {
  transform: rotate(225deg) translate(-2px, -2px);
}

.explorations-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.explorations-grid article {
  min-height: 180px;
  padding: 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.explorations-grid article:nth-child(4n) {
  border-right: 0;
}

.explorations-grid article:nth-last-child(-n + 4) {
  border-bottom: 0;
}

.explorations-grid article > span {
  color: var(--primary-strong);
  font-family: var(--font-mono);
  font-size: 0.58rem;
}

.explorations-grid h3 {
  margin: 24px 0 10px;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.explorations-grid p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.58;
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 19px;
  bottom: 19px;
  left: 187px;
  width: 1px;
  background: linear-gradient(var(--primary), var(--line-strong), var(--violet));
}

.timeline-item {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  min-height: 215px;
}

.timeline-item__rail {
  position: relative;
  padding: 28px 42px 0 0;
  color: var(--primary-strong);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-align: right;
}

.timeline-item__rail i {
  position: absolute;
  top: 32px;
  right: -6px;
  z-index: 2;
  width: 12px;
  height: 12px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 6px var(--primary-soft), 0 0 22px var(--primary);
}

.timeline-item__content {
  margin-left: 42px;
  padding: 26px 0 40px;
  border-bottom: 1px solid var(--line);
}

.timeline-item:last-child .timeline-item__content {
  border-bottom: 0;
}

.timeline-item__type {
  display: block;
  margin-bottom: 9px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-weight: 720;
  text-transform: uppercase;
}

.timeline-item h3 {
  margin-bottom: 11px;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  letter-spacing: -0.03em;
}

.timeline-item p {
  max-width: 770px;
  margin-bottom: 18px;
  font-size: 0.89rem;
  line-height: 1.7;
}

/* ---------- Contact ---------- */
.contact-section {
  overflow: hidden;
  background:
    radial-gradient(circle at 13% 88%, var(--primary-soft), transparent 28rem),
    radial-gradient(circle at 88% 18%, var(--violet-soft), transparent 30rem);
}

.contact-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.7fr);
  align-items: center;
  gap: clamp(45px, 8vw, 110px);
}

.contact-copy h2 {
  max-width: 840px;
  margin: 0 0 26px;
}

.contact-copy h2 span {
  color: var(--primary-strong);
}

.contact-copy > p:not(.section-index):not(.contact-privacy) {
  max-width: 690px;
  margin-bottom: 30px;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.75;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-privacy {
  margin: 18px 0 0;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.67rem;
}

.contact-console {
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--line));
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.04), transparent 30%),
    var(--surface);
  box-shadow: var(--shadow-lg), var(--glow);
  overflow: hidden;
}

.contact-console__bar {
  padding: 0 16px;
}

.contact-console__status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--primary-strong);
}

.contact-console__status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

.contact-console__body {
  padding: 28px;
}

.contact-console__prompt {
  display: block;
  margin-bottom: 23px;
  color: var(--primary-strong);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.contact-console dl {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.contact-console dl > div {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 11px;
  border-bottom: 1px dashed var(--line);
}

.contact-console dt,
.contact-console dd {
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.contact-console dt {
  color: var(--muted-2);
}

.contact-console dd {
  color: var(--text-soft);
  overflow-wrap: anywhere;
}

.contact-console a {
  color: var(--primary-strong);
}

.copy-email {
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.66rem;
}

.clipboard-ready .copy-email {
  display: inline-flex;
}

.copy-email:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
}

.copy-status {
  min-height: 1.4em;
  margin: 9px 0 0;
  color: var(--primary-strong);
  font-family: var(--font-mono);
  font-size: 0.64rem;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 48px 0;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-deep) 86%, transparent);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.3fr) minmax(130px, 0.55fr) minmax(130px, 0.55fr) auto;
  gap: 40px;
  align-items: start;
}

.footer-brand p {
  margin: 15px 0 7px;
  font-size: 0.84rem;
}

.footer-brand > span {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.62rem;
}

.footer-group {
  display: grid;
  align-content: start;
  gap: 7px;
}

.footer-group > span {
  margin-bottom: 6px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.61rem;
  font-weight: 700;
  text-transform: uppercase;
}

.footer-group a {
  justify-self: start;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 640;
}

.footer-group a:hover,
.footer-group a:focus-visible {
  color: var(--primary-strong);
}

.footer-signoff {
  display: flex;
  align-items: center;
  gap: 7px;
  align-self: center;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.57rem;
}

.footer-signoff i {
  width: 15px;
  height: 1px;
  background: var(--line-strong);
}

/* ---------- Command palette ---------- */
.command-palette {
  width: min(calc(100% - 28px), 620px);
  max-height: min(720px, calc(100svh - 40px));
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--text);
  box-shadow: var(--shadow-lg), 0 0 90px var(--primary-soft);
  overflow: hidden;
}

.command-palette::backdrop {
  background: rgba(3, 6, 11, 0.72);
  backdrop-filter: blur(8px);
}

.command-palette__shell {
  max-height: inherit;
  display: flex;
  flex-direction: column;
  padding: 18px;
  background: color-mix(in srgb, var(--surface-solid) 96%, transparent);
}

.command-palette__header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 12px;
  margin-bottom: 16px;
}

.command-palette__prompt {
  color: var(--primary);
  font-family: var(--font-mono);
  font-weight: 800;
}

.command-palette h2 {
  margin: 0 0 4px;
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.command-palette__header p {
  margin: 0;
  font-size: 0.72rem;
}

.command-palette__header button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 1.1rem;
}

.command-palette__search {
  width: 100%;
  min-height: 48px;
  margin-bottom: 12px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--surface-soft);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.77rem;
}

.command-palette__search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.command-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.command-list a {
  display: grid;
  grid-template-columns: 28px minmax(100px, 0.7fr) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 47px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
}

.command-list a:hover,
.command-list a:focus-visible {
  border-color: var(--line);
  background: var(--primary-soft);
}

.command-list span {
  color: var(--primary-strong);
  font-family: var(--font-mono);
  font-size: 0.59rem;
}

.command-list b {
  color: var(--text);
  font-size: 0.77rem;
}

.command-list small {
  color: var(--muted-2);
  font-size: 0.66rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-empty {
  margin: 12px 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  text-align: center;
}

.command-palette__footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.58rem;
}

.command-palette__footer span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.command-palette__footer kbd {
  min-width: 19px;
  padding: 2px 4px;
  text-align: center;
}

/* ---------- Back to top / enhancement animations ---------- */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary) 38%, var(--line));
  border-radius: 50%;
  background: var(--surface-solid);
  color: var(--primary-strong);
  box-shadow: var(--shadow-sm), var(--glow);
  animation: back-to-top-in 220ms var(--ease) both;
}

.back-to-top:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

@keyframes back-to-top-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/*
  Progressive enhancement: .reveal is fully visible by default.
  JavaScript only adds .is-visible to play a short entrance animation.
*/
.reveal {
  opacity: 1;
  transform: none;
}

.reveal.is-visible {
  animation: reveal-in 520ms var(--ease) both;
}

@keyframes reveal-in {
  from {
    opacity: 0.68;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(370px, 0.82fr);
    gap: 42px;
  }

  .command-trigger span {
    display: none;
  }

  .command-trigger {
    padding-left: 9px;
  }

  .project-card__layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  }

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

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

  .explorations-grid article:nth-child(4n) {
    border-right: 1px solid var(--line);
  }

  .explorations-grid article:nth-child(2n) {
    border-right: 0;
  }

  .explorations-grid article:nth-last-child(-n + 4) {
    border-bottom: 1px solid var(--line);
  }

  .explorations-grid article:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .footer-grid {
    grid-template-columns: 1fr 0.5fr 0.5fr;
  }

  .footer-signoff {
    display: none;
  }
}

@media (max-width: 940px) {
  .header-shell {
    flex-wrap: wrap;
    padding-block: 10px;
  }

  .site-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 2px 0 7px;
    scrollbar-width: thin;
  }

  .site-nav a {
    flex: 0 0 auto;
  }

  .menu-ready .header-shell {
    flex-wrap: nowrap;
    padding-block: 0;
  }

  .menu-ready .site-nav {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    left: auto;
    order: initial;
    width: min(340px, calc(100vw - 28px));
    display: none;
    gap: 3px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-solid);
    box-shadow: var(--shadow-lg);
    overflow: visible;
  }

  .menu-ready .site-nav.is-open {
    display: grid;
  }

  .menu-ready .site-nav a {
    padding: 11px 12px;
    border-radius: 8px;
  }

  .menu-ready .site-nav a::after {
    display: none;
  }

  .menu-ready .site-nav a:hover,
  .menu-ready .site-nav a:focus-visible,
  .menu-ready .site-nav a.is-active {
    background: var(--primary-soft);
  }

  .menu-ready .nav-toggle {
    display: inline-flex;
  }

  .hero {
    min-height: auto;
  }

  .hero-system-scene {
    inset: 38% 0 0;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 100%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 100%);
  }

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

  .hero-copy {
    max-width: 820px;
  }

  .runtime-panel {
    width: min(100%, 700px);
  }

  .section-heading {
    grid-template-columns: 1fr;
  }

  .section-heading > p {
    max-width: 680px;
  }

  .project-card {
    grid-column: 1 / -1;
  }

  .project-card__layout {
    grid-template-columns: 1fr;
  }

  .project-card--flagship .project-visual {
    min-height: 490px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .system-map {
    grid-template-columns: 1fr;
  }

  .system-map > i {
    width: 1px;
    height: 22px;
    justify-self: center;
    background: linear-gradient(var(--line-strong), var(--primary), var(--line-strong));
  }

  .contact-shell {
    grid-template-columns: 1fr;
  }

  .contact-console {
    width: min(100%, 640px);
  }
}

@media (max-width: 720px) {
  :root {
    --header-height: 64px;
  }

  .container {
    width: min(calc(100% - 28px), var(--container));
  }

  body::before {
    background-size: 38px 38px;
  }

  .theme-toggle {
    min-width: 40px;
    width: 40px;
    padding: 0;
  }

  .theme-toggle__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .command-trigger {
    display: none !important;
  }

  .hero {
    padding-top: 58px;
    padding-bottom: 40px;
  }

  .hero-grid {
    gap: 32px;
  }

  .hero-lede {
    margin-top: 22px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions .button,
  .contact-actions .button {
    width: 100%;
  }

  .runtime-console {
    padding: 17px;
  }

  .runtime-output {
    gap: 7px;
    margin-block: 18px;
  }

  .runtime-line {
    grid-template-columns: 22px minmax(88px, 1fr) auto;
    min-height: 42px;
  }

  .runtime-line__detail {
    display: none;
  }

  .runtime-panel__footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding-block: 10px;
  }

  .build-loop {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 40px;
  }

  .build-loop ol {
    grid-template-columns: repeat(5, auto);
    justify-content: space-between;
  }

  .build-loop li {
    display: grid;
    gap: 0;
  }

  .build-loop li:not(:last-child)::after {
    display: none;
  }

  .section {
    padding: 88px 0;
  }

  .section-heading {
    margin-bottom: 42px;
  }

  .project-card__header {
    align-items: flex-start;
  }

  .project-card__header > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .project-card__type {
    padding-top: 3px;
    text-align: right;
  }

  .project-card__content {
    padding: 25px 21px 30px;
  }

  .project-card--flagship .project-visual {
    min-height: 440px;
  }

  .trust-orbit {
    width: min(78%, 300px);
  }

  .capability-grid,
  .lab-grid {
    grid-template-columns: 1fr;
  }

  .capability-card {
    min-height: 285px;
  }

  .lab-card {
    min-height: 470px;
  }

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

  .explorations-grid article,
  .explorations-grid article:nth-child(2n),
  .explorations-grid article:nth-child(4n),
  .explorations-grid article:nth-last-child(-n + 2),
  .explorations-grid article:nth-last-child(-n + 4) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .explorations-grid article:last-child {
    border-bottom: 0;
  }

  .timeline::before {
    left: 6px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    padding-left: 30px;
  }

  .timeline-item__rail {
    position: static;
    padding: 0 0 7px;
    text-align: left;
  }

  .timeline-item__rail i {
    top: 4px;
    right: auto;
    left: 0;
  }

  .timeline-item__content {
    margin-left: 0;
    padding: 0 0 38px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px 24px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .back-to-top {
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 779px) {
  .hero-system-scene {
    display: none;
  }
}

@media (max-width: 470px) {
  .brand {
    font-size: 0.82rem;
  }

  .header-actions {
    gap: 5px;
  }

  .hero h1 {
    font-size: clamp(2.7rem, 13vw, 3.2rem);
  }

  .hero {
    padding-top: 52px;
  }

  .hero-grid {
    gap: 27px;
  }

  .hero-kicker {
    line-height: 1.5;
  }

  .hero-lede {
    font-size: 0.98rem;
    line-height: 1.62;
  }

  .hero-note {
    margin-bottom: 23px;
    font-size: 0.84rem;
  }

  .signal-list li {
    font-size: 0.64rem;
  }

  .runtime-panel__bar {
    padding-inline: 12px;
  }

  .runtime-panel__bar > span {
    font-size: 0.59rem;
  }

  .runtime-line {
    gap: 7px;
    min-height: 39px;
    padding-inline: 8px;
    font-size: 0.64rem;
  }

  .runtime-line__status {
    font-size: 0.56rem;
  }

  .runtime-console {
    padding: 14px;
  }

  .runtime-output {
    gap: 5px;
    margin-block: 14px;
  }

  .runtime-panel__footer {
    display: none;
  }

  .build-loop {
    display: none;
  }

  .project-card__header {
    padding-inline: 18px;
  }

  .project-card__type {
    max-width: 100px;
    white-space: normal;
  }

  .project-card--flagship .project-visual {
    min-height: 400px;
  }

  .groove-score,
  .rhythm-sequencer,
  .barcode-scanner,
  .field-compositor {
    width: calc(100% - 24px);
  }

  .rhythm-sequencer {
    padding-inline: 10px;
  }

  .rhythm-sequencer > div {
    grid-template-columns: 42px repeat(7, minmax(0, 1fr));
    gap: 4px;
  }

  .barcode-scanner {
    gap: 10px;
    padding-inline: 15px;
  }

  .barcode-entity {
    gap: 5px;
    padding: 12px;
  }

  .trust-core {
    width: 88px;
    height: 88px;
  }

  .orbit-node {
    font-size: 0.52rem;
  }

  .visual-log {
    display: none;
  }

  .evidence-flow {
    margin-top: 25px;
  }

  .lab-card__icon {
    top: 84px;
    right: 20px;
    width: 70px;
    height: 70px;
  }

  .lab-card h3 {
    max-width: calc(100% - 80px);
    margin-top: 28px;
  }

  .explorations summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .contact-console__body {
    padding: 22px 18px;
  }

  .contact-console dl > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

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

  .footer-brand {
    grid-column: auto;
  }

  .command-palette__shell {
    padding: 13px;
  }

  .command-list a {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .command-list small {
    display: none;
  }
}

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

  .reveal.is-visible {
    animation: none;
  }

  .runtime-line.is-current {
    transform: none;
  }

  .runtime-result i {
    animation-duration: 900ms !important;
    animation-iteration-count: infinite !important;
  }

  .site-nav:not(.is-sequencing):not(.is-sequence-complete) a.is-active::after {
    animation-duration: var(--nav-progress-duration) !important;
    animation-iteration-count: 1 !important;
  }
}

@media (forced-colors: active) {
  .hero-system-scene {
    display: none;
  }

  body,
  .project-card,
  .runtime-panel,
  .capability-card,
  .lab-card,
  .contact-console {
    background: Canvas;
  }

  .status-chip::before,
  .runtime-line__status::before,
  .contact-console__status i,
  .eyebrow__status {
    forced-color-adjust: none;
  }

  .hero h1 span {
    background: none;
    color: LinkText;
  }
}

/* ==========================================================
   V4 / Acid editorial system
   El bloque conserva la base funcional y redefine solo la capa visual.
   ========================================================== */

@font-face {
  font-family: "Barlow Condensed Local";
  src: url("assets/fonts/BarlowCondensed-Light.ttf") format("truetype");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Condensed Local";
  src: url("assets/fonts/BarlowCondensed-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Condensed Local";
  src: url("assets/fonts/BarlowCondensed-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Condensed Local";
  src: url("assets/fonts/BarlowCondensed-Black.ttf") format("truetype");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

:root {
  --bg: #080809;
  --bg-deep: #080809;
  --bg-soft: #0d0d0e;
  --surface: rgba(14, 14, 15, 0.9);
  --surface-solid: #0e0e0f;
  --surface-soft: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.055);
  --text: #e7e4de;
  --text-soft: #cbc8c2;
  --muted: #9b9994;
  --muted-2: #7d7c77;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.18);
  --primary: #c4ff45;
  --primary-strong: #c4ff45;
  --primary-soft: rgba(196, 255, 69, 0.09);
  --primary-ink: #080809;
  --blue: #c4ff45;
  --blue-soft: rgba(196, 255, 69, 0.08);
  --violet: #c4ff45;
  --violet-soft: rgba(196, 255, 69, 0.07);
  --lime: #c4ff45;
  --lime-soft: rgba(196, 255, 69, 0.08);
  --amber: #ffb629;
  --amber-soft: rgba(255, 182, 41, 0.09);
  --shadow-sm: 0 20px 44px rgba(0, 0, 0, 0.22);
  --shadow-lg: 0 34px 90px rgba(0, 0, 0, 0.32);
  --glow: 0 0 70px rgba(196, 255, 69, 0.07);
  --radius-xs: 0;
  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;
  --container: 1400px;
  --header-height: 58px;
  --font-display: "Barlow Condensed Local", "Arial Narrow", Impact, sans-serif;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="light"] {
  --bg: #f4f4ef;
  --bg-deep: #f4f4ef;
  --bg-soft: #ecece6;
  --surface: rgba(244, 244, 239, 0.92);
  --surface-solid: #fbfbf7;
  --surface-soft: rgba(8, 8, 9, 0.035);
  --surface-hover: rgba(8, 8, 9, 0.055);
  --text: #111210;
  --text-soft: #2f302c;
  --muted: #5d5e58;
  --muted-2: #686963;
  --line: rgba(8, 8, 9, 0.1);
  --line-strong: rgba(8, 8, 9, 0.22);
  --primary: #4b7000;
  --primary-strong: #3d5d00;
  --primary-soft: rgba(75, 112, 0, 0.1);
  --primary-ink: #ffffff;
  --blue: #4b7000;
  --blue-soft: rgba(75, 112, 0, 0.08);
  --violet: #4b7000;
  --violet-soft: rgba(75, 112, 0, 0.08);
  --lime: #4b7000;
  --lime-soft: rgba(75, 112, 0, 0.08);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #f4f4ef;
    --bg-deep: #f4f4ef;
    --bg-soft: #ecece6;
    --surface: rgba(244, 244, 239, 0.92);
    --surface-solid: #fbfbf7;
    --surface-soft: rgba(8, 8, 9, 0.035);
    --surface-hover: rgba(8, 8, 9, 0.055);
    --text: #111210;
    --text-soft: #2f302c;
    --muted: #5d5e58;
    --muted-2: #686963;
    --line: rgba(8, 8, 9, 0.1);
    --line-strong: rgba(8, 8, 9, 0.22);
    --primary: #4b7000;
    --primary-strong: #3d5d00;
    --primary-soft: rgba(75, 112, 0, 0.1);
    --primary-ink: #ffffff;
    --blue: #4b7000;
    --blue-soft: rgba(75, 112, 0, 0.08);
    --violet: #4b7000;
    --violet-soft: rgba(75, 112, 0, 0.08);
    --lime: #4b7000;
    --lime-soft: rgba(75, 112, 0, 0.08);
  }
}

html {
  scroll-padding-top: calc(var(--header-height) + 26px);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

body {
  background: var(--bg);
  color: var(--text);
  font-weight: 300;
  letter-spacing: -0.005em;
}

body::before {
  z-index: -2;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--text) 8%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 1;
  mask-image: radial-gradient(ellipse 80% 65% at 50% 18%, #000 28%, transparent 100%);
}

body::after {
  display: none;
}

::selection {
  background: var(--primary);
  color: var(--primary-ink);
}

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border-radius: 0;
  background: var(--line-strong);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.018em;
}

p {
  color: var(--muted);
}

a,
button,
summary {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 5px;
}

.container {
  width: min(calc(100% - clamp(40px, 7vw, 96px)), var(--container));
}

.skip-link {
  border-radius: 0;
  background: var(--primary);
  color: var(--primary-ink);
  font-family: var(--font-mono);
}

.site-header {
  border-bottom: 1px solid transparent;
  background: transparent;
  backdrop-filter: none;
  transition: background-color 240ms ease, border-color 240ms ease, backdrop-filter 240ms ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  box-shadow: none;
  backdrop-filter: blur(14px);
}

.header-shell {
  min-height: var(--header-height);
  gap: 20px;
}

.brand {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.brand__prompt {
  text-shadow: none;
}

.site-nav {
  --nav-progress-duration: 360ms;
  gap: clamp(13px, 1.8vw, 28px);
}

.site-nav a {
  --nav-progress: 0;
  position: relative;
  padding: 19px 0 16px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.025em;
}

.site-nav a > span {
  margin-right: 3px;
  color: var(--muted-2);
  font-size: 0.58rem;
}

.site-nav a::after {
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 0;
  background: var(--primary);
  box-shadow: none;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.is-active,
.site-nav a.is-progressing {
  color: var(--text);
}

.command-trigger,
.theme-toggle,
.nav-toggle {
  min-height: 32px;
  border-radius: 0;
  background: transparent;
}

.command-trigger {
  padding: 0 7px 0 10px;
  font-family: var(--font-mono);
  font-size: 0.61rem;
  font-weight: 400;
}

.command-trigger kbd,
.command-palette kbd {
  border-radius: 0;
  box-shadow: none;
}

.theme-toggle {
  min-width: 75px;
  padding: 0 9px;
  font-family: var(--font-mono);
  font-size: 0.61rem;
  font-weight: 400;
}

.theme-toggle__glyph {
  width: 12px;
  height: 12px;
}

.nav-toggle {
  width: 34px;
  border-radius: 0;
}

.nav-toggle > span,
.nav-toggle > span::before,
.nav-toggle > span::after {
  border-radius: 0;
}

.hero {
  min-height: 100svh;
  padding: clamp(106px, 12vw, 156px) 0 44px;
}

.hero__glow {
  display: none;
}

.hero-system-scene {
  inset: 0 0 0 35%;
  opacity: 0;
  -webkit-mask-image: radial-gradient(ellipse 68% 62% at 66% 45%, #000 8%, rgba(0, 0, 0, 0.6) 46%, transparent 76%);
  mask-image: radial-gradient(ellipse 68% 62% at 66% 45%, #000 8%, rgba(0, 0, 0, 0.6) 46%, transparent 76%);
}

.has-webgl-scene .hero-system-scene {
  opacity: 0.42;
}

html[data-theme="light"].has-webgl-scene .hero-system-scene {
  opacity: 0.25;
}

.hero-grid {
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.38fr);
  gap: clamp(44px, 6vw, 90px);
}

.hero-copy {
  min-width: 0;
}

.eyebrow,
.section-index {
  color: var(--primary);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.13em;
}

.eyebrow {
  margin-bottom: 18px;
  padding-left: 10px;
  border-left: 2px solid var(--primary);
}

.eyebrow__status {
  display: none;
}

.hero-kicker {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: none;
  font-family: var(--font-display);
  font-size: clamp(5.2rem, 13.2vw, 12.8rem);
  font-weight: 900;
  line-height: 0.72;
  letter-spacing: -0.042em;
  text-transform: uppercase;
}

.hero h1 .hero-title__line {
  display: block;
  padding: 0;
  background: none;
  color: var(--text);
}

.hero h1 .hero-title__line--ghost {
  color: color-mix(in srgb, var(--text) 27%, transparent);
  font-weight: 300;
}

.hero-title__cursor {
  display: inline-block;
  width: 0.34em;
  height: 0.62em;
  margin: 0 0 0.03em 0.07em;
  background: var(--primary);
  vertical-align: baseline;
  animation: runtime-cursor-blink 900ms steps(1, end) infinite;
  will-change: opacity;
}

.hero-lede {
  max-width: 620px;
  margin: 38px 0 11px;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.35vw, 1.16rem);
  font-weight: 300;
  line-height: 1.66;
}

.hero-note {
  max-width: 600px;
  margin-bottom: 28px;
  color: var(--muted-2);
  font-size: 0.82rem;
}

.button {
  min-height: 44px;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.button--primary {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: none;
}

.button--primary:hover,
.button--primary:focus-visible {
  background: transparent;
  color: var(--primary);
  transform: none;
  box-shadow: none;
}

.button--secondary {
  background: transparent;
}

.signal-list {
  gap: 5px;
}

.signal-list li,
.chip-list li {
  border-radius: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.61rem;
  font-weight: 400;
}

.signal-list li {
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
}

.signal-list li::before {
  display: none;
}

.runtime-panel {
  border-color: var(--line);
  border-radius: 0;
  background: color-mix(in srgb, var(--surface-solid) 84%, transparent);
  box-shadow: none;
  backdrop-filter: blur(10px);
}

.runtime-panel::before {
  display: none;
}

.runtime-panel__bar,
.project-visual__bar,
.contact-console__bar {
  min-height: 39px;
  font-weight: 400;
}

.window-dots span {
  width: 5px;
  height: 5px;
  border-radius: 0;
  background: var(--line-strong) !important;
}

.runtime-console {
  padding: 21px;
}

.runtime-command,
.runtime-result {
  font-size: 0.66rem;
}

.runtime-output {
  gap: 0;
  margin: 18px 0;
  border-top: 1px solid var(--line);
}

.runtime-line {
  min-height: 39px;
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-size: 0.61rem;
}

.runtime-line.is-current {
  border-bottom-color: color-mix(in srgb, var(--primary) 38%, var(--line));
  background: linear-gradient(90deg, var(--primary-soft), transparent 78%);
  transform: none;
}

.runtime-line__status::before,
.runtime-pulse::before {
  border-radius: 0;
  box-shadow: none;
}

.status-lab {
  color: var(--muted);
}

.runtime-result i {
  width: 6px;
  box-shadow: none;
}

.runtime-panel__footer {
  min-height: 40px;
  font-size: 0.56rem;
}

.build-loop {
  margin-top: clamp(48px, 7vw, 84px);
  padding-top: 18px;
}

.build-loop__label,
.build-loop li,
.build-loop b {
  font-family: var(--font-mono);
  font-weight: 400;
}

.section {
  padding: clamp(96px, 11vw, 164px) 0;
}

.section-heading {
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.4fr);
  gap: clamp(28px, 6vw, 88px);
  margin-bottom: clamp(52px, 7vw, 88px);
}

.section-index {
  margin-bottom: 18px;
  padding-left: 9px;
  border-left: 2px solid var(--primary);
}

.section-heading h2 {
  max-width: 980px;
  font-size: clamp(3.3rem, 7.2vw, 7.2rem);
  font-weight: 700;
  line-height: 0.84;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}

.section-heading > p {
  max-width: 430px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 300;
  line-height: 1.7;
}

.project-grid {
  display: block;
  border-bottom: 1px solid var(--line);
}

.project-card,
.project-card--flagship {
  display: grid;
  grid-template-columns: minmax(170px, 0.52fr) minmax(0, 1.48fr);
  gap: clamp(26px, 5vw, 76px);
  min-height: 0;
  padding: clamp(28px, 4.2vw, 54px) clamp(10px, 1.4vw, 20px);
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  transition: background-color 220ms ease, border-color 220ms ease;
}

.project-card:hover,
.project-card:focus-within {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  box-shadow: none;
  transform: none;
}

.project-card__header {
  grid-column: 1;
  display: block;
  min-width: 0;
}

.project-card__header > div {
  display: block;
}

.project-card__index,
.project-card__type {
  display: block;
  color: var(--muted-2);
  font-size: 0.62rem;
  font-weight: 400;
}

.project-card__type {
  margin-top: 8px;
  color: var(--primary);
}

.project-card h3,
.project-card:not(.project-card--flagship) h3 {
  margin: 12px 0 0;
  font-size: clamp(1.85rem, 3vw, 3rem);
  line-height: 0.98;
}

.project-card__layout {
  display: contents;
}

.project-card__content,
.project-card > .project-card__content {
  grid-column: 2;
  padding: 0;
}

.project-visual {
  display: none;
}

.project-card__summary {
  max-width: 760px;
  margin-bottom: 18px;
  color: var(--text-soft);
  font-size: 0.96rem;
  font-weight: 300;
  line-height: 1.68;
}

.project-card__problem {
  max-width: 760px;
  margin: 0 0 18px;
  padding: 0 0 0 14px;
  border-left: 1px solid var(--line-strong);
}

.project-card__problem > span,
.system-facts b {
  color: var(--muted-2);
  font-size: 0.58rem;
  font-weight: 400;
}

.project-card__problem p,
.system-facts span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 300;
}

.system-facts {
  max-width: 760px;
}

.chip-list {
  gap: 5px;
}

.chip-list li,
.project-card .chip-list li {
  padding: 4px 7px;
  border-color: var(--line);
  color: var(--muted);
}

.project-cta {
  margin-top: 20px;
  color: var(--text);
  font-size: 0.66rem;
  font-weight: 500;
  opacity: 0;
  transform: translateX(-5px);
  transition: color 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.project-card:hover .project-cta,
.project-card:focus-within .project-cta {
  opacity: 1;
  transform: translateX(0);
}

.project-cta::after,
.text-link::after {
  height: 1px;
  background: var(--primary);
}

.system-map {
  display: none;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  border: 0;
  background: var(--line);
}

.capability-card {
  min-height: 258px;
  padding: clamp(22px, 2.2vw, 32px);
  border: 0;
  border-radius: 0;
  background: var(--bg);
  box-shadow: none;
  transition: background-color 220ms ease;
}

.capability-card:hover {
  background: var(--bg-soft);
  box-shadow: none;
  transform: none;
}

.capability-card__top {
  margin-bottom: 28px;
}

.capability-card__top > span,
.capability-card__output {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 400;
}

.capability-card h3 {
  margin-bottom: 12px;
  font-size: 1.45rem;
  line-height: 1;
}

.capability-card p {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 300;
  line-height: 1.65;
}

.capability-card__output {
  color: var(--primary);
}

.lab-section {
  overflow: hidden;
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  background: var(--line);
}

.lab-card {
  position: relative;
  min-height: 380px;
  padding: clamp(28px, 4vw, 50px);
  border: 0;
  border-radius: 0;
  background: var(--bg);
  box-shadow: none;
  overflow: hidden;
}

.lab-card:hover,
.lab-card:focus-within {
  background: var(--bg-soft);
  box-shadow: none;
  transform: none;
}

.lab-card__signal {
  position: relative;
  z-index: 1;
}

.lab-card__signal > span:last-child {
  font-weight: 400;
}

.status-chip {
  border-radius: 0;
  font-weight: 400;
}

.status-chip::before {
  border-radius: 0;
  box-shadow: none;
}

.lab-card__icon {
  position: absolute;
  top: 14px;
  right: 18px;
  width: auto;
  height: auto;
  border: 0;
  background: none;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(5rem, 9vw, 9rem);
  font-weight: 900;
  line-height: 0.8;
  opacity: 0.035;
}

.lab-card__icon--music i,
.lab-card__icon--bot span {
  background: currentColor;
}

.lab-card h3 {
  position: relative;
  z-index: 1;
  margin-top: 68px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 0.95;
}

.lab-card > p,
.lab-card .lab-card__detail,
.lab-card .chip-list,
.lab-card .text-link {
  position: relative;
  z-index: 1;
}

.lab-card > p,
.lab-card .lab-card__detail {
  max-width: 620px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 300;
}

.explorations {
  margin-top: 54px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.explorations summary {
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.explorations summary b,
.explorations summary small,
.explorations__action {
  font-family: var(--font-mono);
  font-weight: 400;
}

.explorations-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  background: var(--line);
}

.explorations-grid article {
  min-height: 150px;
  padding: 22px;
  border: 0;
  background: var(--bg);
}

.explorations-grid article:hover {
  background: var(--bg-soft);
}

.explorations-grid article > span {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.56rem;
}

.explorations-grid h3 {
  margin: 20px 0 8px;
  font-size: 1.28rem;
}

.explorations-grid p {
  font-size: 0.72rem;
  line-height: 1.55;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.timeline::before {
  display: none;
}

.timeline-item {
  display: block;
  min-height: 330px;
  padding: 36px clamp(20px, 2.6vw, 40px);
  border-right: 1px solid var(--line);
}

.timeline-item:last-child {
  border-right: 0;
}

.timeline-item__rail {
  display: block;
  width: auto;
  margin: 0 0 26px;
}

.timeline-item__rail span {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-weight: 400;
}

.timeline-item__rail i {
  display: none;
}

.timeline-item:last-child .timeline-item__rail span {
  color: var(--primary);
}

.timeline-item__content {
  padding: 0;
}

.timeline-item__type {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 400;
}

.timeline-item h3 {
  margin: 13px 0 14px;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.02;
}

.timeline-item p {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 300;
  line-height: 1.65;
}

.contact-section {
  padding: clamp(110px, 14vw, 190px) 0;
}

.contact-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.32fr);
  align-items: end;
  gap: clamp(48px, 8vw, 120px);
}

.contact-copy h2 {
  max-width: 1080px;
  font-size: clamp(3.7rem, 8.8vw, 8.7rem);
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.contact-copy h2 span {
  display: block;
  color: color-mix(in srgb, var(--text) 27%, transparent);
  font-weight: 300;
}

.contact-copy > p:not(.section-index):not(.contact-privacy) {
  max-width: 680px;
  font-size: 0.92rem;
  font-weight: 300;
}

.contact-console {
  border-radius: 0;
  background: var(--surface-solid);
  box-shadow: none;
}

.contact-console__status i {
  border-radius: 0;
  box-shadow: none;
}

.contact-console__body,
.contact-console__body dl,
.contact-console__prompt {
  font-family: var(--font-mono);
}

.copy-email {
  border-radius: 0;
}

.site-footer {
  background: var(--bg);
}

.footer-grid {
  grid-template-columns: minmax(220px, 1fr) minmax(190px, 0.6fr) minmax(150px, 0.45fr) auto;
}

.footer-brand p,
.footer-brand > span,
.footer-group,
.footer-signoff {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 400;
}

.footer-group > span {
  color: var(--primary);
}

.footer-signoff i {
  border-radius: 0;
  background: var(--primary);
}

.command-palette {
  border-radius: 0;
  background: var(--surface-solid);
}

.command-palette::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(7px);
}

.command-palette__search,
.command-list a,
.command-palette__header button {
  border-radius: 0;
}

.command-list a:hover,
.command-list a:focus-visible {
  background: var(--primary-soft);
}

.back-to-top {
  width: 44px;
  height: 44px;
  border-radius: 0;
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: none;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: transparent;
  color: var(--primary);
  transform: none;
}

.reveal.is-visible {
  animation: v4-reveal-in 520ms var(--ease) both;
}

@keyframes v4-reveal-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (hover: none) {
  .project-cta {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1180px) {
  .site-nav {
    gap: 14px;
  }

  .site-nav a {
    font-size: 0.61rem;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
    gap: 34px;
  }

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

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

  .timeline-item:nth-child(2) {
    border-right: 0;
  }

  .timeline-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

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

  .footer-signoff {
    grid-column: 1 / -1;
  }
}

@media (max-width: 940px) {
  .menu-ready .site-nav {
    position: fixed;
    top: var(--header-height);
    right: 0;
    left: 0;
    width: 100%;
    align-items: stretch;
    gap: 0;
    padding: 16px clamp(20px, 5vw, 48px) 28px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    box-shadow: none;
    backdrop-filter: blur(16px);
    overflow-y: auto;
  }

  .menu-ready .site-nav a {
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 700;
    text-transform: uppercase;
  }

  .menu-ready .site-nav a > span {
    display: inline-block;
    min-width: 28px;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    vertical-align: middle;
  }

  .menu-ready .site-nav a::after {
    display: block;
    bottom: -1px;
  }

  .hero {
    padding-top: 112px;
  }

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

  .hero-system-scene {
    inset: 0 0 35% 20%;
  }

  .runtime-panel {
    max-width: 620px;
  }

  .section-heading,
  .contact-shell {
    grid-template-columns: 1fr;
  }

  .section-heading > p {
    max-width: 590px;
  }

  .contact-console {
    max-width: 560px;
  }
}

@media (max-width: 760px) {
  .container {
    width: min(calc(100% - 36px), var(--container));
  }

  .command-trigger,
  .theme-toggle__label {
    display: none !important;
  }

  .theme-toggle {
    min-width: 34px;
    width: 34px;
    padding: 0;
  }

  .hero h1 {
    font-size: clamp(4.2rem, 24vw, 8.2rem);
  }

  .hero-lede {
    margin-top: 30px;
  }

  .runtime-panel {
    display: block;
  }

  .build-loop {
    grid-template-columns: 1fr;
  }

  .build-loop ol {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .build-loop li:not(:last-child)::after {
    display: none;
  }

  .project-card,
  .project-card--flagship {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 30px 4px;
  }

  .project-card__header,
  .project-card__content,
  .project-card > .project-card__content {
    grid-column: 1;
  }

  .project-cta {
    opacity: 1;
    transform: none;
  }

  .lab-grid,
  .timeline {
    grid-template-columns: 1fr;
  }

  .lab-card {
    min-height: 0;
  }

  .timeline-item,
  .timeline-item:nth-child(2) {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .timeline-item:last-child {
    border-bottom: 0;
  }

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

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

  .footer-brand,
  .footer-signoff {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .hero {
    padding-top: 98px;
  }

  .hero h1 {
    font-size: clamp(3.65rem, 23vw, 6.1rem);
  }

  .hero-title__cursor {
    width: 0.28em;
  }

  .hero-actions {
    display: grid;
  }

  .hero-actions .button {
    width: 100%;
  }

  .runtime-console {
    padding: 16px;
  }

  .runtime-line {
    grid-template-columns: 22px minmax(88px, 1fr) auto;
    gap: 7px;
  }

  .runtime-line__detail {
    display: none;
  }

  .section-heading h2 {
    font-size: clamp(2.8rem, 15vw, 4.6rem);
  }

  .capability-grid,
  .explorations-grid {
    grid-template-columns: 1fr;
  }

  .capability-card {
    min-height: 0;
  }

  .contact-copy h2 {
    font-size: clamp(3rem, 16vw, 5rem);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    padding-right: 62px;
  }

  .footer-brand,
  .footer-signoff {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-title__cursor,
  .runtime-result i {
    animation-duration: 900ms !important;
    animation-iteration-count: infinite !important;
  }

  .site-nav:not(.is-sequencing):not(.is-sequence-complete) a.is-active::after {
    animation-duration: var(--nav-progress-duration) !important;
    animation-iteration-count: 1 !important;
  }
}

@media (forced-colors: active) {
  .hero h1 .hero-title__line,
  .hero h1 .hero-title__line--ghost {
    color: CanvasText;
  }

  .hero-title__cursor {
    background: Highlight;
  }
}

/* ==========================================================
   V4.1 / Recuperación de profundidad visual y ajustes de encaje
   ========================================================== */

/* Hero: el runtime necesita una columna real para no cortar estados ni texto. */
@media (min-width: 941px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(400px, 0.55fr);
    gap: clamp(38px, 4.5vw, 68px);
  }

  .runtime-line {
    grid-template-columns: 24px minmax(88px, 0.88fr) minmax(106px, 1fr) minmax(52px, auto);
    gap: 8px;
  }

  .runtime-line__status {
    min-width: 52px;
    white-space: nowrap;
  }
}

/* Proyectos: tres principales apilados; cuatro secundarios en un grid 2x2. */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  border: 0;
  background: var(--line);
}

.project-card,
.project-card--flagship {
  grid-column: auto !important;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  padding: clamp(28px, 3.7vw, 50px);
  border: 0;
  background: var(--bg);
  overflow: hidden;
}

.project-card:nth-child(-n + 3) {
  grid-column: 1 / -1 !important;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.72fr);
  column-gap: clamp(34px, 6vw, 84px);
  row-gap: 30px;
}

.project-card__header {
  grid-column: auto;
}

.project-card:nth-child(-n + 3) > .project-card__header {
  grid-column: 1 / -1;
}

.project-card__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.72fr);
  grid-column: 1 / -1;
  gap: clamp(34px, 6vw, 84px);
  align-items: stretch;
}

.project-card__content,
.project-card > .project-card__content {
  grid-column: auto;
  padding: 0;
}

.project-card:nth-child(3) > .project-card__content {
  grid-column: 1;
  grid-row: 2;
}

.project-card:nth-child(3) > .project-visual {
  grid-column: 2;
  grid-row: 2;
}

.project-visual {
  display: block;
  min-height: 252px;
  margin: 26px 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background-color: var(--bg-soft);
  box-shadow: none;
}

.project-card:nth-child(-n + 3) .project-visual {
  min-height: 340px;
  margin: 0;
}

.project-card:nth-child(n + 4) .project-card__header {
  min-height: 118px;
}

.project-card:nth-child(n + 4) .project-card__summary {
  min-height: 6.5em;
}

.project-card:nth-child(n + 4) .project-card__problem {
  min-height: 7.2em;
}

.project-card:hover,
.project-card:focus-within {
  border-color: transparent;
  background: color-mix(in srgb, var(--bg-soft) 72%, var(--bg));
}

/* Recupera el flujo visual de construcción con la geometría V4. */
.system-map {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 1px;
  margin-bottom: 32px;
  padding: 1px;
  border: 0;
  border-radius: 0;
  background: var(--line);
}

.system-map > i {
  align-self: center;
  width: clamp(30px, 5vw, 82px);
  height: 1px;
  margin: 0 12px;
  background: linear-gradient(90deg, var(--line-strong), var(--primary), var(--line-strong));
}

.system-map__node {
  min-height: 122px;
  padding: clamp(18px, 2.4vw, 30px);
  border: 0;
  border-radius: 0;
  background: var(--bg);
}

.system-map__node > span,
.system-map__node small {
  font-weight: 400;
}

.system-map__node strong {
  margin: 8px 0 5px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1;
}

.system-map__node--core {
  border: 1px solid color-mix(in srgb, var(--primary) 44%, var(--line));
  background: linear-gradient(135deg, var(--primary-soft), var(--bg) 58%);
  box-shadow: none;
}

/* Lab: iconos de sistema visibles, compactos y con acento acid. */
.lab-card__icon {
  position: absolute;
  top: 82px;
  right: 32px;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary) 42%, var(--line));
  border-radius: 0;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  opacity: 1;
  box-shadow: 14px 14px 0 color-mix(in srgb, var(--primary) 5%, transparent);
  transform: rotate(3deg);
}

.lab-card__icon--bot span {
  background: transparent;
  color: inherit;
  font-weight: 850;
}

.lab-card__icon--music {
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 4px;
  padding: 24px;
}

.lab-card__icon--music span {
  position: absolute;
  top: 8px;
  right: 10px;
  background: transparent;
}

.lab-card__icon--music i {
  width: 5px;
  border-radius: 0;
  background: currentColor;
}

.lab-card h3 {
  max-width: calc(100% - 122px);
  margin-top: 72px;
}

/* Exploraciones: el control queda contenido y respira en ambos laterales. */
.explorations {
  width: 100%;
  margin: 54px auto 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg);
  overflow: hidden;
}

.explorations summary {
  min-height: 88px;
  padding: 20px clamp(20px, 2.5vw, 34px);
  border: 0;
  background: var(--bg);
}

.explorations summary > span:first-child,
.explorations__action {
  min-width: 0;
}

.explorations__action {
  flex: 0 0 auto;
}

.explorations-grid {
  border-top: 1px solid var(--line);
}

/* Trayectoria: vuelve a ser una línea temporal vertical y legible. */
.timeline {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 0;
  padding: 0;
  border-top: 0;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 177px;
  display: block;
  width: 1px;
  background: linear-gradient(var(--primary), var(--line-strong) 50%, var(--primary));
}

.timeline-item,
.timeline-item:nth-child(2) {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr);
  min-height: 210px;
  padding: 0;
  border: 0;
}

.timeline-item__rail {
  position: relative;
  width: auto;
  margin: 0;
  padding: 29px 38px 0 0;
  text-align: right;
}

.timeline-item__rail span,
.timeline-item:last-child .timeline-item__rail span {
  color: var(--primary);
  font-weight: 500;
}

.timeline-item__rail i {
  position: absolute;
  top: 33px;
  right: -5px;
  z-index: 2;
  width: 10px;
  height: 10px;
  display: block;
  border: 1px solid var(--primary);
  border-radius: 0;
  background: var(--bg);
  box-shadow: 0 0 0 5px var(--primary-soft);
}

.timeline-item__content {
  margin-left: 38px;
  padding: 27px 0 40px;
  border-bottom: 1px solid var(--line);
}

.timeline-item:last-child .timeline-item__content {
  border-bottom: 0;
}

.timeline-item__type {
  margin-bottom: 10px;
  font-weight: 400;
}

.timeline-item h3 {
  max-width: 820px;
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 3vw, 2.7rem);
}

.timeline-item p {
  max-width: 800px;
  margin-bottom: 18px;
  font-size: 0.86rem;
}

/* Contacto: reserva anchura suficiente y evita partir email/usuario. */
@media (min-width: 941px) {
  .contact-shell {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 0.42fr);
    gap: clamp(44px, 6vw, 84px);
  }
}

.contact-console__body {
  padding: clamp(24px, 3vw, 32px);
}

.contact-console dl > div {
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
}

.contact-console dd {
  min-width: 0;
  overflow-wrap: normal;
  word-break: normal;
}

.contact-console dd a {
  display: inline-block;
  max-width: 100%;
  font-size: clamp(0.58rem, 0.78vw, 0.68rem);
  white-space: nowrap;
}

/* Footer y botón flotante. */
.footer-brand .brand {
  font-size: 1rem;
}

.footer-brand p {
  font-size: 0.7rem;
}

.back-to-top {
  right: 29px;
}

@media (max-width: 940px) {
  .project-card:nth-child(-n + 3),
  .project-card__layout {
    grid-template-columns: 1fr;
  }

  .project-card:nth-child(3) > .project-card__content,
  .project-card:nth-child(3) > .project-visual {
    grid-column: 1;
    grid-row: auto;
  }

  .project-card:nth-child(-n + 3) .project-visual {
    min-height: 300px;
  }

  .contact-console {
    width: min(100%, 560px);
  }
}

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

  .project-card:nth-child(-n + 3) {
    grid-column: 1 !important;
  }

  .project-card:nth-child(n + 4) .project-card__header,
  .project-card:nth-child(n + 4) .project-card__summary,
  .project-card:nth-child(n + 4) .project-card__problem {
    min-height: 0;
  }

  .system-map {
    grid-template-columns: 1fr;
  }

  .system-map > i {
    width: 1px;
    height: 24px;
    margin: 8px auto;
    background: linear-gradient(var(--line-strong), var(--primary), var(--line-strong));
  }

  .timeline::before {
    left: 6px;
  }

  .timeline-item,
  .timeline-item:nth-child(2) {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-left: 30px;
    border: 0;
  }

  .timeline-item__rail {
    position: static;
    padding: 0 0 8px;
    text-align: left;
  }

  .timeline-item__rail i {
    top: 4px;
    right: auto;
    left: 1px;
  }

  .timeline-item__content {
    margin-left: 0;
    padding: 0 0 40px;
  }

  .explorations summary {
    gap: 16px;
  }

  .back-to-top {
    right: 24px;
  }
}

@media (max-width: 480px) {
  .project-card,
  .project-card--flagship {
    padding: 28px 20px;
  }

  .project-visual,
  .project-card:nth-child(-n + 3) .project-visual {
    min-height: 230px;
  }

  .lab-card__icon {
    top: 78px;
    right: 22px;
    width: 78px;
    height: 78px;
  }

  .lab-card h3 {
    max-width: calc(100% - 94px);
  }

  .explorations summary {
    align-items: flex-start;
    padding: 18px;
  }

  .contact-console dl > div {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
  }

  .contact-console dd a {
    font-size: 0.55rem;
  }

  .back-to-top {
    right: 22px;
  }
}
