/* ============================================================
   Landing UI kit — layout & component styles
   Consumes tokens from ../../colors_and_type.css
   ============================================================ */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

.container { max-width: var(--container); margin: 0 auto; padding-inline: var(--gutter); }
.measure { max-width: var(--container-text); }
.section { padding-block: var(--section-y); }
.section--sunken { background: var(--bg-sunken); }
.section--ink { background: var(--bg-ink); color: var(--fg-on-ink); }

.eyebrow {
  font-family: var(--font-sans); font-weight: 600; font-size: var(--t-micro);
  letter-spacing: var(--tr-eyebrow); text-transform: uppercase; color: var(--accent);
  margin: 0 0 var(--s-4);
}
.section--ink .eyebrow { color: var(--accent-light); }

h1,h2,h3,h4 { margin: 0; text-wrap: balance; }
.display {
  font-family: var(--font-display); font-weight: 400; font-size: var(--t-display);
  line-height: var(--lh-tight); letter-spacing: var(--tr-tight);
}
.h2 {
  font-family: var(--font-display); font-weight: 500; font-size: var(--t-h2);
  line-height: var(--lh-heading); letter-spacing: var(--tr-tight);
}
.h3 { font-family: var(--font-sans); font-weight: 600; font-size: var(--t-h3); line-height: var(--lh-heading); }
.h4 { font-family: var(--font-sans); font-weight: 600; font-size: var(--t-h4); line-height: var(--lh-heading); }
.lead { font-size: var(--t-body-lg); line-height: var(--lh-relaxed); color: var(--fg-muted); }
p { margin: 0; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--font-sans); font-size: 16px; font-weight: 600; line-height: 1;
  border-radius: var(--r-md); border: 1px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: 9px; white-space: nowrap;
  padding: 14px 22px; text-decoration: none;
  transition: background var(--motion-micro) var(--easing-standard),
              border-color var(--motion-micro) var(--easing-standard);
}
.btn--primary { background: var(--accent); color: var(--fg-on-amber); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--primary:active { background: var(--accent-press); }
.btn--secondary { background: transparent; color: var(--fg); border-color: var(--line-strong); }
.btn--secondary:hover { border-color: var(--fg-muted); }
.section--ink .btn--secondary { color: var(--fg-on-ink); border-color: rgba(244,241,234,0.3); }
.btn--ghost { background: transparent; color: var(--accent); padding-inline: 4px; }
.btn--ghost:hover { color: var(--accent-hover); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn--lg { padding: 16px 26px; font-size: 17px; }

/* ---------- cards ---------- */
.card {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}

/* ---------- amber divider ---------- */
.rule { height: 1px; background: var(--accent-line); border: 0; margin: 0; }
.rule--amber { background: var(--accent); height: 2px; width: 40px; border-radius: 2px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.nav__links { display: flex; align-items: center; gap: var(--s-6); }
.nav__link { color: var(--fg-muted); text-decoration: none; font-size: 15px; font-weight: 500; white-space: nowrap;
  transition: color var(--motion-micro) var(--easing-standard); }
.nav__link:hover { color: var(--fg); }
.wordmark { font-family: var(--font-sans); font-weight: 600; font-size: 21px; letter-spacing: 0.01em; color: var(--fg); }
.wordmark .e { color: var(--accent); }
.section--ink .wordmark { color: var(--fg-on-ink); }
.section--ink .wordmark .e { color: var(--accent-light); }
/* wordmark on dark surfaces (footer) — keep high contrast + light amber E */
.wordmark.dark { color: var(--fg-on-ink); }
.wordmark.dark .e { color: var(--accent-light); }

/* ---------- brand focus ring (keyboard nav) ---------- */
:where(a, button, input, select, textarea, [role="switch"], [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.section--ink :where(a, button):focus-visible { outline-color: var(--accent-light); }

/* ---------- footer ---------- */
.footer { background: var(--bg-ink); color: var(--fg-on-ink); padding-block: var(--s-8) var(--s-7); }
.footer a { color: var(--accent-light); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer__legal { color: #8C8983; font-size: var(--t-small); line-height: 1.6; max-width: 560px; }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(22,21,19,0.5);
  display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 100;
}
.modal {
  background: var(--bg); border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 460px; padding: 32px; position: relative;
}
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--fg); }
.field input, .field select, .field textarea {
  font-family: var(--font-sans); font-size: 15px; color: var(--fg);
  background: var(--bg-raised); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); padding: 12px 14px; outline: none; width: 100%;
  transition: border-color var(--motion-micro), box-shadow var(--motion-micro);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(146,64,14,0.12);
}

/* ---------- flow stepper (Cómo empieza) ---------- */
.flow { display: flex; align-items: stretch; gap: var(--s-2); margin-top: var(--s-6); }
.flow__step {
  flex: 1 1 0; display: flex; flex-direction: column; gap: var(--s-3);
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--s-5);
}
.flow__step--key { border-color: var(--accent-line); background: var(--accent-wash); }
.flow__num {
  font-family: var(--font-mono); font-weight: 500; font-size: 13px; color: var(--accent);
  width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--accent-line);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.flow__label { font-size: 15px; font-weight: 500; line-height: 1.4; color: var(--fg); }
.flow__arrow { display: flex; align-items: center; color: var(--accent-light); font-size: 22px; flex: none; }
@media (max-width: 860px) {
  .flow { flex-direction: column; gap: var(--s-2); }
  .flow__arrow { align-self: center; transform: rotate(90deg); }
}

@media (max-width: 768px) {
  .nav__links .nav__link { display: none; }
}

/* phone — wordmark + CTA were sitting flush (touching) because `space-between`
   collapses the space when they nearly fill the bar. Anchor links are already
   hidden (≤768px above); here we add a HARD gap (a flex `gap` can't collapse)
   and shrink the CTA so the two always keep a visible gap and fit from ~360px up. */
@media (max-width: 480px) {
  .nav .container { padding-inline: 16px; }                            /* lateral margins ~16px (from 24px) */
  .nav__inner { height: 60px; gap: 16px; }                            /* hard 16px gap → wordmark & CTA can't touch */
  .nav .wordmark { font-size: 18px; }                                 /* brand a touch smaller on phone */
  .nav__links .btn--primary { padding: 10px 14px; font-size: 14px; }  /* more compact CTA (less padding, smaller type) */
  .nav__links .btn--primary i { display: none; }                      /* drop the arrow glyph to free width */
}
