/* XLABOON / XCN — sober app system
   Night surfaces + light app cards; cyan and orange stay as the brand accents. */

:root {
  --night: #0d1117;
  --night-2: #161b22;
  --night-3: #1f2630;
  --night-line: #2b333e;
  --paper: #f4f7f9;
  --white: #ffffff;
  --line: #e2e8ee;
  --text: #0d1117;
  --muted: #4b5563;
  --muted-dark: #a3adba;

  --cyan: #1ecfe3;
  --cyan-tint: #dcf7fa;
  --teal: #0b6e79;
  --orange: #ff5a12;
  --orange-tint: #fff0e8;
  --orange-ink: #9a3412;
  --ink: #0d1117;

  --f-display: "Anybody", "Archivo", sans-serif;
  --f-ui: "Chakra Petch", "Archivo", sans-serif;
  --f-body: "Archivo", system-ui, sans-serif;

  --gut: clamp(16px, 4vw, 48px);
  --head: 68px;
  --rail: 300px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-io: cubic-bezier(0.77, 0, 0.175, 1);
  --shadow: 0 1px 2px rgba(13, 17, 23, 0.06), 0 8px 24px -12px rgba(13, 17, 23, 0.18);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--head) + 12px);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

::selection { background: var(--cyan); color: var(--night); }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
ul, ol, dl, dd { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
strong, b { font-weight: 600; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -0.2em; }
.ic-lg { width: 1.8rem; height: 1.8rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }
.hero :focus-visible, .section-dark :focus-visible, .contact :focus-visible, .colophon :focus-visible,
.masthead :focus-visible, .menu :focus-visible, .split-supply :focus-visible { outline-color: var(--cyan); }

.skip-link {
  position: fixed; left: 12px; top: 12px; z-index: 100;
  background: var(--cyan); color: var(--night); padding: 10px 16px; border-radius: 999px;
  font-weight: 600; text-decoration: none;
  transform: translateY(-160%); transition: transform 160ms var(--ease-out);
}
.skip-link:focus { transform: none; }

/* ---------- type ---------- */

.h2 {
  font-family: var(--f-display);
  font-weight: 700;
  font-stretch: 106%;
  font-size: clamp(1.9rem, 3.6vw, 3.1rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
}
.h2 em, .hero-title em { font-style: normal; color: var(--teal); }
.hero .hero-title em, .section-dark .h2 em, .contact .h2 em, .split-supply .h2 em { color: var(--cyan); }
.lead { font-size: clamp(1.05rem, 1.3vw, 1.18rem); color: var(--muted); max-width: 56ch; margin-top: 16px; }
.section-dark .lead, .contact .lead { color: var(--muted-dark); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 24px;
  border: 0; border-radius: 999px;
  font-family: var(--f-body); font-weight: 600; font-size: 1rem;
  text-decoration: none; white-space: nowrap;
  transition: background-color 160ms ease, color 160ms ease, transform 120ms var(--ease-out), box-shadow 160ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn .ic { transition: transform 200ms var(--ease-out); }
.btn:hover .ic { transform: translateX(3px); }
.btn:active { transform: scale(0.97); }
.btn-sm { min-height: 42px; padding: 8px 18px; font-size: 0.92rem; }
.btn-primary { background: var(--orange); color: var(--night); }
.btn-primary:hover { background: #ff7336; }
.btn-dark { background: var(--night); color: var(--white); }
.btn-dark:hover { background: var(--night-3); }

/* ---------- glossary terms ---------- */

.term {
  text-decoration: underline dotted;
  text-decoration-color: currentColor;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  border-radius: 4px;
  cursor: help;
  transition: background-color 140ms ease, color 140ms ease;
}
.term:hover, .term.is-on { background: var(--cyan-tint); color: var(--teal); }

/* ---------- masthead ---------- */

.masthead {
  position: sticky; top: 0; z-index: 50;
  height: var(--head);
  background: rgba(13, 17, 23, 0.92);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--night-line);
  color: var(--white);
}
.masthead-inner { height: 100%; display: flex; align-items: center; gap: 28px; padding-inline: var(--gut); }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark { width: 32px; height: 32px; }
.logo-word { font-family: var(--f-display); font-weight: 800; font-stretch: 118%; font-size: 1.2rem; letter-spacing: -0.01em; }
.nav { display: flex; gap: 6px; margin-left: auto; }
.nav a {
  padding: 8px 12px; border-radius: 999px;
  font-size: 0.93rem; font-weight: 500; color: var(--muted-dark); text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease;
}
.nav a:hover { color: var(--white); background: var(--night-3); }
.nav a[aria-current="true"] { color: var(--white); }
.menu-toggle { display: none; }

@media (max-width: 1080px) {
  .nav, .masthead-cta { display: none; }
  .menu-toggle {
    display: inline-grid; place-content: center; gap: 6px;
    margin-left: auto; width: 44px; height: 44px;
    border: 1px solid var(--night-line); border-radius: 999px; background: var(--night-2);
  }
  .menu-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--white); transition: transform 200ms var(--ease-out); }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
}

.menu {
  position: fixed; inset: var(--head) 0 0; z-index: 49;
  background: var(--night); color: var(--white);
  padding: 24px var(--gut) 32px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
  overflow-y: auto;
}
.menu[hidden] { display: none; }
.menu nav { display: flex; flex-direction: column; }
.menu nav a {
  font-family: var(--f-display); font-weight: 700; font-stretch: 106%;
  font-size: clamp(1.6rem, 7vw, 2.2rem); line-height: 1.2; letter-spacing: -0.02em;
  text-decoration: none; padding-block: 12px; border-bottom: 1px solid var(--night-line);
}
.menu .btn { width: 100%; }
.js .menu:not([hidden]) nav a { animation: menu-in 320ms var(--ease-out) backwards; }
.js .menu:not([hidden]) nav a:nth-child(2) { animation-delay: 25ms; }
.js .menu:not([hidden]) nav a:nth-child(3) { animation-delay: 50ms; }
.js .menu:not([hidden]) nav a:nth-child(4) { animation-delay: 75ms; }
.js .menu:not([hidden]) nav a:nth-child(5) { animation-delay: 100ms; }
.js .menu:not([hidden]) nav a:nth-child(6) { animation-delay: 125ms; }
.js .menu:not([hidden]) nav a:nth-child(7) { animation-delay: 150ms; }
@keyframes menu-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- page + rail ---------- */

.page { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1240px) { .page { grid-template-columns: minmax(0, 1fr) var(--rail); } }

/* ---------- hero ---------- */

.hero {
  background: var(--night); color: var(--white);
  padding: clamp(40px, 6vw, 80px) var(--gut) clamp(32px, 4vw, 48px);
  display: flex; flex-direction: column; gap: clamp(36px, 5vw, 56px);
}
@media (min-width: 1080px) { .hero { min-height: calc(100svh - var(--head)); justify-content: center; } }
.hero-inner {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 72px); align-items: center;
}
.hero-title {
  margin-top: 0;
  font-family: var(--f-display); font-weight: 800; font-stretch: 108%;
  font-size: clamp(2.6rem, 6.2vw, 5.6rem); line-height: 0.98; letter-spacing: -0.035em;
}
.hero-lede { margin-top: 22px; font-size: clamp(1.08rem, 1.45vw, 1.25rem); color: var(--muted-dark); max-width: 52ch; }

.quick { margin-top: 32px; max-width: 560px; }
.quick-route {
  border: 0; margin: 0 0 12px; padding: 4px;
  display: inline-grid; grid-template-columns: 1fr 1fr;
  background: var(--night-2); border-radius: 999px; border: 1px solid var(--night-line);
}
.quick-route label { position: relative; display: block; cursor: pointer; }
.quick-route input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.quick-route span {
  display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 6px 18px;
  border-radius: 999px; font-weight: 600; font-size: 0.93rem; color: var(--muted-dark);
  transition: background-color 180ms ease, color 180ms ease;
}
.quick-route label:hover span { color: var(--white); }
.quick-route input:checked + span { background: var(--white); color: var(--night); }
.quick-route input:focus-visible + span { outline: 3px solid var(--cyan); outline-offset: 2px; }
.quick-row {
  display: flex; gap: 8px; padding: 6px;
  background: var(--night-2); border: 1px solid var(--night-line); border-radius: 999px;
  transition: border-color 160ms ease;
}
.quick-row:focus-within { border-color: var(--cyan); }
.quick-row input {
  flex: 1; min-width: 0; min-height: 48px; padding: 8px 18px;
  border: 0; background: transparent; color: var(--white); border-radius: 999px;
}
.quick-row input::placeholder { color: #8b96a5; }
.quick-row input:focus-visible { outline: none; }
.quick-row input[aria-invalid="true"] { color: #ffb4a0; }
.quick-status { margin-top: 12px; font-size: 0.9rem; color: var(--muted-dark); padding-left: 18px; }
.quick-status.is-error { color: #ffb4a0; font-weight: 600; }

/* app preview */
.app { margin: 0; display: grid; justify-items: center; gap: 14px; }
.app-tag {
  font-family: var(--f-ui); font-weight: 600; font-size: 0.75rem; letter-spacing: 0.04em;
  color: var(--muted-dark); padding: 5px 12px; border-radius: 999px; border: 1px dashed var(--night-line);
}
.phone {
  width: min(320px, 82vw); aspect-ratio: 9 / 18.6;
  padding: 10px; border-radius: 46px;
  background: #05070a; border: 1px solid #333c48;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8), inset 0 0 0 2px #1b2028;
}
.js .phone { animation: phone-in 900ms var(--ease-out) backwards 120ms; }
@keyframes phone-in { from { opacity: 0; transform: translateY(24px); } }
.phone-screen {
  height: 100%; border-radius: 37px; overflow: hidden;
  background: var(--paper); color: var(--text);
  padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 12px;
  font-size: 13px; line-height: 1.35;
}
.phone-status { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 12px; padding: 2px 6px 0; }
.phone-notch { width: 78px; height: 22px; border-radius: 999px; background: #05070a; }
.phone-icons { display: flex; gap: 4px; }
.phone-icons .ic { width: 14px; height: 14px; }
.app-head { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.app-hello { font-family: var(--f-display); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.app-badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--orange-tint); color: var(--orange-ink); }
.app-card { background: var(--white); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); }
.app-state { display: flex; gap: 12px; align-items: center; }
.app-state strong { display: block; font-size: 14px; }
.app-state small { color: var(--muted); font-size: 12px; }
.app-state-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--night); color: var(--cyan); }
.app-label { font-weight: 600; font-size: 12px; color: var(--muted); margin-top: 2px; }
.app-rules { list-style: none; background: var(--white); border-radius: 18px; padding: 4px 12px; box-shadow: var(--shadow); }
.app-rules li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.app-rules li:last-child { border-bottom: 0; }
.app-rules .ic { width: 16px; height: 16px; color: var(--teal); }
.app-rules span { flex: 1; font-size: 12.5px; }
.switch { width: 34px; height: 20px; border-radius: 999px; background: #cfd6dd; position: relative; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch.is-on { background: var(--teal); }
.switch.is-on::after { left: 16px; }
.app-meter { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.app-meter div { background: var(--white); border-radius: 16px; padding: 10px 12px; box-shadow: var(--shadow); }
.app-meter span { display: block; font-size: 11px; color: var(--muted); }
.app-meter b { font-family: var(--f-display); font-size: 18px; font-weight: 700; }
.app-cta { margin-top: auto; text-align: center; padding: 12px; border-radius: 999px; background: var(--night); color: var(--white); font-weight: 600; font-size: 13px; }

.facts {
  list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--night-2); border: 1px solid var(--night-line); border-radius: var(--r-lg);
}
.facts li { padding: 18px 22px; display: grid; gap: 4px; }
.facts li + li { border-left: 1px solid var(--night-line); }
.facts span { font-size: 0.85rem; color: var(--muted-dark); }
.facts b { font-family: var(--f-display); font-weight: 700; font-stretch: 104%; font-size: 1.2rem; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 8px; }
.facts b .ic { color: var(--orange); }

@media (max-width: 1079px) {
  .hero-inner { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts li:nth-child(3) { border-left: 0; }
  .facts li:nth-child(n+3) { border-top: 1px solid var(--night-line); }
}
@media (max-width: 560px) {
  .quick-route { display: grid; width: 100%; }
  .quick-row { flex-direction: column; border-radius: var(--r-md); }
  .quick-row input { min-height: 50px; }
  .quick-row .btn { width: 100%; }
  .quick-status { padding-left: 4px; }
  .facts li { padding: 14px 16px; }
  .facts b { font-size: 1.05rem; }
}

/* ---------- sections ---------- */

.section { background: var(--white); }
.section-light { background: var(--paper); }
.section-dark { background: var(--night); color: var(--white); }
.section-inner { padding: clamp(72px, 9vw, 120px) var(--gut); }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 56px); }

.split-head {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(28px, 4vw, 56px); align-items: center;
  margin-bottom: clamp(36px, 5vw, 56px);
}
@media (max-width: 900px) { .split-head { grid-template-columns: 1fr; } }

.media-card {
  position: relative; overflow: hidden;
  background: var(--night); border-radius: var(--r-lg);
}
.halftone { display: block; width: 100%; }
.halftone-rack { height: clamp(260px, 26vw, 380px); }
.halftone-devices { height: clamp(190px, 18vw, 250px); }
.media-tag {
  position: absolute; left: 16px; bottom: 16px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(13, 17, 23, 0.82); color: var(--white);
  font-size: 0.8rem; font-weight: 500;
}

/* cards */
.cards { display: grid; gap: 16px; }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(22px, 2.4vw, 30px);
  display: grid; grid-template-columns: auto 1fr; align-items: center; align-content: start;
  column-gap: 14px; row-gap: 12px;
}
.card > p { grid-column: 1 / -1; }
.section .card { background: var(--paper); border-color: transparent; }
.section-light .card { background: var(--white); border-color: var(--line); }
.card h3 { font-family: var(--f-display); font-weight: 700; font-stretch: 104%; font-size: 1.2rem; line-height: 1.2; letter-spacing: -0.015em; }
.card p { color: var(--muted); font-size: 0.98rem; }
.card-icon {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 50%; background: var(--cyan-tint); color: var(--teal);
}
.card-icon .ic { width: 20px; height: 20px; }
.card-icon-lg { width: 56px; height: 56px; border-radius: 16px; }
.card-icon-lg .ic { width: 26px; height: 26px; }
.section-dark .card.card-dark { background: var(--night-2); border: 1px solid var(--night-line); }
.section-dark .card p { color: var(--muted-dark); }
.section-dark .card-icon { background: rgba(30, 207, 227, 0.12); color: var(--cyan); }
@media (max-width: 1100px) { .cards-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .cards-3, .cards-4 { grid-template-columns: 1fr; } }

.quote {
  margin: clamp(36px, 5vw, 56px) 0 0;
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--r-lg); background: var(--night); color: var(--white);
}
.quote p { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.25rem, 2.2vw, 1.75rem); line-height: 1.3; letter-spacing: -0.015em; max-width: 46ch; }
.quote cite { display: block; margin-top: 14px; font-style: normal; font-size: 0.9rem; color: var(--muted-dark); }

/* tabs */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--paper); border-radius: 999px; border: 1px solid var(--line); }
.tab {
  min-height: 42px; padding: 6px 18px; border: 0; border-radius: 999px; background: transparent;
  font-weight: 600; font-size: 0.93rem; color: var(--muted);
  transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--white); color: var(--text); box-shadow: var(--shadow); }
.tab-panel { padding-top: 24px; }
.tab-panel[hidden] { display: none !important; }
.tab-panel h3 { font-family: var(--f-display); font-weight: 700; font-stretch: 104%; font-size: clamp(1.35rem, 2vw, 1.7rem); letter-spacing: -0.02em; margin-bottom: 10px; }
.tab-panel p { color: var(--muted); max-width: 56ch; }
.js .tab-panel:not([hidden]) { animation: panel-in 240ms var(--ease-out); }
@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chips li { font-size: 0.86rem; font-weight: 500; padding: 6px 12px; border-radius: 999px; background: var(--cyan-tint); color: var(--teal); }

/* arquitectura */
.arch { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.arch-stack { display: grid; gap: 12px; }
.arch-plane {
  display: flex; gap: 16px; align-items: center;
  padding: 18px 20px; border-radius: var(--r-md);
  background: var(--paper); border: 2px solid transparent;
  transition: background-color 240ms ease, border-color 240ms ease, transform 360ms var(--ease-out);
}
.arch-plane b { display: block; font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.arch-plane small { color: var(--muted); font-size: 0.92rem; }
.arch-n {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--white); border: 1px solid var(--line);
  font-family: var(--f-display); font-weight: 700;
}
.arch-stack[data-active="demand"] [data-plane="demand"],
.arch-stack[data-active="control"] [data-plane="control"],
.arch-stack[data-active="supply"] [data-plane="supply"] { background: var(--white); border-color: var(--cyan); box-shadow: var(--shadow); transform: translateX(8px); }
.arch-stack[data-active="demand"] [data-plane="demand"] .arch-n,
.arch-stack[data-active="control"] [data-plane="control"] .arch-n,
.arch-stack[data-active="supply"] [data-plane="supply"] .arch-n { background: var(--night); color: var(--cyan); border-color: var(--night); }
@media (max-width: 900px) { .arch { grid-template-columns: 1fr; } }

/* flujo */
.flow { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 16px; align-items: stretch; }
.frames { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.frame {
  display: grid; align-content: start; gap: 6px; text-align: left;
  min-height: 150px; padding: 18px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md);
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 120ms var(--ease-out);
}
.frame-n {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%;
  background: var(--paper); font-family: var(--f-display); font-weight: 700; font-size: 0.95rem; margin-bottom: 6px;
}
.frame strong { font-size: 1rem; }
.frame small { font-size: 0.9rem; line-height: 1.4; color: var(--muted); }
.frame:hover { border-color: #c8d2dc; }
.frame:active { transform: scale(0.98); }
.frame[aria-pressed="true"] { background: var(--night); color: var(--white); border-color: var(--night); }
.frame[aria-pressed="true"] small { color: var(--muted-dark); }
.frame[aria-pressed="true"] .frame-n { background: var(--orange); color: var(--night); }
.readout {
  display: flex; flex-direction: column; gap: 14px;
  padding: clamp(22px, 2.6vw, 30px); border-radius: var(--r-lg);
  background: var(--night); color: var(--white);
}
.readout-state { font-family: var(--f-ui); font-weight: 600; font-size: 0.82rem; letter-spacing: 0.06em; color: var(--cyan); }
.readout-big { font-family: var(--f-display); font-weight: 700; font-stretch: 104%; font-size: clamp(1.5rem, 2.2vw, 2rem); line-height: 1.1; letter-spacing: -0.02em; }
.readout-bar { height: 8px; border-radius: 999px; background: var(--night-3); margin-top: auto; overflow: hidden; }
.readout-bar span { display: block; height: 100%; width: 16.6%; border-radius: inherit; background: var(--cyan); transition: width 420ms var(--ease-out); }
.readout-note { font-size: 0.95rem; color: var(--muted-dark); }
@media (max-width: 960px) { .flow { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .frames { grid-template-columns: 1fr 1fr; } .frame { min-height: 140px; padding: 14px; } }

/* medición */
.meter { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 16px; align-items: start; }
.meter-explain { display: grid; gap: 16px; }
.neq { display: grid; gap: 8px; padding: clamp(22px, 2.6vw, 30px); border-radius: var(--r-lg); background: var(--night); color: var(--white); }
.neq b { font-family: var(--f-display); font-weight: 800; font-stretch: 110%; font-size: clamp(2rem, 3.4vw, 2.8rem); line-height: 1; letter-spacing: -0.02em; }
.neq b .term:hover { background: rgba(30, 207, 227, 0.14); color: var(--cyan); }
.neq span { color: var(--muted-dark); }
.units { list-style: none; border-radius: var(--r-lg); background: var(--paper); padding: 6px 22px; }
.units li { display: grid; grid-template-columns: 9.5rem 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.units li:last-child { border-bottom: 0; }
.units b { font-family: var(--f-display); font-weight: 700; }
.units span { color: var(--muted); }
.evidence { padding: clamp(22px, 2.6vw, 30px); border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--white); }
.evidence-title { font-family: var(--f-display); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.015em; margin-bottom: 16px; }
.tabs-ladder { display: grid; grid-template-columns: repeat(4, 1fr); border-radius: var(--r-md); }
.tabs-ladder .tab { padding-inline: 6px; font-size: 0.86rem; border-radius: 12px; }
.evidence .tab-panel { display: grid; gap: 12px; justify-items: start; min-height: 140px; }
@media (max-width: 1100px) { .meter { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .units li { grid-template-columns: 1fr; gap: 2px; }
  .tabs-ladder { grid-template-columns: 1fr 1fr; }
}

/* status badges */
.stamp {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  background: var(--cyan-tint); color: var(--teal);
  font-size: 0.82rem; font-weight: 600; white-space: nowrap;
}
.stamp-ghost { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px #c9d2db; }
.stamp-block { background: var(--orange-tint); color: var(--orange-ink); }

/* estado */
.gates { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.gate {
  display: grid; align-content: start; gap: 10px;
  padding: 22px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line);
}
.gate-id {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  background: var(--paper); font-family: var(--f-display); font-weight: 700;
}
.gate h3 { font-family: var(--f-display); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.015em; }
.gate p { color: var(--muted); font-size: 0.96rem; }
.gate .stamp { justify-self: start; margin-top: 4px; }
.gate.is-now { border: 2px solid var(--cyan); }
.gate.is-now .gate-id { background: var(--night); color: var(--cyan); }
.gate.is-blocked { background: var(--paper); border-style: dashed; border-color: #c9d2db; }
.block-note {
  display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start;
  margin-top: 16px; padding: clamp(18px, 2.4vw, 26px);
  border-radius: var(--r-lg); background: var(--orange-tint); color: var(--orange-ink);
}
.block-note p { max-width: 80ch; color: #5c1f0a; }
@media (max-width: 1100px) { .gates { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .gates { grid-template-columns: 1fr; } }

/* para quién */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: clamp(56px, 7vw, 96px) var(--gut); background: var(--white); }
.split-half {
  display: flex; flex-direction: column; align-items: flex-start; gap: 18px;
  padding: clamp(24px, 3vw, 40px); border-radius: var(--r-lg);
}
.split-half > p:not(.fine) { max-width: 46ch; }
.split-supply { background: var(--night); color: var(--white); }
.split-supply > p { color: var(--muted-dark); }
.split-demand { background: var(--paper); }
.split-demand > p { color: var(--muted); }
.media-card-tight { width: 100%; background: transparent; border-radius: 0; margin: -8px 0 4px; }
.ticks { list-style: none; display: grid; gap: 10px; }
.ticks li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: center; }
.ticks li::before {
  content: ""; width: 20px; height: 20px; border-radius: 50%;
  background: var(--cyan) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4L18 8' fill='none' stroke='%230d1117' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.split-demand .ticks li::before { background-color: var(--night); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4L18 8' fill='none' stroke='%231ecfe3' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.fine { font-size: 0.85rem; max-width: 52ch; margin-top: auto; padding-top: 4px; }
.split-supply .fine { color: var(--muted-dark); }
.split-demand .fine { color: var(--muted); }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

/* faq */
.faq { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.accordion { display: grid; gap: 10px; }
.acc-item { border-radius: var(--r-md); background: var(--paper); transition: background-color 180ms ease; }
.acc-item:hover { background: #ecf1f4; }
.acc-item h3 { margin: 0; }
.acc-item button {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  width: 100%; padding: 20px 22px; text-align: left; background: none; border: 0;
  font-family: var(--f-body); font-weight: 600; font-size: 1.05rem; line-height: 1.35;
}
.acc-item button .ic {
  width: 32px; height: 32px; padding: 7px; border-radius: 50%; background: var(--white);
  transition: transform 240ms var(--ease-out), background-color 160ms ease, color 160ms ease;
}
.acc-item button[aria-expanded="true"] .ic { transform: rotate(45deg); background: var(--night); color: var(--white); }
.acc-panel { padding: 0 22px 22px; }
.acc-panel p { max-width: 62ch; color: var(--muted); }
.js .acc-panel:not([hidden]) { animation: panel-in 220ms var(--ease-out); }
@media (max-width: 960px) { .faq { grid-template-columns: 1fr; } }

/* contacto */
.contact { background: var(--night); color: var(--white); }
.contact-inner {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 5vw, 80px);
  padding: clamp(72px, 9vw, 120px) var(--gut);
}
.demo-note { margin-top: 24px; padding: 14px 16px; border-radius: var(--r-md); border: 1px dashed var(--night-line); font-size: 0.92rem; color: var(--muted-dark); max-width: 46ch; }
.demo-note strong { color: var(--white); }
.form { display: grid; gap: 16px; align-content: start; padding: clamp(20px, 2.6vw, 32px); border-radius: var(--r-lg); background: var(--night-2); border: 1px solid var(--night-line); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.9rem; font-weight: 600; }
.opt { font-weight: 400; color: var(--muted-dark); }
.field input, .field textarea, .field select {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1px solid var(--night-line); border-radius: var(--r-sm);
  background: var(--night); color: var(--white); caret-color: var(--cyan);
  transition: border-color 160ms ease;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input::placeholder, .field textarea::placeholder { color: #8b96a5; }
.field input:hover, .field textarea:hover, .field select:hover { border-color: #3b4552; }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(30, 207, 227, 0.22); }
.field [aria-invalid="true"] { border-color: #ff8a65; }
.select { position: relative; }
.select select { appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer; }
.select::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--muted-dark); border-bottom: 2px solid var(--muted-dark);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.field-error { min-height: 1.2em; font-size: 0.85rem; font-weight: 600; color: #ffb4a0; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.form-status { font-size: 0.92rem; color: var(--muted-dark); flex: 1 1 220px; }
.form-status.is-error { color: #ffb4a0; font-weight: 600; }
@media (max-width: 960px) { .contact-inner { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } .form-foot .btn { width: 100%; } }

/* ---------- glossary rail ---------- */

.glossary { background: var(--paper); border-top: 1px solid var(--line); }
.glossary-inner { padding: 48px var(--gut); }
.glossary-title { font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; margin-bottom: 14px; }
.gloss { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.gloss-item {
  display: grid; gap: 6px; align-content: start;
  padding: 14px 16px; border-radius: var(--r-md);
  background: var(--white); border: 1px solid var(--line);
  transition: border-color 180ms ease, box-shadow 180ms ease;
  scroll-margin: 16px;
}
.gloss-item:focus { outline: none; }
.gloss-item dt { font-family: var(--f-display); font-weight: 700; font-size: 1rem; }
.gloss-item dd { font-size: 0.88rem; line-height: 1.45; color: var(--muted); }
.gloss-go {
  justify-self: start; display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.82rem; font-weight: 600; color: var(--teal); text-decoration: none;
}
.gloss-go:hover { text-decoration: underline; text-underline-offset: 3px; }
.gloss-go .ic { width: 0.95em; height: 0.95em; }
.gloss-item.is-on { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-tint); }

@media (min-width: 1240px) {
  .glossary {
    border-top: 0; border-left: 1px solid var(--line);
    position: sticky; top: var(--head);
    height: calc(100svh - var(--head));
    overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: #c9d2db transparent;
  }
  .glossary-inner { padding: 24px 18px 28px; }
  .gloss { grid-template-columns: 1fr; }
}

/* ---------- term popover ---------- */

.term-pop {
  position: fixed; z-index: 60; left: 16px; right: 16px; bottom: 16px;
  max-width: 420px; margin-inline: auto;
  padding: 18px 20px 20px; border-radius: var(--r-md);
  background: var(--white); border: 1px solid var(--line);
  box-shadow: 0 18px 40px -16px rgba(13, 17, 23, 0.45);
  display: grid; gap: 10px;
}
.term-pop[hidden] { display: none; }
.js .term-pop:not([hidden]) { animation: pop-in 200ms var(--ease-out); }
@keyframes pop-in { from { opacity: 0; transform: translateY(12px); } }
.term-pop-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.term-pop-head strong { font-family: var(--f-display); font-weight: 700; font-size: 1.2rem; }
.term-pop-close { width: 38px; height: 38px; display: grid; place-content: center; border: 0; border-radius: 50%; background: var(--paper); }
.term-pop-close:hover { background: var(--line); }
.term-pop p { font-size: 0.95rem; color: var(--muted); }

/* ---------- section swap transition ---------- */

.swap { position: fixed; z-index: 90; inset: 0; overflow: hidden; pointer-events: none; visibility: hidden; }
.swap.is-running { visibility: visible; }
.swap-band {
  position: absolute; top: 0; bottom: 0; left: -25%; width: 150%;
  background: var(--night);
  transform: translateX(-110%) skewX(-8deg);
  display: grid; place-items: center;
}
.swap-word {
  transform: skewX(8deg);
  font-family: var(--f-display); font-weight: 800; font-stretch: 112%;
  font-size: clamp(3rem, 12vw, 9rem); line-height: 1; color: var(--cyan); letter-spacing: -0.03em;
}

/* ---------- footer ---------- */

.colophon { background: var(--night); color: var(--white); border-top: 1px solid var(--night-line); }
.colophon-inner { padding: clamp(40px, 5vw, 64px) var(--gut) 28px; }
.colophon-top { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; }
.colophon-top > p { color: var(--muted-dark); }
.colophon nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.colophon nav a { font-size: 0.92rem; color: var(--muted-dark); text-decoration: none; }
.colophon nav a:hover { color: var(--white); }
.legal { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--night-line); font-size: 0.84rem; color: #8b96a5; max-width: 110ch; }
.legal-credits { margin-top: 8px; padding-top: 0; border-top: 0; }
@media (max-width: 860px) { .colophon-top { grid-template-columns: 1fr; } }

@media print { .masthead, .menu, .swap, .term-pop, .glossary { display: none; } }
