/* Stackr Lux — landing page
   Claro de principio a fin, lenguaje de diseño Apple: tipografía del sistema,
   grises #f5f5f7, texto #1d1d1f/#86868b, acento azul #0071e3. */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --link: #0066cc;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --hairline: #d2d2d7;
  --hairline-strong: #b8b8bd;
  --radius: 14px;
  --radius-lg: 20px;
  --maxw: 1120px;
  --maxw-text: 780px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { color-scheme: light; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

body {
  font-family: -apple-system, "SF Pro Display", "SF Pro Text", BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

.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;
}

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

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

.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

section { padding-block: clamp(6rem, 11vw, 10rem); }

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.85rem;
}

.brand {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
}

.site-nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
  align-items: center;
}

.site-nav a:not(.btn) {
  font-size: 0.9rem;
  color: var(--text);
  transition: color 0.2s var(--ease);
}

.site-nav a:not(.btn):hover { color: var(--link); }

.site-nav .btn-small {
  padding: 0.45rem 1.05rem;
  font-size: 0.82rem;
}

/* ---------- Language toggle ---------- */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 2px;
  background: var(--bg-alt);
  border-radius: 980px;
}

.lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.32rem 0.65rem;
  border-radius: 980px;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.lang-btn:hover { color: var(--text); }

.lang-btn.is-active {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.8rem 1.75rem;
  border-radius: 980px;
  font-size: 0.98rem;
  font-weight: 400;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), opacity 0.2s var(--ease);
  cursor: pointer;
  white-space: nowrap;
}

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

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

.btn[aria-disabled="true"] {
  background: var(--bg-alt);
  color: var(--text-tertiary);
  border-color: var(--hairline);
  cursor: not-allowed;
  pointer-events: none;
}

.btn-link {
  background: transparent;
  color: var(--link);
  padding: 0.8rem 0.25rem;
  border-radius: 0;
}

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

.btn-link span { transition: transform 0.2s var(--ease); display: inline-block; }
.btn-link:hover span { transform: translateX(2px); }

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(4rem, 10vw, 6.5rem) clamp(3rem, 8vw, 5rem);
  text-align: center;
}

.eyebrow {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.9rem;
  display: inline-block;
  letter-spacing: -0.01em;
}

.hero h1 {
  font-size: clamp(2.25rem, 5.2vw, 3.6rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.08;
  text-wrap: balance;
}

.hero .tagline {
  margin: 1.25rem auto 0;
  max-width: 42ch;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.cta-row {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
}

.cta-note {
  margin-top: 1.1rem;
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

.hero-visual {
  margin-top: clamp(3rem, 7vw, 4.5rem);
  max-width: 900px;
  margin-inline: auto;
}

/* ---------- Media frame (image slots with premium placeholder) ---------- */
.media-frame {
  position: relative;
  width: 100%;
  border-radius: 14px;
  /* NB: no overflow:hidden here — it would clip the shadow. The image
     itself is rounded (border-radius below), so corners stay clean. */
  background: transparent;
  /* Layered soft shadow — the app window floats with real depth on the
     light ground, the way Apple lifts product shots off the page. The
     hairline ring (last layer) crisps the edge against white. */
  box-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.06),
    0 6px 14px rgba(0, 0, 0, 0.05),
    0 22px 44px -12px rgba(0, 0, 0, 0.18),
    0 48px 92px -28px rgba(0, 0, 0, 0.24);
}

/* The in-flow <img> drives the frame's height now (no forced aspect-ratio,
   so nothing letterboxes or stretches). Kept as no-ops for compatibility. */
.media-frame--16-10,
.media-frame--3-2,
.media-frame--app { aspect-ratio: auto; }

.media-frame__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.media-frame__placeholder span {
  font-size: 0.9rem;
  color: var(--text-tertiary);
  letter-spacing: -0.005em;
}

.media-frame img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  /* Visible by default — never depend on JS to reveal the product. */
  opacity: 1;
}

/* Placeholder only shows if an image is genuinely missing. */
.media-frame:has(img[src]) .media-frame__placeholder { display: none; }

/* ---------- Split chapter (asymmetric: copy beside image) ----------
   Breaks the all-centered rhythm — Apple alternates side-by-side blocks. */
.chapter--split .split-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
}
.chapter--split .split-copy { text-align: left; max-width: 34ch; }
.chapter--split .split-copy .eyebrow { display: block; margin-bottom: 0.9rem; }
.chapter--split .split-copy h2 {
  font-size: clamp(1.6rem, 2.9vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.1;
  text-wrap: balance;
}
.chapter--split .split-copy p {
  margin-top: 1.1rem;
  color: var(--text-secondary);
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  line-height: 1.5;
}
/* Reverse: image on the left, copy on the right. */
.chapter--split-reverse .split-media { order: -1; }

@media (max-width: 820px) {
  .chapter--split .split-grid { grid-template-columns: 1fr; gap: clamp(2rem, 8vw, 3rem); }
  .chapter--split .split-copy { text-align: center; max-width: 46ch; margin-inline: auto; }
  .chapter--split-reverse .split-media { order: 0; }
}

/* ---------- Section / chapter headings ---------- */
.section-head,
.chapter-head {
  max-width: 46ch;
  margin-inline: auto;
  text-align: center;
  margin-bottom: clamp(2.75rem, 6vw, 4.25rem);
}

.section-head .eyebrow,
.chapter-head .eyebrow { display: block; }

.section-head h2,
.chapter-head h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.08;
  color: var(--text);
  text-wrap: balance;
}

.section-head p,
.chapter-head p {
  margin-top: 1.1rem;
  color: var(--text-secondary);
  font-size: clamp(1.15rem, 1.6vw, 1.3rem);
  max-width: 52ch;
  margin-inline: auto;
}

/* ---------- Chapters ---------- */
.chapter--alt { background: var(--bg-alt); }

.chapter-media {
  max-width: 900px;
  margin-inline: auto;
}

/* ---------- Methods list ---------- */
.methods-list {
  max-width: var(--maxw-text);
  margin: clamp(3rem, 6vw, 4.5rem) auto 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.75rem, 4vw, 2.75rem) clamp(2rem, 4vw, 3rem);
}

.method-item {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  text-align: left;
}

.method-tag {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--hairline-strong);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.method-item.is-flagship .method-tag {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.method-item h3 {
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.tag-recommended {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: rgba(0, 113, 227, 0.1);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
}

.method-item p {
  margin-top: 0.4rem;
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ---------- Features ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(2.5rem, 5vw, 3.5rem) clamp(1.5rem, 3vw, 2.5rem);
}

.feature {
  text-align: center;
}

.feature .icon {
  width: 32px;
  height: 32px;
  color: var(--text);
  margin-inline: auto;
}

.feature h3 {
  margin-top: 1.1rem;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.feature p {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ---------- Specs table ---------- */
.specs-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  max-width: var(--maxw-text);
  margin-inline: auto;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

.specs-table th,
.specs-table td {
  text-align: left;
  padding: 1.1rem 1.75rem;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--hairline);
}

.specs-table tr:last-child th,
.specs-table tr:last-child td { border-bottom: none; }

.specs-table th {
  font-weight: 500;
  color: var(--text-secondary);
  width: 40%;
  background: var(--bg-alt);
}

.specs-table td { color: var(--text); }

/* ---------- Final CTA ---------- */
.final-cta {
  text-align: center;
  background: var(--bg-alt);
}

.final-cta h2 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  max-width: 26ch;
  margin-inline: auto;
  color: var(--text);
}

.final-cta .cta-row { margin-top: 2rem; }

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 3rem;
  background: var(--bg-alt);
  border-top: 1px solid var(--hairline);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}

.footer-brand .brand { margin-bottom: 0.75rem; display: inline-block; }

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  max-width: 32ch;
}

.footer-links {
  display: flex;
  gap: clamp(2rem, 6vw, 4rem);
  flex-wrap: wrap;
}

.footer-col h4 {
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  margin-bottom: 0.9rem;
  font-weight: 600;
}

.footer-col a,
.footer-col span {
  display: block;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 0.6rem;
  transition: color 0.2s var(--ease);
}

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

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.social-slot {
  display: flex;
  gap: 0.9rem;
}

.social-slot a {
  color: var(--text-tertiary);
  transition: color 0.2s var(--ease);
}

.social-slot a:hover { color: var(--link); }

.social-slot svg { width: 18px; height: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .site-nav a:not(.btn) { display: none; }
  .methods-list { grid-template-columns: 1fr; }
}

/* ---------- Statement chapter (text-only, big centered) ---------- */
.statement { text-align: center; }
.statement .container { max-width: 42ch; }
.statement .eyebrow { display: block; margin-bottom: 0.9rem; }
.statement h2 {
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.08;
  text-wrap: balance;
  color: var(--text);
}
.statement p {
  margin-top: 1.25rem;
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  line-height: 1.5;
  color: var(--text-secondary);
  text-wrap: pretty;
}

/* ---------- Footnote + reference ---------- */
.fnref {
  font-size: 0.7em;
  vertical-align: super;
  line-height: 0;
  color: var(--text-tertiary);
  text-decoration: none;
}
.footnote {
  margin-top: clamp(2rem, 4vw, 3rem);
  max-width: 62ch;
  margin-inline: auto;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* Statement con fondo alterno */
.statement--alt { background: var(--bg-alt); }
