/* 0Dopamine — sistema de diseño compartido
   Dark theme unificado, tipografía display + body Inter,
   tokens de spacing/radius/color coherentes en las 5 páginas. */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
img, svg, video, picture { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- Tokens ---------- */
:root {
  /* Surfaces — dark unificado */
  --bg:          #050607;
  --bg-1:        #0A0B0E;
  --bg-2:        #12141A;
  --bg-3:        #1A1D25;
  --border:      rgba(255, 255, 255, .08);
  --border-2:    rgba(255, 255, 255, .14);
  --border-3:    rgba(255, 255, 255, .22);

  /* Ink */
  --ink:         #F4F5F7;
  --ink-2:       #C5CAD3;
  --ink-3:       #8A90A0;
  --ink-4:       #5D6372;

  /* Accent — derivado del navy del logo */
  --accent:      #5B8EF0;
  --accent-2:    #8FB4FF;
  --accent-3:    #2B5FC9;
  --accent-soft: rgba(91, 142, 240, .14);
  --accent-glow: rgba(91, 142, 240, .35);

  /* Semantic */
  --danger:      #FF5B5B;
  --success:     #4ADE80;

  /* Spacing — escala 4px */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --s-9: 96px; --s-10: 144px;

  /* Radius */
  --r-xs: 6px;  --r-sm: 10px; --r-md: 14px;
  --r-lg: 20px; --r-xl: 28px; --r-full: 999px;

  /* Layout */
  --container: 1200px;
  --nav-h: 78px;

  /* Motion */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur-fast: 150ms;
  --dur: 260ms;
  --dur-slow: 420ms;

  /* Typography scale fluido */
  --fs-display: clamp(3rem, 7.5vw, 5.5rem);
  --fs-h1:      clamp(2.25rem, 5vw, 3.75rem);
  --fs-h2:      clamp(1.75rem, 3.5vw, 2.75rem);
  --fs-h3:      clamp(1.2rem, 2vw, 1.5rem);
  --fs-lead:    clamp(1.05rem, 1.4vw, 1.25rem);
  --fs-body:    1rem;
  --fs-sm:      .9rem;
  --fs-xs:      .8rem;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", "Inter Tight", -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01";
  font-optical-sizing: auto;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: var(--accent-glow); color: #fff; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); letter-spacing: -0.03em; }
h2 { font-size: var(--fs-h2); letter-spacing: -0.028em; }
h3 { font-size: var(--fs-h3); letter-spacing: -0.02em; line-height: 1.2; }

.display {
  font-size: var(--fs-display);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.038em;
}
.lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 60ch;
  text-wrap: pretty;
}
.mono { font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

/* ---------- Accessibility primitives ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff;
  padding: 10px 16px; border-radius: 0 0 var(--r-xs) 0;
  font-weight: 600; z-index: 10000;
}
.skip-link:focus { left: 0; }

/* ---------- i18n primitives ---------- */
html[lang="es"] [data-lang="en"],
html[lang="en"] [data-lang="es"] { display: none !important; }

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
}
.section { padding-block: clamp(72px, 10vw, 128px); }
.section-sm { padding-block: clamp(48px, 7vw, 80px); }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.eyebrow::before {
  content: ""; display: block; width: 24px; height: 1px;
  background: currentColor;
}

/* ---------- Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--nav-h);
  gap: var(--s-4);
  padding-inline: clamp(16px, 2.5vw, 28px);
  width: 100%;
}
.nav-left   { display: flex; align-items: center; }
.nav-center { display: flex; align-items: center; }
.nav-right  { display: flex; align-items: center; }

.nav-logo {
  display: inline-flex; align-items: center;
  transition: transform var(--dur-fast) var(--ease);
}
.nav-logo img {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 8px 20px rgba(0,0,0,.45);
}
.nav-logo:hover { transform: translateY(-1px); }

/* Single-button language switch — shows EN / ES, active highlighted */
.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 8px 4px;
  background: transparent;
  border: 0;
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease);
}
.lang-switch:hover { transform: translateY(-1px); }
.lang-switch:active { transform: translateY(0); }
.lang-switch .lang-opt { transition: color var(--dur-fast) var(--ease); }
.lang-switch .lang-sep { color: var(--ink-4); margin: 0 6px; font-weight: 400; }
html[lang="es"] .lang-switch .lang-opt--es,
html[lang="en"] .lang-switch .lang-opt--en { color: var(--ink); font-weight: 600; }
html[lang="es"] .lang-switch .lang-opt--en,
html[lang="en"] .lang-switch .lang-opt--es { color: var(--ink-4); }

.nav-cta {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 11px 22px;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--r-full);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: -.005em;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.nav-cta:hover { transform: translateY(-1px); background: #fff; }
.nav-cta:active { transform: translateY(0); }

@media (max-width: 560px) {
  .nav { gap: var(--s-2); padding-inline: 14px; }
  .lang-switch { padding: 7px 12px; font-size: .78rem; }
  .nav-right .nav-cta { padding: 9px 14px; font-size: .8rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-2);
  padding: 14px 24px;
  border-radius: var(--r-full);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.005em;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 17px 30px; font-size: 1.05rem; }
.btn-block { display: flex; width: 100%; }
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover { background: #fff; transform: translateY(-1px); box-shadow: 0 12px 32px rgba(255,255,255,.08); }
.btn-primary:disabled { opacity: .55; cursor: wait; transform: none; box-shadow: none; }
.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 30px -10px var(--accent-glow);
}
.btn-accent:hover { background: var(--accent-2); color: var(--bg); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-2);
}
.btn-ghost:hover { background: var(--bg-2); border-color: var(--border-3); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: clamp(48px, 6vw, 72px) 32px;
  background: var(--bg-1);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--s-7);
  margin-bottom: var(--s-7);
}
.footer-brand { display: flex; flex-direction: column; gap: var(--s-3); }
.footer-brand img { width: 44px; height: 44px; border-radius: var(--r-sm); }
.footer-brand p { color: var(--ink-3); font-size: var(--fs-sm); max-width: 32ch; }
.footer-col h4 {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--s-4);
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a {
  font-size: var(--fs-sm);
  color: var(--ink-2);
  transition: color var(--dur-fast) var(--ease);
}
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
  font-size: var(--fs-xs);
  color: var(--ink-4);
  gap: var(--s-4); flex-wrap: wrap;
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-6); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Modal (shared beta flow) ---------- */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(5, 6, 7, .78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 20px;
  align-items: center; justify-content: center;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  position: relative;
  width: 100%; max-width: 480px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  padding: 40px 32px 28px;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.03) inset;
  animation: modalIn .3s var(--ease);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: var(--r-sm);
  color: var(--ink-3); cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.modal-close:hover { background: var(--bg-3); color: var(--ink); }
.modal-close svg { width: 18px; height: 18px; }

.badge {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 6px 12px;
  background: var(--accent-soft);
  color: var(--accent-2);
  border: 1px solid rgba(91,142,240,.22);
  border-radius: var(--r-full);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: var(--s-4);
}
.modal h2, .modal h3 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: var(--s-2);
}
.modal-desc { color: var(--ink-2); font-size: var(--fs-sm); margin-bottom: var(--s-4); }
.modal-preview {
  display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none;
  margin-bottom: var(--s-4);
}
.modal-preview li {
  font-size: .72rem; font-weight: 500;
  padding: 5px 11px;
  border-radius: var(--r-full);
  background: var(--bg-3);
  color: var(--ink-2);
  border: 1px solid var(--border);
}

.field-stack { display: flex; flex-direction: column; gap: var(--s-2); }
.field {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1.5px solid var(--border-2);
  border-radius: var(--r-md);
  color: var(--ink);
  font-size: 1rem;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
.field::placeholder { color: var(--ink-4); }
.field:hover { border-color: var(--border-3); }
.field:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-1);
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.field.error, .field[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(255,91,91,.2); }
.field-error {
  min-height: 1.2em;
  font-size: var(--fs-xs);
  color: var(--danger);
  margin-top: -2px;
}
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.step { display: none; }
.step.active { display: block; }

.step-list { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-3); }
.step-row {
  display: flex; gap: var(--s-3); align-items: flex-start;
  padding: 12px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  color: var(--ink-2);
  line-height: 1.45;
}
.step-num {
  flex: 0 0 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: #fff;
  border-radius: var(--r-full);
  font-size: .72rem; font-weight: 700;
  margin-top: 1px;
}
.modal-note {
  margin-top: var(--s-4);
  font-size: .78rem;
  color: var(--ink-4);
  text-align: center;
  line-height: 1.5;
}
.modal-note a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
.cta-stack { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-4); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
