/*
 * landing.css — public marketing landing (MKT-37, v4 "Editorial + Chat Vivo").
 *
 * Page-level layout only, loaded solely on the marketing host root. Every atom
 * (buttons, cards, bubbles, chips, badges, brand-mark, form field, typing dots)
 * is a base component from ui.css; this file only composes them into the
 * landing's sections and holds the page-scoped motion. Token-only, so it renders
 * correctly under warm light and warm dark from its first commit. Animation is
 * layered on top of a complete, static final state: with no JS (or reduced
 * motion) every reveal, chat bubble, and marker settles visible.
 */

.landing {
  position: relative;
  overflow-x: clip;
}

/* Ambient warm glows behind the whole page (decorative). */
.landing::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 42% at 78% -4%, var(--glow-warm), transparent 70%),
    radial-gradient(52% 40% at 6% 6%, var(--glow-red), transparent 72%);
}

.landing > * {
  position: relative;
  z-index: 1;
}

.landing__wrap {
  width: min(72rem, 100% - clamp(2rem, 10vw, 6rem));
  margin-inline: auto;
}

.landing__eyebrow,
.landing__platforms-label {
  display: inline-flex;
  gap: var(--space-2);
  align-items: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-highlight-text);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.landing__eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 2px;
  background: linear-gradient(90deg, var(--color-highlight), transparent);
  border-radius: var(--radius-xs);
}

.landing__eyebrow--red {
  color: var(--color-primary-text);
}

.landing__eyebrow--red::before {
  background: linear-gradient(90deg, var(--color-primary), transparent);
}

/* No underlines on landing links (browser default); affordance is color + weight. */
.landing a {
  text-decoration: none;
}

.landing__inline-link {
  font-weight: var(--weight-bold);
  color: var(--color-primary-text);
}

/* --- Self-drawing marigold marker (marker controller) --- */
.landing__mark {
  position: relative;

  /* .brand-mark sets white-space: nowrap and the page clips overflow-x, so on
     narrow screens the final word of a long / Spanish marked phrase was
     silently truncated. Let landing marks wrap instead. */
  white-space: normal;
}

.landing__marker {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.landing__marker path {
  fill: none;
  stroke: var(--color-highlight);
  stroke-linecap: round;
}

/* Static highlight (no JS or reduced motion): a cloned inline band sits behind
   EVERY wrapped line. brand-mark's single ::after bar assumes one line, so
   retire it here and highlight the text itself. */
.landing .landing__mark::after {
  content: none;
}

.landing__mark-text {
  position: relative;
  z-index: 1;
  background: linear-gradient(var(--color-highlight), var(--color-highlight)) 0 82% / 100% 0.4em
    no-repeat;
  /* stylelint-disable-next-line property-no-vendor-prefix -- no autoprefixer/build step; iOS Safari needs the prefix for the per-line highlight band */
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Once the SVG stroke has drawn, retire the static band so the two don't stack. */
.landing__mark--drawn .landing__mark-text {
  background-image: none;
}

/* --- Reveal on scroll (reveal controller; armed only with JS + motion) --- */
.landing--reveals .landing__reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.7s var(--ease-out) var(--reveal-delay, 0s),
    transform 0.7s var(--ease-out) var(--reveal-delay, 0s);
}

.landing--reveals .landing__reveal.is-in {
  opacity: 1;
  transform: none;
}

.landing__reveal--d1 {
  --reveal-delay: 60ms;
}

.landing__reveal--d2 {
  --reveal-delay: 140ms;
}

.landing__reveal--d3 {
  --reveal-delay: 220ms;
}

.landing__reveal--d4 {
  --reveal-delay: 300ms;
}

.landing__reveal--d5 {
  --reveal-delay: 380ms;
}

/* --- Nav --- */
.landing__nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-canvas) 82%, transparent);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(12px) saturate(1.2);
}

.landing__nav-inner {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-3);
}

.landing__brand {
  display: inline-flex;
  gap: var(--space-3);
  align-items: center;
  color: var(--color-text);
}

.landing__brand-badge {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}

.landing__brand-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.landing__wordmark {
  color: var(--color-primary-text);
}

.landing__nav-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.landing__theme {
  border: 1px solid transparent;
}

.landing__theme:hover {
  border-color: var(--color-border);
}

/* Scoped under .landing__theme so these beat ui.css `.ic { display: inline-block }`
   (equal specificity, and the app bundle loads after landing.css). */
.landing__theme .landing__theme-sun {
  display: none;
}

:root[data-theme="dark"] .landing__theme .landing__theme-sun {
  display: inline-block;
}

:root[data-theme="dark"] .landing__theme .landing__theme-moon {
  display: none;
}

.landing__nav-link {
  padding: var(--space-2) var(--space-3);
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  border-radius: var(--radius-md);
}

.landing__nav-link:hover {
  color: var(--color-text);
  background: var(--color-surface-sunken);
}

.landing__nav-cta {
  min-height: 40px;
  padding-block: var(--space-2);
}

@media (width <= 35rem) {
  .landing__nav-signin {
    display: none;
  }
}

/* --- Hero --- */
.landing__hero {
  padding-block: var(--space-10) var(--space-12);
}

.landing__hero-grid {
  display: grid;
  gap: var(--space-8);
  align-items: center;
}

.landing__hero-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.landing__hero-title {
  max-width: 14ch;
  font-size: clamp(2.4rem, 7vw, 4.4rem);
}

.landing__hero-line {
  display: block;
}

.landing__lede {
  max-width: 46ch;
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  color: var(--color-text-muted);
}

.landing__cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.landing__cta-row .btn {
  min-height: 52px;
}

.landing__hero-note {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.landing__hero-note .status-dot {
  box-shadow: 0 0 0 4px var(--color-success-soft);
}

@media (width >= 58rem) {
  .landing__hero-grid {
    grid-template-columns: 1.08fr 0.92fr;
  }

  .landing__hero {
    padding-block: var(--space-12);
  }
}

/* --- Living chat --- */
.landing__chat-stage {
  position: relative;
  display: flex;
  justify-content: center;
}

.landing__hero-mascot {
  position: absolute;
  bottom: -8%;
  left: -4%;
  z-index: 4;
  width: clamp(88px, 14vw, 140px);
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 12px 18px var(--shadow-color));
  animation: landing-mascot-float 5.5s var(--ease-out) infinite;
}

@keyframes landing-mascot-float {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }

  50% {
    transform: translateY(-7px) rotate(1.5deg);
  }
}

@media (width <= 33rem) {
  .landing__hero-mascot {
    right: 0;
    left: auto;
    bottom: -6%;
    width: 92px;
  }
}

.landing__chat {
  width: min(26rem, 100%);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  transform: rotate(-1.3deg);
  transition: transform 0.6s var(--ease-spring);
}

.landing__chat:hover {
  transform: rotate(0deg);
}

.landing__chat-head {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 1px dashed var(--color-border-strong);
}

.landing__chat-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  font-size: var(--text-xl);
  background: var(--color-primary-soft);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-primary) 16%, transparent);
}

.landing__chat-who {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.landing__chat-name {
  overflow: hidden;
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.landing__chat-badge {
  display: inline-flex;
  flex: none;
  gap: var(--space-1);
  align-items: center;
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-1);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  color: var(--color-primary-text);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  background: var(--color-primary-soft);
  border-radius: var(--radius-pill);
}

.landing__chat-badge-img {
  width: 1.35rem;
  height: 1.35rem;
  object-fit: cover;
  background: var(--color-surface);
  border-radius: var(--radius-pill);
}

.landing__chat-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 20rem;
  padding: var(--space-4);
}

.landing__chat-row {
  display: flex;
  flex-direction: column;
  max-width: 86%;
}

.landing__chat-row--me {
  align-self: flex-end;
  align-items: flex-end;
}

.landing__chat-row--them {
  align-self: flex-start;
  align-items: flex-start;
}

.landing__chat-stamp {
  padding-inline: var(--space-1);
  margin-top: var(--space-1);
  font-size: var(--text-2xs);
  color: var(--color-text-muted);
}

.landing__chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-self: flex-start;
}

.landing__chat-quick .chip {
  min-height: 34px;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-primary-text);
  background: var(--color-surface);
  border-color: var(--color-border-strong);
}

/* Chat choreography — armed only when the controller is playing. */
.landing__chat--playing [data-landing-chat-target="step"] {
  opacity: 0;
  transform: translateY(12px) scale(0.97);
}

.landing__chat--playing [data-landing-chat-target="step"].is-shown {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.4s var(--ease-out),
    transform 0.5s var(--ease-spring);
}

/* --- Section scaffolding --- */
.landing__section {
  padding-block: var(--space-12);
}

.landing__sec-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 46ch;
}

.landing__sec-title {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
}

.landing__sec-lede {
  max-width: 52ch;
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  color: var(--color-text-muted);
}

/* --- How it works --- */
.landing__steps {
  display: grid;
  gap: var(--space-8);
  padding: 0;
  margin-top: var(--space-10);
  list-style: none;
}

.landing__step {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-top: var(--space-4);
  border-top: 2px solid var(--color-border-strong);
}

.landing__step-n {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: var(--weight-heavy);
  line-height: 1;
  color: transparent;
  letter-spacing: var(--tracking-tight);
  -webkit-text-stroke: 1.5px var(--color-highlight);
}

.landing__step-label {
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-primary-text);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.landing__step-title {
  margin-top: var(--space-1);
}

.landing__step-body {
  margin-top: var(--space-2);
  color: var(--color-text-muted);
}

@media (width >= 50rem) {
  .landing__steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .landing__step:nth-child(2) {
    transform: translateY(var(--space-8));
  }
}

/* --- "Ready for" platform strip --- */
.landing__platforms {
  padding-block: var(--space-8);
}

.landing__platforms-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-6);
  align-items: center;
  justify-content: center;
  text-align: center;
}

.landing__platforms-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}

.landing__platform {
  display: inline-flex;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  transition:
    transform var(--transition-base) var(--ease-spring),
    color var(--transition-fast) var(--ease-out),
    border-color var(--transition-fast) var(--ease-out);
}

.landing__platform:hover {
  color: var(--color-text);
  border-color: var(--color-border-strong);
  transform: translateY(-3px);
}

.landing__platform .ic {
  color: var(--color-primary-text);
}

/* --- Moat --- */
.landing__moat {
  background: var(--color-surface-sunken);
  border-block: 1px solid var(--color-border);
}

.landing__moat-grid {
  display: grid;
  gap: var(--space-8);
  align-items: center;
}

.landing__moat-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.landing__moat-title {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
}

.landing__moat-body {
  max-width: 40ch;
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  color: var(--color-text-muted);
}

.landing__memory {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 0;
  margin: 0;
  list-style: none;
}

.landing__mem {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.landing__mem-tick {
  display: grid;
  flex: none;
  place-items: center;
  width: 2rem;
  height: 2rem;
  color: var(--color-success-text);
  background: var(--color-success-soft);
  border-radius: var(--radius-sm);
}

.landing__mem-copy {
  display: flex;
  flex-direction: column;
}

.landing__mem-copy b {
  font-weight: var(--weight-bold);
}

.landing__mem-copy span {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

@media (width >= 54rem) {
  .landing__moat-grid {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

/* --- Muestrario (example outputs) --- */
.landing__muestra-cards {
  display: grid;
  gap: var(--space-5);
  margin-top: var(--space-10);
}

.landing__mcard {
  transform: rotate(-0.7deg);
  transition:
    transform 0.6s var(--ease-spring),
    box-shadow var(--transition-base) var(--ease-out);
}

.landing__mcard:nth-child(2) {
  transform: rotate(0.7deg);
}

.landing__mcard:nth-child(3) {
  transform: rotate(-0.35deg);
}

.landing__mcard:hover {
  box-shadow: var(--shadow-lg);
  transform: rotate(0deg) translateY(-3px);
}

.landing__mcard-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  height: 100%;
}

.landing__muestra-tag {
  display: inline-flex;
  gap: var(--space-2);
  align-items: center;
  align-self: flex-start;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
}

.landing__mcard-content {
  flex: 1;
  line-height: var(--leading-normal);
  color: var(--color-text);
}

.landing__mcard-foot {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-3);
  border-top: 1px dashed var(--color-border-strong);
}

.landing__mcard-voice {
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--color-text-muted);
}

.landing__mcard-copy {
  min-height: 32px;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

.landing__muestra-cap {
  margin-top: var(--space-6);
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--color-text-muted);
  text-align: center;
}

@media (width >= 54rem) {
  .landing__muestra-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- Request-access (Beta privada) --- */
.landing__access-panel {
  width: 100%;
  background:
    radial-gradient(120% 130% at 100% 0%, var(--color-primary-soft), transparent 55%),
    var(--color-surface);
  box-shadow: var(--shadow-lg);
}

.landing__access-inner {
  display: grid;
  gap: var(--space-8);
  align-items: center;
  padding: clamp(var(--space-6), 5vw, var(--space-12));
}

.landing__access-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: flex-start;
}

.landing__access-title {
  font-size: clamp(1.9rem, 4.4vw, 2.8rem);
}

.landing__access-lead {
  max-width: 38ch;
  font-size: var(--text-lg);
  color: var(--color-text-muted);
}

.landing__access-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.landing__access-row {
  display: flex;
  gap: var(--space-3);
}

.landing__access-row .input {
  flex: 1;
  min-height: 52px;
}

.landing__access-row .btn {
  flex: none;
  min-height: 52px;
}

.landing__access-note,
.landing__access-signin {
  margin: 0;
}

.landing__access-done {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: flex-start;
}

.landing__access-check {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--color-success-text);
  background: var(--color-success-soft);
  border-radius: var(--radius-pill);
}

@media (width >= 50rem) {
  .landing__access-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (width <= 30rem) {
  .landing__access-row {
    flex-direction: column;
  }
}

/* --- Footer --- */
.landing__footer {
  padding-block: var(--space-10);
  background: var(--color-surface-sunken);
  border-top: 1px solid var(--color-border);
}

.landing__footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5) var(--space-8);
  align-items: center;
  justify-content: space-between;
}

.landing__footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.landing__footer-tagline {
  max-width: 34ch;
}

.landing__footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
}

.landing__footer-links a {
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
}

.landing__footer-links a:hover {
  color: var(--color-primary-text);
}

.landing__footer-copy {
  width: 100%;
  padding-top: var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
}

/* --- Motion off: settle everything on its final, legible state. --- */
@media (prefers-reduced-motion: reduce) {
  .landing--reveals .landing__reveal {
    opacity: 1;
    transform: none;
  }

  .landing__chat {
    transform: none;
  }

  .landing__hero-mascot {
    animation: none;
  }
}
