/* Buendía — landing
   Sigue docs/design-system.md v1.0. Papel primero, controles en tinta,
   sólidos planos, grano. Sin gradientes, sin blur, sin glow, sin sombras. */

/* ---------- 1. Tokens ---------- */

:root {
  /* Paleta (design-system §4) */
  --papel: #f6f1e4;
  --tinta: #211d16;
  --tinta-suave: #6f6a5c;
  --brasa: #e25d33;
  --sol: #efb63f;
  --cielo: #5e8fcb;
  --lavanda: #a5a1de;

  /* Derivados */
  --ficha: #fbf7ec;              /* un paso más claro que Papel */
  --hairline: rgba(33, 29, 22, 0.2);
  --borde: var(--tinta);

  /* Layout */
  --wrap: 720px;
  --gutter: 1.5rem;

  /* Tipografía */
  --font-sans: "Outfit", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* ---------- 2. Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

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

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

/* ---------- 3. Grano (design-system §8.2) ---------- */

/* El filtro se define una vez por documento; cualquier <rect> lo referencia. */
.grain-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.grain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: multiply;
  z-index: 0;
}

/* Grano de página: vive DETRÁS del contenido, nunca sobre texto micro. */
.grain-page {
  position: fixed;
  top: 0;
  left: 0;
}

/* Todo el contenido va por encima del grano de página. */
.site-header,
.site-main,
.site-footer {
  position: relative;
  z-index: 1;
}

/* ---------- 4. Layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* padding-block, no el shorthand: .section suele ir junto a .wrap y no debe
   pisarle el gutter horizontal. */
.section {
  padding-block: 4.5rem;
}

.section + .section {
  border-top: 1px solid var(--hairline);
}

@media (max-width: 480px) {
  .section {
    padding-block: 3.25rem;
  }
}

/* ---------- 5. Tipografía (design-system §5) ---------- */

/* Titulares siempre en minúsculas. El copy va en sentence case en el HTML;
   el text-transform es la única línea que hay que tocar para revertirlo. */
.h1,
.h2 {
  text-transform: lowercase;
  font-weight: 400;
  margin: 0;
  letter-spacing: -0.01em;
}

.h1 {
  font-size: clamp(2.15rem, 9vw, 3rem);
  line-height: 1.05;
}

.h2 {
  font-size: clamp(1.5rem, 5.5vw, 1.9rem);
  line-height: 1.15;
}

.h3 {
  font-weight: 500;
  font-size: 1.0625rem;
  margin: 0;
  text-transform: lowercase;
}

/* Gesto de peso: la palabra que importa lleva 500. */
.w500 {
  font-weight: 500;
}

.w300 {
  font-weight: 300;
}

.lede {
  font-size: 1.0625rem;
  color: var(--tinta-suave);
  margin: 1.25rem 0 0;
  max-width: 34em;
}

.caption {
  font-size: 0.8125rem;
  color: var(--tinta-suave);
  line-height: 1.45;
}

/* Micro = Space Mono, mayúsculas, tracking. Nunca frases completas. */
.micro {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--tinta-suave);
}

.eyebrow {
  font-size: 1.0625rem;
  color: var(--tinta-suave);
  margin: 0 0 0.4rem;
}

/* ---------- 6. Marcas de tinta (design-system §7) ---------- */

.mark-arrow {
  color: var(--brasa);
}

.mark-dot {
  color: var(--sol);
}

.mark-chevron {
  color: var(--tinta-suave);
}

.mark-serie {
  font-family: var(--font-mono);
  color: var(--tinta);
}

/* ---------- 7. Logo (design-system §3) ---------- */

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.38em;
  text-decoration: none;
  font-size: 1.6rem;
  line-height: 1;
  white-space: nowrap;
}

/* Sol timbrado: círculo Sol + anillo Brasa completo, desregistrado
   arriba-derecha 9%. El anillo va ENCIMA y nunca se recorta. */
.iso {
  --d: 0.95em;
  position: relative;
  display: inline-block;
  width: var(--d);
  height: var(--d);
  flex: none;
}

.iso-sol,
.iso-anillo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.iso-sol {
  background: var(--sol);
  z-index: 0;
}

/* Trazo 4% del diámetro, con la línea media sobre el diámetro del sol
   (medido contra el brandbook: dx +9%, dy -9% del diámetro). */
.iso-anillo {
  inset: calc(var(--d) * -0.02);
  border: calc(var(--d) * 0.04) solid var(--brasa);
  transform: translate(calc(var(--d) * 0.09), calc(var(--d) * -0.09));
  z-index: 1;
}

.wm {
  letter-spacing: -0.01em;
}

.wm-a {
  font-weight: 300;
}

.wm-b {
  font-weight: 500;
}

.wm-dot {
  font-weight: 500;
  color: var(--brasa);
}

/* Sobre bloques de color el wordmark va siempre en Papel. */
.on-color .lockup,
.on-color .wm {
  color: var(--papel);
}

/* ---------- 8. Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem var(--gutter);
  max-width: var(--wrap);
  margin: 0 auto;
}

.lang {
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--tinta-suave);
  white-space: nowrap;
}

.lang a {
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 1px;
}

.lang a:hover {
  border-bottom-color: var(--tinta);
}

.lang [aria-current="true"] {
  font-weight: 500;
  color: var(--tinta);
}

.lang-sep {
  margin: 0 0.35em;
}

/* Banner de idioma: fino, descartable, nunca redirige solo. */
.lang-banner {
  border-bottom: 1px solid var(--hairline);
  background: var(--papel);
  position: relative;
  z-index: 2;
}

.lang-banner[hidden] {
  display: none;
}

.lang-banner-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0.6rem var(--gutter);
  font-size: 0.8125rem;
}

.lang-banner a {
  text-decoration: none;
  border-bottom: 1px solid var(--tinta);
}

.lang-banner button {
  border: 0;
  background: none;
  color: var(--tinta-suave);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  padding: 0.25rem;
  cursor: pointer;
}

/* ---------- 9. Hero ---------- */

.hero {
  padding-block: 2.5rem 4.5rem;
}

.hero-h1 .rot {
  font-weight: 500;
  transition: opacity 420ms linear;
}

.hero-h1 .rot.is-out {
  opacity: 0;
}

/* ---------- 10. Formulario (controles: siempre tinta sobre papel) ---------- */

.signup {
  margin-top: 2.25rem;
  max-width: 30rem;
}

/* Va dentro del form (que es flex): ocupa la fila completa. */
.signup-label {
  display: block;
  flex: 1 0 100%;
  margin-bottom: -0.05rem;
}

.subscribe-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.subscribe-form input[type="email"] {
  flex: 1 1 13rem;
  min-width: 0;
  font: inherit;
  color: var(--tinta);
  background: var(--papel);
  border: 1px solid var(--borde);
  border-radius: 4px;
  padding: 0.7rem 0.8rem;
}

.subscribe-form input[type="email"]::placeholder {
  color: var(--tinta-suave);
}

.btn {
  font: inherit;
  font-weight: 500;
  color: var(--papel);
  background: var(--tinta);
  border: 1px solid var(--tinta);
  border-radius: 4px;
  padding: 0.7rem 1.3rem;
  cursor: pointer;
  transition: background-color 160ms linear, color 160ms linear;
}

.btn:hover {
  background: var(--papel);
  color: var(--tinta);
}

.btn[disabled] {
  opacity: 0.55;
  cursor: default;
}

.signup-micro {
  margin: 0.7rem 0 0;
}

.signup-success,
.signup-error {
  margin: 0;
  font-size: 1.0625rem;
}

.signup-error {
  color: var(--brasa);
}

.signup-success[hidden],
.signup-error[hidden] {
  display: none;
}

/* Honeypot: fuera de pantalla, nunca visible ni tabulable. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- 11. Patch bay (design-system §8.3) ---------- */

.patchbay {
  margin-top: 2.5rem;
}

.patchbay-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.select-wrap {
  position: relative;
  flex: 1 1 9rem;
  min-width: 0;
}

.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  font: inherit;
  color: var(--tinta);
  background: var(--papel);
  border: 1px solid var(--borde);
  border-radius: 4px;
  padding: 0.7rem 2.1rem 0.7rem 0.8rem;
  cursor: pointer;
}

.select-wrap::after {
  content: "∨";
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tinta-suave);
  font-size: 0.9rem;
  pointer-events: none;
}

/* La única marca grande del sistema. */
.patchbay-arrow {
  color: var(--brasa);
  font-size: 2rem;
  line-height: 1;
  flex: none;
}

.patchbay-out {
  margin: 1.25rem 0 0;
  font-size: 1.0625rem;
  color: var(--tinta-suave);
}

.patchbay-out .w500 {
  color: var(--tinta);
}

/* ---------- 12. La Ficha (design-system §8.1) ---------- */

.ficha {
  background: var(--ficha);
  border: 1px solid var(--tinta);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 2rem;
  max-width: 26rem;
}

.ficha-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.1rem 0.8rem;
  border-bottom: 1px solid var(--tinta);
}

.ficha-title {
  font-weight: 500;
  font-size: 1.0625rem;
}

.ficha-serie {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.ficha-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ficha-rows li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.7rem 1.1rem;
}

.ficha-rows li + li {
  border-top: 1px solid var(--hairline);
}

.ficha-date {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  color: var(--tinta-suave);
  flex: none;
  width: 4.6rem;
}

.ficha-entry {
  font-size: 0.9375rem;
}

.ficha-footer {
  position: relative;
  background: var(--sol);
  border-top: 1px solid var(--tinta);
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.ficha-total {
  position: relative;
  z-index: 1;
  font-weight: 500;
  font-size: 1.25rem;
}

.ficha-stamp {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ficha-caption {
  margin: 1.25rem 0 0;
  max-width: 30em;
}

/* ---------- 13. Cómo funciona ---------- */

.steps {
  list-style: none;
  margin: 2.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 2rem;
}

.step-serie {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  color: var(--tinta-suave);
  display: block;
  margin-bottom: 0.5rem;
}

.step p {
  margin: 0.4rem 0 0;
  color: var(--tinta-suave);
  max-width: 32em;
}

@media (min-width: 620px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
  }
  .step p {
    font-size: 0.9375rem;
  }
}

/* ---------- 14. Banda manifiesto (bloque sólido Cielo) ---------- */

.band {
  position: relative;
  background: var(--cielo);
  color: var(--papel);
  border-top: 1px solid var(--tinta);
  border-bottom: 1px solid var(--tinta);
  padding: 4.5rem 0;
  overflow: hidden;
}

.band-inner {
  position: relative;
  z-index: 1;
}

.band-title {
  margin: 0;
  font-weight: 400;
  font-size: clamp(1.75rem, 6.5vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  max-width: 16em;
}

.band .signup-label,
.band .signup-micro,
.band .caption {
  color: var(--papel);
}

.band .signup-error {
  color: var(--papel);
  font-weight: 500;
}

/* ---------- 15. Footer ---------- */

.site-footer {
  padding: 3rem 0 3.5rem;
}

.footer-lockup {
  font-size: 1.35rem;
}

.footer-meta {
  margin: 1rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--tinta-suave);
}

.footer-meta a {
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
}

.footer-meta a:hover {
  border-bottom-color: var(--tinta);
}

.footer-sep {
  color: var(--hairline);
}

.footer-privacy {
  margin: 1.5rem 0 0;
  max-width: 40em;
}

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