:root {
  --bg: #f7f9f8;
  --surface: #ebf0ee;
  --surface-2: #dde6e3;
  --ink: #06525c;
  --muted: #2f737d;
  --accent: #06525c;
  --accent-ink: #f7f9f8;
  --field: #06525c;
  --field-ink: #f7f9f8;
  --field-soft: #a9cdd1;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);

  --edge: 12px;
  --pad: clamp(24px, 4.4vw, 72px);
  --gap-section: clamp(96px, 12vw, 176px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 400 var(--step-body)/1.5 "Archivo", "Helvetica Neue", Arial, sans-serif;
}
h1, h2 { font-weight: 400; letter-spacing: -0.02em; line-height: 1; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { text-decoration-thickness: 0.16em; }
strong { font-weight: 600; }
img { display: block; max-width: 100%; height: auto; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.etapas :focus-visible, .pie-menu :focus-visible { outline-color: currentColor; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* controls */
.button {
  appearance: none; border: 0; border-radius: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  font: 600 var(--step-body)/1 "Archivo", sans-serif;
  padding: 20px 32px;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease);
}
.button:hover { background: #0a6a76; }
.button:active { transform: translateY(2px) scale(0.985); }
.link-button {
  appearance: none; border: 0; background: none; padding: 0; cursor: pointer; color: inherit;
  font: 600 var(--step-small)/1.2 "Archivo", sans-serif;
  text-decoration: underline; text-underline-offset: 0.18em;
}
.link-button:hover { text-decoration-thickness: 0.16em; }
.link-button:active { transform: translateY(1px); }

/* the split: a reading sheet and a stage that stays */
.split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--edge); padding: var(--edge);
}
.sheet { min-width: 0; padding: 0 var(--pad); background: var(--bg); }
.split-a { grid-template-rows: auto 1fr; row-gap: 0; }
.split-a > .top { grid-column: 1; grid-row: 1; }
.split-a > .sheet { grid-column: 1; grid-row: 2; }
.split-a > .stage { grid-column: 2; grid-row: 1 / span 2; }
.sheet > section { max-width: 34rem; margin-inline: auto; }
.sheet > section + section { margin-top: var(--gap-section); }
.sheet > section:last-child { padding-bottom: var(--gap-section); }

.stage {
  position: sticky; top: var(--edge); align-self: start;
  height: calc(100svh - 2 * var(--edge)); min-height: 420px;
  display: flex; flex-direction: column;
  background: var(--surface-2); overflow: hidden;
}
.stage-view { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.stage-pictures, .stage-live { position: absolute; inset: 0; }
.stage-pictures img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: left top;
  opacity: 0; transition: opacity 1600ms ease;
}
.stage-pictures img.is-on { opacity: 1; }
.stage-pictures img[data-missing] { display: none; }
.stage-live iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--bg); }
.stage-status {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0;
  padding: 16px 20px; background: var(--field); color: var(--field-ink);
  font-size: var(--step-body); line-height: 1.35;
  transform: translateY(100%); transition: transform 240ms var(--ease);
}
.stage-status:not(:empty) { transform: none; }
.stage[data-state="live"] .stage-pictures { visibility: hidden; }
.stage-bar {
  flex: none; min-height: 56px; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap;
  background: var(--bg); font-size: var(--step-small); line-height: 1.3;
}
.stage-file { min-width: 0; overflow-wrap: anywhere; }
.stage-file [data-file-name] { font-weight: 600; }
.stage-huella { color: var(--muted); font-variant-numeric: tabular-nums; }
.stage-tools { display: flex; align-items: center; gap: 20px; flex: none; }

/* the stage, taking the whole window */
.stage.is-full {
  position: fixed; inset: 0; top: 0; height: 100svh; z-index: 20;
}
body.has-full-stage { overflow: hidden; }

/* the paper stage of the second split: the object on a flat field */
.stage-papel .stage-pictures img {
  object-fit: contain; object-position: center;
  padding: clamp(24px, 5vw, 72px) clamp(24px, 5vw, 72px) 0;
}

/* top row and hero, set like a menu card */
.top {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 16px;
  padding: 28px var(--pad) 0; background: var(--bg); font-size: var(--step-small);
}
.top a { text-decoration: none; padding: 8px 0; }
.top a:hover { text-decoration: underline; }
.top a:last-child { text-align: right; }
.top .wordmark { font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.02em; line-height: 1; }

.sheet > .hero {
  max-width: none; text-align: center;
  min-height: calc(100svh - 2 * var(--edge) - 80px);
  padding-top: clamp(64px, 17svh, 200px);
}
.hero h1 { font-size: var(--step-head); }
.hero h1 span { display: block; }
.hero-text { max-width: 40ch; margin: 36px auto 0; }
.hero-action { margin-top: 36px; }
.hero-note { margin-top: 20px; font-size: var(--step-small); color: var(--muted); }

/* index of examples */
.indice h2, .faq h2 { font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; }
.indice > p { margin-top: 16px; }
.indice-lista { list-style: none; margin: 48px 0 0; padding: 0; display: grid; gap: 36px; }
.indice-nombre {
  appearance: none; border: 0; background: none; padding: 0; cursor: pointer; display: block; text-align: left;
  font: 400 var(--step-head)/1.05 "Archivo", sans-serif; letter-spacing: -0.02em;
  color: var(--muted); opacity: 0.62;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease), color 200ms var(--ease);
}
.indice-nombre:hover, .indice-nombre:focus-visible, .indice-nombre.is-on { color: var(--ink); opacity: 1; transform: translateX(8px); }
.indice-nombre:active { transform: translateX(8px) scale(0.99); }
.indice-dato { display: block; margin-top: 10px; font-size: var(--step-small); color: var(--muted); }
.indice-pie { margin-top: 48px; font-size: var(--step-small); color: var(--muted); }

/* "Hoy": one word across the column, then filled bars */
.lista { container-type: inline-size; }
.gigante { font-size: 54cqw; line-height: 0.8; letter-spacing: -0.045em; margin-left: -0.04em; }
.lista-intro { margin: 28px 0 20px; }
.barra { background: var(--surface); margin-top: 6px; }
.barra summary {
  list-style: none; cursor: pointer; min-height: 56px; padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-weight: 600; transition: background-color 160ms var(--ease);
}
.barra summary::-webkit-details-marker { display: none; }
.barra summary:hover { background: var(--surface-2); }
.mas { position: relative; flex: none; width: 16px; height: 16px; }
.mas::before, .mas::after {
  content: ""; position: absolute; left: 0; top: 6px; width: 16px; height: 4px; background: currentColor;
  transition: transform 200ms var(--ease);
}
.mas::after { transform: rotate(90deg); }
.barra[open] .mas::after { transform: rotate(0deg); }
.barra dl { margin: 0; padding: 4px 18px 6px; display: grid; gap: 14px; }
.barra dl div { display: flex; justify-content: space-between; gap: 24px; }
.barra dt { flex: none; max-width: 60%; }
.barra dd { margin: 0; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.barra > p { padding: 14px 18px 20px; font-size: var(--step-small); }
.barra dl:last-child { padding-bottom: 20px; }

/* how an app connects: two fields and one slider, full width */
.etapas { margin: 0 var(--edge); background: var(--bg); position: relative; }
.etapas-campos { display: grid; grid-template-columns: 1fr 1fr; min-height: 70svh; }
.etapas-texto { background: var(--field); color: var(--field-ink); padding: clamp(28px, 5vw, 80px) clamp(24px, 4vw, 64px); }
.etapas-texto h2 { font-size: var(--step-head); max-width: 13ch; min-height: 2em; }
.etapas-nota { margin-top: 32px; max-width: 38ch; color: var(--field-soft); }
.etapas-muestra { display: grid; place-items: center; padding: clamp(28px, 5vw, 80px) 24px; background: var(--surface-2); }
.etapas-control { padding: 28px 28px 32px; }
.etapas-nombres {
  list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr);
  font-size: var(--step-small); color: var(--muted);
}
.etapas-nombres li:nth-child(2) { text-align: center; padding-right: 33%; }
.etapas-nombres li:nth-child(3) { text-align: center; padding-left: 33%; }
.etapas-nombres li:last-child { text-align: right; }
.etapas-nombres li.is-on { color: var(--ink); font-weight: 600; }
.etapas noscript .etapas-nota { color: var(--ink); max-width: none; padding: 0 28px 28px; }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 32px; margin: 0; background: none; cursor: grab;
}
input[type="range"]:active { cursor: grabbing; }
input[type="range"]::-webkit-slider-runnable-track { height: 8px; background: none; }
input[type="range"]::-moz-range-track { height: 8px; background: none; }
.etapas-pista { position: relative; height: 32px; }
.etapas-pista::before, .etapas-pista::after { content: ""; position: absolute; left: 0; top: 12px; height: 8px; }
.etapas-pista::before { right: 0; background: var(--surface-2); }
.etapas-pista::after { width: var(--done, 0%); background: var(--ink); transition: width 200ms var(--ease); }
.etapas-pista input { position: absolute; inset: 0; z-index: 1; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 32px; height: 32px; margin-top: -12px;
  background: var(--bg); border: 8px solid var(--ink); border-radius: 0;
  transition: transform 160ms var(--ease);
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; background: var(--bg); border: 8px solid var(--ink); border-radius: 0;
}
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.12); }

/* fragments of the product, at true size */
.ui {
  width: min(440px, 100%); background: var(--bg); color: var(--ink);
  font-size: 15px; line-height: 1.4; padding: 20px;
  transition: opacity 200ms ease;
}
.ui[hidden] { display: none; }
.ui-titulo { font-weight: 600; font-size: 16px; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ui table { width: 100%; border-collapse: collapse; }
.ui th { text-align: left; font-weight: 400; color: var(--muted); font-size: 13px; padding: 0 8px 8px 0; }
.ui td { padding: 10px 8px 10px 0; border-top: 1px solid var(--surface-2); }
.ui td:last-child, .ui th:last-child { text-align: right; padding-right: 0; }
.ui-boton { display: inline-block; padding: 6px 10px; background: var(--surface); font-weight: 600; font-size: 13px; white-space: nowrap; }
.ui-boton.is-hover { background: var(--ink); color: var(--bg); }
.ui dl { margin: 0; display: grid; gap: 10px; }
.ui dl div { display: flex; justify-content: space-between; gap: 16px; }
.ui dd { margin: 0; text-align: right; color: var(--muted); }
.ui-revision ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ui-revision li { display: flex; align-items: center; gap: 12px; }
.ui-marca { flex: none; width: 14px; height: 14px; background: var(--ink); }
.ui-abierto { padding-bottom: 0; }
.ui-abierto img { width: 100%; height: 300px; object-fit: cover; object-position: center 8%; }

/* questions, as reading text */
.split-b { margin-top: var(--edge); }
.split-b .sheet > section { padding-top: clamp(48px, 9vw, 120px); }
.faq-texto { margin-top: 36px; }
.faq-texto p + p { margin-top: 20px; }
.faq-texto p { break-inside: avoid; }

/* the close */
.pie { display: grid; grid-template-columns: 1fr 1fr; gap: var(--edge); padding: 0 var(--edge) var(--edge); min-height: 100svh; }
.pie-foto { overflow: hidden; background: var(--surface-2); }
.pie-foto img { width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.pie-menu { background: var(--field); color: var(--field-ink); padding: clamp(28px, 5vw, 80px) clamp(24px, 4vw, 64px); display: flex; flex-direction: column; }
.pie-marca { font-weight: 600; font-size: var(--step-lead); letter-spacing: -0.02em; }
.pie-menu ul { list-style: none; margin: clamp(40px, 6vw, 80px) 0 0; padding: 0; display: grid; gap: 22px; }
.pie-menu nav a {
  display: inline-block; text-decoration: none; font-weight: 600;
  font-size: clamp(1.5rem, 2.6vw, 2.6rem); line-height: 1.1; letter-spacing: -0.02em;
  transition: transform 200ms var(--ease), opacity 200ms var(--ease);
}
.pie-menu nav ul:hover a { opacity: 0.6; }
.pie-menu nav ul a:hover, .pie-menu nav a:focus-visible { opacity: 1; transform: translateX(12px); }
.pie-bloques { margin-top: 64px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; font-size: var(--step-small); line-height: 1.5; color: var(--field-soft); }
.pie-bloques strong { color: var(--field-ink); }
.pie-legal { margin-top: auto; padding-top: 48px; font-size: var(--step-small); color: var(--field-soft); max-width: 60ch; }

/* dropping a file anywhere */
body.is-dropping::after {
  content: "Suéltalo para abrirlo"; position: fixed; inset: var(--edge); z-index: 30;
  display: grid; place-items: center; text-align: center; padding: 24px;
  background: var(--field); color: var(--field-ink);
  font-size: var(--step-head); letter-spacing: -0.02em; line-height: 1;
}

/* entrances: only when the script runs, and never left hidden */
.js [data-rise] { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); transition-delay: var(--rise-delay, 0ms); }
.js [data-rise].is-in { opacity: 1; transform: none; }
@keyframes deriva { from { transform: scale(1); } to { transform: scale(1.05); } }
.pie-foto img { animation: deriva 18s ease-in-out infinite alternate; transform-origin: left top; }

@media (max-width: 860px) {
  .split { display: flex; flex-direction: column; gap: 0; }
  .split-a > .top { order: -2; grid-template-columns: auto 1fr auto; padding: 10px 16px 12px; align-items: center; }
  .split-a > .top a:first-child { order: 2; text-align: right; }
  .split-a > .top a:last-child { order: 3; }
  .top .wordmark { font-size: 1.25rem; }
  .stage { order: -1; align-self: stretch; top: var(--edge); height: 40svh; min-height: 260px; z-index: 0; }
  .sheet { position: relative; z-index: 1; padding: 0 16px; }
  .sheet > section { max-width: none; }
  .sheet > .hero { min-height: 0; padding-top: 32px; padding-bottom: 24px; }
  .hero h1 { font-size: 9vw; }
  .hero-text { margin-top: 20px; }
  .hero-action { margin-top: 24px; }
  .hero-action .button { width: 100%; }
  .stage-tools [data-app-name] { display: none; }
  .gigante { font-size: 56cqw; }
  .etapas-campos { grid-template-columns: 1fr; min-height: 0; }
  .etapas-muestra { min-height: 46svh; padding: 28px 16px; }
  .etapas-control { padding: 20px 16px 28px; }
  .etapas-texto { padding: 56px 16px 56px; }
  .etapas-texto h2 { font-size: 9vw; max-width: none; }
  .etapas-nombres { grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: 15px; margin-bottom: 0; }
  .etapas-nombres li:nth-child(n) { text-align: left; padding: 0; }
  input[type="range"]::-webkit-slider-thumb { width: 40px; height: 40px; margin-top: -16px; }
  .split-b .stage { height: 50svh; }
  .pie { grid-template-columns: 1fr; min-height: 0; }
  .pie-foto { height: 50svh; }
  .pie-menu nav a { font-size: 8vw; }
  .pie-bloques { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 1ms !important; animation: none !important; }
  .js [data-rise] { opacity: 1; transform: none; }
}
