/* ============================================================
   Clavado — landing page styles
   Dual-mode color system: [data-mode="math"] vs [data-mode="verbal"]
   ============================================================ */

:root {
  /* Neutrals tinted toward the ink hue for cohesion */
  --bg: oklch(97.5% 0.008 85);
  --bg-warm: oklch(95.5% 0.014 80);
  --surface: oklch(99% 0.006 85);
  --ink: oklch(24% 0.03 265);
  --ink-soft: oklch(42% 0.028 265);
  --ink-faint: oklch(58% 0.02 265);
  --line: oklch(88% 0.012 85);

  /* Accent is set per-mode below; default = math */
  --accent: oklch(58% 0.18 255);
  --accent-strong: oklch(50% 0.19 255);
  --accent-tint: oklch(94% 0.045 255);
  --accent-ink: oklch(30% 0.12 255);

  /* Fluid spacing scale (4pt base) */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: clamp(3.5rem, 8vw, 6.5rem);
  --space-4xl: clamp(5rem, 12vw, 10rem);

  --radius: 14px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px oklch(24% 0.03 265 / 0.06);
  --shadow-lg: 0 30px 60px -25px oklch(24% 0.05 265 / 0.35);

  --maxw: 1180px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --mode-word: "Matemáticas";

  color-scheme: light;
}

html[data-mode="math"] {
  --accent: oklch(58% 0.18 255);
  --accent-strong: oklch(49% 0.19 255);
  --accent-tint: oklch(94% 0.045 255);
  --accent-ink: oklch(32% 0.13 255);
}

html[data-mode="verbal"] {
  --accent: oklch(63% 0.19 35);
  --accent-strong: oklch(55% 0.2 33);
  --accent-tint: oklch(94.5% 0.04 45);
  --accent-ink: oklch(40% 0.14 33);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.5s var(--ease-out);
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }
em { font-style: normal; color: var(--accent-strong); transition: color 0.5s var(--ease-out); }

a { color: inherit; text-decoration: none; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  border: none;
  transition: transform 0.2s var(--ease-out), background-color 0.3s, color 0.3s;
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn--pill {
  background: var(--ink);
  color: var(--bg);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-pill);
}
.btn--pill:hover { background: var(--accent-strong); }

.btn--ghost {
  background: transparent;
  color: var(--accent-ink);
  border: 1.5px solid var(--accent);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-pill);
}
.btn--ghost:hover { background: var(--accent-tint); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklch, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background-color 0.5s var(--ease-out);
}
.nav.is-scrolled { border-bottom-color: var(--line); }

.nav__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.75rem clamp(1rem, 4vw, 2.5rem);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-md);
}

.brand {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}
.brand__mark { color: var(--accent); display: inline-flex; transition: color 0.5s var(--ease-out); }

.mode-toggle {
  display: inline-flex;
  gap: 0.15rem;
  background: var(--bg-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0.2rem;
  justify-self: start;
}
.mode-toggle__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-faint);
  background: transparent;
  border: none;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.25s, background-color 0.25s;
}
.mode-toggle__btn .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; opacity: 0.5;
}
.mode-toggle__btn[aria-pressed="true"] {
  background: var(--surface);
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
}
.mode-toggle__btn[aria-pressed="true"] .dot { background: var(--accent); opacity: 1; }

.nav__cta { justify-self: end; }

/* ---------- Layout helpers ---------- */
.band {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--space-4xl) clamp(1.25rem, 5vw, 2.5rem);
}

.section-kicker {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin-bottom: var(--space-md);
  transition: color 0.5s var(--ease-out);
}
.section-title {
  font-size: clamp(2rem, 1.3rem + 3.6vw, 3.9rem);
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1.25rem, 5vw, 2.5rem) var(--space-4xl);
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--accent-tint);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-lg);
  transition: background-color 0.5s var(--ease-out);
}
.eyebrow strong { color: var(--accent-ink); }

.hero__title {
  font-size: clamp(2.8rem, 1.6rem + 5.6vw, 5.4rem);
  margin-bottom: var(--space-lg);
}
.hero__title .strike {
  position: relative;
  color: var(--ink-faint);
  font-weight: 700;
}
.hero__title .strike::after {
  content: "";
  position: absolute;
  left: -2%; right: -2%; top: 55%;
  height: 0.09em;
  background: var(--accent);
  transform: rotate(-3deg) scaleX(0);
  transform-origin: left;
  animation: strike 0.7s 0.5s var(--ease-out) forwards;
}
@keyframes strike { to { transform: rotate(-3deg) scaleX(1); } }

.hero__lede {
  font-size: clamp(1.05rem, 0.98rem + 0.5vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 34ch;
  margin-bottom: var(--space-xl);
}
.hero__lede [data-mode-word2] { color: var(--accent-strong); font-weight: 600; }

.hero__note {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-top: var(--space-lg);
}

/* ---------- Store buttons ---------- */
.store-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.store-row--center { justify-content: center; }

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--ink);
  color: var(--bg);
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius);
  transition: transform 0.2s var(--ease-out), background-color 0.3s;
}
.store-btn:hover { transform: translateY(-2px); background: var(--accent-strong); }
.store-btn svg { flex: none; }
.store-btn span { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.store-btn small { font-size: 0.62rem; opacity: 0.8; }
.store-btn strong { font-size: 1rem; font-weight: 700; }
.store-btn--invert { background: var(--bg); color: var(--ink); }
.store-btn--invert:hover { background: var(--bg-warm); color: var(--ink); transform: translateY(-2px); }

/* ---------- Phone ---------- */
.hero__phone { justify-self: center; }
.phone {
  width: min(320px, 78vw);
  aspect-ratio: 320 / 660;
  background: oklch(18% 0.02 265);
  border-radius: 44px;
  padding: 12px;
  box-shadow: var(--shadow-lg), 0 0 0 2px oklch(30% 0.02 265);
  position: relative;
  animation: floaty 6s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-12px) rotate(0.5deg); }
}
.phone__notch {
  position: absolute;
  top: 18px; left: 50%; transform: translateX(-50%);
  width: 90px; height: 22px;
  background: oklch(18% 0.02 265);
  border-radius: var(--radius-pill);
  z-index: 3;
}
.phone__screen {
  width: 100%; height: 100%;
  background: var(--bg);
  border-radius: 33px;
  overflow: hidden;
  transition: background-color 0.5s var(--ease-out);
}
.phone__hint {
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-top: var(--space-md);
  transition: opacity 0.3s;
}

/* ---------- App inside phone ---------- */
.app { height: 100%; display: flex; flex-direction: column; }
.app__bar {
  padding: 2.6rem 0.9rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  transition: background-color 0.5s var(--ease-out);
}
.app__toggle {
  align-self: flex-start;
  position: relative;
  display: inline-flex;
  background: var(--bg-warm);
  border-radius: var(--radius-pill);
  padding: 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
}
.app__toggle span:not(.app__toggle-thumb) {
  position: relative;
  z-index: 1;
  padding: 0.28rem 0.7rem;
  color: var(--ink-faint);
  transition: color 0.3s;
}
.app__toggle-thumb {
  position: absolute;
  top: 0.2rem; left: 0.2rem; bottom: 0.2rem;
  width: calc(50% - 0.2rem);
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: transform 0.35s var(--ease-out), background-color 0.4s;
}
html[data-mode="verbal"] .app__toggle-thumb { transform: translateX(0); }
html[data-mode="math"] .app__toggle-thumb { transform: translateX(100%); }
html[data-mode="verbal"] [data-app-verbal] { color: #fff; }
html[data-mode="math"] [data-app-math] { color: #fff; }

.app__tabs { display: flex; gap: 0.3rem; }
.app__tab {
  flex: 1;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  border-radius: 8px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.app__tab.is-active { color: var(--accent-ink); border-bottom-color: var(--accent); }

.app__feed {
  flex: 1;
  overflow: hidden;
  position: relative;
  padding: 0.9rem;
}

/* Feed cards */
.card {
  position: absolute;
  inset: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
  pointer-events: none;
}
.card.is-active { opacity: 1; transform: none; pointer-events: auto; }
.card.is-out { opacity: 0; transform: translateY(-24px) scale(0.97); }

.card__tag {
  align-self: flex-start;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent-tint);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
}
.card__q { font-size: 0.92rem; font-weight: 600; line-height: 1.35; }
.card__q .frac { display:inline-flex; flex-direction:column; text-align:center; vertical-align:middle; font-size:0.75rem; line-height:1; }
.card__q .frac span:first-child { border-bottom:1px solid currentColor; padding-bottom:1px; }

.opts { display: flex; flex-direction: column; gap: 0.4rem; margin-top: auto; }
.opt {
  text-align: left;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.55rem 0.7rem;
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  transition: border-color 0.2s, background-color 0.2s, transform 0.1s;
}
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt:active:not(:disabled) { transform: scale(0.99); }
.opt .key {
  width: 20px; height: 20px; flex:none;
  display: grid; place-items: center;
  border-radius: 6px;
  background: var(--bg-warm);
  font-size: 0.7rem;
}
.opt.is-correct { border-color: oklch(62% 0.16 150); background: oklch(95% 0.05 150); color: oklch(35% 0.1 150); }
.opt.is-correct .key { background: oklch(62% 0.16 150); color: #fff; }
.opt.is-wrong { border-color: oklch(60% 0.18 25); background: oklch(95% 0.05 25); color: oklch(40% 0.13 25); }
.opt.is-wrong .key { background: oklch(60% 0.18 25); color: #fff; }
.opt:disabled { cursor: default; }

.card__feedback {
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  background: var(--accent-tint);
  color: var(--accent-ink);
  display: none;
}
.card__feedback.show { display: block; animation: pop 0.4s var(--ease-out); }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Lesson recommend card */
.lesson { justify-content: center; text-align: center; align-items: center; }
.lesson__icon {
  width: 52px; height: 52px; border-radius: 16px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-size: 1.4rem;
  margin-bottom: 0.3rem;
}
.lesson h4 { margin: 0; font-family: "Bricolage Grotesque"; font-size: 1rem; }
.lesson p { font-size: 0.8rem; color: var(--ink-soft); }
.lesson .btn { margin-top: 0.4rem; font-size: 0.8rem; padding: 0.5rem 1rem; }

/* ---------- Different section ---------- */
.different__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-top: var(--space-2xl);
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 68ch;
}

/* ---------- Loop ---------- */
.loop__steps {
  list-style: none;
  padding: 0;
  margin: var(--space-3xl) 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.loop__step {
  background: var(--surface);
  padding: clamp(1.5rem, 3vw, 2.2rem);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: background-color 0.3s;
}
.loop__step:hover { background: var(--accent-tint); }
.loop__num {
  font-family: "Bricolage Grotesque";
  font-weight: 800;
  font-size: 2.2rem;
  color: var(--accent);
  line-height: 1;
  transition: color 0.5s var(--ease-out);
}
.loop__step h3 { font-size: 1.15rem; }
.loop__step p { font-size: 0.95rem; color: var(--ink-soft); }

/* ---------- Modes ---------- */
.modes__head { max-width: 40ch; }
.modes__lede { margin-top: var(--space-md); color: var(--ink-soft); }
.modes__head .btn { margin-top: var(--space-lg); }
.modes__cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
}
.mode-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.5rem);
}
.mode-card:first-child { border-color: color-mix(in oklch, oklch(63% 0.19 35) 30%, var(--line)); }
.mode-card:first-child h3 { color: oklch(55% 0.2 33); }
.mode-card:last-child { border-color: color-mix(in oklch, oklch(58% 0.18 255) 30%, var(--line)); }
.mode-card:last-child h3 { color: oklch(49% 0.19 255); }
.mode-card h3 { font-size: 1.6rem; margin-bottom: var(--space-sm); }
.mode-card p { color: var(--ink-soft); margin-bottom: var(--space-md); }
.mode-card ul { margin: 0; padding-left: 1.1rem; color: var(--ink-soft); display: grid; gap: 0.3rem; font-size: 0.95rem; }

/* ---------- Split ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
}
.split__divider { width: 1px; align-self: stretch; background: var(--line); }
.split__label {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-strong);
  transition: color 0.5s var(--ease-out);
}
.split__item h3 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.3rem); margin: 0.5rem 0 0.75rem; }
.split__item p { color: var(--ink-soft); max-width: 40ch; }

/* ---------- Goal ---------- */
.goal { text-align: left; }
.goal__inner {
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 6vw, 4.5rem);
  display: grid;
  gap: var(--space-lg);
}
.goal__inner .section-title { color: var(--bg); }
.goal__inner p { color: oklch(85% 0.02 265); max-width: 52ch; font-size: 1.1rem; }
.goal__inner em, .goal .section-title em { color: var(--accent); }

/* ---------- Final CTA ---------- */
.cta__inner {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: clamp(2.5rem, 7vw, 5rem);
  text-align: center;
  display: grid;
  gap: var(--space-lg);
  justify-items: center;
  transition: background-color 0.5s var(--ease-out);
}
.cta__inner h2 { font-size: clamp(2rem, 1.4rem + 3vw, 3.5rem); color: #fff; }
.cta__inner p { font-size: 1.15rem; color: oklch(97% 0.02 var(--h, 255) / 0.92); max-width: 40ch; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  background: var(--bg-warm);
}
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--space-2xl) clamp(1.25rem, 5vw, 2.5rem);
  display: grid;
  gap: var(--space-md);
}
.brand--footer { justify-self: start; font-size: 1.15rem; }
.footer__note { font-size: 0.8rem; color: var(--ink-faint); max-width: 60ch; }
.footer__copy { font-size: 0.8rem; color: var(--ink-faint); }

/* ---------- Reveal animation ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; text-align: center; }
  .hero__copy { order: 2; }
  .hero__phone { order: 1; }
  .hero__lede, .modes__head { margin-left: auto; margin-right: auto; }
  .store-row { justify-content: center; }
  .different__cols { grid-template-columns: 1fr; }
  .modes__cards { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .split__divider { display: none; }
}

@media (max-width: 560px) {
  .nav__inner { grid-template-columns: 1fr auto; row-gap: 0.6rem; }
  .mode-toggle { grid-column: 1 / -1; order: 3; justify-self: center; }
  .brand { justify-self: start; }
  .mode-toggle__btn { font-size: 0.8rem; padding: 0.35rem 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .hero__title .strike::after { transform: rotate(-3deg) scaleX(1); }
}
