/* ============================================================
   Sereno — landing page styles
   Design tokens extracted from Figma (node 1-60).
   Display face: Labil Grotesk (licensed, self-hosted, Latin subset).
   Body: Inter (self-hosted). No external font requests.
   ============================================================ */

/* ---------- Fonts (self-hosted, no external requests) ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/inter-400.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/inter-500.woff2") format("woff2");
}
@font-face {
  font-family: "Labil Grotesk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/labil-400.woff2") format("woff2");
}
@font-face {
  font-family: "Labil Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/labil-500.woff2") format("woff2");
}
@font-face {
  font-family: "Labil Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/labil-700.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  --ink: #111;
  --ink-cta: #1a1a1a;
  --muted: #e1e1e1;
  --accent: #0dff41; /* hero panel green (Figma node 55-72) */
  --bg-section: #f8f8f8;
  --white: #fff;
  --line: #e7e7e7;
  --text-soft: #6b6b6b;
  --grey-mid: #878787;   /* intro lead */
  --grey-light: #adadad; /* step subtitles */

  --font-display: "Labil Grotesk", "Inter Tight", Inter, system-ui, sans-serif; /* Labil now licensed + self-hosted; rest are graceful fallbacks */
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --maxw: 1440px;
  --gutter: clamp(20px, 5vw, 56px);
  --section-y: clamp(72px, 14vw, 200px);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; }

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Header / language toggle ---------- */
.site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(18px, 3vw, 28px) var(--gutter);
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
}
.lang-toggle { display: flex; gap: 4px; align-items: center; font-size: 14px; }
.lang-toggle a {
  text-decoration: none;
  color: var(--text-soft);
  padding: 4px 8px;
  border-radius: 999px;
  line-height: 1;
}
.lang-toggle a[aria-current="true"] { color: var(--ink); font-weight: 500; }
.lang-toggle span { color: var(--muted); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "text media";
  height: 100svh; /* hero fills the viewport so the CTA stays visible without scrolling */
}
.hero__text {
  grid-area: text;
  display: flex;
  flex-direction: column;
}
/* White upper block: the black headline. Top padding clears the fixed header. */
.hero__headline {
  padding: clamp(64px, 7vw, 84px) 16px clamp(24px, calc(1vw + 16px), 28px);
}
/* Green lower panel: black promise line + CTA pinned to the bottom.
   Full-bleed colour across the column; text/CTA inset 16px. */
.hero__panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vw, 40px);
  background: var(--accent);
  padding: clamp(0px, 0.6vw, 8px) 16px clamp(16px, 2vw, 24px);
}
.hero__title,
.hero__promise {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  line-height: 0.83;
  letter-spacing: -0.04em;
  text-wrap: balance;
  /* Mobile / fallback: width-driven. */
  font-size: clamp(44px, 12vw, 150px);
}
/* Desktop: size tracks the viewport HEIGHT so headline + promise + CTA all fit
   inside 100svh (~7 wrapped lines plus fixed chrome). Fills big screens; safe on laptops. */
@media (min-width: 861px) {
  .hero__title,
  .hero__promise { font-size: clamp(56px, calc(17vh - 46px), 152px); }
}
.hero__panel .cta { margin-top: auto; } /* pin CTA to the bottom of the green panel */
.hero__media { grid-area: media; position: relative; overflow: hidden; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-areas: "text" "media";
    height: auto; /* stacked layout scrolls; viewport-locking only applies on desktop */
  }
  .hero__media { aspect-ratio: 4 / 5; max-height: 70vh; }
}

/* ---------- CTA pill ---------- */
.cta {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  background: var(--ink-cta);
  color: var(--white);
  border: 0;
  border-radius: 100px;
  padding: clamp(20px, 3vw, 28px) 24px;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}
.cta:hover { opacity: .92; }
.cta:active { transform: scale(.99); }
.cta__main { display: block; font-weight: 500; font-size: 20px; letter-spacing: -0.01em; }
.cta__sub { display: block; margin-top: 6px; font-size: 14px; color: rgba(255,255,255,.7); }

/* ---------- Section scaffolding ---------- */
.section { padding-block: var(--section-y); }
.section--tint { background: var(--bg-section); }
.eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: clamp(28px, 4vw, 48px);
}
.section__lead { font-size: clamp(18px, 2.4vw, 22px); max-width: 42ch; color: var(--text-soft); }

/* ---------- Cómo funciona ---------- */
/* Intro (white): headline + muted lead */
.how-intro { background: var(--white); padding-block: clamp(72px, 12vw, 150px); }
.how-intro__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: clamp(20px, 2.4vw, 28px);
}
.how-intro__lead {
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.35;
  color: var(--grey-mid);
  max-width: 40ch;
}

/* Steps (tinted): 3 numbered columns, no image */
.how-steps { background: var(--bg-section); border-top: 1px solid var(--line); padding-block: clamp(64px, 12vw, 160px); }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(40px, 6vw, 72px);
}
.step__num {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(64px, 8vw, 120px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.step__icon {
  display: block;
  width: clamp(28px, 2.6vw, 34px);
  height: clamp(28px, 2.6vw, 34px);
  color: #a9a9a9;
}
.step__title {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: clamp(24px, 3vw, 36px) 0 8px;
  color: var(--ink);
}
.step__sub {
  font-size: clamp(15px, 1.7vw, 18px);
  line-height: 1.4;
  color: var(--grey-light);
  max-width: 30ch;
}
@media (max-width: 760px) {
  .steps-grid { grid-template-columns: 1fr; gap: clamp(40px, 9vw, 56px); }
}

/* Encoding: "Tu dirección:" label + address line that scrambles into an
   anonymous ID (Figma 55-195). Label in Inter grey, value in SF Mono near-black. */
.encoding {
  margin-top: clamp(20px, 2.4vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.encoding__label {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(19px, 2vw, 26px);
  letter-spacing: -0.03em;
  color: var(--grey-mid);
}
.encoding__text {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 600;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 0.83;
  letter-spacing: -0.04em;
  color: #3a3a3a;
  white-space: pre;   /* preserve spaces while characters scramble */
}
.encoding__text .dud { color: #a4a4a4; } /* transient random glyphs, lighter than the locked value */

/* ---------- Seguridad (2 columns: intro + encoding | icon list, Figma 56-237) ---------- */
.security { background: var(--white); padding-block: clamp(72px, 12vw, 140px); }
.security__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}
.security__intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: clamp(40px, 7vw, 90px);
}
.security__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: clamp(20px, 2.4vw, 28px);
}
.security__list {
  list-style: none;
  margin: 0;
  padding-left: clamp(40px, 7vw, 90px);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(32px, 4vw, 48px);
}
.sec-item { display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 2.4vw, 32px); align-items: start; }
.sec-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(56px, 5vw, 72px);
  height: clamp(56px, 5vw, 72px);
  border-radius: clamp(12px, 1.4vw, 16px);
  background: var(--accent);
  color: var(--ink); /* icon renders dark on the green square */
}
.sec-icon .step__icon { color: inherit; }
.sec-item__title {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--ink);
}
.sec-item__sub { font-size: clamp(15px, 1.7vw, 18px); line-height: 1.4; color: var(--grey-light); max-width: 44ch; }
@media (max-width: 860px) {
  .security__grid { grid-template-columns: 1fr; gap: clamp(48px, 9vw, 64px); }
  .security__intro { padding-right: 0; }
  .security__list { border-left: 0; padding-left: 0; }
}

/* ---------- ¿Cuánto cuesta? (2-column price/wait comparison, Figma 56-410) ---------- */
.cost-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 72px); }
.cost-col__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 clamp(48px, 7vw, 96px);
}
.cost-metrics { margin: 0; display: flex; flex-direction: column; gap: clamp(28px, 3.6vw, 48px); }
.cost-metric__label {
  font-family: var(--font-body);
  font-size: clamp(18px, 2vw, 24px);
  letter-spacing: -0.01em;
  color: var(--grey-mid);
  margin-bottom: 8px;
}
.cost-metric__value {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
@media (max-width: 760px) {
  .cost-grid { grid-template-columns: 1fr; gap: clamp(48px, 9vw, 64px); }
}

/* Dark / negative variant — scoped so the shared .how-intro/.how-steps
   classes stay light in "Cómo funciona" (Figma 58-557). */
.section--dark .how-intro { background: #111; }
.section--dark .how-steps { background: #181818; border-top-color: rgba(255, 255, 255, 0.07); }
.section--dark .how-intro__title,
.section--dark .cost-col__name,
.section--dark .cost-metric__value { color: #fafafa; }
.section--dark .how-intro__lead,
.section--dark .cost-metric__label { color: #b1b1b1; }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: clamp(20px, 2.6vw, 26px) 40px clamp(20px, 2.6vw, 26px) 0;
  position: relative;
  font-weight: 500;
  font-size: clamp(17px, 2vw, 20px);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  font-size: 24px; font-weight: 400; color: var(--text-soft);
  transition: transform .2s ease;
}
.faq details[open] summary::after { content: "−"; }
.faq__a { padding: 0 40px clamp(22px, 2.6vw, 28px) 0; color: var(--text-soft); max-width: 62ch; }

/* ---------- Form ---------- */
.form-section { background: var(--ink-cta); color: var(--white); }
.form-wrap { max-width: 560px; margin-inline: auto; text-align: center; }
.form-wrap .eyebrow { color: var(--white); }
.form-wrap .section__lead { color: rgba(255,255,255,.65); margin-inline: auto; text-align: center; }
form.signup { margin-top: clamp(28px, 4vw, 40px); text-align: left; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; margin-bottom: 8px; color: rgba(255,255,255,.7); }
.field input[type="email"], .field input[type="text"] {
  width: 100%;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: var(--white);
  font: inherit;
}
.field input::placeholder { color: rgba(255,255,255,.4); }
.field input:focus { outline: 2px solid var(--white); outline-offset: 1px; }
.field input[aria-invalid="true"] { border-color: #ff8a8a; }
.consent { display: flex; gap: 12px; align-items: flex-start; margin: 20px 0 24px; font-size: 14px; color: rgba(255,255,255,.75); }
.consent input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--white); }
.consent a { color: var(--white); }
/* Honeypot — off-screen rather than display:none, which some bots skip. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { color: #ffb3b3; font-size: 14px; min-height: 20px; margin-bottom: 8px; }
.btn-submit {
  display: block; width: 100%;
  background: var(--white); color: var(--ink);
  border: 0; border-radius: 100px;
  padding: 20px; font-weight: 500; font-size: 18px;
  cursor: pointer; transition: opacity .15s ease;
}
.btn-submit:hover { opacity: .9; }
.btn-submit:disabled { opacity: .5; cursor: default; }
.form-success {
  display: none;
  text-align: center;
  padding: clamp(32px, 5vw, 48px) 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(22px, 3.4vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.form-success.is-visible { display: block; }
.form-success .check {
  display: grid; place-items: center;
  width: 56px; height: 56px; margin: 0 auto 20px;
  border-radius: 50%; background: var(--white); color: var(--ink-cta);
  font-size: 28px;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: clamp(40px, 6vw, 64px) var(--gutter);
  display: flex; flex-wrap: wrap; gap: 12px 32px;
  justify-content: space-between; align-items: center;
  font-size: 14px; color: var(--text-soft);
  border-top: 1px solid var(--line);
}
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer nav { display: flex; gap: 24px; }

/* ---------- Legal pages ---------- */
.legal { max-width: 720px; margin-inline: auto; padding-block: clamp(90px, 12vw, 140px); }
.legal h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(32px, 5vw, 52px); letter-spacing: -0.03em; margin-bottom: 8px; }
.legal .updated { color: var(--text-soft); font-size: 14px; margin-bottom: 40px; }
.legal h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(19px, 2.4vw, 24px); margin: 36px 0 10px; letter-spacing: -0.02em; }
.legal p, .legal li { color: #333; }
.legal a { color: var(--ink); }
.legal .back { display: inline-block; margin-top: 48px; color: var(--text-soft); text-decoration: none; }
.legal .back:hover { color: var(--ink); }

/* ---------- Accessibility ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
