/* ==========================================================================
   Miguel Sánchez — web personal
   Paleta: azul marino + azul de marca + colores del cubo Rubik
   ========================================================================== */

:root {
  --bg: #0b1530;
  --bg-2: #0f1c3d;
  --bg-3: #14244b;
  --line: rgba(255, 255, 255, .1);
  --ink: #f3f1ea;
  --ink-2: #b7bfd6;
  --ink-3: #7f8aab;
  --blue: #3966ed;
  --red: #e8473c;
  --orange: #f28c28;
  --yellow: #f6c945;
  --green: #2fb36b;
  --white: #f7f7f2;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 18px;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
svg { display: block; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 600; line-height: 1.08; letter-spacing: -.01em; }
em { font-style: italic; color: var(--yellow); font-weight: 400; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap--text { max-width: 760px; }
.section { padding: clamp(80px, 11vw, 140px) 0; position: relative; }
.eyebrow {
  font: 700 12px/1 var(--sans);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: currentColor; }
.h1 { font-size: clamp(40px, 6vw, 76px); margin-bottom: 20px; }
.h2 { font-size: clamp(34px, 5vw, 60px); margin-bottom: 26px; max-width: 16ch; }
.lead { font-size: clamp(18px, 1.6vw, 21px); color: var(--ink); line-height: 1.6; }

/* ---------- Botones ---------- */
.btn {
  --b: var(--blue);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 24px;
  border-radius: 999px;
  background: var(--b); color: #fff;
  font: 700 15px/1 var(--sans);
  text-decoration: none; border: 2px solid var(--b);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn svg { width: 18px; height: 18px; transition: transform .2s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -10px rgba(57, 102, 237, .8); }
.btn:hover svg { transform: translateX(3px); }
.btn--ghost { background: transparent; border-color: rgba(255, 255, 255, .25); }
.btn--ghost:hover { border-color: #fff; box-shadow: none; }
.btn--sm { padding: 10px 18px; font-size: 14px; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 6px; }

/* ---------- Navegación ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  padding: 14px clamp(16px, 4vw, 40px);
  transition: background .3s, backdrop-filter .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled { background: rgba(11, 21, 48, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-color: var(--line); }
.nav__brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font: 600 18px/1 var(--serif); }
.nav__brand img { width: 40px; height: 40px; }
.nav__links { display: flex; gap: 26px; margin-left: auto; }
.nav__links a { text-decoration: none; font-size: 15px; font-weight: 600; color: var(--ink-2); transition: color .2s; }
.nav__links a:hover, .nav__links a[aria-current] { color: #fff; }
.nav__toggle { display: none; }

@media (max-width: 860px) {
  .nav { gap: 14px; }
  .nav .btn--sm { margin-left: auto; }
  .nav__toggle {
    display: grid; place-content: center; gap: 6px;
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255,255,255,.08); border: 0; cursor: pointer;
  }
  .nav__toggle span { width: 18px; height: 2px; background: #fff; transition: transform .25s; }
  .nav.is-open .nav__toggle span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav.is-open .nav__toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav__links {
    position: fixed; inset: 72px 12px auto 12px;
    flex-direction: column; gap: 4px; padding: 12px;
    background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav__links a { padding: 14px 16px; border-radius: 10px; font-size: 17px; }
  .nav__links a:hover { background: rgba(255,255,255,.05); }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; transform: none; }
}
@media (max-width: 420px) { .nav__brand span { display: none; } }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: 120px 0 70px;
  position: relative; overflow: hidden;
  background:
    radial-gradient(60% 60% at 78% 45%, rgba(57,102,237,.35), transparent 70%),
    radial-gradient(40% 40% at 10% 90%, rgba(232,71,60,.12), transparent 70%),
    var(--bg);
}
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(70% 70% at 60% 45%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 70% at 60% 45%, #000 20%, transparent 75%);
  opacity: .55;
}
.hero__inner { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 40px; }
.hero__title { display: flex; flex-direction: column; margin-bottom: 26px; }
.hero__name { font: 700 clamp(15px, 1.4vw, 18px)/1 var(--sans); letter-spacing: .3em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 18px; }
.hero__claim { font-size: clamp(50px, 8vw, 108px); font-weight: 800; line-height: .98; letter-spacing: -.025em; }
.hero__claim em { font-weight: 400; color: var(--yellow); }
.hero__roles { font-weight: 600; color: var(--ink-2); margin: -8px 0 24px; }
.hero__quote { font: italic 400 clamp(19px, 1.8vw, 24px)/1.45 var(--serif); color: var(--ink-2); max-width: 30ch; border-left: 3px solid var(--blue); padding-left: 18px; margin-bottom: 34px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 34px; }
.hero__social { list-style: none; padding: 0; margin: 0; display: flex; gap: 10px; }
.hero__social a {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--ink-2);
  transition: color .2s, border-color .2s, transform .2s, background .2s;
}
.hero__social a:hover { color: #fff; border-color: var(--blue); background: rgba(57,102,237,.15); transform: translateY(-3px); }
.hero__social svg { width: 18px; height: 18px; }

.hero__art { display: flex; flex-direction: column; align-items: center; }
.hero__hint { font-size: 13px; color: var(--ink-3); margin-top: 18px; letter-spacing: .04em; }

/* ---------- Cubo 3D ---------- */
.cube-stage {
  --s: clamp(190px, 26vw, 300px);
  width: calc(var(--s) * 1.9); height: calc(var(--s) * 1.9);
  max-width: 88vw;
  display: grid; place-items: center;
  perspective: 1100px;
  cursor: grab; touch-action: none; user-select: none;
  position: relative;
}
.cube-stage:active { cursor: grabbing; }
.cube {
  width: var(--s); height: var(--s);
  position: relative; transform-style: preserve-3d;
  transform: rotateX(-28deg) rotateY(-38deg);
}
.face {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 5%;
  padding: 4.5%;
  background: #0a0a0d;
  border-radius: 10%;
  backface-visibility: hidden;
}
.face i {
  border-radius: 16%;
  background: var(--sc, #fff);
  box-shadow: inset 0 -6px 12px rgba(0,0,0,.22), inset 0 4px 8px rgba(255,255,255,.28);
  transition: background .45s;
}
.f-front  { transform: translateZ(calc(var(--s) / 2)); }
.f-back   { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.f-right  { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.f-left   { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.f-top    { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.f-bottom { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.f-front i.logo { background: #fff url("assets/logos/logo-m-azul.webp") center / 82% no-repeat; }
.cube-shadow {
  position: absolute; bottom: 4%; left: 50%;
  width: 70%; height: 40px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(0,0,0,.6), transparent);
  filter: blur(6px); pointer-events: none;
}

/* ---------- Cinta ---------- */
.ticker { border-block: 1px solid var(--line); overflow: hidden; background: var(--bg-2); }
.ticker__track {
  display: flex; align-items: center; gap: 28px;
  width: max-content; padding: 20px 0;
  animation: ticker 40s linear infinite;
  font: italic 400 clamp(20px, 2.4vw, 30px)/1 var(--serif);
  color: var(--ink-2);
}
.ticker__track i { width: 14px; height: 14px; border-radius: 3px; background: var(--blue); flex: none; }
.ticker__track i:nth-of-type(6n+2) { background: var(--red); }
.ticker__track i:nth-of-type(6n+3) { background: var(--yellow); }
.ticker__track i:nth-of-type(6n+4) { background: var(--green); }
.ticker__track i:nth-of-type(6n+5) { background: var(--orange); }
.ticker__track i:nth-of-type(6n) { background: var(--white); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Sobre mí ---------- */
.about__grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(40px, 6vw, 90px); align-items: center; }
.about__media { margin: 0; position: relative; }
.about__media > img:first-child { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r); }
.about__badge {
  position: absolute; right: -22px; bottom: -22px;
  width: 120px; height: 120px; padding: 12px;
  background: var(--blue); border-radius: 50%;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,.6);
}
.about__text > p:not(.eyebrow):not(.lead) { color: var(--ink-2); }
.roles { list-style: none; padding: 0; margin: 34px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.role {
  padding: 20px; border-radius: 14px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-top: 3px solid var(--c);
  display: flex; flex-direction: column; gap: 4px;
  transition: transform .25s, border-color .25s;
}
.role:hover { transform: translateY(-4px); }
.role__n { font: 700 12px/1 var(--sans); color: var(--c); letter-spacing: .1em; margin-bottom: 6px; }
.role strong { font: 600 19px/1.2 var(--serif); }
.role small { font-size: 14px; color: var(--ink-3); line-height: 1.45; }

/* ---------- Lo que me mueve ---------- */
.passions { background: var(--bg-2); }
.pgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.pcard {
  grid-column: span 1;
  padding: 26px; border-radius: var(--r);
  background: var(--bg); border: 1px solid var(--line);
  color: var(--ink-3);
  position: relative; overflow: hidden;
  transition: transform .3s, border-color .3s;
}
.pcard::after {
  content: ""; position: absolute; inset: auto -30% -60% auto;
  width: 70%; aspect-ratio: 1; border-radius: 50%;
  background: var(--c); opacity: .08; filter: blur(40px);
  transition: opacity .3s;
}
.pcard:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--c) 55%, transparent); }
.pcard:hover::after { opacity: .2; }
.pcard--wide { grid-column: span 2; }
.pcard__art { width: 100%; height: 150px; margin-bottom: 20px; }
.pcard h3 { font-size: 23px; color: var(--ink); margin-bottom: 8px; }
.pcard p { font-size: 15px; color: var(--ink-2); margin: 0; }
.pcard p a { color: var(--c); font-weight: 600; }

/* animaciones de los gráficos (solo cuando la tarjeta es visible) */
.maze-path { stroke-dasharray: 900; stroke-dashoffset: 900; }
.in .maze-path { animation: draw 3.2s ease-in-out .2s infinite alternate; }
.maze-dot { offset-path: path("M30 140V30h40v100h40V70h40v60h40V30h40v60h40v50h20"); offset-distance: 0%; offset-rotate: 0deg; }
.in .maze-dot { animation: travel 3.2s ease-in-out .2s infinite alternate; }
.maze-dot { cx: 0; cy: 0; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes travel { to { offset-distance: 100%; } }

.bars rect { transform-box: fill-box; transform-origin: bottom; transform: scaleY(.1); transition: transform .9s cubic-bezier(.2,.8,.2,1); }
.in .bars rect { transform: scaleY(1); }
.in .bars rect:nth-child(2) { transition-delay: .12s; }
.in .bars rect:nth-child(3) { transition-delay: .24s; }
.in .bars rect:nth-child(4) { transition-delay: .36s; }
.trend { stroke-dasharray: 200; stroke-dashoffset: 200; transition: stroke-dashoffset 1.4s ease .5s; }
.in .trend { stroke-dashoffset: 0; }

.steps { stroke-dasharray: 260; stroke-dashoffset: 260; transition: stroke-dashoffset 1.6s ease; }
.in .steps { stroke-dashoffset: 0; }
.climber { offset-path: path("M35 133L65 108L95 83L125 58"); offset-rotate: 0deg; offset-distance: 0%; }
.in .climber { animation: climbmove 4s ease-in-out infinite; }
@keyframes climbmove { 0%, 10% { offset-distance: 0%; } 85%, 100% { offset-distance: 100%; } }

.pulses path { stroke-dasharray: 10 90; stroke-dashoffset: 100; opacity: 0; }
.in .pulses path { opacity: 1; animation: pulse-run 1.8s linear infinite; }
.in .pulses path:nth-child(2) { animation-delay: .45s; }
.in .pulses path:nth-child(3) { animation-delay: .9s; }
.in .pulses path:nth-child(4) { animation-delay: 1.35s; }
@keyframes pulse-run { to { stroke-dashoffset: 0; } }

.fp { stroke-dasharray: 200; stroke-dashoffset: 200; }
.in .fp { animation: draw 2.4s ease forwards; }
.in .fp:nth-child(2) { animation-delay: .15s; }
.in .fp:nth-child(3) { animation-delay: .3s; }
.in .fp:nth-child(4) { animation-delay: .45s; }
.in .fp:nth-child(5) { animation-delay: .6s; }
.in .fp:nth-child(6) { animation-delay: .75s; }
.idl { transform-box: fill-box; transform-origin: left; transform: scaleX(0); transition: transform .8s ease 1s; }
.in .idl { transform: scaleX(1); }

.vt { opacity: 0; transform: translateY(12px); transition: opacity .6s ease var(--d), transform .6s cubic-bezier(.2,.8,.2,1) var(--d); }
.in .vt { opacity: 1; transform: none; }
.art-rubik polygon { stroke: #0a0a0d; stroke-width: 2.4; stroke-linejoin: round; transition: fill .5s; }
.art-slide rect.t { transition: x .35s cubic-bezier(.3,.8,.3,1), y .35s cubic-bezier(.3,.8,.3,1); }

/* ---------- Juega ---------- */
.play__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 90px); align-items: center; }
.play__text .lead { color: var(--ink-2); }
.play__stats { display: flex; gap: 40px; margin: 30px 0; }
.play__stats div { display: flex; flex-direction: column-reverse; }
.play__stats dt { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.play__stats dd { margin: 0; font: 700 44px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.play__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.play__msg { min-height: 1.6em; margin-top: 18px; color: var(--green); font-weight: 700; }
.puzzle-wrap {
  padding: clamp(12px, 2vw, 18px);
  background: linear-gradient(145deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line); border-radius: 26px;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.7);
  width: 100%; max-width: 480px; justify-self: center;
}
.puzzle {
  position: relative; width: 100%; aspect-ratio: 1;
  border-radius: 16px; background: rgba(0,0,0,.25);
}
.tile {
  position: absolute; width: calc(33.333% - 8px); height: calc(33.333% - 8px);
  margin: 4px; border: 0; padding: 0; cursor: pointer;
  border-radius: 12px;
  background-color: var(--blue);
  background-image: url("assets/logos/logo-m-blanco.webp");
  background-size: 300% 300%;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.22), 0 6px 14px -6px rgba(0,0,0,.6);
  transition: left .22s cubic-bezier(.3,.8,.3,1), top .22s cubic-bezier(.3,.8,.3,1), filter .2s;
  font: 700 12px/1 var(--sans); color: #0b1530;
  display: flex; align-items: flex-start; justify-content: flex-end; padding: 7px 9px; opacity: 1;
}
.tile:hover { filter: brightness(1.12); }
.tile.ok { background-color: var(--green); }
.puzzle.solved .tile { background-color: var(--blue); color: transparent; }
.puzzle.solved { animation: pop .6s ease; }
@keyframes pop { 50% { transform: scale(1.03); } }

/* ---------- Blog / Lo que comparto ---------- */
.share { background: var(--bg-2); }
.share__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 30px; }
.share__next {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 999px;
  background: rgba(47,179,107,.1); border: 1px solid rgba(47,179,107,.3);
  font-size: 14px; color: var(--ink-2); margin: 0 0 26px;
}
.share__next strong { color: #fff; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(47,179,107,.7); animation: ping 1.8s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(47,179,107,0); } 100% { box-shadow: 0 0 0 0 rgba(47,179,107,0); } }

.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 60px; }
.pcard-post {
  display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; text-decoration: none;
  transition: transform .3s, border-color .3s;
}
.pcard-post:hover { transform: translateY(-5px); border-color: var(--blue); }
.pcard-post__img { aspect-ratio: 16 / 9; background: var(--bg-3); overflow: hidden; }
.pcard-post__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.pcard-post:hover .pcard-post__img img { transform: scale(1.05); }
.pcard-post__body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pcard-post__date { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); font-weight: 700; }
.pcard-post h3 { font-size: 22px; }
.pcard-post p { font-size: 15px; color: var(--ink-2); margin: 0; }
.pcard-post__go { margin-top: auto; padding-top: 8px; font-weight: 700; font-size: 14px; color: var(--yellow); }
.posts-empty {
  grid-column: 1 / -1; padding: 40px; border-radius: var(--r);
  border: 1px dashed var(--line); text-align: center; color: var(--ink-2);
}

.channels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.channel {
  display: flex; flex-direction: column; gap: 8px;
  padding: 28px; border-radius: var(--r);
  border: 1px solid var(--line); text-decoration: none;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 14%, transparent), transparent 60%);
  transition: transform .3s, border-color .3s;
}
a.channel:hover { transform: translateY(-4px); border-color: var(--c); }
.channel__k { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--c); }
.channel strong { font: 600 24px/1.15 var(--serif); }
.channel p { font-size: 15px; color: var(--ink-2); margin: 0; }
.channel__go { margin-top: auto; padding-top: 10px; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.channel__go svg { width: 16px; height: 16px; }

/* ---------- Redes ---------- */
.sgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stile {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  column-gap: 18px; align-items: center;
  padding: 24px; border-radius: var(--r);
  background: var(--bg-2); border: 1px solid var(--line);
  text-decoration: none; position: relative; overflow: hidden;
  transition: transform .3s, border-color .3s, background .3s;
}
.stile svg { grid-row: span 2; width: 46px; height: 46px; padding: 11px; border-radius: 12px; background: rgba(255,255,255,.06); color: var(--c); transition: background .3s, color .3s; }
.stile strong { font: 600 21px/1.2 var(--serif); }
.stile span { font-size: 14px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stile::after { content: "↗"; position: absolute; top: 18px; right: 20px; color: var(--ink-3); transition: transform .3s, color .3s; }
.stile:hover { transform: translateY(-4px); border-color: var(--c); }
.stile:hover svg { background: var(--c); color: var(--bg); }
.stile:hover::after { transform: translate(3px, -3px); color: #fff; }

.final {
  margin-top: 80px; padding: clamp(40px, 6vw, 70px);
  border-radius: 28px; text-align: center;
  background: radial-gradient(80% 120% at 50% 0%, rgba(57,102,237,.45), transparent 70%), var(--bg-2);
  border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.final img { width: 88px; height: 88px; }
.final p { font: 600 clamp(24px, 3vw, 36px)/1.2 var(--serif); max-width: 22ch; margin: 0 0 6px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 30px 0; font-size: 14px; color: var(--ink-3); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer p { margin: 0; }
.footer .nav__brand { font-size: 16px; color: var(--ink); }
.footer .nav__brand img { width: 32px; height: 32px; }
.footer__top { text-decoration: none; }
.footer__top:hover { color: #fff; }

/* ---------- Página del blog ---------- */
.blog-hero { padding: 150px 0 100px; }
.blog-hero .lead { color: var(--ink-2); max-width: 56ch; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.tag {
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--ink-2);
  font: 600 14px/1 var(--sans); transition: all .2s;
}
.tag:hover { border-color: var(--blue); color: #fff; }
.tag[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.posts--all .pcard-post:first-child { grid-column: span 2; }
.posts--all .pcard-post:first-child h3 { font-size: 30px; }

.post { padding-bottom: 100px; }
.post__cover { height: clamp(260px, 46vh, 460px); background: var(--bg-3) center / cover no-repeat; position: relative; }
.post__cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(11,21,48,.4), var(--bg)); }
.post .wrap { margin-top: -90px; position: relative; }
.post__back { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14px; margin-bottom: 28px; }
.post__back svg { width: 16px; height: 16px; }
.post__back:hover { color: #fff; }
.post__body { font-size: 19px; line-height: 1.8; color: #dfe3ee; }
.post__body h2 { font-size: 32px; margin: 1.6em 0 .6em; }
.post__body h3 { font-size: 24px; margin: 1.4em 0 .5em; }
.post__body a { color: var(--yellow); }
.post__body blockquote { margin: 1.6em 0; padding-left: 22px; border-left: 3px solid var(--blue); font: italic 400 24px/1.5 var(--serif); color: #fff; }
.post__body img { border-radius: 14px; margin: 1.6em 0; }
.post__body ul, .post__body ol { padding-left: 1.3em; }
.post__end {
  margin-top: 60px; padding: 26px; border-radius: var(--r);
  background: var(--bg-2); border: 1px solid var(--line);
  display: flex; gap: 18px; align-items: center;
}
.post__end img { width: 56px; height: 56px; flex: none; }
.post__end p { margin: 4px 0 0; font-size: 15px; color: var(--ink-2); }
.post__share { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; align-items: center; color: var(--ink-3); font-size: 14px; }
.post__share a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); font-weight: 600; }
.post__share a:hover { border-color: var(--blue); color: #fff; }

/* ---------- Revelado al hacer scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .pgrid { grid-template-columns: repeat(2, 1fr); }
  .posts, .channels { grid-template-columns: repeat(2, 1fr); }
  .sgrid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .hero { padding-top: 100px; }
  .hero__inner { grid-template-columns: 1fr; text-align: left; gap: 10px; }
  .hero__art { order: -1; }
  .cube-stage { --s: clamp(96px, 28vw, 170px); height: calc(var(--s) * 1.7); }
  .hero__hint { display: none; }
  .about__grid, .play__grid { grid-template-columns: 1fr; }
  .about__media { max-width: 420px; }
  .about__media > img:first-child { aspect-ratio: 4 / 3; }
  .about__badge { width: 90px; height: 90px; right: -8px; bottom: -18px; }
  .posts--all .pcard-post:first-child { grid-column: auto; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 84px 0 50px; min-height: 0; }
  .hero__claim { font-size: clamp(44px, 13vw, 60px); }
  .hero__title { margin-bottom: 18px; }
  .wrap { padding: 0 16px; }
  .pgrid, .posts, .channels, .sgrid, .roles { grid-template-columns: 1fr; }
  .pcard--wide { grid-column: auto; }
  .hero__cta .btn { flex: 1 1 100%; justify-content: center; }
  .hero__social { flex-wrap: wrap; }
  .play__stats dd { font-size: 36px; }
  .post__body { font-size: 17px; }
  .final .btn { width: 100%; justify-content: center; }
}

/* Movimiento reducido: solo frenamos lo intrusivo (la cinta). El resto sigue vivo. */
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation-duration: 120s; }
}

/* "Ver resuelto": muestra el logo completo un momento */
.puzzle::after {
  content: ""; position: absolute; inset: 4px; border-radius: 12px;
  background: var(--blue) url("assets/logos/logo-m-blanco.webp") center / 100% no-repeat;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.puzzle.peek::after { opacity: 1; }
