/* =============================================================
   1. Tokens
   ============================================================= */
:root{
  --bg:          #0b0912;   /* violet-black, never pure black */
  --bg-2:        #120f1c;
  --bg-3:        #191527;
  --cream:       #f1eef8;   /* text on dark — never pure white */
  --cream-2:     #c8c3d6;
  --cream-3:     #83809a;   /* metadata / muted */
  --accent:      #8b5cf6;   /* premium violet */
  --accent-2:    #c4b5fd;   /* lighter violet, used sparingly */
  --accent-deep: #6d28d9;
  --line:        rgba(238,235,248,0.10);
  --line-strong: rgba(238,235,248,0.20);

  --serif: 'Fraunces', ui-serif, Georgia, serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --nav-h: 64px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after{ box-sizing: border-box; margin: 0; }
html{
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
}
body{
  background: var(--bg);
  color: var(--cream-2);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video{ display:block; max-width:100%; height:auto; }
a{ color: inherit; text-decoration:none; }
button{ font: inherit; color: inherit; cursor:pointer; border:0; background:none; }
p{ text-wrap: pretty; }
h1, h2, h3{ text-wrap: balance; line-height: 1.05; }
code{
  font-family: var(--sans);
  background: rgba(238,235,248,0.08);
  border: 1px solid var(--line);
  padding: 0.1em 0.45em;
  border-radius: 3px;
  font-size: 0.88em;
  color: var(--cream);
}
::selection{ background: var(--accent); color: var(--bg); }
:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link{
  position: fixed; top:-100px; left:1rem;
  padding:.7rem 1.1rem; background: var(--cream); color: var(--bg);
  z-index: 9999; border-radius: 4px; font-weight:500; font-size: 14px;
  transition: top 0.2s var(--ease-out);
}
.skip-link:focus{ top: 1rem; }

.eyebrow{
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1rem 0;
}

.badge-pill{
  display:inline-flex; align-items:center; gap:0.45rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(139,92,246,0.08);
  color: var(--accent-2);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  margin-bottom: 1.4rem;
}

/* =============================================================
   4. Reveal / signature effect
   ============================================================= */
[data-reveal]{
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-soft), transform 0.9s var(--ease-soft);
}
[data-reveal].is-visible{
  opacity: 1;
  transform: translateY(0);
}
.chapter__media, .hero__media{
  overflow: hidden;
}
.chapter__media .media-slot,
.hero__media .media-slot{
  transform: scale(1.08);
  transition: transform 1.3s var(--ease-soft);
}
.chapter.is-visible .chapter__media .media-slot{
  transform: scale(1);
}
.hero__media .media-slot{ transform: scale(1); } /* hero visible on load, no scale-in wait */

/* =============================================================
   5. Progress bar / back-to-top (minimal chrome)
   ============================================================= */
.progress-bar{
  position: fixed; top:0; left:0; right:0; height:2px;
  background: transparent; z-index: 500; pointer-events:none;
}
.progress-bar span{
  display:block; height:100%; width:0%;
  background: var(--accent);
  opacity: 0.7;
  transition: width 0.1s linear;
}

.back-to-top{
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(11,9,18,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--cream-2);
  font-size: 16px;
  display:flex; align-items:center; justify-content:center;
  z-index: 400;
  opacity: 0; visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), border-color 0.2s;
}
.back-to-top.is-visible{ opacity:1; visibility: visible; transform: translateY(0); }
.back-to-top:hover{ border-color: var(--accent); color: var(--accent); }

.nav{
  position: sticky; top:0; z-index: 300;
  height: var(--nav-h);
  display:flex; align-items:center; justify-content:space-between;
  padding: 0 var(--gutter);
  /* solid fallback first — browsers without backdrop-filter still get a readable bar */
  background: rgba(11,9,18,0.92);
  border-bottom: 1px solid rgba(238,235,248,0.08);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 12px 30px rgba(0,0,0,0.22);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)){
  .nav{
    background: rgba(11,9,18,0.42);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
  }
}
.nav__brand-group{ display:flex; align-items:center; gap: 0.5rem; min-width:0; }
.nav__brand-hub{
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1rem;
  color: var(--cream);
  transition: color 0.2s var(--ease-out);
  flex-shrink:0;
}
.nav__brand-hub:hover{ color: var(--accent); }
.nav__brand-sep{ color: var(--cream-3); font-size: 0.85rem; flex-shrink:0; }
.nav__brand-current{
  font-size: 0.85rem;
  color: var(--cream-3);
  white-space: nowrap; overflow:hidden; text-overflow:ellipsis;
}
.nav__links{ display:flex; gap: clamp(1rem, 3vw, 2rem); flex-shrink:0; }
.nav__links a{
  font-size: 0.88rem;
  color: var(--cream-2);
  transition: color 0.2s var(--ease-out);
}
.nav__links a:hover{ color: var(--accent); }

/* =============================================================
   6. Media slot placeholder component
   ============================================================= */
.media-fill{
  width:100%; height:100%; object-fit: cover;
}
.media-slot{
  position: absolute; inset:0;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap: 0.6rem;
  text-align:center;
  padding: 2rem;
  background:
    repeating-linear-gradient(135deg, rgba(238,235,248,0.025) 0 2px, transparent 2px 26px),
    linear-gradient(160deg, var(--bg-3), var(--bg-2));
  border: 1px dashed var(--line-strong);
}
.media-slot__icon{
  font-size: 22px;
  color: var(--accent);
  opacity: 0.8;
}
.media-slot__label{
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream);
  font-weight: 500;
}
.media-slot__note{
  font-size: 13px;
  color: var(--cream-3);
  max-width: 40ch;
}

/* =============================================================
   7. Hero
   ============================================================= */
.hero{
  position: relative;
  min-height: clamp(460px, 68vh, 760px);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-end;
  overflow:hidden;
}
.hero__media{ position:absolute; inset:0; }
.hero__media .media-fill{
  filter: blur(1.3px) brightness(0.85) saturate(1.05);
  transform: scale(1.015);
}
.hero-glow{
  position:absolute; top:0; left:50%; transform:translateX(-50%);
  width:min(1100px, 140%); aspect-ratio: 16/10;
  background: radial-gradient(ellipse 55% 60% at 50% 0%, rgba(139,92,246,0.6) 0%, rgba(139,92,246,0.2) 42%, transparent 72%);
  filter: blur(50px);
  mix-blend-mode: screen;
  pointer-events:none;
  z-index:1;
}
.hero__scrim{
  position:absolute; inset:0;
  z-index:1;
  background:
    linear-gradient(180deg, rgba(11,9,18,0.35) 0%, rgba(11,9,18,0.45) 55%, rgba(11,9,18,0.94) 100%);
}
.hero__content{
  position: relative;
  z-index: 2;
  max-width: 920px;
  padding: 0 var(--gutter) clamp(3rem, 8vh, 6rem) var(--gutter);
  text-align:center;
}
.hero__brand{
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream-3);
  margin-bottom: 1.4rem;
}
.hero__title{
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.9rem, 5.2vw, 3.6rem);
  color: var(--cream);
  letter-spacing: -0.01em;
  max-width: 20ch;
  margin: 0 auto;
}
.hero__sub{
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  color: var(--cream-2);
  margin: 1.4rem auto 0 auto;
  max-width: 44ch;
}
.hero__cue{
  position:absolute; bottom: 1.6rem; left:50%; transform: translateX(-50%);
  z-index:2;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream-3);
  display:flex; flex-direction:column; align-items:center; gap:0.4rem;
}
.hero__cue span{ animation: cueBob 2.2s ease-in-out infinite; }
@keyframes cueBob{
  0%, 100%{ transform: translateY(0); opacity:0.6; }
  50%{ transform: translateY(6px); opacity:1; }
}
@media (prefers-reduced-motion: reduce){
  .hero__cue span{ animation: none; }
}

/* =============================================================
   8. Text-only blocks (Overview, Troubleshooting, Soporte)
   ============================================================= */
.text-block{
  padding: clamp(5rem, 14vh, 9rem) var(--gutter);
  display:flex; justify-content:center;
}
.text-block__inner{
  max-width: 680px;
  width:100%;
  text-align:center;
}
.text-block--tight{ padding-top: clamp(4rem, 10vh, 6rem); padding-bottom: clamp(4rem, 10vh, 6rem); }
.text-block--closing{ padding-bottom: clamp(6rem, 16vh, 10rem); }
.text-block--flush{ padding-bottom: 0; }

.text-block__title{
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  color: var(--cream);
  margin-bottom: 1.3rem;
}
.text-block__lede{
  font-size: clamp(1rem, 1.3vw, 1.1rem);
  color: var(--cream-2);
  font-weight: 300;
}

/* Chapter list (real sequence — Overview) */
.chapter-list{
  list-style:none;
  margin-top: 2.8rem;
  text-align:left;
  border-top: 1px solid var(--line);
}
.chapter-list li{
  display:flex; align-items:baseline; gap: 1.2rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.chapter-list__num{
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--accent);
  flex-shrink:0;
  width: 2.2ch;
}
.chapter-list__text{ font-size: 0.98rem; color: var(--cream-2); }

/* Q&A (Troubleshooting) */
.qa{
  text-align:left;
  padding: 1.4rem 0;
  border-top: 1px solid var(--line);
}
.qa:last-child{ border-bottom: 1px solid var(--line); }
.qa__q{
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1rem;
  color: var(--cream);
  margin-bottom: 0.5rem;
}
.qa__a{ font-size: 0.95rem; color: var(--cream-2); }

/* CTA row */
.cta-row{
  margin-top: 2.4rem;
  display:flex; gap: 0.9rem; justify-content:center; flex-wrap:wrap;
}
.btn{
  display:inline-block;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 24px -6px rgba(139,92,246,0.55);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), filter 0.25s var(--ease-out);
}
.btn:hover{ transform: translateY(-2px); filter: brightness(1.1); box-shadow: 0 10px 30px -6px rgba(139,92,246,0.7); }
.btn--ghost{
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--cream);
}
.btn--ghost:hover{ background: rgba(238,235,248,0.06); border-color: var(--accent); color: var(--accent); }

/* =============================================================
   9. Stat strip (Requisitos)
   ============================================================= */
.stat-strip{
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(3rem, 8vh, 4.5rem) var(--gutter);
}
.stat-strip__inner{
  max-width: 1000px;
  margin: 0 auto;
  display:grid;
  grid-template-columns: 1fr;
  gap: 2.2rem;
  text-align:center;
}
.stat__value{
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  color: var(--cream);
}
.stat__label{
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--cream-3);
  letter-spacing: 0.02em;
}

/* =============================================================
   10. Chapter (media + text, repeatable narrative unit)
   ============================================================= */
.chapter{ position: relative; }
.chapter__media{
  position: relative;
  min-height: 78svh;
  width: 100%;
}
.chapter__media--framed{
  min-height: auto;
  display:flex; align-items:center; justify-content:center;
  padding: clamp(1.5rem, 4vh, 2.5rem) var(--gutter);
  background: var(--bg-2);
}
.chapter__media--framed .media-fill{
  width:100%; height:auto;
  max-width: 880px; max-height: 62vh;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  box-shadow: 0 40px 100px -30px rgba(139,92,246,0.35);
}
.chapter__text{
  padding: clamp(2rem, 5vh, 3rem) var(--gutter);
  max-width: 680px;
  margin: 0 auto;
  text-align:center;
}
.chapter__title{
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  color: var(--cream);
  margin-bottom: 1.2rem;
}
.chapter__text-p{
  font-size: clamp(0.98rem, 1.2vw, 1.05rem);
  color: var(--cream-2);
  margin-bottom: 1rem;
}
.chapter__text-p:last-child{ margin-bottom:0; }
.chapter__aside{
  margin-top: 1.4rem;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--cream-3);
}

/* Preset showcase — unified grid (one scene, five looks) */
.preset-showcase{
  padding: 2rem var(--gutter) clamp(4rem, 10vh, 6rem) var(--gutter);
  max-width: 1180px;
  margin: 0 auto;
}
.preset-showcase__grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 2.4vw, 1.6rem);
}
.preset-card{ margin: 0; transition: opacity 0.9s var(--ease-soft), transform 0.25s var(--ease-out); }
.preset-card:hover{ transform: translateY(-4px); }
.preset-card__media{
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  transition: box-shadow 0.25s var(--ease-out);
}
.preset-card:hover .preset-card__media{ box-shadow: 0 20px 50px -18px rgba(139,92,246,0.5); }
.preset-card__media .media-slot{ padding: 1.4rem; }
.preset-card__media .media-slot__icon{ font-size: 18px; }
.preset-card__media .media-slot__note{ font-size: 12px; }
.preset-card__caption{
  margin-top: 0.7rem;
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--cream-3);
}
.preset-showcase__more{
  margin-top: clamp(2rem, 5vh, 3rem);
  text-align: center;
  font-size: 0.92rem;
}
.preset-showcase__more a{
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease-out);
}
.preset-showcase__more a:hover{ border-color: var(--accent); }

@media (min-width: 540px){
  .preset-showcase__grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px){
  .preset-showcase__grid{ grid-template-columns: repeat(3, 1fr); }
}

/* Step list (real sequences — install, custom presets) */
.step-list{
  text-align:left;
  margin-top: 1.6rem;
  padding-left: 0;
  list-style: none;
  counter-reset: step;
}
.step-list li{
  counter-increment: step;
  position: relative;
  padding: 0.7rem 0 0.7rem 2.4rem;
  font-size: 0.95rem;
  color: var(--cream-2);
  border-bottom: 1px solid var(--line);
}
.step-list li:first-child{ border-top: 1px solid var(--line); }
.step-list li::before{
  content: counter(step);
  position: absolute;
  left: 0; top: 0.7rem;
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent);
  font-size: 0.95rem;
}

/* =============================================================
   11. Footer
   ============================================================= */
.footer{
  border-top: 1px solid var(--line);
  padding: clamp(2.5rem, 6vh, 3.5rem) var(--gutter);
  text-align:center;
}
.footer__brand{
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--cream);
  margin-bottom: 0.6rem;
}
.footer__meta, .footer__copy{
  font-size: 0.8rem;
  color: var(--cream-3);
}
.footer__meta{ margin-bottom: 0.3rem; }

/* =============================================================
   12. Responsive
   ============================================================= */
@media (min-width: 720px){
  .chapter__text{ max-width: 720px; }
  .step-list li, .qa, .chapter-list li{ font-size: 1rem; }
}

@media (min-width: 960px){
  .stat-strip__inner{ grid-template-columns: repeat(3, 1fr); }
  .chapter__media{ min-height: 92svh; }
  .hero__title{ font-size: clamp(2.4rem, 4.4vw, 4.2rem); }
}

@media (min-width: 1280px){
  .text-block__inner{ max-width: 760px; }
}

/* =============================================================
   13. Reduced motion — only intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce){
  [data-reveal]{ transition-duration: 0.3s; }
  .chapter__media .media-slot, .hero__media .media-slot{ transition-duration: 0.3s; }
}
