/* ============================================================
   Pineapple Games — Estilos compartidos
   ------------------------------------------------------------
   Misma identidad gráfica que https://pineappleva.github.io/:
   fondo oscuro cálido, ámbar #f5a623 como único acento,
   Space Grotesk para el texto y Archivo Black para la marca.

   Temas: dark (marca) y light (blanco cálido). El tema se aplica
   antes de pintar con un script inline en el <head>; todo el color
   vive en variables CSS. html[data-theme="light"] = tema claro.
   ============================================================ */

:root {
  --bg: #131007;
  --bg-soft: #1c1810;
  --bg-deep: #0d0b05;
  --card: #211c11;
  --card-hover: #2a2415;
  --border: #3a3220;
  --text: #f5f0e4;
  --text-dim: #b8ad95;
  --brand: #f5a623;
  --brand-soft: #f8d348;
  --brand-strong: #f8d348;
  --brand-text: #ffc266;      /* ámbar para texto sobre fondos oscuros */
  --on-brand: #1a1408;
  --header-bg: rgba(19, 16, 7, .9);
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, .25);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, .4);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .4);
  --glow: rgba(245, 166, 35, .35);
  --color-scheme: dark;
  --radius: 14px;
  --maxw: 1080px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --f-body: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-display: "Archivo Black", "Arial Black", Impact, var(--f-body);
  --green: #4caf6d;
  --red: #e05c4a;
  --orange: #e8930c;
}

html[data-theme="light"] {
  --bg: #fafaf7;
  --bg-soft: #f4f3ee;
  --bg-deep: #edece5;
  --card: #ffffff;
  --card-hover: #fbfaf5;
  --border: rgba(28, 24, 18, .13);
  --text: #1f1b12;
  --text-dim: #6f695c;
  --brand-strong: #8a5c00;    /* suficiente contraste sobre blanco */
  --brand-text: #8a5c00;
  --header-bg: rgba(250, 250, 247, .9);
  --shadow-sm: 0 1px 2px rgba(33, 26, 14, .05), 0 4px 14px rgba(33, 26, 14, .06);
  --shadow-md: 0 12px 30px rgba(33, 26, 14, .12);
  --shadow-lg: 0 20px 50px rgba(33, 26, 14, .14);
  --glow: rgba(245, 166, 35, .26);
  --color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  color-scheme: var(--color-scheme);
  scrollbar-gutter: stable;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color .25s ease, color .25s ease;
}

@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
body { animation: pageIn .4s ease both; }
body.page-leave { opacity: 0; transition: opacity .18s ease; }

::selection { background: var(--brand); color: var(--on-brand); }

a { color: var(--brand-strong); }
img { max-width: 100%; height: auto; }
a[target="_blank"] { text-underline-offset: 2px; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.2rem;
  width: 100%;
}

[hidden] { display: none !important; }

/* ============================================================
   Accesibilidad
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sr-only:focus,
.skip-link:focus {
  position: fixed !important;
  left: 12px !important;
  top: 12px !important;
  width: auto !important;
  height: auto !important;
  padding: .6rem .9rem !important;
  background: var(--bg-soft) !important;
  color: var(--text) !important;
  border: 1px solid var(--brand) !important;
  border-radius: 8px !important;
  z-index: 9999 !important;
  clip: auto !important;
  overflow: visible !important;
  white-space: normal !important;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
  padding: .6rem 1rem;
  border-radius: 0 0 10px 0;
  z-index: 200;
}
.skip-link:focus { left: 0; }

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

/* ============================================================
   Barra de progreso de scroll
   ============================================================ */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 120;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-soft));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .08s linear;
}

/* ============================================================
   Cabecera
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .2s ease, background-color .25s ease;
}
.site-header.scrolled { box-shadow: 0 12px 32px rgba(0, 0, 0, .28); }
html[data-theme="light"] .site-header.scrolled { box-shadow: 0 12px 30px rgba(33, 26, 14, .1); }

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  padding-top: .65rem;
  padding-bottom: .65rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
}
.brand img {
  width: 34px; height: 34px;
  object-fit: contain;
  transition: transform .3s ease;
}
.brand:hover img { transform: rotate(-8deg) scale(1.08); }
.brand small { display: block; font-weight: 400; font-size: .72rem; color: var(--text-dim); }

.main-nav { margin-left: auto; }
.main-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-wrap: wrap;
}
.main-nav a {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  text-decoration: none;
  color: var(--text-dim);
  font-size: .9rem;
  font-weight: 500;
  padding: .4rem .78rem;
  border-radius: 8px;
  transition: background .15s ease, color .15s ease;
}
.main-nav a:hover { background: var(--bg-soft); color: var(--text); }
.main-nav a[aria-current="page"] {
  color: var(--brand-strong);
  font-weight: 600;
  background: rgba(245, 166, 35, .16);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: .45rem .55rem;
  cursor: pointer;
}
.nav-toggle:hover { border-color: var(--brand); }

.theme-toggle {
  margin-left: .3rem;
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--brand-strong);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease, background-color .25s ease;
}
.theme-toggle:hover { border-color: var(--brand); transform: rotate(-12deg) scale(1.05); }
.theme-toggle .ico-moon { display: none; }
.theme-toggle .ico-sun { display: block; }
html[data-theme="light"] .theme-toggle .ico-moon { display: block; }
html[data-theme="light"] .theme-toggle .ico-sun { display: none; }

/* ============================================================
   Botones
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .62rem 1.15rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: var(--f-body);
  font-weight: 600;
  font-size: .88rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease,
              color .15s ease, border-color .15s ease;
}
.btn.primary { background: var(--brand); color: var(--on-brand); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(245, 166, 35, .35); }
.btn.ghost,
.btn:not(.primary) {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn.ghost:hover,
.btn:not(.primary):hover {
  background: var(--card-hover);
  border-color: var(--text-dim);
  color: var(--text);
}
.btn.big { padding: .8rem 1.5rem; font-size: .95rem; }
.btn.small { padding: .4rem .85rem; font-size: .8rem; }
.btn:active { transform: translateY(1px) !important; box-shadow: none !important; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: 1.4rem 0 2.2rem;
}
.legal .btn-row { margin: .6rem 0 0; }

/* ============================================================
   Portada (hero)
   ============================================================ */
.hero {
  position: relative;
  padding: 3.4rem 0 1.2rem;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 680px;
  height: 680px;
  background: radial-gradient(circle, rgba(245, 166, 35, .16), transparent 62%);
  pointer-events: none;
}
html[data-theme="light"] .hero::before { background: radial-gradient(circle, rgba(245, 166, 35, .22), transparent 62%); }

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
  z-index: -1;
}
.orb-1 {
  width: 400px; height: 400px;
  background: rgba(245, 166, 35, .16);
  top: -150px; left: -120px;
  animation: drift 18s ease-in-out infinite alternate;
}
.orb-2 {
  width: 340px; height: 340px;
  background: rgba(248, 211, 72, .1);
  bottom: -190px; right: -110px;
  animation: drift 22s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(70px, 50px) scale(1.18); }
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}
.hero [data-animate] {
  opacity: 0;
  animation: riseIn .7s cubic-bezier(.2, .7, .3, 1) forwards;
}
.hero [data-animate="1"] { animation-delay: .05s; }
.hero [data-animate="2"] { animation-delay: .18s; }
.hero [data-animate="3"] { animation-delay: .32s; }
.hero [data-animate="4"] { animation-delay: .46s; }
.hero [data-animate="5"] { animation-delay: .60s; }
.hero [data-animate="6"] { animation-delay: .74s; }

.hero .logo,
.hero-logo {
  width: 84px;
  height: 84px;
  object-fit: contain;
  filter: drop-shadow(0 6px 22px var(--glow));
  animation: logoIn .9s cubic-bezier(.2, .7, .3, 1) both,
             float 6s ease-in-out 1.2s infinite;
}
@keyframes logoIn {
  0%   { opacity: 0; transform: scale(.5) rotate(-14deg); }
  70%  { transform: scale(1.08) rotate(3deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}

.hero h1 {
  font-size: clamp(1.9rem, 4.6vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -.015em;
  margin: .9rem 0 .5rem;
}
.hero h1 span { color: var(--brand-strong); }

.hero-h1 { margin-top: 1.2rem; }
.h1-hand {
  display: block;
  font-weight: 500;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--text-dim);
  line-height: 1.25;
}
.h1-display {
  display: block;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 8vw, 4.4rem);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--text);
  margin-top: .12rem;
}
.h1-display .grad {
  background: linear-gradient(92deg, var(--brand), var(--brand-soft), var(--brand));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 6s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }

.eyebrow,
.kicker,
.kicker-label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--brand-strong);
  line-height: 1.4;
}
.eyebrow { margin-top: 1.4rem; }
.kicker-label { margin-bottom: .25rem; }

.hero p,
.lead {
  color: var(--text-dim);
  max-width: 58ch;
  font-size: 1.05rem;
  line-height: 1.75;
}
.hero p strong,
.lead strong { color: var(--text); }

.hero-actions {
  margin-top: 1.9rem;
  display: flex;
  gap: .7rem;
  flex-wrap: wrap;
}

/* ============================================================
   Secciones y títulos
   ============================================================ */
.section { padding: 4rem 0; }
.section.alt {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.2;
  margin: 2.2rem 0 .6rem;
}
.section-title::before {
  content: "";
  display: block;
  width: 2.2rem;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-soft));
  margin-bottom: .7rem;
}
.section-sub,
.content > p {
  color: var(--text-dim);
  max-width: 62ch;
}

/* ============================================================
   Contenido principal
   ============================================================ */
.content {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.6rem 1.2rem 3rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-bottom: 1rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: .9rem;
}
.back-link:hover { color: var(--brand-strong); }

/* ============================================================
   Tarjetas
   ============================================================ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.2rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  text-decoration: none;
  color: var(--text);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .25s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 166, 35, .45);
  box-shadow: var(--shadow-md);
  background: var(--card-hover);
}
.card .icon {
  font-size: 1.7rem;
  line-height: 1;
  transition: transform .25s ease;
}
.card:hover .icon { transform: scale(1.15) rotate(-6deg); }
.card .logo-mark {
  width: 46px;
  height: 46px;
  object-fit: contain;
  margin-bottom: .2rem;
  transition: transform .25s ease;
}
.card:hover .logo-mark { transform: scale(1.06); }
.card h3 { font-size: 1.08rem; letter-spacing: -.01em; }
.card p { font-size: .88rem; color: var(--text-dim); flex: 1; }
.card.disabled { opacity: .78; }

.card.locked { position: relative; opacity: .92; }
.card.locked::after {
  content: "🔒";
  position: absolute;
  top: .9rem; right: .9rem;
  font-size: 1.1rem;
  opacity: .7;
}
.card.slim { padding: .9rem 1rem; }

/* Tarjeta con dos accesos (juego + archivo) */
.card.card-split { position: relative; }
.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: auto;
  padding-top: .5rem;
}
.card-links a {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .3rem .78rem;
  transition: transform .15s ease, border-color .15s ease, color .15s ease, background .15s ease;
}
.card-links a:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--brand-strong); }
.card-links a.primary {
  border-color: transparent;
  background: var(--brand);
  color: var(--on-brand);
}
.card-links a.primary:hover { box-shadow: 0 6px 18px rgba(245, 166, 35, .32); }
.card-links a.tomb { color: var(--text-dim); }
.card-links a.tomb:hover { border-color: var(--text-dim); color: var(--text); }

/* ============================================================
   Insignias de estado
   ============================================================ */
.badge {
  align-self: flex-start;
  font-size: .64rem;
  font-weight: 600;
  padding: .18rem .6rem;
  border-radius: 999px;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.badge.ok      { background: rgba(76, 175, 109, .16); border-color: transparent; color: #7fd6a0; }
.badge.closed  { background: rgba(224, 92, 74, .14);  border-color: transparent; color: #f0947f; }
.badge.pending { background: rgba(232, 147, 12, .14); border-color: transparent; color: #f2b45a; }
.badge.beta    { background: rgba(248, 211, 72, .14); border-color: transparent; color: var(--brand-soft); }
.badge.deter   { background: rgba(248, 211, 72, .12); border-color: transparent; color: var(--brand-soft); }
.badge.locked  { background: rgba(160, 160, 180, .14); border-color: transparent; color: #c2c2d6; }
.badge.ai      { background: rgba(130, 120, 255, .14); border-color: transparent; color: #b3adff; }
.badge.new     { background: rgba(245, 166, 35, .16); border-color: transparent; color: var(--brand-strong); }
html[data-theme="light"] .badge.ok      { color: #2e7d49; }
html[data-theme="light"] .badge.closed  { color: #a03a2a; }
html[data-theme="light"] .badge.pending { color: #9c5f04; }
html[data-theme="light"] .badge.beta,
html[data-theme="light"] .badge.deter,
html[data-theme="light"] .badge.new     { color: #8a6400; }
html[data-theme="light"] .badge.locked  { color: #5b5b6b; }

/* ============================================================
   Avisos
   ============================================================ */
.notice {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.3rem;
  color: var(--text-dim);
  margin: .9rem 0;
}
.notice h3 { color: var(--text); margin-bottom: .35rem; font-size: 1.02rem; }
.notice p + p { margin-top: .55rem; }
.notice code,
.notice a code {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .08rem .35rem;
  font-size: .9em;
}
.notice.info  { border-left-color: var(--brand); }
.notice.warn  { border-left-color: var(--orange); }
.notice.error { border-left-color: var(--red); }

/* ============================================================
   Artículos y posts (markdown renderizado)
   ============================================================ */
article.post,
.post {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  margin-bottom: 1.2rem;
}
article.post .date {
  color: var(--text-dim);
  font-size: .84rem;
  display: block;
  margin-bottom: 1rem;
}
article.post h1,
.md-post h1 { font-size: clamp(1.4rem, 3vw, 1.7rem); letter-spacing: -.015em; line-height: 1.2; margin: .2rem 0 .7rem; }
article.post h2,
.md-post h2 { font-size: 1.25rem; margin: 1.6rem 0 .5rem; }
article.post h3,
.md-post h3 { font-size: 1.06rem; margin: 1.3rem 0 .4rem; color: var(--brand-strong); }
.md-post h4 { font-size: .96rem; margin: 1.1rem 0 .35rem; color: var(--brand-strong); }
article.post h1:first-child,
.md-post h1:first-child { margin-top: 0; }
article.post p,
.md-post p { margin: .65rem 0; font-size: .98rem; line-height: 1.75; }
article.post p + p { margin-top: .6rem; }
article.post ul,
article.post ol,
.md-post ul,
.md-post ol { margin: .7rem 0 .7rem 1.3rem; font-size: .95rem; display: flex; flex-direction: column; gap: .35rem; }
article.post ul, .md-post ul { list-style: disc; }
article.post ol, .md-post ol { list-style: decimal; }
article.post li,
.md-post li { line-height: 1.7; }
article.post strong,
.md-post strong { color: var(--text); }
article.post a,
.md-post a { text-decoration-color: rgba(245, 166, 35, .45); text-underline-offset: 3px; }
article.post a:hover,
.md-post a:hover { text-decoration-color: currentColor; }
article.post em,
.md-post em { color: var(--text); }

.md-post blockquote,
article.post blockquote {
  border-left: 3px solid var(--brand);
  background: var(--bg-soft);
  padding: .8rem 1.1rem;
  border-radius: 0 10px 10px 0;
  margin: 1rem 0;
  color: var(--text-dim);
}
.md-post img { max-width: 100%; border-radius: 10px; margin: .6rem 0; display: block; }
.md-post code,
article.post code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85em;
}
.md-post p code,
.md-post li code,
article.post p code,
article.post li code {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .08rem .35rem;
}
.md-post pre,
article.post pre {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .9rem 1rem;
  overflow: auto;
  margin: .8rem 0;
}
.md-post pre code,
article.post pre code { background: none; border: none; padding: 0; font-size: .85rem; }
.md-post hr,
article.post hr { border: 0; border-top: 1px solid var(--border); margin: 1.4rem 0; }

/* ============================================================
   Selector lateral de noticias (anuncios)
   ============================================================ */
.md-posts { margin-top: .5rem; }
.md-posts .md-post { margin-bottom: 1.2rem; }

.md-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  margin: 0 auto;
}

.md-sidebar {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  overflow-x: hidden;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  padding: 0 .9rem 0 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.md-sidebar::-webkit-scrollbar { width: 4px; }
.md-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

.md-sidebar-head {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: 0 0 .9rem;
  padding: 0 0 .6rem;
  border-bottom: 1px solid var(--border);
}
.md-sidebar-title {
  font-weight: 600;
  font-size: .72rem;
  color: var(--text-dim);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.md-sidebar-count { display: none; }

.md-sidebar-list { display: flex; flex-direction: column; gap: 2px; }

.md-sidebar-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  width: 100%;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  padding: .48rem .6rem .48rem .7rem;
  cursor: pointer;
  color: var(--text-dim);
  font-family: inherit;
  transition: background .14s, border-color .14s, color .14s;
}
.md-sidebar-item:hover { background: var(--bg-soft); border-left-color: var(--border); color: var(--text); }
.md-sidebar-item.active {
  background: rgba(245, 166, 35, .1);
  border-left-color: var(--brand);
  color: var(--text);
}
.md-sidebar-item .line { display: flex; align-items: center; min-width: 0; }
.md-sidebar-item .dot { display: none; }
.md-sidebar-item .title {
  font-weight: 500;
  font-size: .84rem;
  line-height: 1.28;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -.01em;
}
.md-sidebar-item .meta {
  font-size: .68rem;
  color: var(--text-dim);
  opacity: .75;
  margin-top: .12rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.md-main { min-width: 0; max-width: 760px; }
.md-main .md-post { scroll-margin-top: 92px; }
.md-main .md-post.is-highlight {
  outline: 1px solid rgba(245, 166, 35, .45);
  outline-offset: 3px;
  animation: mdFlash .8s ease;
}
@keyframes mdFlash {
  0%   { box-shadow: 0 0 0 0 rgba(245, 166, 35, 0); }
  35%  { box-shadow: 0 0 0 5px rgba(245, 166, 35, .14); }
  100% { box-shadow: 0 0 0 0 rgba(245, 166, 35, 0); }
}
.md-loading { color: var(--text-dim); padding: .6rem 0; }

/* Feed de últimos anuncios (portada de Anuncios) */
.md-feed { display: flex; flex-direction: column; gap: 1rem; }
.md-feed .md-post { margin-bottom: 0; }
.md-feed-meta { font-size: .84rem; color: var(--text-dim); margin-bottom: .6rem; }
.md-feed-meta a { color: var(--brand-strong); text-decoration: none; font-weight: 600; }
.md-feed-meta a:hover { text-decoration: underline; }
.md-feed-preview-wrap { position: relative; max-height: 210px; overflow: hidden; }
.md-feed-preview h1,
.md-feed-preview h2 { font-size: 1.05rem; margin: .2rem 0 .4rem; }
.md-feed-preview p,
.md-feed-preview li { font-size: .92rem; color: var(--text-dim); }
.md-feed-fade {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 70px;
  background: linear-gradient(to bottom, transparent, var(--card));
  pointer-events: none;
}
.md-feed-more { margin-top: .8rem; align-self: flex-start; }

/* ============================================================
   Tablas y listas
   ============================================================ */
.table-wrap { overflow-x: auto; margin: .9rem 0; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table-wrap th,
.table-wrap td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table-wrap th { background: var(--bg-soft); color: var(--brand-strong); font-weight: 600; }
.table-wrap tr:hover td { background: var(--bg-soft); }

.dir-list { display: flex; flex-direction: column; gap: .5rem; margin: .4rem 0 .8rem; }
.dir-list a { text-decoration: none; }
.dir-list a:hover { text-decoration: underline; }
.dir-hint { color: var(--text-dim); font-size: .88rem; }

/* ============================================================
   Pie de página
   ============================================================ */
.site-footer {
  margin-top: auto;
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  transition: background-color .25s ease;
  position: relative;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 2rem;
  padding-top: 2.2rem;
  padding-bottom: 1.6rem;
}
.footer-brand .brand { font-size: 1rem; }
.footer-brand .brand img { width: 38px; height: 38px; }
.footer-note {
  margin-top: .8rem;
  color: var(--text-dim);
  font-size: .88rem;
}

.footer-col h3 {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: .7rem;
  color: var(--brand-strong);
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.footer-col a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: .9rem;
  transition: color .15s ease;
}
.footer-col a:hover { color: var(--brand-strong); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: .4rem;
  padding-bottom: 1.2rem;
  display: flex;
  justify-content: space-between;
  gap: .6rem;
  flex-wrap: wrap;
  font-size: .84rem;
  color: var(--text-dim);
}
.site-footer a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color .15s ease;
}
.site-footer a:hover { color: var(--brand-strong); }
.site-footer .spacer { margin-left: auto; }

/* Olas decorativas (mismo gesto que la web de Pineapple) */
.wave {
  position: relative;
  line-height: 0;
  overflow: hidden;
}
.wave-footer { height: 70px; }
.wave-track {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 200%;
  display: flex;
  animation: waveSlide 16s linear infinite;
  will-change: transform;
}
.wave-track svg { flex: 0 0 auto; width: 50%; height: 100%; display: block; }
@keyframes waveSlide { to { transform: translateX(-50%); } }

/* ============================================================
   Volver arriba
   ============================================================ */
.to-top {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--brand-strong);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease, border-color .15s ease, visibility .25s, background-color .25s ease;
  z-index: 90;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--brand); background: var(--card-hover); }

/* ============================================================
   404
   ============================================================ */
.notfound {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: .8rem;
  padding: 3rem 1.2rem;
}
.notfound h1 {
  font-family: var(--f-display);
  font-size: clamp(4rem, 16vw, 7rem);
  line-height: .9;
  letter-spacing: -.02em;
  color: var(--brand-text);
}
.notfound p { color: var(--text-dim); max-width: 520px; }

/* ============================================================
   Anuncios con formato de blog (como pineappleva.github.io)
   ------------------------------------------------------------
   Cabecera de sección + listado de tarjetas con portada de color
   y entrada a página completa (?p=slug) con tipografía editorial.
   ============================================================ */
.blog-hero {
  position: relative;
  padding: 2.2rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.blog-hero h1 {
  font-size: clamp(1.9rem, 4.6vw, 2.6rem);
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: .45rem 0 .55rem;
}
.blog-hero p.sub { color: var(--text-dim); max-width: 62ch; font-size: 1rem; }
.hero-count { color: var(--brand-text); font-weight: 700; white-space: nowrap; }

.md-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .8rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
}
.md-toolbar h2 {
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--text-dim);
  font-weight: 600;
}
.md-hint { font-size: .82rem; color: var(--text-dim); }

.md-list,
.md-posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.3rem;
  margin-top: 1.4rem;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  animation: fadeUp .5s var(--ease) both;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background-color .25s ease;
}
.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  background: var(--card-hover);
}

.post-cover {
  position: relative;
  height: 116px;
  padding: .85rem 1.1rem;
  overflow: hidden;
  color: #fff;
}
.post-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 45%);
}
.cov-no {
  display: inline-block;
  position: relative;
  z-index: 1;
  font-weight: 700;
  font-size: .92rem;
  letter-spacing: .06em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .35);
}
.cov-pine {
  position: absolute;
  right: -.5rem;
  bottom: -1.3rem;
  z-index: 1;
  font-size: 4.6rem;
  line-height: 1;
  opacity: .26;
  transform: rotate(-10deg);
  transition: transform .3s ease;
}
.post-card:hover .cov-pine { transform: rotate(-4deg) scale(1.06); }
.post-cover .cov-img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-cover.has-img .cov-pine { display: none; }
.post-cover.has-img .cov-no {
  padding: .12rem .55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, .42);
}

.cov-amber  { background: linear-gradient(135deg, #f5a623, #f8d348); }
.cov-sunset { background: linear-gradient(135deg, #ff9900, #741b47); }
.cov-green  { background: linear-gradient(135deg, #34a853, #1f7a3d); }
.cov-blue   { background: linear-gradient(135deg, #0081c2, #00507a); }
.cov-violet { background: linear-gradient(135deg, #8e6ff1, #5a3fd4); }
.cov-rose   { background: linear-gradient(135deg, #ef5f8a, #c2255c); }

.post-card-body {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  flex: 1;
  padding: 1.2rem 1.35rem 1.3rem;
}
.post-card-head { display: flex; gap: .4rem; flex-wrap: wrap; }
.pill {
  display: inline-block;
  font-size: .72rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .1rem .6rem;
  line-height: 1.5;
}
.pill-brand {
  color: var(--on-brand);
  background: var(--brand);
  border-color: transparent;
  font-weight: 700;
}
.pill.author { color: var(--brand-strong); font-weight: 600; }
.post-card h3 { font-size: 1.12rem; line-height: 1.3; letter-spacing: -.01em; }
.post-card p {
  font-size: .9rem;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin-top: auto;
  padding-top: .3rem;
  font-size: .84rem;
  color: var(--text-dim);
}
.post-card-more {
  display: inline-block;
  font-size: .86rem;
  font-weight: 600;
  color: var(--brand-strong);
  transition: transform .2s var(--ease);
}
.post-card:hover .post-card-more { transform: translateX(4px); }

.post-card.featured { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 36%) 1fr; }
.post-card.featured .post-cover { height: auto; min-height: 230px; }
.post-card.featured .cov-pine { font-size: 8rem; right: -1rem; bottom: -2.6rem; }
.post-card.featured .post-card-body { justify-content: center; gap: .65rem; padding: 1.8rem 2rem; }
.post-card.featured h3 { font-size: clamp(1.4rem, 3vw, 1.8rem); line-height: 1.2; }
.post-card.featured p { font-size: .96rem; -webkit-line-clamp: 4; }

/* --- Entrada abierta --- */
.post-view { animation: fadeUp .45s var(--ease) both; }
.post-hero {
  position: relative;
  padding: 2.2rem 0 1.4rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.post-hero h1 {
  font-size: clamp(1.8rem, 4.4vw, 2.5rem);
  line-height: 1.18;
  letter-spacing: -.02em;
  margin: .45rem 0 0;
  max-width: 30ch;
}
.post-hero-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.post-hero-meta .pill { background: var(--bg-soft); }
.post-banner {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  margin-top: 1.5rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .55s ease, transform .55s var(--ease);
}
.post-banner.show { opacity: 1; transform: none; }

.post-section { padding: 1.6rem 0 3rem; }
.post-view .back-link { margin-top: 1.4rem; }
.post-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.8rem; }

.post-pager {
  max-width: 760px;
  margin: 1.6rem 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .9rem;
}
.pager-card {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s ease, transform .15s ease, background-color .25s ease;
}
.pager-card:hover { border-color: var(--brand); transform: translateY(-2px); background: var(--card-hover); }
.pager-card.next { text-align: right; }
.pager-card .dir { font-size: .72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; }
.pager-card .t { font-size: .92rem; font-weight: 600; line-height: 1.3; }

/* --- Tipografía editorial de la entrada --- */
.md-post.single { max-width: 760px; }
.md-post.single > p { font-size: 1.02rem; line-height: 1.78; margin: .85rem 0; }
.md-post.single > p:first-of-type { font-size: 1.1rem; }
.md-post.single > p:first-of-type::first-letter {
  float: left;
  font-size: 3em;
  line-height: .86;
  padding: .05em .12em 0 0;
  font-weight: 700;
  color: var(--brand);
}
.md-post.single h2 { font-size: 1.45rem; margin: 2.2rem 0 .5rem; }
.md-post.single h2::before {
  content: "";
  display: block;
  width: 2.2rem;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-soft));
  margin-bottom: .65rem;
}
.md-post.single h3 { font-size: 1.16rem; margin-top: 1.8rem; }
.md-post.single ul, .md-post.single ol { padding-left: 1.3rem; }
.md-post.single li { margin: .35rem 0; line-height: 1.7; }
.md-post.single blockquote {
  margin: 1.3rem 0;
  padding: .95rem 1.2rem;
  border-left: 3px solid var(--brand);
  border-radius: 0 12px 12px 0;
  background: var(--bg-soft);
  font-style: italic;
  color: var(--text-dim);
}
.md-post.single a {
  text-decoration: underline;
  text-decoration-color: rgba(245, 166, 35, .45);
  text-underline-offset: 3px;
}
.md-post.single a:hover { text-decoration-color: currentColor; }
.md-post.single hr { margin: 1.9rem 0; }
.md-post.single::after {
  content: "🍍";
  display: block;
  text-align: center;
  margin-top: 2.2rem;
  font-size: 1.25rem;
  opacity: .45;
}

/* --- Esqueletos mientras llegan los anuncios --- */
.skel-card,
.skel-line {
  background: linear-gradient(90deg, var(--bg-soft), var(--card), var(--bg-soft));
  background-size: 200% 100%;
  animation: skelShine 1.35s ease-in-out infinite;
  border-radius: var(--radius);
}
.skel-card { height: 290px; }
.skel-card.skel-featured { grid-column: 1 / -1; height: 230px; }
.skel-post { display: flex; flex-direction: column; gap: .85rem; }
.skel-line { height: .95rem; border-radius: 8px; }
.skel-line.w60 { width: 60%; height: 1.4rem; }
.skel-line.w45 { width: 45%; }
@keyframes skelShine {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   IMTLazarus Games — paleta del logotipo
   ------------------------------------------------------------
   El verde, el naranja, el azul y el granate del logo sustituyen
   al ámbar del sitio solo dentro de las páginas del juego.
   ============================================================ */
.imt {
  --brand: #ff9900;
  --brand-soft: #ffb340;
  --brand-strong: #ffb340;
  --on-brand: #201300;
  --glow: rgba(255, 153, 0, .38);
  --imt-green: #34a853;
  --imt-orange: #ff9900;
  --imt-blue: #0081c2;
  --imt-maroon: #741b47;
}
html[data-theme="light"] .imt {
  --brand-strong: #a35400;
  --brand-soft: #ffb340;
}
.imt .btn.primary:hover { box-shadow: 0 6px 18px rgba(255, 153, 0, .35); }
.imt .hero::before { background: radial-gradient(circle, rgba(255, 153, 0, .16), transparent 62%); }
.imt .eyebrow,
.imt .kicker-label,
.imt .section-title::before,
.imt .icon { color: inherit; }
.imt .eyebrow,
.imt .kicker-label { color: var(--imt-green); }
.imt .section-title::before { background: linear-gradient(90deg, var(--imt-green), var(--imt-orange), var(--imt-blue), var(--imt-maroon)); }
.imt .h1-display .grad {
  background: linear-gradient(92deg, var(--imt-green), var(--imt-orange) 38%, var(--imt-blue) 72%, #b8365f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: none;
}
.imt .imt-strip {
  display: flex;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  margin: 1.6rem 0 0;
  max-width: 220px;
}
.imt .imt-strip span { flex: 1; }
.imt .imt-strip span:nth-child(1) { background: var(--imt-green); }
.imt .imt-strip span:nth-child(2) { background: var(--imt-orange); }
.imt .imt-strip span:nth-child(3) { background: var(--imt-blue); }
.imt .imt-strip span:nth-child(4) { background: var(--imt-maroon); }

.imt .card { border-top: 2px solid var(--border); }
.imt .card.c-green  { border-top-color: var(--imt-green); }
.imt .card.c-orange { border-top-color: var(--imt-orange); }
.imt .card.c-blue   { border-top-color: var(--imt-blue); }
.imt .card.c-maroon { border-top-color: var(--imt-maroon); }
.imt .card.c-green  .icon { color: #5cc46f; }
.imt .card.c-orange .icon { color: #ffb340; }
.imt .card.c-blue   .icon { color: #4aa8dc; }
.imt .card.c-maroon .icon { color: #d4659a; }
html[data-theme="light"] .imt .card.c-green  .icon { color: #1f7a3a; }
html[data-theme="light"] .imt .card.c-orange .icon { color: #b35c00; }
html[data-theme="light"] .imt .card.c-blue   .icon { color: #00628f; }
html[data-theme="light"] .imt .card.c-maroon .icon { color: #8f2158; }
.imt .notice.info { border-left-color: var(--imt-blue); }
.imt .badge.new { background: rgba(52, 168, 83, .18); color: #7fd6a0; }
html[data-theme="light"] .imt .badge.new { color: #2e7d49; }

/* ============================================================
   Detalles de marca
   ============================================================ */
/* Easter egg: la puntita de la i de iRiS es su logo */
.iris-i { position: relative; display: inline-block; }
.iris-i::before {
  content: "";
  position: absolute;
  left: 50%;
  top: .24em;
  width: .21em;
  height: .21em;
  transform: translateX(-50%);
  background: url("../img/iris-logo.jpg") center / cover no-repeat;
  border-radius: 50%;
  box-shadow: 0 0 .14em rgba(244, 121, 32, .5);
  transition: transform .15s ease;
}
.iris-i:hover::before { transform: translateX(-50%) scale(1.35); }

/* Easter egg: la O de DOPAMINA es la bolita del juego */
.dopa-o {
  position: relative;
  display: inline-block;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: transparent;          /* la O está, pero invisible: conserva métricas */
  cursor: pointer;
  line-height: 1;
  width: .92em;
  height: .92em;
  vertical-align: -0.06em;
}
.dopa-o::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8bb7 0%, #ff4081 55%, #d61c60 100%);
  box-shadow: 0 0 .45em rgba(255, 64, 129, .55), inset 0 0 0 .12em rgba(255, 255, 255, .18);
  transition: transform .15s ease, box-shadow .15s ease;
}
.dopa-o:hover::before {
  transform: scale(1.1);
  box-shadow: 0 0 .85em rgba(255, 128, 171, .8), 0 0 1.3em rgba(255, 128, 171, .35), inset 0 0 0 .12em rgba(255, 255, 255, .18);
}
.dopa-o:active::before { transform: scale(.86); }
.dopa-o:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

.dopa-egg-p {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  color: #ff9ec4;
  font-weight: 800;
  font-size: .95rem;
  text-shadow: 0 0 8px rgba(255, 64, 129, .8);
}
@media (prefers-reduced-motion: no-preference) {
  .dopa-egg-p { animation: dopaEggFloat .9s ease-out forwards; }
  @keyframes dopaEggFloat {
    from { opacity: 1; transform: translate(0, 0) scale(1); }
    to   { opacity: 0; transform: translate(0, -52px) scale(1.05); }
  }
}

/* Zona bloqueada (Slop Central) */
.slop-hero { position: relative; overflow: hidden; }

.skeleton {
  background: linear-gradient(90deg, var(--bg-soft), var(--card), var(--bg-soft));
  background-size: 200% 100%;
  animation: skel 1.4s linear infinite;
  border-radius: 10px;
}
@keyframes skel { to { background-position: -200% 0; } }

/* Aparición suave al hacer scroll */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.js .reveal {
  opacity: 0;
  transform: translateY(24px) scale(.99);
  transition: opacity .65s var(--ease) var(--d, 0ms), transform .65s var(--ease) var(--d, 0ms);
}
.js .reveal.in,
.js .reveal.visible { opacity: 1; transform: none; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.6rem 2rem; }
  .md-layout { grid-template-columns: 1fr; gap: 1rem; }
  .md-sidebar {
    position: relative;
    top: auto;
    max-height: none;
    overflow-y: visible;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0 0 .7rem;
  }
  .md-sidebar-list { flex-direction: row; overflow-x: auto; gap: .45rem; padding-bottom: .2rem; }
  .md-sidebar-item {
    min-width: 170px;
    max-width: 220px;
    flex: 0 0 auto;
    border-left: none;
    border-bottom: 2px solid transparent;
    border-radius: 8px 8px 0 0;
    padding: .5rem .65rem;
    background: var(--bg-soft);
  }
  .md-sidebar-item:hover { border-left-color: transparent; border-bottom-color: var(--border); }
  .md-sidebar-item.active { border-left-color: transparent; border-bottom-color: var(--brand); }
  .md-main { max-width: none; }
}

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .theme-toggle { order: 2; margin-left: 0; }
  .main-nav {
    order: 3;
    flex-basis: 100%;
    margin-left: 0;
    display: none;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: .15rem; padding: .5rem 0 .3rem; }
  .main-nav a { padding: .55rem .7rem; }
  .hero { padding-top: 2.4rem; }
  .card { padding: 1.15rem 1.2rem; }
  .site-footer > .wrap:first-of-type { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .wave-footer { height: 48px; }
  .card-links a { font-size: .78rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .wrap { padding: 0 1rem; }
}

/* ============================================================
   Print y movimiento reducido
   ============================================================ */
@media print {
  .site-header, .site-footer, #pg-consent, .md-sidebar, .btn-row, .back-link,
  .progress, .to-top, .theme-toggle, .nav-toggle, .wave { display: none !important; }
  body { background: #fff; color: #000; }
  article.post, .notice, .card { background: #fff; border: 1px solid #ccc; box-shadow: none; color: #000; }
  a { color: #000; text-decoration: underline; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body { animation: none; }
  .hero [data-animate] { opacity: 1; animation: none; }
  .hero .logo, .hero-logo { animation: none; }
  .orb { animation: none; }
  .wave-track { animation: none; }
  .h1-display .grad { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
