/*! KairSun Web — wave 2026-10-08 · correcciones visuales/layout/motion auditadas.
 * Cargar AL FINAL del <head> (después de ks-nav-v2.css). Gana la cascada.
 * Alcance: home. No toca marcadores de deploy ni JS/HTML. */

/* 01 · spine vertical global fuera */
main.story::before,
main.story::after {
  content: none !important;
}

/* 02 · ancho útil ultrawide */
@media (min-width: 1440px) {
  :root {
    --max: clamp(1280px, 84vw, 1720px);
  }
}
@media (min-width: 2000px) {
  :root {
    --max: 1720px;
  }
}

/* 03 · hero ≥1440 */
@media (min-width: 1440px) {
  main.story > .hero.ks-hero {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: clamp(48px, 4.5vw, 88px);
    padding-block: 64px 56px;
    min-height: clamp(620px, 66vh, 720px) !important;
    align-items: center;
  }
  main.story > .hero.ks-hero h1 {
    font-size: clamp(3.4rem, 2vw + 1.7rem, 4.75rem);
  }
  main.story > .hero.ks-hero .lead {
    max-width: 46ch;
  }
  main.story > .hero.ks-hero .hero-visual {
    min-height: clamp(440px, 40vw, 540px);
  }
  main.story > .hero.ks-hero .fox-stage {
    width: clamp(360px, 26vw, 500px);
  }
}

/* 04 · videos en grilla 3-up desde 861 */
@media (min-width: 861px) {
  #kairsun-social .ks-media-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  #kairsun-social .ks-video-rail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: clamp(14px, 1.6vw, 20px);
    overflow: visible;
    padding: 0;
    scroll-snap-type: none;
  }
  #kairsun-social .ks-video-rail > .ks-video-card {
    flex: none;
    width: auto;
    scroll-snap-align: none;
  }
  #kairsun-social .ks-video-meta > div {
    min-width: 0;
  }
  #kairsun-social .ks-media-rail-hint {
    display: none;
  }
}
@media (min-width: 861px) and (max-width: 1099px) {
  #kairsun-social .ks-video-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-top: 15px;
  }
}

/* 05 · rail de producto ≥1440 */
@media (min-width: 1440px) {
  .story-pair-inner {
    max-width: min(1440px, var(--max));
    gap: 64px;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr) !important;
  }
  .story-pair-rev .story-pair-inner {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px) !important;
  }
  .story-device {
    max-width: 340px !important;
  }
  main.story .story-copy p {
    max-inline-size: 62ch;
  }
}

/* 06 · FAQ de home a ancho útil + 2 columnas */
.ksdir-faq {
  max-width: var(--max) !important;
}
@media (min-width: 1101px) {
  .ksdir-faq-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
  }
  .ksdir-faq-item:first-child {
    grid-column: 1 / -1;
  }
}

/* 07 · waitlist: grid canónica (solo donde el 2-col tiene espacio) */
@media (min-width: 900px) {
  .fw-conversion-grid {
    max-width: 1160px !important;
    margin-inline: auto;
    grid-template-columns: minmax(300px, 0.78fr) minmax(540px, 1.22fr);
    align-items: start;
  }
}

/* 08 · primera sección kob ≥1440 */
@media (min-width: 1440px) {
  .kob-phone {
    width: min(100%, clamp(196px, 14vw, 270px));
  }
}

/* 09 · P0 móvil: subtítulo de videos sin animación + hint legible */
.ks-media-heading .section-sub {
  animation: none !important;
}
.ks-media-heading .ks-media-rail-hint {
  margin: 6px auto clamp(18px, 2vw, 25px) !important;
  color: rgba(232, 239, 248, 0.78);
}

/* 10 · P0 caption del phone sin recorte + sin CLS por contain-intrinsic-size */
.story-device {
  max-height: none !important;
}
@media (max-width: 899px) {
  .story-pair.story-beat {
    content-visibility: visible !important;
  }
}

/* 11 · 721–860 apretado: una columna */
@media (max-width: 860px) {
  .pillars {
    grid-template-columns: 1fr !important;
  }
  .ksdir-loop .steps {
    grid-template-columns: 1fr !important;
    max-width: 560px;
    margin-inline: auto;
  }
  .hub-card--mastery {
    grid-column: 1 / -1;
  }
}

/* 12 · FAQ: foco visible sin recorte */
.ksdir-faq-item {
  overflow: visible;
}
.ksdir-faq-item summary:focus-visible {
  outline: none !important;
  box-shadow: inset 0 0 0 2px var(--gold-hi, #ffe9b8);
  border-radius: 17px;
}

/* 13 · redes sociales: filas grandes, sprite, colores de marca */
.ks-social-links a {
  min-height: 64px;
  grid-template-columns: 44px minmax(0, 1fr) 16px;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
}
@media (max-width: 520px) {
  .ks-social-links {
    grid-template-columns: minmax(0, 1fr);
  }
}
.ks-social-mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
}
.ks-social-icon {
  display: block;
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.ks-social-name {
  font-size: 0.875rem;
}
.ks-social-handle {
  font-size: 0.75rem;
  color: rgba(220, 231, 243, 0.72);
}
.ks-social-mark::before {
  content: none !important;
}
.ks-social-links li[data-network="x"],
.ks-social-links li[data-network="threads"] {
  --ks-brand: #ffffff;
}
.ks-social-links li[data-network="instagram"] {
  --ks-brand: #dd2a7b;
}
.ks-social-links li[data-network="tiktok"] {
  --ks-brand: #25f4ee;
}
.ks-social-links li[data-network="facebook"] {
  --ks-brand: #0866ff;
}
.ks-social-links li[data-network="youtube"] {
  --ks-brand: #ff0000;
}
.ks-social-mark {
  color: var(--ks-brand, #ffe9b8);
  border-color: color-mix(in srgb, var(--ks-brand, #f5c451) 38%, transparent);
}
[data-network="instagram"] .ks-social-mark {
  background: linear-gradient(45deg, #f58529, #dd2a7b 52%, #8134af);
  color: #fff;
  border-color: transparent;
}
@media (hover: hover) {
  .ks-social-links a:hover {
    border-color: color-mix(in srgb, var(--ks-brand, #f5c451) 52%, transparent);
    background: color-mix(in srgb, var(--ks-brand, #f5c451) 11%, rgba(255, 255, 255, 0.04));
  }
  .ks-social-links a:hover .ks-social-mark {
    border-color: color-mix(in srgb, var(--ks-brand, #f5c451) 60%, transparent);
  }
}

/* 14 · pills de video: tap 44 + canal clickeable */
.ks-video-socials a {
  min-height: 44px;
  padding: 8px 13px;
  gap: 8px;
  font-size: 0.8rem;
}
.ks-video-socials .ks-social-icon {
  width: 16px;
  height: 16px;
}
.ks-media-channel {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  margin: 0 -10px;
}

/* 15 · tipografía piso 12px + taps */
.pillar-links a,
.story-exception a,
.story-pair .story-copy p a,
.fw-fallback a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 6px;
  margin-inline: -6px;
}
@media (min-width: 1100px) {
  .ks-media-kicker,
  .pillar-label,
  .ksdir-loop-lead {
    font-size: 0.8rem;
  }
  .ks-social-handle {
    font-size: 0.76rem;
  }
  .pillar-links a,
  .ks-media-channel {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}
.hero .hero-prize-label {
  font-size: 0.75rem;
}
#waitlist .hero-prize-label {
  font-size: 0.75rem !important;
}
#waitlist .fw-assurances {
  font-size: 0.8rem !important;
}
footer .ksf-col__title {
  font-size: 0.78rem !important;
}
footer .ksf-fine {
  font-size: 0.82rem !important;
}
footer .ksf-brand__etym,
footer .ksf-badge {
  font-size: 0.8rem !important;
}

/* 16 · companion estable: siempre fixed, stage clamp, línea 2-líneas */
#ks-companion.ks-companion {
  position: fixed !important;
  left: 0;
  right: 0;
  top: calc(var(--header-h, 64px) + 2px) !important;
  z-index: 45;
  pointer-events: none;
  isolation: isolate;
}
#ks-companion.ks-companion .ks-companion-stage {
  min-height: 0 !important;
  max-height: 56px !important;
  padding: 6px 14px 7px 16px !important;
  overflow: hidden !important;
}
#ks-companion.ks-companion .ks-companion-line.is-on {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  line-clamp: 2 !important;
  font-size: 0.88rem !important;
  line-height: 1.32 !important;
  white-space: normal !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  max-height: 2.64em !important;
}
@media (min-width: 861px) {
  #ks-companion.ks-companion .ks-companion-stage {
    max-height: 64px !important;
    padding: 8px 18px 9px 20px !important;
  }
  #ks-companion.ks-companion .ks-companion-line.is-on {
    font-size: 0.925rem !important;
    line-height: 1.35 !important;
    max-height: 2.7em !important;
  }
}

/* 16b · orbes del hero no aportan overflow en pantallas anchas */
@media (min-width: 1600px) {
  .ksdir-orb--gold {
    right: -6%;
  }
  .ksdir-orb--teal {
    left: -6%;
  }
}

/* 17 · reduced-motion robusto */
@media (prefers-reduced-motion: reduce) {
  .vista-tabs span,
  .hero-cta .btn-primary,
  .rf-card,
  .rf-card__icons img,
  .rf-card--legend .rf-card__pet,
  .rf-card__medal img {
    transition: none !important;
  }
  .rf-ladder .rf-card.rf-aurora::before {
    animation: none !important;
  }
  html {
    scroll-behavior: auto !important;
  }
}

/* 18 · chips fake del caption: el toggle real vive arriba del phone */
figcaption .vista-tabs {
  display: none !important;
}

/* 19 · switchers reales del beat, claros y clickeables en todo viewport */
.story-device .ks-embed .ks-view__tabs,
.story-pair .ks-embed .ks-view__tabs {
  position: relative;
  z-index: 6;
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 0 auto 10px;
}
.story-device .ks-embed .ks-view__tabs label,
.story-pair .ks-embed .ks-view__tabs label {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(10, 12, 16, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.875rem;
}
@media (max-width: 899px) {
  .story-device .ks-embed .ks-view__tabs label,
  .story-pair .ks-embed .ks-view__tabs label {
    min-height: 44px;
  }
}

/* 19b · foco visible del toggle del rail (los radios son sr-only) */
.ks-view:has(> input[type="radio"]:focus-visible) > .ks-view__tabs {
  outline: 2px solid var(--gold-hi, #ffe9b8);
  outline-offset: 3px;
  border-radius: 999px;
}

/* 20 · desk CTA no tapa los phones */
@media (min-width: 1100px) and (max-width: 1599px) {
  .ksc-desk-cta {
    transform: scale(0.86) !important;
    right: 12px !important;
    bottom: 12px !important;
    opacity: 0.96;
  }
}

/* 20b · el CTA sticky movil no tapa el final del contenido */
@media (max-width: 860px) {
  main.story {
    padding-bottom: 104px;
  }
}

/* 21 · fachada de video */
.ks-media-player {
  border: 1px solid rgba(245, 196, 81, 0.22);
  border-radius: var(--radius-xl, 24px);
  overflow: hidden;
}
