/* ============================================================
   DUNITY — blog  ·  dunity.app/blog
   Lectura oscura y cinematográfica. Hereda los tokens de marca.
   Space Grotesk + JetBrains Mono · acento píldora #F32424.
   ============================================================ */

:root {
  --bg:      #0a0a0b;
  --bg-elev: #111114;
  --card:    #131318;
  --card-2:  #17171d;
  --line:    rgba(255, 255, 255, 0.08);
  --line-2:  rgba(255, 255, 255, 0.14);
  --text:    #f5f5f4;
  --muted:   #a6a6ae;
  --faint:   #6a6a73;
  --accent:  #F32424;
  --art-accent: #F32424; /* lo pisa cada artículo según su cluster */
  --display: "Space Grotesk", system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, monospace;
  --ease:    cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; overflow-x: hidden; }
html, body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--display);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body { overflow-x: hidden; width: 100%; position: relative; }
::selection { background: var(--accent); color: #fff; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

#matrix { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0.08; }

/* ---------- header ---------- */
.blog-top {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  max-width: 1180px; margin: 0 auto; padding: 22px 24px;
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 1.5px; font-size: 17px; }
.wordmark img { width: 28px; height: 28px; object-fit: contain; }
.blog-nav { display: flex; gap: 22px; font-size: 14px; }
.blog-nav a { color: var(--muted); transition: color .2s; }
.blog-nav a:hover, .blog-nav a[aria-current="page"] { color: var(--text); }

/* ---------- layout de artículo ---------- */
.article, .hub { position: relative; z-index: 1; }
.wrap-article { width: 100%; max-width: 760px; margin: 0 auto; padding: 24px 24px 80px; }

.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--art-accent); display: inline-flex; align-items: center; gap: 10px; margin: 8px 0 18px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--art-accent); box-shadow: 0 0 12px var(--art-accent); }

.article h1, .hub h1 {
  font-size: clamp(30px, 5.2vw, 50px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.03;
  margin: 0 0 22px; text-wrap: balance;
}
.hub .lead { color: var(--muted); font-size: clamp(17px, 2vw, 20px); line-height: 1.55; max-width: 54ch; margin: 0 0 40px; }

/* ---------- hero art ---------- */
.hero { margin: 0 0 40px; }
.hero-art {
  width: 100%; height: auto; border-radius: 18px; border: 1px solid var(--line);
  display: block; box-shadow: 0 30px 80px -40px rgba(0,0,0,0.9);
}

/* ---------- prosa ---------- */
.prose { font-size: 18px; line-height: 1.72; color: #e6e6e4; }
.prose > p { margin: 0 0 22px; }
.prose h2 {
  font-size: clamp(24px, 3.4vw, 32px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.12;
  margin: 52px 0 18px; scroll-margin-top: 24px;
}
.prose h3 { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; margin: 34px 0 12px; }
.prose strong { color: #fff; font-weight: 600; }
.prose em { color: #f0f0ef; font-style: italic; }
.prose a { color: var(--art-accent); border-bottom: 1px solid color-mix(in srgb, var(--art-accent) 40%, transparent); transition: border-color .2s, background .2s; padding-bottom: 1px; }
.prose a:hover { border-color: var(--art-accent); background: color-mix(in srgb, var(--art-accent) 12%, transparent); }

.prose ul, .prose ol { margin: 0 0 24px; padding-left: 0; list-style: none; }
.prose ul li, .prose ol li { position: relative; padding-left: 30px; margin: 0 0 13px; }
.prose ul li::before {
  content: ""; position: absolute; left: 6px; top: 12px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--art-accent); box-shadow: 0 0 10px color-mix(in srgb, var(--art-accent) 70%, transparent);
}
.prose ol { counter-reset: n; }
.prose ol li { counter-increment: n; }
.prose ol li::before {
  content: counter(n); position: absolute; left: 0; top: 2px;
  font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--art-accent);
  width: 20px; height: 20px; border: 1px solid color-mix(in srgb, var(--art-accent) 45%, transparent);
  border-radius: 50%; display: grid; place-items: center;
}

/* ---------- tabla ---------- */
.table-wrap { overflow-x: auto; margin: 0 0 30px; border: 1px solid var(--line); border-radius: 16px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
.prose th, .prose td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose thead th, .prose tr:first-child th { background: var(--card-2); color: #fff; font-weight: 600; }
.prose td.rowh { color: #fff; font-weight: 600; background: rgba(255,255,255,0.02); }
.prose tr:last-child td { border-bottom: none; }
.prose table td:last-child { color: var(--text); }

/* ---------- CTA destacado ---------- */
.cta {
  position: relative; overflow: hidden;
  margin: 48px 0; padding: 34px 32px;
  border: 1px solid color-mix(in srgb, var(--art-accent) 40%, var(--line-2));
  border-radius: 22px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  box-shadow: 0 0 60px -20px color-mix(in srgb, var(--art-accent) 55%, transparent);
}
.cta-glow { position: absolute; top: -60px; right: -40px; width: 220px; height: 220px; border-radius: 50%; background: var(--art-accent); filter: blur(90px); opacity: 0.28; pointer-events: none; }
/* línea de reposición de categoría "despertar jugando" — dorada, sembrada una vez por pieza */
.cta-reposition {
  position: relative; margin: 0 0 16px; padding-bottom: 14px;
  font-family: var(--mono); font-size: 13px; line-height: 1.5; letter-spacing: 0.01em;
  color: #d9c98a; border-bottom: 1px solid rgba(212, 175, 55, 0.22);
}
.cta-reposition strong { color: #f0dfa0; font-weight: 600; }
.cta-title { position: relative; font-size: clamp(22px, 3.2vw, 28px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 14px; }
.cta-body { position: relative; color: var(--muted); font-size: 16.5px; line-height: 1.6; }
.cta-body p { margin: 0 0 12px; }
.cta-body strong { color: var(--text); }
.cta-body a.store-pill { color: var(--art-accent); font-weight: 600; border-bottom: 1px solid currentColor; }

.cta-stores { position: relative; display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.store-btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 11px 20px 11px 16px; border-radius: 14px;
  border: 1px solid var(--line-2); background: rgba(255,255,255,0.04);
  transition: border-color .25s, transform .25s var(--ease), background .25s;
}
.store-btn:hover { transform: translateY(-2px); border-color: var(--art-accent); background: rgba(255,255,255,0.07); }
.store-btn[data-store="appstore"] { border-color: color-mix(in srgb, var(--art-accent) 55%, var(--line-2)); }
.store-glyph { width: 24px; height: 24px; flex: none; background: currentColor; opacity: .95;
  -webkit-mask: center/contain no-repeat; mask: center/contain no-repeat; }
.store-btn[data-store="appstore"] .store-glyph {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M16.365 1.43c0 1.14-.42 2.2-1.26 3.06-.9.93-2.03 1.47-3.06 1.38-.13-1.08.44-2.2 1.2-3 .84-.9 2.13-1.5 3.12-1.44zM20.6 17.02c-.55 1.28-.82 1.85-1.53 2.98-.99 1.58-2.39 3.55-4.12 3.56-1.54.01-1.93-1-4.02-.99-2.09.01-2.52.99-4.06.98-1.73-.02-3.05-1.8-4.04-3.38C-.03 16.9-.32 11.36 1.9 8.4c1.05-1.42 2.71-2.32 4.24-2.32 1.56 0 2.54 1 3.83 1 1.25 0 2.01-1 3.82-1 1.36 0 2.8.74 3.83 2.02-3.36 1.84-2.82 6.64.98 8.02z'/></svg>"); }
.store-btn[data-store="googleplay"] .store-glyph {
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M3.6 1.4a1 1 0 0 0-.6.92v19.36a1 1 0 0 0 .6.92l11.06-10.6L3.6 1.4zm12.5 8.9L5.9 1.02 17.7 7.9l-1.6 2.4zm2.9 1.7 2.6 1.5c.9.53.9 1.86 0 2.4l-2.6 1.5-1.9-2.85 1.9-2.05zm-2.9 3.9 1.6 2.4L5.9 22.98l10.2-9.28 1.9 3.1z'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='black' d='M3.6 1.4a1 1 0 0 0-.6.92v19.36a1 1 0 0 0 .6.92l11.06-10.6L3.6 1.4z'/></svg>"); }
.store-txt { display: flex; flex-direction: column; line-height: 1.15; }
.store-txt small { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.store-txt b { font-size: 15px; font-weight: 600; }

/* enlace de tienda inline (fuera del CTA, si lo hubiera) */
.store-inline { color: var(--art-accent); font-weight: 600; border-bottom: 1px solid currentColor; }

/* ---------- FAQ acordeón ---------- */
.faq-title { margin-top: 56px; }
.faq { border-top: 1px solid var(--line); margin-top: 8px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 20px 40px 20px 0; position: relative;
  font-size: 18px; font-weight: 600; color: var(--text); line-height: 1.35;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 18px;
  color: var(--art-accent); font-weight: 400; font-size: 24px; transition: transform .25s var(--ease);
}
.faq details[open] summary::after { content: "–"; }
.faq .faq-a { padding: 0 0 20px; color: var(--muted); font-size: 16.5px; line-height: 1.65; }
.faq .faq-a p { margin: 0 0 12px; }
.faq .faq-a a { color: var(--art-accent); border-bottom: 1px solid color-mix(in srgb, var(--art-accent) 40%, transparent); }

/* ---------- relacionados ---------- */
.related { margin: 64px 0 0; }
.related-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 20px; }
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.related-card {
  display: flex; flex-direction: column; gap: 8px; padding: 20px;
  border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg, var(--card-2), var(--card));
  transition: border-color .25s, transform .3s var(--ease);
}
.related-card:hover { border-color: var(--art-accent); transform: translateY(-3px); }
.rc-k { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.rc-t { font-size: 16px; font-weight: 600; line-height: 1.3; text-transform: capitalize; }

/* ---------- footer ---------- */
.article-foot { margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; }
.foot-links { display: flex; gap: 22px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); font-size: 14px; transition: color .2s; }
.foot-links a:hover { color: var(--text); }
.foot-legal { color: var(--faint); font-size: 13px; margin: 0; }

/* ---------- hub ---------- */
.hub-cluster { margin: 0 0 52px; }
.hub-cluster h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 20px; color: var(--muted); }
.hub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hub-card {
  display: flex; flex-direction: column; gap: 9px; padding: 22px;
  border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, var(--card-2), var(--card));
  transition: border-color .25s, transform .3s var(--ease);
}
.hub-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.hub-card.pilar { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2)); box-shadow: 0 0 40px -24px var(--accent); }
.hc-k { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.hc-t { font-size: 18px; font-weight: 600; line-height: 1.25; }
.hc-d { font-size: 14px; color: var(--muted); line-height: 1.5; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .related-grid, .hub-grid { grid-template-columns: 1fr; }
  .prose { font-size: 17px; }
  .cta { padding: 26px 22px; }
  .blog-nav { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ============================================================
   VIBRA — animación y vida (mismo lenguaje que la home)
   ============================================================ */

/* ---- barra de progreso de lectura ---- */
.read-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50;
  background: rgba(255,255,255,0.04); pointer-events: none;
}
.read-progress i {
  display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--art-accent), #ff8a5c 60%, var(--art-accent));
  box-shadow: 0 0 12px color-mix(in srgb, var(--art-accent) 70%, transparent);
  transition: transform .1s linear;
}

/* ---- scroll reveal (solo activo si el JS marcó body.vibe-on) ---- */
body.vibe-on .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
body.vibe-on .reveal.in { opacity: 1; transform: none; }
body.vibe-on .reveal[data-d="1"] { transition-delay: .06s; }
body.vibe-on .reveal[data-d="2"] { transition-delay: .12s; }
body.vibe-on .reveal[data-d="3"] { transition-delay: .18s; }

/* ---- glow que respira (ambiente) ---- */
.vibe-glow {
  position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; z-index: 0;
  background: var(--art-accent); opacity: .18; animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe { 0%,100%{ opacity:.14; transform:scale(1);} 50%{ opacity:.26; transform:scale(1.12);} }
@keyframes float-y { 0%,100%{ transform:translateY(0);} 50%{ transform:translateY(-12px);} }
.wrap-article { position: relative; z-index: 1; }

/* ---- hero: glow detrás + leve flotación ---- */
.hero { position: relative; }
.hero::before {
  content: ""; position: absolute; inset: -40px -10% auto auto; width: 320px; height: 320px; right: -40px; top: -30px;
  border-radius: 50%; background: var(--art-accent); filter: blur(100px); opacity: .22;
  animation: breathe 10s ease-in-out infinite; z-index: -1; pointer-events: none;
}
.hero-art { animation: float-y 7s ease-in-out infinite; }

/* ---- eyebrow dot que late ---- */
.eyebrow .dot { animation: dotpulse 2.4s ease-in-out infinite; }
@keyframes dotpulse { 0%,100%{ box-shadow: 0 0 8px var(--art-accent);} 50%{ box-shadow: 0 0 18px var(--art-accent), 0 0 30px color-mix(in srgb,var(--art-accent) 50%, transparent);} }

/* ---- drop cap en el primer párrafo ---- */
.prose > p:first-of-type::first-letter {
  font-size: 3.1em; line-height: .8; font-weight: 700; float: left;
  padding: 4px 12px 0 0; color: var(--art-accent);
}

/* ---- CTA: shimmer + edge glow + botón gradiente ---- */
.cta { isolation: isolate; }
.cta::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.09) 48%, transparent 66%);
  background-size: 250% 100%; background-position: 150% 0; animation: shimmer 6s ease-in-out infinite;
}
@keyframes shimmer { 0%{ background-position: 160% 0;} 55%,100%{ background-position: -60% 0;} }
.cta > * { position: relative; z-index: 1; }
.cta-glow { animation: breathe 8s ease-in-out infinite; }
.store-btn { position: relative; overflow: hidden; }
.store-btn[data-store="appstore"] {
  background: linear-gradient(135deg, color-mix(in srgb, var(--art-accent) 26%, #17171d), #141018);
}
.store-btn::before {
  content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.18), transparent); transform: skewX(-18deg);
}
.store-btn:hover::before { animation: sweep .8s ease; }
@keyframes sweep { to { left: 130%; } }

/* ---- cards con vida (related / hub) ---- */
.related-card, .hub-card { position: relative; overflow: hidden; }
.related-card::before, .hub-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 80% at 50% -20%, color-mix(in srgb, var(--art-accent) 22%, transparent), transparent 60%);
  opacity: 0; transition: opacity .3s var(--ease);
}
.related-card:hover::before, .hub-card:hover::before { opacity: 1; }
.hub-card.pilar { animation: breathe-border 6s ease-in-out infinite; }
@keyframes breathe-border { 0%,100%{ box-shadow: 0 0 30px -18px var(--accent);} 50%{ box-shadow: 0 0 48px -14px var(--accent);} }

/* ---- conejo dorado cruzando (divisor antes del CTA) ---- */
.hop-divider { position: relative; height: 46px; margin: 40px 0 8px; overflow: hidden; pointer-events: none; }
.hop-divider::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
}
.hop-divider .hopper { position: absolute; bottom: 2px; left: 0; width: 34px; height: 34px; animation: hop-x 14s linear infinite; }
.hop-divider .hopper img { width: 100%; height: 100%; object-fit: contain; animation: hop-y .8s ease-in-out infinite; filter: drop-shadow(0 4px 10px rgba(0,0,0,.5)); }
@keyframes hop-x { 0%{ transform: translateX(-12vw);} 100%{ transform: translateX(112vw);} }
@keyframes hop-y { 0%,100%{ transform: translateY(0) rotate(-3deg);} 50%{ transform: translateY(-16px) rotate(3deg);} }

/* ---- insignia El Camino de la Madriguera (fases de la luna) ---- */
.camino-badge {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 8px 0 34px; padding: 16px 20px; border-radius: 16px;
  border: 1px solid color-mix(in srgb, #A855F7 32%, var(--line)); background: linear-gradient(180deg, var(--card-2), var(--card));
}
.camino-badge .cb-k { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #c9a8ff; }
.camino-badge .cb-moons { display: flex; gap: 8px; font-size: 20px; }
.camino-badge .cb-moons span { opacity: .5; transition: transform .3s var(--ease); }
.camino-badge .cb-moons span:hover { transform: scale(1.3) translateY(-2px); opacity: 1; }
.camino-badge a { color: #c9a8ff; border-bottom: 1px solid rgba(201,168,255,.4); font-size: 14px; }

/* ---- FAQ: brillo al abrir ---- */
.faq details[open] { background: linear-gradient(180deg, color-mix(in srgb, var(--art-accent) 5%, transparent), transparent); }
.faq details[open] summary { color: var(--art-accent); }
.faq .faq-a { animation: faqIn .35s var(--ease); }
@keyframes faqIn { from { opacity: 0; transform: translateY(-6px);} to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .hero-art, .cta::after, .cta-glow, .vibe-glow, .hop-divider .hopper, .hop-divider .hopper img, .hub-card.pilar, .eyebrow .dot { animation: none !important; }
}
