@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --esmalte: #f3e9d6;
  --esmalte-hondo: #e8dbc2;
  --rojo: #c8102e;
  --rojo-hondo: #9b0c22;
  --tinta: #2a2521;
  --tinta-suave: #5a4f44;
  --oro: #c9a227;
  --chapa: #8a7a63;

  --frame: clamp(14px, 1.8vw, 26px);
  --pad: clamp(20px, 5vw, 76px);
  --measure: 66ch;

  --display: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  scrollbar-color: var(--rojo) var(--esmalte);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--esmalte);
  color: var(--tinta);
  font: 400 17px/1.62 var(--body);
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
}

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

::selection { background: var(--rojo); color: var(--esmalte); }

:focus-visible {
  outline: 3px solid var(--rojo);
  outline-offset: 3px;
  border-radius: 2px;
}

a { color: inherit; }

/* ---------------------------------------------------------------- cartel -- */

.sign {
  position: relative;
  min-height: 100dvh;
  border: var(--frame) solid var(--rojo);
  background: var(--esmalte);
  animation: settle 560ms cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes settle {
  from { transform: translateY(-16px); }
  to   { transform: translateY(0); }
}

/* filete dorado por dentro del marco rojo */
.sign::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 2px solid var(--oro);
  opacity: .5;
  pointer-events: none;
  z-index: 2;
}

/* grano de esmalte: un SVG de ruido, multiplicado sobre toda la chapa */
.sign::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: .2;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
}

/* esquinas astilladas: chapa al descubierto */
.chip {
  position: absolute;
  z-index: 4;
  background: linear-gradient(150deg, #9b8b71, var(--chapa) 55%, #6f6252);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .28), inset 0 -2px 4px rgba(0, 0, 0, .35);
  pointer-events: none;
}
.chip--a { width: 58px; height: 21px; top: calc(var(--frame) * -1); left: 21%;
  clip-path: polygon(0 0, 100% 0, 96% 58%, 84% 100%, 70% 62%, 55% 92%, 41% 54%, 26% 86%, 12% 56%, 0 74%); }
.chip--b { width: 34px; height: 15px; bottom: calc(var(--frame) * -1); right: 27%;
  clip-path: polygon(0 100%, 100% 100%, 94% 44%, 78% 0, 62% 46%, 44% 8%, 27% 52%, 12% 18%, 0 60%); }
.chip--c { width: 19px; height: 22px; top: 34%; right: calc(var(--frame) * -1);
  clip-path: polygon(100% 0, 100% 100%, 58% 92%, 0 78%, 46% 62%, 6% 48%, 52% 32%, 10% 16%, 60% 6%); }
.chip--d { width: 24px; height: 16px; bottom: 22%; left: calc(var(--frame) * -1);
  clip-path: polygon(0 0, 0 100%, 44% 94%, 100% 76%, 54% 60%, 96% 44%, 48% 28%, 92% 12%, 40% 4%); }

.screw {
  position: absolute;
  z-index: 4;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #f0e7d2, #b6a88d 58%, #7a6d5c 100%);
  box-shadow: 0 1px 2px rgba(30, 20, 10, .45), inset 0 -1px 1px rgba(0, 0, 0, .35);
  pointer-events: none;
}
.screw::after {
  content: "";
  position: absolute; left: 3px; right: 3px; top: 50%; height: 1.5px;
  background: rgba(40, 30, 20, .55);
  transform: rotate(-28deg);
}
.screw--tl { top: 26px; left: 26px; }
.screw--tr { top: 26px; right: 26px; }

/* ------------------------------------------------------------- portada -- */

/* La portada es un escenario, no una columna: el canvas sangra hasta el marco
   rojo y se queda con todo el alto que sobra. Las filas de texto no se estiran. */
.masthead {
  position: relative;
  z-index: 1;
  min-height: calc(100dvh - 2 * var(--frame));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(4px, .7vh, 10px);
  padding: clamp(14px, 2.2vh, 26px) var(--pad) clamp(12px, 1.8vh, 20px);
  text-align: center;
}
.masthead > * { flex: 0 0 auto; }

.wordmark {
  width: min(30dvh, 360px, 84%);
  aspect-ratio: 1400 / 599;
  margin: 0;
  background: var(--rojo);
  -webkit-mask: url("assets/logotipo.png") center / contain no-repeat;
  mask: url("assets/logotipo.png") center / contain no-repeat;
  filter: drop-shadow(0 3px 0 rgba(120, 12, 22, .16));
  animation: paint 620ms cubic-bezier(.16, 1, .3, 1) 90ms both;
}

@keyframes paint {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.flavor {
  margin: 0;
  font-size: clamp(12px, 1.1vw, 15px);
  font-weight: 600;
  letter-spacing: .4em;
  text-transform: uppercase;
  text-indent: .4em;
  color: var(--tinta);
}

.rule {
  width: min(520px, 58%);
  height: 3px;
  background: var(--rojo);
  margin: 0;
}

/* Escenario a sangre: ocupa todo el ancho útil del cartel y el alto que queda
   entre el wordmark y el tablero de controles. */
.stage {
  position: relative;
  flex: 1 1 auto;
  align-self: stretch;
  min-height: 190px;
  margin-inline: calc(-1 * var(--pad));
  margin-block: clamp(6px, 1.2vh, 14px) 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-block: 1px solid rgba(201, 162, 39, .55);
  background:
    linear-gradient(180deg, #ecdfc4 0%, #f3e9d6 26%, #f8f0e1 62%, #e9dabc 100%);
  animation: ring 700ms cubic-bezier(.16, 1, .3, 1) 150ms both;
}

/* Halo de esmalte detrás de la lata: da profundidad de vitrina sin dibujar un
   piso, que a este ancho se leería como una mesa infinita. */
.diorama {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  background:
    radial-gradient(56% 72% at 50% 47%,
      rgba(255, 255, 255, .94) 0%,
      rgba(253, 248, 236, .6) 36%,
      rgba(243, 233, 214, 0) 74%);
}

@keyframes ring {
  from { opacity: 0; transform: scale(.985); }
  to   { opacity: 1; transform: scale(1); }
}

.can-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: pan-y;
  opacity: 0;
}
.can-canvas[data-ready="true"] { opacity: 1; }
.can-canvas:active { cursor: grabbing; }

.stage-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--tinta-suave);
  pointer-events: none;
}
.stage-status[data-error="true"] {
  inset: 24% 16%;
  font-size: 13.5px;
  letter-spacing: .02em;
  text-transform: none;
  line-height: 1.5;
  color: var(--rojo-hondo);
}
.stage-status[hidden] { display: none; }

/* sello nutricional: pegado al escenario, arriba a la derecha */
.badge {
  position: absolute;
  top: clamp(14px, 3.4%, 40px);
  right: clamp(16px, 3.4vw, 52px);
  width: clamp(84px, 7.4vw, 112px);
  aspect-ratio: 1;
  display: grid;
  align-content: center;
  gap: 1px;
  border-radius: 50%;
  background: var(--rojo);
  color: var(--esmalte);
  font-size: clamp(10.5px, .78vw, 11px);
  letter-spacing: .12em;
  text-transform: uppercase;
  box-shadow: 0 10px 22px -12px rgba(90, 10, 22, .6);
}
.badge b {
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
}

.sign-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(18px, 3.4vw, 56px);
  font-size: 13.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.sign-nav a {
  padding: 6px 2px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 180ms ease, color 180ms ease;
}
.sign-nav a:hover { color: var(--rojo-hondo); border-bottom-color: var(--rojo-hondo); }

/* ------------------------------------------------------- controles del 3D -- */
/* Tablero de esmalte: botones chatos con borde de tinta, como las teclas de
   una máquina expendedora vieja. El activo se llena de rojo. */

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 8px;
  margin: 0;
}
.controls[hidden] { display: none; }

.ctl-group {
  display: flex;
  gap: 6px;
}

.ctl-rule {
  width: 1px;
  height: 24px;
  margin: 0 4px;
  background: rgba(42, 37, 33, .26);
}

.controls button {
  min-height: 44px;
  min-width: 44px;
  padding: 0 13px;
  font: 600 11.5px/1 var(--body);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tinta);
  background: transparent;
  border: 1.5px solid rgba(42, 37, 33, .42);
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.controls button:hover {
  border-color: var(--tinta);
  background: rgba(42, 37, 33, .07);
}
.controls button[aria-pressed="true"] {
  background: var(--rojo);
  border-color: var(--rojo);
  color: var(--esmalte);
}
.controls button[aria-pressed="true"]:hover {
  background: var(--rojo-hondo);
  border-color: var(--rojo-hondo);
}

.controls .ctl-icon {
  padding: 0;
  font-size: 16px;
  letter-spacing: 0;
  line-height: 1;
}

/* El giro automático no es "dónde estás" sino "esto está encendido": se marca
   con borde y letra roja, sin relleno, para no competir con la vista activa. */
.controls .ctl-spin {
  padding: 0 16px;
}
.controls .ctl-spin[aria-pressed="true"] {
  background: transparent;
  border-color: var(--rojo);
  color: var(--rojo-hondo);
  box-shadow: inset 0 0 0 1px rgba(200, 16, 46, .28);
}
.controls .ctl-spin[aria-pressed="true"]:hover {
  background: rgba(200, 16, 46, .06);
  border-color: var(--rojo-hondo);
  color: var(--rojo-hondo);
}

.drag-hint {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 13.5px;
  letter-spacing: .04em;
  color: var(--tinta-suave);
  transition: opacity 400ms ease;
}
.drag-hint[data-used="true"] { opacity: .42; }

.drag-arrow {
  position: relative;
  width: 42px;
  height: 2px;
  background: currentColor;
}
.drag-arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: -4px;
  width: 9px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.maker-line {
  margin: 0;
  font-size: 12px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--tinta-suave);
}

/* -------------------------------------------------------------- placas -- */

.plate {
  position: relative;
  z-index: 1;
  padding: clamp(56px, 8vw, 118px) var(--pad);
  border-top: 2px solid rgba(201, 162, 39, .5);
}

.plate--specs { background: var(--esmalte); }
.plate--process { background: var(--esmalte-hondo); padding-top: 0; }
.plate--data { background: var(--esmalte); }

.plate-head h2,
.band h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(28px, 3.6vw, 52px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.01em;
  text-transform: uppercase;
}

.plate-head h2::after {
  content: "";
  display: block;
  width: 62px;
  height: 4px;
  margin-top: 16px;
  background: var(--rojo);
}

.lede {
  margin: clamp(22px, 3vw, 34px) 0 0;
  max-width: var(--measure);
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.55;
}

.specs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: clamp(34px, 4.6vw, 56px) 0 0;
  border-top: 2px solid var(--oro);
  border-bottom: 2px solid var(--oro);
}

.spec {
  padding: clamp(18px, 2.4vw, 30px) clamp(12px, 1.8vw, 26px);
  border-left: 1px solid rgba(201, 162, 39, .55);
}
.spec:first-child { border-left: 0; padding-left: 0; }

.spec dt {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--tinta-suave);
}

.spec dd {
  margin: 8px 0 0;
  font-size: clamp(30px, 3.8vw, 50px);
  font-weight: 800;
  line-height: .95;
  letter-spacing: -.03em;
}
.spec dd small {
  font-size: max(.36em, 11px);
  font-weight: 600;
  letter-spacing: .02em;
}
.spec .spec-word {
  font-size: clamp(19px, 1.9vw, 26px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.fineprint {
  margin: clamp(20px, 2.6vw, 30px) 0 0;
  max-width: var(--measure);
  font-size: 14.5px;
  color: var(--tinta-suave);
}

/* -------------------------------------------------------------- proceso -- */

.band {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  margin: 0 calc(-1 * var(--pad));
  padding: clamp(22px, 3vw, 36px) var(--pad);
  background: var(--rojo);
  color: var(--esmalte);
}
.band h2 { color: var(--esmalte); }
.band-note {
  margin: 0;
  font-size: 12.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--esmalte);
}

.steps {
  list-style: none;
  margin: clamp(34px, 4.6vw, 54px) 0 0;
  padding: 0;
  counter-reset: step;
  max-width: 96ch;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: minmax(52px, 104px) minmax(0, 1fr);
  gap: clamp(14px, 2.6vw, 40px);
  padding: clamp(22px, 3vw, 34px) 0;
  border-bottom: 1px solid rgba(42, 37, 33, .16);
}
.steps li:first-child { border-top: 1px solid rgba(42, 37, 33, .16); }

.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 800;
  line-height: .9;
  letter-spacing: -.03em;
  color: var(--rojo);
}

.steps h3 {
  margin: 0;
  font-size: clamp(19px, 2.1vw, 26px);
  font-weight: 700;
  letter-spacing: -.01em;
}
.steps p {
  margin: 8px 0 0;
  max-width: 62ch;
}
.steps b { font-weight: 700; }

/* ---------------------------------------------------------------- datos -- */

.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(28px, 4vw, 64px);
  margin-top: clamp(28px, 4vw, 44px);
}
.data-grid h3 {
  margin: 0 0 10px;
  font-size: clamp(17px, 1.6vw, 20px);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.data-grid p { margin: 0 0 12px; max-width: 54ch; }

/* Los enlaces de vista van en el texto como una tecla más del tablero. */
.data-grid code {
  padding: 1px 5px;
  font: 600 .9em/1 ui-monospace, "Cascadia Mono", Menlo, monospace;
  letter-spacing: .02em;
  border: 1px solid rgba(42, 37, 33, .3);
  border-radius: 2px;
  background: rgba(255, 255, 255, .4);
}

.disclosure {
  margin: clamp(34px, 4.4vw, 54px) 0 0;
  max-width: 82ch;
  padding: clamp(18px, 2.4vw, 28px) clamp(20px, 2.6vw, 32px);
  border: 2px solid var(--oro);
  font-size: 15px;
  line-height: 1.6;
  background: rgba(255, 255, 255, .28);
}
.disclosure b {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------ pie -- */

.foot {
  position: relative;
  z-index: 1;
  padding: clamp(40px, 5.6vw, 72px) var(--pad) clamp(30px, 4vw, 46px);
  background: var(--esmalte-hondo);
  border-top: 2px solid rgba(201, 162, 39, .5);
}
.foot-note { margin: 0; max-width: 58ch; font-size: 15px; }
.foot-legal {
  margin: 14px 0 0;
  max-width: 84ch;
  font-size: 13px;
  line-height: 1.6;
  color: var(--tinta-suave);
}
.credit {
  margin: clamp(26px, 3.4vw, 40px) 0 0;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .04em;
}

/* ------------------------------------------------------------ pantallas -- */

@media (max-width: 1080px) {
  /* Debajo de 1080 el sello baja al pie del escenario, dentro del ancho: con
     el canvas a sangre, un sello mordiendo el borde queda cortado. */
  .badge {
    top: auto;
    right: clamp(12px, 2.4vw, 24px);
    bottom: clamp(12px, 2.4vh, 22px);
    width: 78px;
    padding: 0;
    font-size: 9.5px;
    box-shadow: 0 6px 14px -8px rgba(90, 10, 22, .55);
  }
  .badge b { font-size: 21px; }
}

@media (max-width: 900px) {
  body { font-size: 16px; }
  .specs { grid-template-columns: repeat(2, 1fr); }
  .spec { border-left: 0; padding-left: 0; }
  .spec:nth-child(odd) { padding-right: 12px; }
  .spec:nth-child(even) { padding-left: 16px; border-left: 1px solid rgba(201, 162, 39, .55); }
  .spec:nth-child(n + 3) { border-top: 1px solid rgba(201, 162, 39, .55); }
  .steps li { grid-template-columns: 44px minmax(0, 1fr); }
  .maker-line { display: none; }
  .wordmark { width: min(26dvh, 300px, 78%); }
}

@media (max-width: 560px) {
  .wordmark { width: min(24dvh, 250px, 72%); }
  .flavor { letter-spacing: .34em; text-indent: .34em; }
  .sign::before { inset: 8px; }
  .chip--a { left: 12%; }
  /* Arriba el sello cae en el aire, al lado del hombro de la lata; abajo
     taparía el sello nutricional de la propia etiqueta. */
  .badge {
    top: 12px;
    right: 10px;
    bottom: auto;
    width: 66px;
    font-size: 8.5px;
  }
  .badge b { font-size: 18px; }
  /* Los separadores del tablero quedan huérfanos cuando los botones pasan a
     dos filas: en pantalla chica se sacan y manda el espacio. */
  .ctl-rule { display: none; }
  .controls { gap: 10px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
  }
}
