/* ==========================================================================
   Mesquite TV · Landing page
   Mobile-first. Breakpoints: 520px (features 2 col), 860px (hero en
   2 columnas), 920px (features 4 col).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tokens de color · modo claro (por defecto)
   Basados en la paleta de Mesquite Studio (mesquitestudio.mx): verde de marca
   #048C44, escala de verdes suaves y neutros grises.
   -------------------------------------------------------------------------- */
:root {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-alt: #F4FBF6;      /* green-1 */
  --border: #EBEBEB;           /* gray-5 */
  --text: #333333;             /* gray-12 */
  --text-muted: #666666;       /* gray-11 */
  --accent: #048C44;           /* marca / green-9 */
  --accent-mid: #047A3A;       /* green-10 */
  --accent-dark: #036530;      /* green-11 */
  --accent-tint: #E8F6EC;      /* green-2 */
  --sage: #94D1A8;             /* green-5 */
  --sage-tint: #D3EEDB;        /* green-3 */
  --complement: #6EE7A8;       /* menta de acento */
  --complement-dark: #043D1E;  /* green-12 */
  --complement-tint: #F4FBF6;

  /* Derivados */
  --on-accent: #FFFFFF;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(4, 61, 30, .07);
  --shadow-lg: 0 24px 60px rgba(4, 61, 30, .16);
  --nav-bg: rgba(255, 255, 255, .85);
  --danger: #B3402F;

  /* Tipografía y medidas */
  --font-head: "Rubik", Arial, sans-serif;
  --font-body: "IBM Plex Sans", Arial, sans-serif;
  --radius: 14px;
  --radius-sm: 8px;
  --container: 1160px;
  --gutter: 16px;
  --nav-h: 64px;

  color-scheme: light;
}

/* --------------------------------------------------------------------------
   Tokens de color · modo oscuro
   Claro por defecto. Se activa con el botón de tema (data-theme="dark" en <html>).
   -------------------------------------------------------------------------- */
:root[data-theme="dark"] {
  --bg: #0F1512;
  --surface: #151D19;
  --surface-alt: #18231D;
  --border: #26312B;
  --text: #F1F1F1;
  --text-muted: #B3B3B3;
  --accent: #3DBF74;
  --accent-mid: #6EE7A8;
  --accent-dark: #94D1A8;
  --accent-tint: #143222;
  --sage: #5FA87C;
  --sage-tint: #1C2E23;
  --complement: #6EE7A8;
  --complement-dark: #D3EEDB;
  --complement-tint: #121A16;

  --on-accent: #0F1512;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
  --nav-bg: rgba(15, 21, 18, .85);
  --danger: #F08A7A;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }

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

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

@media (min-width: 720px) {
  :root { --gutter: 32px; }
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-mid);
  margin-bottom: 14px;
}

/* --------------------------------------------------------------------------
   Botones
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s;
}
.btn:active { transform: translateY(1px); }

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

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-mid); }

.btn--sm { min-height: 40px; padding: 0 18px; font-size: 15px; }
.btn--block { width: 100%; }

/* --------------------------------------------------------------------------
   Wordmark
   -------------------------------------------------------------------------- */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark__tv { color: var(--accent); }
.wordmark__mark {
  width: 26px;
  height: 20px;
  border-radius: 5px;
  background: var(--accent);
  position: relative;
  flex: none;
}
.wordmark__mark::after {
  /* "pantalla" dentro del logotipo */
  content: "";
  position: absolute;
  inset: 4px 5px 6px;
  border-radius: 2px;
  background: var(--sage-tint);
}

/* --------------------------------------------------------------------------
   Animación de aparición al hacer scroll
   script.js agrega .is-visible al entrar en pantalla y, al terminar, quita
   .reveal para que cada elemento recupere sus propias transiciones (hover).
   Solo aplica con JS activo (.js en <html>).
   -------------------------------------------------------------------------- */
.js .reveal {
  transition:
    opacity .8s ease,
    transform .9s cubic-bezier(.16, 1, .3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
.js .reveal:not(.is-visible) {
  opacity: 0;
  transform: translateY(48px) scale(.97);
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal:not(.is-visible) { opacity: 1; transform: none; }
}

/* ==========================================================================
   1. NAV
   ========================================================================== */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.is-scrolled { border-bottom-color: var(--border); }

.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Botón de tema claro/oscuro (siempre visible) */
.theme-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: auto;
  margin-right: 4px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent-mid); }
.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle__sun { display: block; }
:root[data-theme="dark"] .theme-toggle__moon { display: none; }

/* Botón hamburguesa (solo móvil) */
.nav__toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 10px;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav__toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menú desplegable en móvil */
.nav__menu {
  position: absolute;
  top: var(--nav-h);
  left: 0;
  right: 0;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 12px var(--gutter) 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.nav__menu.is-open { display: flex; }

.nav__menu a:not(.btn) {
  padding: 12px 4px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.nav__menu a:not(.btn):hover { color: var(--accent); }
.nav__menu .btn { margin-top: 8px; }

@media (min-width: 760px) {
  .nav__toggle { display: none; }
  .nav__menu {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 28px;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  .nav__menu { margin-left: auto; }
  .theme-toggle { order: 2; margin-left: 20px; margin-right: 0; }
  .nav__menu a:not(.btn) { padding: 0; font-size: 15px; }
  .nav__menu .btn { margin-top: 0; }
}

/* ==========================================================================
   2. HERO
   ========================================================================== */
.hero {
  padding: calc(var(--nav-h) + 40px) 0 56px;
  background:
    radial-gradient(900px 500px at 85% 10%, var(--accent-tint), transparent 70%),
    radial-gradient(600px 400px at 0% 100%, var(--complement-tint), transparent 70%);
}

.hero__grid {
  display: grid;
  gap: 48px;
  align-items: center;
}

.hero__title {
  font-weight: 900;
  font-size: clamp(2.1rem, 7vw, 3.6rem);
  margin-bottom: 20px;
  text-wrap: balance;
}

.hero__lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 34em;
  margin-bottom: 28px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.hero__actions .btn { flex: 1 1 180px; }

.hero__note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-muted);
}
.dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-tint);
}

@media (min-width: 860px) {
  .hero { padding: calc(var(--nav-h) + 72px) 0 96px; }
  .hero__grid { grid-template-columns: 1.05fr 1fr; gap: 56px; }
  .hero__actions .btn { flex: 0 0 auto; }
}

/* ---- Imagen del hero ---- */
.hero__visual {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.hero__visual img,
.hero__placeholder {
  width: 100%;
  border-radius: var(--radius);
}
.hero__visual img {
  height: auto;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

/* Placeholder: se reemplaza por <img> con la imagen del proyecto */
.hero__placeholder {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  border: 2px dashed var(--accent);
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, var(--sage-tint) 14px 15px),
    var(--surface);
  color: var(--accent-mid);
  font-weight: 500;
  font-size: 15px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   3. BANDA DE ESTADÍSTICAS
   ========================================================================== */
.stats {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats__grid {
  display: grid;
  grid-template-columns: 1fr;
}

.stat {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.stat:last-child { border-bottom: 0; }

.stat__value {
  display: block;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(2rem, 6vw, 2.75rem);
  line-height: 1.1;
  color: var(--accent);
  margin-bottom: 6px;
}
.stat__label {
  color: var(--text-muted);
  max-width: 26em;
}

@media (min-width: 760px) {
  .stats__grid { grid-template-columns: repeat(3, 1fr); }
  .stat {
    padding: 40px 32px;
    border-bottom: 0;
    border-left: 1px solid var(--border);
  }
  .stat:first-child { border-left: 0; padding-left: 0; }
}

/* ==========================================================================
   Secciones genéricas
   ========================================================================== */
.section { padding: 72px 0; }
.section--alt { background: var(--surface-alt); }

.section__head {
  max-width: 640px;
  margin-bottom: 40px;
}
.section__title {
  font-weight: 800;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  margin-bottom: 14px;
  text-wrap: balance;
}
.section__lead {
  color: var(--text-muted);
  font-size: 1.0625rem;
}

@media (min-width: 860px) {
  .section { padding: 104px 0; }
  .section__head { margin-bottom: 56px; }
}

/* ==========================================================================
   4. FUNCIONES
   1 col (<520) → 2 col (520–919) → 4 col (≥920)
   ========================================================================== */
.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 520px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 920px) { .features { grid-template-columns: repeat(4, 1fr); gap: 20px; } }

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.feature:hover {
  border-color: var(--sage);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.feature__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-tint);
  color: var(--accent-mid);
  margin-bottom: 18px;
}
.feature__icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feature__icon .fill { fill: currentColor; }


.feature__title {
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 8px;
}
.feature p {
  color: var(--text-muted);
  font-size: 15px;
}

/* ==========================================================================
   5. GALERÍA
   ========================================================================== */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(2, 1fr); gap: 24px; } }

.shot { margin: 0; }

/* Placeholder: se reemplaza por <img> con la captura real */
.shot__placeholder,
.shot img {
  aspect-ratio: 1272 / 676;
  width: 100%;
  border-radius: var(--radius);
}
.shot img {
  height: auto;
  object-fit: cover;
  object-position: top left;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.shot__placeholder {
  display: grid;
  place-items: center;
  border: 2px dashed var(--accent);
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, var(--sage-tint) 14px 15px),
    var(--surface);
  color: var(--accent-mid);
  font-weight: 500;
  font-size: 15px;
}

.shot figcaption {
  margin-top: 12px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.0625rem;
}

/* ==========================================================================
   6. FOOTER
   ========================================================================== */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 14px;
}
.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (min-width: 760px) {
  .footer__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }
  .footer__inner p:first-of-type { flex: 1; }
}
