/*
 * Sitio público. Marca v2.0.
 *
 * Todos los valores salen de tokens.css, que GENERA design/brand/build.py y
 * copia acá (nunca se edita a mano). Este archivo sólo los aplica: si un color,
 * un tamaño o un radio no está en tokens.css, se agrega en build.py primero.
 * Reglas: design/brand/guidelines.md — lino de fondo, eucalipto para la acción,
 * coral sólo en el punto del logo y las ondas (nunca texto ni aviso), Instrument
 * Sans en 400/500 (nunca bold) e Instrument Serif italic una sola vez por pieza.
 */

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400 500;
  src: url(fonts/instrument-sans-latin-ext-wght-normal.woff2) format('woff2-variations');
  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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400 500;
  src: url(fonts/instrument-sans-latin-wght-normal.woff2) format('woff2-variations');
  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: 'Instrument Serif';
  font-style: italic;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/instrument-serif-latin-ext-400-italic.woff2) format('woff2');
  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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/instrument-serif-latin-400-italic.woff2) format('woff2');
  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;
}

* { box-sizing: border-box; }

/* The success state and the submitted form are toggled via the hidden
   attribute; this must win over any display rule below. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--text-body--line-height);
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  overflow-x: hidden;
}

a { color: var(--accent); }

/* Ondas (guía §7): de fondo en el hero, recortadas por el borde y nunca detrás
   de texto largo. El único punto coral de la pieza es el suyo. */
.ripples {
  position: absolute;
  top: -340px;
  right: -370px;
  width: 520px;
  height: 520px;
  pointer-events: none;
  z-index: 0;
}

/* Header */
.site-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 24px 16px 0;
}

.logo { display: block; line-height: 0; }

.logo img {
  display: block;
  height: 22px;
  width: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-calm), border-color var(--duration-fast) var(--ease-calm), opacity var(--duration-fast) var(--ease-calm);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-outline {
  background: var(--surface);
  color: var(--on-accent-soft);
  border-color: var(--brand-200);
}

.btn-outline:hover { border-color: var(--brand-300); background: var(--brand-50); }

/* Main / hero */
main {
  position: relative;
  z-index: 1;
  padding: 56px 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* El acento emocional: Instrument Serif italic, una sola vez en la pieza. */
.accent {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--accent);
}

.lead {
  margin: 20px auto 0;
  font-size: var(--text-subtitle);
  line-height: var(--text-body--line-height);
  font-weight: 400;
  color: var(--text-muted);
  max-width: 40ch;
  text-wrap: balance;
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 56px;
  padding: 20px 16px 28px;
  text-align: center;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-footer p {
  margin: 0;
  font-size: var(--text-small);
  color: var(--text-faint);
}

.footer-year { display: none; }

/* Instalar (/install): el instructivo que se manda por WhatsApp. Se lee en el
   teléfono, así que es una sola columna alineada a la izquierda. */
main.install {
  align-items: stretch;
  text-align: left;
  max-width: 560px;
  margin: 0 auto;
  padding-top: 40px;
}

.install-intro h1 {
  margin: 0;
  font-size: var(--text-h1);
  line-height: var(--text-h1--line-height);
  letter-spacing: var(--text-h1--letter-spacing);
  font-weight: var(--text-h1--font-weight);
  text-wrap: balance;
}

.install-intro .lead {
  margin: 12px 0 0;
  max-width: none;
}

.picker {
  display: flex;
  gap: 4px;
  margin-top: 32px;
  padding: 4px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.picker button {
  flex: 1;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--text-body);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-calm), color var(--duration-fast) var(--ease-calm);
}

.picker button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--border);
}

.picker button:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* El segundo nivel, adentro de la tarjeta: el navegador. Más chico que el
   del teléfono para que se lea como parte de la guía y no como otra pregunta
   del mismo peso. */
.picker-label {
  margin: 0 0 8px;
  font-size: var(--text-small);
  line-height: var(--text-small--line-height);
  color: var(--text-muted);
}

.picker-sm {
  margin: 0 0 20px;
}

.picker-sm button {
  padding: 8px 10px;
  white-space: nowrap;
  font-size: var(--text-small);
}

/* Sin JavaScript se ven todos los navegadores y el título los separa; con
   JavaScript los separa el selector. */
.browser-title {
  margin: 20px 0 12px;
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--text-muted);
}

.js .browser-title { display: none; }

.guide {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
}

.guide h2 {
  margin: 0 0 16px;
  font-size: var(--text-subtitle);
  line-height: var(--text-subtitle--line-height);
  letter-spacing: var(--text-subtitle--letter-spacing);
  font-weight: var(--text-subtitle--font-weight);
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 40px;
  min-height: 28px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--on-accent-soft);
  font-size: var(--text-small);
  font-weight: 500;
  display: grid;
  place-items: center;
}

.steps p {
  margin: 0;
  padding-top: 2px;
  color: var(--text);
}

/* El nombre de un botón o de un menú tal como aparece en la pantalla. */
.ui {
  font-weight: 500;
  color: var(--on-accent-soft);
}

.step-action {
  margin-top: 12px;
  padding: 12px 20px;
  font-size: var(--text-body);
}

.steps .link-copy {
  margin-top: 8px;
  padding: 10px 14px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  font-family: var(--font-mono);
  font-size: var(--text-small);
  user-select: all;
}

.guide-note {
  margin: 16px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: var(--text-small);
  line-height: var(--text-small--line-height);
  color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ============ Desktop (md: 768px+) ============ */
@media (min-width: 768px) {
  .ripples {
    top: -560px;
    right: -560px;
    width: 1000px;
    height: 1000px;
  }

  .site-header { padding: 32px 64px 0; }

  .logo img { height: 26px; }

  main { padding: 112px 64px 96px; }

  .lead { margin-top: 24px; font-size: var(--text-h3); max-width: 60ch; }

  .site-footer {
    margin-top: 0;
    padding: 24px 64px 32px;
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    text-align: left;
  }

  .footer-year { display: block; }

  main.install { padding: 72px 16px 96px; }
}
