/* ==========================================================================
   NovaWebs — styles.css
   Arquetipo: Editorial Light Cream (minimalista) · efectos: miniatura en vivo
   que se expande (firma), portada 3D, fondo que respira, splash, split text,
   botones magnéticos y el mago con conejo al suscribirse / descargar
   ========================================================================== */

:root {
  --bg: #f4efe6;          /* crema cálido */
  --card: #fffdf9;
  --ink: #1a1a1a;
  --mute: #6b6b6b;
  --line: rgba(26, 26, 26, .12);
  --soft-bg: #e8dfd0;      /* arena */
  --accent: #b85c3a;       /* terracota — único acento */
  --accent-2: #4a5d3a;     /* musgo */
  --on-ink: #ffffff;       /* texto sobre botones oscuros */
  --nav-bg: rgba(244, 239, 230, .85);
  --field-bg: #ffffff;
  --soft: #a39889;
  --ok: #15803d;
  --err: #dc2626;
  --grain-opacity: .14;
  --grain-blend: multiply;
  --glow-1: rgba(184, 92, 58, .30);    /* terracota */
  --glow-2: rgba(232, 180, 120, .45);  /* arena dorada */
  --glow-3: rgba(74, 93, 58, .20);     /* musgo */
  /* Ventanal y ciudad (modo claro = atardecer dorado) */
  --sky-top: #f4efe6; --sky-low: #f1cfb0; --b-far: #e3d0bc; --b-mid: #d6bea6; --b-near: #c7ab90;
  --win: rgba(255, 251, 242, .6); --star-o: 0; --sun-o: .85; --moon-o: 0; --lamp-o: 0; --mon-glow: .35;
  --mullion: rgba(26, 26, 26, .07); --plane: rgba(26, 26, 26, .35);
  color-scheme: light;
  --f: "Inter", system-ui, -apple-system, sans-serif;
  --f-display: "Fraunces", Georgia, serif;
  --ease-soft: cubic-bezier(.22, 1, .36, 1);
  --r: 14px;
  --max: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Modo nocturno ----------
   1) Por defecto sigue la configuración del visitante (prefers-color-scheme).
   2) Si el visitante elige con el botón, se guarda en data-theme="light|dark". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17140f; --card: #201c16; --ink: #f2ece2; --mute: #a39a8c;
    --line: rgba(242, 236, 226, .12); --soft-bg: #2a251e; --accent: #e07f57;
    --on-ink: #17140f; --nav-bg: rgba(23, 20, 15, .82); --field-bg: #15120d;
    --soft: #7d7466; --ok: #4ade80; --err: #f87171;
    --grain-opacity: .07; --grain-blend: overlay; color-scheme: dark;
    --glow-1: rgba(224, 127, 87, .34); --glow-2: rgba(170, 80, 35, .30); --glow-3: rgba(255, 175, 95, .12);
    --sky-top: #0f0c09; --sky-low: #2b1c13; --b-far: #2a221b; --b-mid: #211b15; --b-near: #18130f;
    --win: #ffcf7a; --star-o: .9; --sun-o: 0; --moon-o: .95; --lamp-o: .95; --mon-glow: .9;
    --mullion: rgba(242, 236, 226, .06); --plane: rgba(242, 236, 226, .5);
  }
}
:root[data-theme="dark"] {
  --bg: #17140f; --card: #201c16; --ink: #f2ece2; --mute: #a39a8c;
  --line: rgba(242, 236, 226, .12); --soft-bg: #2a251e; --accent: #e07f57;
  --on-ink: #17140f; --nav-bg: rgba(23, 20, 15, .82); --field-bg: #15120d;
  --soft: #7d7466; --ok: #4ade80; --err: #f87171;
  --grain-opacity: .07; --grain-blend: overlay; color-scheme: dark;
    --glow-1: rgba(224, 127, 87, .34); --glow-2: rgba(170, 80, 35, .30); --glow-3: rgba(255, 175, 95, .12);
    --sky-top: #0f0c09; --sky-low: #2b1c13; --b-far: #2a221b; --b-mid: #211b15; --b-near: #18130f;
    --win: #ffcf7a; --star-o: .9; --sun-o: 0; --moon-o: .95; --lamp-o: .95; --mon-glow: .9;
    --mullion: rgba(242, 236, 226, .06); --plane: rgba(242, 236, 226, .5);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); transition: background-color .4s, color .4s; font: 400 16px/1.6 var(--f); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.08; font-weight: 500; font-family: var(--f-display); font-variation-settings: "opsz" 96; }
h1 em, h2 em { font-style: italic; font-weight: 400; color: var(--accent); }
.info h3 { font-family: var(--f); font-weight: 600; letter-spacing: -.01em; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 999; background: var(--ink); color: var(--on-ink); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.section { padding-top: clamp(80px, 10vw, 130px); }
.kicker { margin: 0 0 10px; font-size: 13px; font-weight: 500; color: var(--mute); }
.muted { color: var(--mute); }
.soft { color: var(--soft); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 999px; font-size: 15px; font-weight: 500; border: 1px solid transparent; white-space: nowrap; transition: background .25s, border-color .25s, transform .45s var(--ease-soft), box-shadow .45s var(--ease-soft), opacity .2s; }
.btn:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .22), 0 8px 18px -8px rgba(184, 92, 58, .22); }
.btn:active { transform: translateY(-1px); transition-duration: .12s; }
.btn-sm { padding: 8px 15px; font-size: 14px; }
.btn-dark { background: var(--ink); color: var(--on-ink); }
.btn-dark:hover { background: var(--accent); color: #fff; }
.btn-line { border-color: var(--line); background: var(--card); }
.btn-line:hover { border-color: var(--ink); }
.btn-discord { background: #5865f2; color: #fff; }
.btn-telegram { background: #229ed9; color: #fff; }
.btn-paypal { background: #ffc439; color: #003087; }
.btn-coffee { background: #ffdd00; color: #111; }
.btn-discord:hover, .btn-telegram:hover, .btn-paypal:hover, .btn-coffee:hover { opacity: .88; }
.x { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--mute); transition: background .2s, color .2s; }
.x:hover { background: var(--soft-bg); color: var(--ink); }

/* ---------- Botón de tema ---------- */
.theme-toggle { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink); transition: background .25s, border-color .25s, transform .45s var(--ease-soft); flex: none; }
.theme-toggle:hover { border-color: var(--ink); transform: rotate(-20deg); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
.is-dark .theme-toggle .i-sun { display: block; }
.is-dark .theme-toggle .i-moon { display: none; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 28px; padding: 14px var(--gutter); background: var(--nav-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .3s; }
.nav.is-scrolled { border-bottom-color: var(--line); }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 17px; }
.logo-mark { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; }
.nav-links { display: flex; gap: 24px; margin-left: auto; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-links a { font-size: 14px; color: var(--mute); transition: color .2s; }
.nav-links a:hover { color: var(--ink); }
.nav-link { position: relative; padding: 4px 0; }
.nav-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease-soft); }
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- Intro ---------- */
/* ---------- Portada ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; margin-bottom: clamp(24px, 4vw, 48px); }
.hero-grid { display: grid; grid-template-columns: 1fr 1.08fr; grid-template-areas: "copy stage" "desk stage"; column-gap: clamp(24px, 4vw, 56px); align-items: center; padding-top: clamp(48px, 7vw, 96px); padding-bottom: clamp(20px, 3vw, 40px); }
.hero-copy { grid-area: copy; align-self: end; }
.hero-stage { grid-area: stage; }
.hero h1 { font-size: clamp(42px, 6.2vw, 84px); letter-spacing: -.035em; line-height: 1; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* Fondo que respira (mesh gradient en CSS) */
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); will-change: transform; }
.b1 { width: 44vw; height: 44vw; left: -10vw; top: -16vw; background: var(--glow-1); animation: drift1 18s ease-in-out infinite alternate; }
.b2 { width: 40vw; height: 40vw; right: -8vw; top: 2vw; background: var(--glow-2); animation: drift2 22s ease-in-out infinite alternate; }
.b3 { width: 32vw; height: 32vw; left: 32vw; top: 18vw; background: var(--glow-3); animation: drift3 26s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate3d(9vw, 7vw, 0) scale(1.18); } }
@keyframes drift2 { to { transform: translate3d(-7vw, 9vw, 0) scale(.88); } }
@keyframes drift3 { to { transform: translate3d(-12vw, -6vw, 0) scale(1.25); } }

/* Plantillas flotando en 3D */
.hero-stage { position: relative; height: clamp(320px, 36vw, 500px); perspective: 1600px; }
.stack { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.win {
  position: absolute; width: 74%; aspect-ratio: 16 / 10.5; display: flex; flex-direction: column;
  border-radius: 12px; overflow: hidden; background: var(--card); border: 1px solid var(--line); cursor: pointer;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .45), 0 12px 30px -18px rgba(184, 92, 58, .35);
  animation: winFloat 7s ease-in-out infinite; transition: box-shadow .4s;
}
.win:hover { box-shadow: 0 50px 90px -30px rgba(0, 0, 0, .5), 0 0 0 2px var(--accent); }
.w1 { top: 0; right: 0; transform: translate3d(calc(var(--fan, 0) * 50px), calc(var(--fan, 0) * -40px), 90px) rotateY(-16deg) rotateX(5deg); }
.w2 { top: 22%; right: 22%; transform: translate3d(calc(var(--fan, 0) * -160px), calc(var(--fan, 0) * 10px), 0) rotateY(-16deg) rotateX(5deg) rotateZ(calc(var(--fan, 0) * -4deg)); animation-delay: -2.3s; }
.w3 { top: 44%; right: 6%; transform: translate3d(calc(var(--fan, 0) * 80px), calc(var(--fan, 0) * 70px), -90px) rotateY(-16deg) rotateX(5deg) rotateZ(calc(var(--fan, 0) * 3deg)); animation-delay: -4.6s; }
@keyframes winFloat { 50% { translate: 0 -12px; } }
.win-bar { flex: none; height: 26px; display: flex; align-items: center; gap: 5px; padding: 0 10px; background: var(--soft-bg); border-bottom: 1px solid var(--line); }
.win-bar i { width: 8px; height: 8px; border-radius: 50%; background: #ff5f57; }
.win-bar i:nth-child(2) { background: #febc2e; }
.win-bar i:nth-child(3) { background: #28c840; }
.win-bar span { margin-left: 8px; padding: 0 10px; border-radius: 6px; background: var(--bg); color: var(--mute); font-size: 10px; line-height: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-body { position: relative; flex: 1; overflow: hidden; background: var(--soft-bg); }
.win-scroll { position: absolute; top: 0; left: 0; width: 100%; animation: winScroll 20s ease-in-out infinite alternate; }
@keyframes winScroll { 0%, 12% { translate: 0 0; } 88%, 100% { translate: 0 var(--to, 0px); } }
.win-body iframe { display: block; width: 1280px; height: 2400px; border: 0; transform: scale(var(--s, .3)); transform-origin: 0 0; pointer-events: none; background: var(--soft-bg); opacity: 0; transition: opacity .6s; }
.win.is-loaded iframe { opacity: 1; }
.win-body img { width: 100%; height: auto; }
.lead { margin: 20px 0 0; max-width: 52ch; font-size: clamp(16px, 1.3vw, 18px); color: var(--mute); }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 7px 14px; border-radius: 999px; font-size: 14px; color: var(--mute); transition: background .2s, color .2s; }
.chip:hover { color: var(--ink); }
.chip.is-active { background: var(--ink); color: var(--bg); }
.search { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--mute); width: 220px; transition: border-color .2s; }
.search:focus-within { border-color: var(--ink); }
.search input { border: 0; outline: 0; background: none; width: 100%; font-size: 14px; color: var(--ink); }

/* ---------- Grid + cards ---------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px) clamp(16px, 2.4vw, 28px); }
.card { position: relative; z-index: 1; }
.card.is-hidden { display: none; }
.card.is-expanded { z-index: 20; }

.thumb {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 11; overflow: hidden;
  border-radius: var(--r); background: var(--soft-bg); border: 1px solid var(--line); cursor: pointer;
  transform-origin: var(--ox, center) top;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-radius .5s;
}
.card.is-expanded .thumb { transform: scale(1.38); border-radius: 10px; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .35), 0 18px 40px -18px rgba(184, 92, 58, .35), 0 0 0 1px rgba(0, 0, 0, .06); }
.live { position: absolute; left: 0; top: 0; width: 100%; transform: translateY(0); will-change: transform; }
.thumb.is-scrolling .live { transform: translateY(var(--ty, 0px)); transition: transform var(--dur, 6s) linear; }
.thumb:not(.is-scrolling) .live { transition: transform .6s var(--ease); }
.live iframe { display: block; width: 1280px; height: var(--ph, 2400px); border: 0; transform: scale(var(--s, .3)); transform-origin: 0 0; pointer-events: none; background: var(--soft-bg); }
.live img { width: 100%; height: auto; }
.thumb-loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--mute); transition: opacity .4s; }
.thumb.is-loaded .thumb-loading { opacity: 0; pointer-events: none; }
.hint { position: absolute; left: 10px; bottom: 10px; padding: 4px 10px; border-radius: 999px; background: rgba(17, 17, 17, .75); color: #fff; font-size: 12px; opacity: 0; transition: opacity .3s; pointer-events: none; }
.thumb:hover .hint { opacity: 1; }
.card.is-expanded .hint { opacity: 0; }
.badge { position: absolute; top: 10px; left: 10px; z-index: 2; padding: 3px 9px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.badge-lock { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }

.info { padding-top: 14px; }
.info-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.info h3 { font-size: 17px; }
.info .cat { font-size: 13px; color: var(--mute); }
.info p { margin: 4px 0 0; font-size: 14px; color: var(--mute); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.actions { display: flex; gap: 8px; margin-top: 12px; }
.empty { color: var(--mute); text-align: center; padding: 40px 0; }

/* ---------- Section heads ---------- */
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 32px; }
.head h2, .box h2 { font-size: clamp(28px, 3.6vw, 40px); }
.perks { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 0; margin: 32px 0 0; font-size: 14px; color: var(--mute); }
.perks li::before { content: "✓ "; color: var(--accent); font-weight: 600; }

/* ---------- Community + support ---------- */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.box { padding: clamp(24px, 3.5vw, 40px); border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.box .muted { margin: 12px 0 0; max-width: 42ch; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* ---------- Reviews ---------- */
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.quote { margin: 0; padding: 24px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.quote blockquote { margin: 0; font-family: var(--f-display); font-size: 19px; line-height: 1.45; flex: 1; }
.quote figcaption { font-size: 14px; }
.quote figcaption span { color: var(--mute); }
.stars { color: var(--accent); font-size: 13px; letter-spacing: 1px; }
.stars .off { color: var(--line); }
.review-form { display: grid; gap: 10px; max-width: 520px; margin: 0 0 32px; padding: 24px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.review-form[hidden] { display: none; }
.review-form input, .review-form textarea, .inline-sub input, .email-pop input { width: 100%; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--field-bg); outline: 0; resize: vertical; transition: border-color .2s; }
.review-form input:focus, .review-form textarea:focus, .inline-sub input:focus, .email-pop input:focus { border-color: var(--ink); }
.review-form .btn { justify-self: start; }
.stars-input { display: flex; gap: 2px; }
.stars-input button { font-size: 24px; line-height: 1; color: var(--line); transition: color .15s; }
.stars-input button.on { color: var(--accent); }
.form-msg { margin: 0; font-size: 14px; min-height: 1.2em; color: var(--ok); }
.form-msg.err { color: var(--err); }

/* ---------- Footer ---------- */
.footer { margin-top: clamp(90px, 11vw, 140px); padding-bottom: 40px; }
.footer-sub { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.footer-sub p { margin: 0; }
.footer-sub .form-msg { flex-basis: 100%; text-align: right; }
.inline-sub { display: flex; gap: 8px; width: min(400px, 100%); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-top: 24px; font-size: 14px; color: var(--mute); }
.footer-bottom nav { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-bottom a:hover { color: var(--ink); }

/* ---------- Email pop (corner, non-blocking) ---------- */
.email-pop { position: fixed; left: 20px; bottom: 20px; z-index: 60; width: min(340px, calc(100% - 40px)); padding: 20px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 20px 50px -15px rgba(0, 0, 0, .25); animation: popUp .5s var(--ease); }
.email-pop[hidden] { display: none; }
.email-pop p { margin: 0 0 4px; font-size: 14px; padding-right: 24px; }
.email-pop form { display: grid; gap: 8px; margin-top: 12px; }
.email-pop .x { position: absolute; top: 10px; right: 10px; }
@keyframes popUp { from { opacity: 0; transform: translateY(16px); } }

/* ---------- Preview modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(17, 17, 17, .5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
body.modal-open { overflow: hidden; }
.preview-shell { position: relative; width: min(1320px, 100%); height: min(90vh, 920px); display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: var(--card); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .5); animation: popUp .35s var(--ease); }
.preview-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--line); }
.preview-bar strong { margin-right: auto; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.devices { display: flex; padding: 3px; border-radius: 999px; background: var(--soft-bg); }
.devices button { padding: 5px 12px; border-radius: 999px; font-size: 13px; color: var(--mute); }
.devices button.is-active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.preview-stage { flex: 1; display: grid; place-items: center; background: var(--soft-bg); overflow: auto; }
.preview-frame { width: 100%; height: 100%; background: #fff; transition: width .4s var(--ease); }
.preview-frame[data-device="mobile"] { width: 390px; height: calc(100% - 32px); max-height: 800px; border-radius: 24px; overflow: hidden; box-shadow: 0 0 0 8px #111; }
.preview-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 200; transform: translate(-50%, 200%); opacity: 0; padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font-size: 14px; transition: transform .4s var(--ease), opacity .3s; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Estados de plantillas ---------- */
.badge-soon { background: var(--accent); color: #fff; }
.badge-upd { background: #e9b308; color: #1a1a1a; }
.badge-maint { background: var(--mute); color: var(--bg); }
.thumb-static { cursor: default; display: grid; place-items: center; text-align: center; }
.thumb-static .live img { filter: blur(6px) saturate(.7); transform: scale(1.08); }
.ph { position: absolute; inset: 0; background:
  repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--ink) 5%, transparent) 14px 15px),
  radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%), var(--soft-bg); }
.ph-label { position: relative; z-index: 1; display: grid; gap: 6px; justify-items: center; padding: 16px; }
.ph-label .ph-icon { font-size: 28px; line-height: 1; }
.ph-label strong { font-family: var(--f-display); font-weight: 500; font-size: clamp(20px, 2vw, 26px); letter-spacing: -.01em; }
.ph-label span { font-size: 13px; color: var(--mute); }
.card.is-proximamente .ph-label strong em { color: var(--accent); }
.status-note { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--soft-bg); font-size: 13px; color: var(--ink); }
.btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }
.card.is-actualizando .thumb, .card.is-mantenimiento .thumb { border-style: dashed; }

/* Tarjeta "Más plantillas en camino" */
.more-card .thumb-static { border: 1.5px dashed color-mix(in srgb, var(--ink) 25%, transparent); background: transparent; }
.more-card .ph { background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 65%); }
.more-dots { display: flex; gap: 6px; }
.more-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: moreDot 1.4s ease-in-out infinite; }
.more-dots i:nth-child(2) { animation-delay: .2s; }
.more-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes moreDot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }

/* ---------- Barra de anuncio ---------- */
.announce { position: relative; z-index: 60; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 48px 8px 16px; background: var(--ink); color: var(--bg); font-size: 14px; text-align: center; }
.announce[hidden] { display: none; }
.announce p { margin: 0; }
.announce a { text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.announce a:hover { color: var(--accent); }
.announce .x { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: inherit; opacity: .7; }
.announce .x:hover { background: rgba(127, 127, 127, .2); color: inherit; opacity: 1; }

/* ---------- Modo mantenimiento ---------- */
.maint { position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; padding: 24px; background: var(--bg); overflow: auto; }
.maint[hidden] { display: none; }
.maint::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 50% at 30% 20%, var(--glow-1), transparent), radial-gradient(50% 50% at 80% 70%, var(--glow-2), transparent); filter: blur(30px); }
.maint-card { max-width: 560px; display: grid; justify-items: center; gap: 14px; text-align: center; }
.maint-mark { width: 52px; height: 52px; border-radius: 14px; font-size: 24px; margin-bottom: 6px; }
.maint h1 { font-size: clamp(36px, 6vw, 60px); }
.maint-msg { margin: 0; color: var(--mute); font-size: 17px; }
.maint-eta { margin: 0; padding: 6px 14px; border-radius: 999px; background: var(--soft-bg); font-size: 14px; font-weight: 500; }
.maint .inline-sub { margin-top: 10px; }
.maint-links { justify-content: center; margin-top: 4px; }
body.is-maint { overflow: hidden; }
body.is-maint .splash { display: none; }

/* ---------- Grain (textura editorial sutil) ---------- */
.has-grain::after {
  content: ""; position: fixed; inset: 0; z-index: 300; pointer-events: none; opacity: var(--grain-opacity); mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}

/* ---------- Splash (doble seguro: animación CSS 4.5s + JS) ---------- */
.splash {
  position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; background: var(--bg);
  transition: opacity .8s var(--ease-soft), clip-path 1s var(--ease-soft); clip-path: inset(0 0 0 0);
  animation: splashSafety .01s 4.5s forwards;
}
.splash.is-out { opacity: 0; pointer-events: none; clip-path: inset(0 0 100% 0); }
@keyframes splashSafety { to { opacity: 0; pointer-events: none; clip-path: inset(0 0 100% 0); } }
.splash-inner { display: grid; justify-items: center; gap: 14px; }
.splash-mark { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--accent); color: #fff; font: 600 24px var(--f); animation: splashIn .7s var(--ease-soft) both; }
.splash-name { font: italic 400 28px var(--f-display); animation: splashIn .7s .1s var(--ease-soft) both; }
.splash-line { width: 120px; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.splash-line::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform-origin: left; animation: splashLine 1s .2s var(--ease-soft) both; }
@keyframes splashIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes splashLine { from { transform: scaleX(0); } }

/* ---------- Botones magnéticos ---------- */
.has-magnetic { position: relative; isolation: isolate; }
.magnetic-inner { display: inline-flex; align-items: center; justify-content: center; gap: inherit; will-change: transform; transition: transform .8s var(--ease-soft); }

/* ---------- Split text (palabra por palabra) ---------- */
.split-word { display: inline-block; opacity: 0; transform: translateY(.45em); transition: opacity .9s var(--ease-soft), transform .9s var(--ease-soft); transition-delay: calc(var(--i, 0) * 70ms + 150ms); }
.is-split-in .split-word { opacity: 1; transform: none; }

/* ---------- Oficina en lo alto: ventanal + skyline de Nueva York ---------- */
.sky { position: absolute; left: 0; right: 0; top: 0; height: 74%; overflow: hidden; background: linear-gradient(var(--sky-top), var(--sky-low)); }
.city { position: absolute; inset: 0; width: 100%; height: 100%; }
.city .b-far { fill: var(--b-far); }
.city .b-mid { fill: var(--b-mid); }
.city .b-near { fill: var(--b-near); }
.city .w { fill: var(--win); }
.city .tw { animation: cityBlink 7s steps(1) infinite; }
@keyframes cityBlink { 0%, 64% { opacity: 1; } 65%, 100% { opacity: .1; } }
.city .star { fill: #fff; opacity: var(--star-o); }
.city .star.tw { animation: starTw 4s ease-in-out infinite; }
@keyframes starTw { 50% { opacity: calc(var(--star-o) * .2); } }
.city .sun { fill: #f4b483; opacity: var(--sun-o); }
.city .moon { fill: #f2ece2; opacity: var(--moon-o); }
.city .plane { fill: var(--plane); transform-box: view-box; animation: planeFly 55s linear infinite; }
.city .plane-light { fill: #ff5a4f; animation: planeBlink 1.2s steps(1) infinite; }
@keyframes planeFly { from { transform: translate(-60px, 110px); } to { transform: translate(1680px, 70px); } }
@keyframes planeBlink { 50% { opacity: 0; } }
.frame { position: absolute; inset: 0; background:
  linear-gradient(var(--mullion), var(--mullion)) 0 22% / 100% 3px no-repeat,
  repeating-linear-gradient(90deg, transparent 0 calc(25% - 3px), var(--mullion) calc(25% - 3px) 25%); }
.sill { position: absolute; left: 0; right: 0; top: 74%; height: 10px; background: var(--soft-bg); border-top: 1px solid var(--line); box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .25); }
.hero-fade { position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 78%, transparent) 30%, transparent 58%); }

/* ---------- Programador ---------- */
.office { grid-area: desk; align-self: end; width: min(100%, 420px); margin-top: 8px; pointer-events: none; }
.office svg { width: 100%; height: auto; display: block; overflow: visible; }
.office .of-floor { fill: rgba(0, 0, 0, .12); }
.office .of-lamp-light { opacity: var(--lamp-o); transition: opacity .6s; }
.office .of-glow { opacity: var(--mon-glow); }
.office g, .office rect, .office path { transform-box: view-box; }
.office .of-code { transform-box: fill-box; transform-origin: left center; animation: ofType 9s linear infinite both; animation-delay: var(--d); }
@keyframes ofType { 0% { transform: scaleX(0); } 6% { transform: scaleX(1); } 82% { transform: scaleX(1); opacity: 1; } 90%, 100% { transform: scaleX(1); opacity: 0; } }
.office .of-arm1 { animation: ofTap .22s ease-in-out infinite alternate; }
.office .of-arm2 { animation: ofTap .27s ease-in-out -.1s infinite alternate; }
@keyframes ofTap { to { transform: translateY(-1.6px); } }
.office .of-head { transform-origin: 106px 86px; animation: ofNod 5s ease-in-out infinite; }
@keyframes ofNod { 50% { transform: rotate(3deg); } }
.office .of-steam path { animation: ofSteam 3s ease-in-out infinite; }
.office .of-steam path + path { animation-delay: 1.5s; }
@keyframes ofSteam { 0% { opacity: 0; transform: translateY(3px); } 40% { opacity: .8; } 100% { opacity: 0; transform: translateY(-7px); } }
.office .of-flash, .office .of-spark { opacity: 0; }
.office .of-spinner { transform-origin: 100px 150px; }
.office.is-spinning .of-spinner { animation: ofSpin 1.6s ease-in-out; }
@keyframes ofSpin { 25% { transform: translateY(-3px) scaleX(.05); } 50% { transform: translateY(-4px) scaleX(-1); } 75% { transform: translateY(-3px) scaleX(.05); } }
.office .of-person { transform-origin: 232px 75px; }
.office.is-entering .of-person { animation: ofEnter .9s cubic-bezier(.6, 0, .8, .4) forwards; }
.office.is-exiting .of-person { animation: ofExit .9s cubic-bezier(.2, .6, .4, 1) both; }
@keyframes ofEnter { to { transform: scale(.04); opacity: 0; } }
@keyframes ofExit { from { transform: scale(.04); opacity: 0; } }
.office.is-entering .of-flash, .office.is-exiting .of-flash { animation: ofFlash 1s .45s ease-out; }
@keyframes ofFlash { 30% { opacity: .75; } 100% { opacity: 0; } }
.office.is-entering .of-spark, .office.is-exiting .of-spark { transform-origin: 232px 76px; animation: ofSpark .9s .4s ease-out; }
@keyframes ofSpark { 0% { opacity: 0; transform: scale(.4) rotate(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: scale(1.5) rotate(60deg); } }

/* Mini programador que camina dentro de la plantilla flotante */
.visitor { position: absolute; bottom: 6%; left: -14%; height: 30%; aspect-ratio: 30 / 44; z-index: 3; opacity: 0; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.visitor svg { width: 100%; height: 100%; display: block; overflow: visible; }
.visitor g { transform-box: view-box; }
.win.is-visited { box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .45), 0 0 0 2px var(--accent), 0 0 46px rgba(224, 127, 87, .45); }
.win.is-visited .visitor { animation: visitWalk 5s linear forwards; }
.win.is-visited .visitor svg { animation: vsBob .2s ease-in-out infinite alternate; }
.win.is-visited .vs-leg { transform-origin: 15px 30px; animation: vsStep .4s ease-in-out infinite alternate; }
.win.is-visited .vs-leg.l2 { animation-direction: alternate-reverse; }
.win.is-visited .vs-arm { transform-origin: 20px 19px; animation: vsWave .9s 2.2s ease-in-out 1 both; }
@keyframes visitWalk { 0% { left: -14%; opacity: 0; } 6% { opacity: 1; } 42% { left: 44%; } 58% { left: 44%; } 94% { opacity: 1; } 100% { left: 108%; opacity: 0; } }
@keyframes vsBob { to { transform: translateY(-3%); } }
@keyframes vsStep { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
@keyframes vsWave { 25%, 75% { transform: rotate(-150deg); } 50% { transform: rotate(-120deg); } }

/* ---------- Mago + conejo + "¡Gracias!" ----------
   Línea de tiempo (≈4.5 s): aparece el mago → agita la varita → sale el conejo
   del sombrero → el conejo levanta su sombrerito y sale el letrero → lanza polvo
   y todo se desvanece. */
.magic { position: fixed; left: 0; top: 0; z-index: 9000; width: 240px; height: 220px; pointer-events: none; animation: mgIn .45s cubic-bezier(.3, 1.4, .5, 1) both, mgOut .7s 3.65s ease-in forwards; }
.magic::before { content: ""; position: absolute; inset: 6% 2% 0; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, var(--card), transparent); }
.magic svg { width: 100%; height: 100%; display: block; overflow: visible; }
/* En modo oscuro: foco de luz cálida para que se vean los sombreros negros */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .magic::before { inset: -4% -6% -2%; background: radial-gradient(closest-side, rgba(255, 214, 170, .42), rgba(255, 214, 170, .12) 60%, transparent); } }
:root[data-theme="dark"] .magic::before { inset: -4% -6% -2%; background: radial-gradient(closest-side, rgba(255, 214, 170, .42), rgba(255, 214, 170, .12) 60%, transparent); }
@keyframes mgIn { from { opacity: 0; transform: translateY(18px) scale(.6); } }
@keyframes mgOut { to { opacity: 0; transform: scale(.9) translateY(-6px); filter: blur(6px); } }
.magic g { transform-box: view-box; }
.mg-brazo { transform-origin: 60px 128px; animation: mgWave .9s .35s ease-in-out both; }
@keyframes mgWave { 0% { transform: rotate(0); } 30% { transform: rotate(-28deg); } 60% { transform: rotate(18deg); } 100% { transform: rotate(0); } }
.mg-chispas { opacity: 0; transform-origin: 26px 76px; animation: mgSpark .8s .65s ease-out both; }
@keyframes mgSpark { 0% { opacity: 0; transform: scale(.3) rotate(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: scale(1.6) rotate(90deg); } }
.mg-hat-glow { opacity: 0; animation: mgGlow .9s .85s ease-out both; }
@keyframes mgGlow { 40% { opacity: .9; } 100% { opacity: 0; } }
.mg-conejo { transform: translateY(96px); animation: mgRise .75s 1.05s cubic-bezier(.3, 1.5, .5, 1) forwards; }
@keyframes mgRise { to { transform: translateY(0); } }
.mg-sombrerito { transform-origin: 170px 104px; animation: mgTip .45s 1.85s ease-out forwards; }
@keyframes mgTip { to { transform: translate(-10px, -12px) rotate(-22deg); } }
.mg-letrero { transform-origin: 170px 98px; transform: scaleY(0); animation: mgSign .7s 2.05s cubic-bezier(.3, 1.45, .5, 1) forwards; }
@keyframes mgSign { to { transform: scaleY(1); } }
.mg-pata { transform-origin: 181px 134px; animation: mgThrow .45s 3.2s ease-in-out both; }
@keyframes mgThrow { 50% { transform: rotate(-70deg) translate(0, -3px); } }
.mg-ojo { transform-origin: center; animation: mgBlink 3s 1.6s steps(1) infinite; }
@keyframes mgBlink { 0%, 92%, 100% { opacity: 1; } 94% { opacity: 0; } }
.dust { position: fixed; left: 0; top: 0; z-index: 9001; width: 6px; height: 6px; margin: -3px; border-radius: 50%; pointer-events: none; box-shadow: 0 0 8px 2px rgba(255, 209, 102, .7); }
@media (max-width: 640px) { .magic { width: 200px; height: 183px; } }

/* ---------- Reveal (subtle) ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; grid-template-areas: "copy" "stage" "desk"; }
  .office { justify-self: center; width: min(86%, 360px); }
  .sky { height: 66%; }
  .sill { top: 66%; }
  .hero-fade { background: linear-gradient(180deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 80%, transparent) 34%, transparent 52%); }
  .hero-stage { height: clamp(260px, 56vw, 420px); margin-top: 8px; }
  .win { width: 70%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quotes { grid-template-columns: 1fr 1fr; }
  .quotes .quote:nth-child(3) { display: none; }
  .nav-links { display: none; }
  .nav-actions { margin-left: auto; }
}
@media (max-width: 640px) {
  .hero-stage { height: 230px; }
  .win { width: 76%; }
  .win-bar { height: 18px; }
  .win-bar span { display: none; }
  .grid { grid-template-columns: 1fr; }
  .duo, .quotes { grid-template-columns: 1fr; }
  .quotes .quote:nth-child(3) { display: flex; }
  .search { width: 100%; }
  .filters { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 4px; scrollbar-width: none; }
  .chip { flex: none; }
  .actions .btn { flex: 1; }
  .footer-sub .form-msg { text-align: left; }
  .preview-bar { flex-wrap: wrap; }
  .preview-bar strong { flex-basis: calc(100% - 44px); }
  .devices { display: none; }
  .preview-shell { height: 92vh; }
  .preview-frame[data-device] { width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
}
