/* ==========================================================
   K'exul — sitio público
   Los tokens de color son EXACTAMENTE los de kexul_palette.dart
   (mobile/packages/kexul_core), no una paleta nueva inventada para
   el sitio: es la misma marca en otra superficie.
   ========================================================== */

:root {
  --accent: #111439;
  --accent-dark: #0a0c24;
  --accent-ink: #ffffff;
  --accent-soft: #e9ebf6;
  --accent-deep: #1d2461;

  --bg: #f1f4fb;
  --surface: #ffffff;
  --border: #dce2f0;
  --text: #14171c;
  --text-muted: #5f6478;

  --gold: #f2e6ce;
  --gold-ink: #6b5416;

  --ok: #2e7d52;
  --ok-soft: #e3f3e8;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-card: 0 1px 2px rgba(17, 20, 57, 0.04), 0 8px 24px rgba(17, 20, 57, 0.06);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #93a8ff;
    --accent-dark: #7690f0;
    --accent-ink: #0b0e20;
    --accent-soft: #1a1f3d;
    --accent-deep: #c3cdff;

    --bg: #0a0c1c;
    --surface: #14162e;
    --border: #262b4a;
    --text: #ecedf5;
    --text-muted: #969ab5;

    --gold: #241f14;
    --gold-ink: #d9be8a;

    --ok: #6bbf8a;
    --ok-soft: #14261c;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 28px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --accent: #93a8ff;
  --accent-dark: #7690f0;
  --accent-ink: #0b0e20;
  --accent-soft: #1a1f3d;
  --accent-deep: #c3cdff;

  --bg: #0a0c1c;
  --surface: #14162e;
  --border: #262b4a;
  --text: #ecedf5;
  --text-muted: #969ab5;

  --gold: #241f14;
  --gold-ink: #d9be8a;

  --ok: #6bbf8a;
  --ok-soft: #14261c;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 28px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  text-wrap: balance;
  margin: 0 0 0.5em;
  color: var(--text);
}

h1 {
  font-size: clamp(2.25rem, 4vw + 1rem, 3.5rem);
  font-weight: 500;
}

h2 {
  font-size: clamp(1.75rem, 2.4vw + 1rem, 2.5rem);
}

h3 {
  font-size: 1.15rem;
  margin-bottom: 0.4em;
}

p {
  margin: 0 0 1em;
  color: var(--text-muted);
}

a {
  color: inherit;
}

.container {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: max(20px, env(safe-area-inset-left));
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75em;
}

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 14px;
}

.nav__brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.nav__links {
  display: flex;
  gap: 28px;
  flex: 1;
  justify-content: center;
}

.nav__links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav__links a:hover {
  color: var(--text);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle__icon--moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__icon--sun {
    display: none;
  }

  :root:not([data-theme="light"]) .theme-toggle__icon--moon {
    display: block;
  }
}

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

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

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.nav__toggle span {
  display: block;
  height: 2px;
  margin-inline: 8px;
  background: var(--text);
  border-radius: 2px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

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

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

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

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--sm {
  padding: 9px 16px;
  font-size: 0.85rem;
}

.btn--lg {
  padding: 14px 28px;
  font-size: 1rem;
}

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

/* ---------- hero ---------- */

.hero {
  padding-block: clamp(48px, 8vw, 96px) clamp(56px, 8vw, 88px);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.hero__lead {
  font-size: 1.15rem;
  max-width: 46ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
}

.hero__note {
  font-size: 0.85rem;
  margin-top: 14px;
  margin-bottom: 0;
}

.hero__art {
  display: flex;
  justify-content: center;
}

/* Maqueta de teléfono dibujada en CSS -- no es una captura real, así
   que se declara claramente estilizada (bordes gruesos, geometría
   simple) en vez de fingir ser una foto de pantalla. */
.phone {
  width: min(300px, 78vw);
  aspect-ratio: 9 / 18.5;
  background: var(--accent-dark);
  border-radius: 42px;
  padding: 14px;
  box-shadow: var(--shadow-card);
  position: relative;
}

.phone__notch {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 18px;
  background: var(--accent-dark);
  border-radius: 0 0 14px 14px;
  z-index: 2;
}

.phone__screen {
  background: var(--bg);
  height: 100%;
  border-radius: 30px;
  padding: 34px 18px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
}

.mock__eyebrow {
  font-size: 0.7rem;
  color: var(--accent);
  margin: 0 0 4px;
  font-weight: 600;
}

.mock__big {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--text);
  margin: 0 0 12px;
}

.mock__big span {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

.mock__dots {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.mock__dots span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
}

.mock__dots span.on {
  background: var(--accent);
  border-color: var(--accent);
}

.mock__reward {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.mock__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.mock__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
}

.mock__row.muted {
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
}

.mock__row .pill {
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 0.62rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

/* ---------- sections ---------- */

.section {
  padding-block: clamp(56px, 8vw, 96px);
}

.section--tinted {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

.section__head {
  max-width: 640px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.section__head h2 {
  margin-top: 0;
}

.section__lead {
  font-size: 1.05rem;
}

/* ---------- cards ---------- */

.cards {
  display: grid;
  gap: 20px;
}

.cards--3 {
  grid-template-columns: repeat(3, 1fr);
}

.cards--4 {
  grid-template-columns: repeat(2, 1fr);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
}

.card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--icon-bg);
  color: var(--icon-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.card__icon svg {
  width: 22px;
  height: 22px;
}

.card h3,
.feature h3 {
  font-size: 1.1rem;
}

.card p,
.feature p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.feature {
  background: transparent;
  padding: 4px 0;
}

.feature h3 {
  color: var(--text);
}

/* ---------- split (two-column generic) ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}

.split__copy p {
  font-size: 1.02rem;
  max-width: 48ch;
}

.split__art {
  display: flex;
  justify-content: center;
}

.chip-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 320px;
}

.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-weight: 600;
  box-shadow: var(--shadow-card);
}

.chip:nth-child(2) {
  margin-inline-start: 28px;
}

.chip:nth-child(3) {
  margin-inline-start: 56px;
}

/* ---------- form ---------- */

.split--form {
  align-items: start;
}

.form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 36px);
  box-shadow: var(--shadow-card);
}

.form__row {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form__row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.form__row .optional {
  font-weight: 400;
  color: var(--text-muted);
}

.form__row input,
.form__row textarea {
  font: inherit;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}

.form__row input:focus,
.form__row textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form__submit {
  width: 100%;
  margin-top: 4px;
}

.form__status {
  margin: 14px 0 0;
  font-size: 0.9rem;
  min-height: 1.2em;
}

.form__status[data-state="ok"] {
  color: var(--ok);
}

.form__status[data-state="error"] {
  color: #b3261e;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .form__status[data-state="error"] {
    color: #f2857d;
  }
}

:root[data-theme="dark"] .form__status[data-state="error"] {
  color: #f2857d;
}

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--border);
  padding-block: 28px;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer a {
  text-decoration: none;
  color: var(--text-muted);
}

.footer a:hover {
  color: var(--accent);
}

/* ---------- responsive ---------- */

@media (max-width: 880px) {
  .nav__links {
    position: fixed;
    inset: 64px 0 0 0;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 20px;
    gap: 4px;
    border-top: 1px solid var(--border);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
  }

  .nav__links a {
    width: 100%;
    padding: 12px 4px;
    border-bottom: 1px solid var(--border);
  }

  .nav.is-open .nav__links {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav__toggle {
    display: flex;
  }

  .nav__actions .btn--sm {
    display: none;
  }

  .hero__grid,
  .split {
    grid-template-columns: 1fr;
  }

  .hero__art {
    order: -1;
  }

  .cards--3,
  .cards--4 {
    grid-template-columns: 1fr;
  }

  .chip:nth-child(2),
  .chip:nth-child(3) {
    margin-inline-start: 0;
  }
}

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

  * {
    transition: none !important;
  }
}
