/* ═══════════════════════════════════════════════════
   INVISIBLES — El valor de la identidad
   Estética: Editorial minimalista / Feed moderno
   Mobile-First · Syne + DM Sans
   ═══════════════════════════════════════════════════ */

/* ── TOKENS ─────────────────────────────────────── */
:root {
  --ink:          #0d0d0d;
  --ink-2:        #3a3a3a;
  --ink-3:        #7a7a7a;
  --ink-4:        #b0b0b0;
  --surface:      #fafafa;
  --surface-2:    #f2f2f2;
  --surface-3:    #e8e8e8;
  --accent:       #1a1aff;
  --accent-soft:  rgba(26,26,255,.08);
  --accent-mid:   rgba(26,26,255,.18);
  --white:        #ffffff;
  --danger:       #e84040;

  --radius-sm:    8px;
  --radius-md:    14px;
  --radius-lg:    20px;
  --radius-xl:    28px;

  --shadow-sm:    0 1px 4px rgba(0,0,0,.06);
  --shadow-md:    0 4px 20px rgba(0,0,0,.09);
  --shadow-lg:    0 8px 40px rgba(0,0,0,.13);

  --nav-h:        60px;
  --bottom-h:     72px;
  --max-w:        480px;

  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  --ease-out:     cubic-bezier(.22,1,.36,1);
}

/* ── RESET & BASE ────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--ink);
  min-height: 100dvh;
  padding-top: var(--nav-h);
  padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom, 16px));
  /* subtle grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='.025'/%3E%3C/svg%3E");
}

button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── TOP NAV ─────────────────────────────────────── */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(250,250,250,.88);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--surface-3);
  z-index: 100;
}

.top-nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-nav__logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: .14em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-icon{
    width:32px;
    height:32px;
    object-fit:contain;
}
.logo-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,100% { transform: scale(1); opacity:1; }
  50%      { transform: scale(1.5); opacity:.6; }
}

.top-nav__action {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: background .15s;
}
.top-nav__action:hover { background: var(--surface-2); }

/* ── STORIES STRIP ───────────────────────────────── */
.stories {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 12px 0 8px;
  overflow-x: auto;
  overflow-y: visible;          /* never clip vertically */
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: relative;
  z-index: 1;                   /* below nav (z-index:100) but above body */
  -webkit-overflow-scrolling: touch;
}
.stories::-webkit-scrollbar { display: none; }

.stories__track {
  display: flex;
  gap: 14px;
  padding: 0 20px;
  width: max-content;
  /* ensure track never captures pointer-events away from buttons */
  pointer-events: none;
}

.story {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;               /* NUNCA se aplasta */
  /* restore pointer-events on each story button */
  pointer-events: auto;
  /* increase tap target slightly for mobile */
  padding: 2px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;   /* prevent 300ms delay on iOS */
  cursor: pointer;
}

.story__ring {
  width: 60px; height: 60px;
  border-radius: 50%;
  padding: 2.5px;
  background: linear-gradient(135deg, var(--accent), #6b6bff);
  transition: transform .2s var(--ease-out);
  flex-shrink: 0;               /* mantiene dimensiones fijas */
}
.story__ring--seen {
  background: var(--surface-3);
}
.story__ring--dashed {
  background: none;
  border: 2px dashed var(--surface-3);
}
.story__ring--podcast {
  background: linear-gradient(135deg, var(--ink), #555);
}
.story:active .story__ring { transform: scale(.93); }

.story__avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 2.5px solid var(--surface);
  background: var(--surface-2);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  color: var(--white);
  overflow: hidden;
}
.story__avatar--add {
  background: var(--surface-2);
  color: var(--ink-2);
  border: none;
}

.story__label {
  font-size: .68rem;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: .02em;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
/* ── FEED LABEL ──────────────────────────────────── */
.feed-label {
  max-width: var(--max-w);
  margin: 4px auto 0;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.feed-label span {
  font-family: var(--font-display);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--ink-4);
  white-space: nowrap;
}
.feed-label__line {
  flex: 1;
  height: 1px;
  background: var(--surface-3);
}

/* ── FEED ────────────────────────────────────────── */
.feed {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 10px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ── POST BASE ───────────────────────────────────── */
.post {
  background: var(--white);
  border-top: 1px solid var(--surface-2);
  border-bottom: 1px solid var(--surface-2);
  padding: 16px 20px 8px;
  transition: background .15s;
  outline: none;
}
.post:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.post__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.post__avatar-wrap { flex-shrink: 0; }

.post__avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  color: var(--white);
}
.post__avatar--anon {
  background: var(--surface-2);
  color: var(--ink-3);
}
.post__avatar--podcast {
  background: var(--ink);
}

.post__meta { flex: 1; min-width: 0; }

.post__author {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .88rem;
  color: var(--ink);
  letter-spacing: -.01em;
}
.post__date {
  font-size: .75rem;
  color: var(--ink-4);
  margin-top: 1px;
}

.post__more {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink-3);
  flex-shrink: 0;
  transition: background .15s;
}
.post__more:hover { background: var(--surface-2); }

.post__badge {
  font-family: var(--font-display);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 8px;
  border-radius: 100px;
  flex-shrink: 0;
}
.post__badge--anon {
  color: var(--ink-3);
  background: var(--surface-2);
}

/* ── POST TESTIMONY ──────────────────────────────── */
.post__body { position: relative; margin-bottom: 12px; }

.post__text {
  font-size: .95rem;
  line-height: 1.65;
  color: var(--ink-2);
  font-style: italic;
  border-left: 3px solid var(--accent);
  padding-left: 14px;
}

.post__quote-accent {
  width: 32px; height: 3px;
  background: var(--surface-3);
  border-radius: 2px;
  margin-top: 10px;
}

/* ── POST PODCAST ────────────────────────────────── */
.post__podcast-card {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--surface-3);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
}

.podcast-art {
  width: 110px;
  flex-shrink: 0;
  background: var(--ink);
  position: relative;
  display: grid; place-items: center;
  min-height: 140px;
  overflow: hidden;
}

.podcast-art__bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 40%, #2a2aff22, transparent 60%),
              radial-gradient(ellipse at 70% 70%, #ffffff0a, transparent 50%);
}

.podcast-art__icon {
  position: relative;
  width: 44px; height: 44px;
  background: rgba(255,255,255,.12);
  border-radius: 50%;
  display: grid; place-items: center;
  backdrop-filter: blur(6px);
  z-index: 1;
}

.podcast-art__rings {
  position: absolute; inset: 0;
  display: grid; place-items: center;
}
.ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.07);
  animation: ring-pulse 3s ease-in-out infinite;
}
.ring--1 { width: 60px;  height: 60px;  animation-delay: 0s; }
.ring--2 { width: 90px;  height: 90px;  animation-delay: .6s; }
.ring--3 { width: 120px; height: 120px; animation-delay: 1.2s; }

@keyframes ring-pulse {
  0%,100% { opacity: .5; transform: scale(1); }
  50%      { opacity: .15; transform: scale(1.05); }
}

.podcast-info {
  flex: 1;
  padding: 14px 14px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.podcast-episode {
  font-family: var(--font-display);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--accent);
}

.podcast-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .92rem;
  color: var(--ink);
  line-height: 1.3;
}

.podcast-desc {
  font-size: .78rem;
  color: var(--ink-3);
  line-height: 1.5;
  margin-top: 2px;
  flex: 1;
}

.podcast-progress { margin-top: 8px; }

.progress-bar {
  width: 100%;
  height: 2px; /* Super delgada */
  background: rgba(0, 0, 0, 0.1); /* Gris muy suave de fondo */
  border-radius: 2px;
  position: relative;
  cursor: pointer;
  margin: 15px 0; /* Espacio arriba y abajo */
}

/* La línea negra que avanza */
.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 70%;
  width: 0%; 
  background: var(--ink); /* MAGIA: Negro de día, Blanco de noche automático */
  border-radius: 2px;
  transition: width 0.1s linear;
}
.progress-bar:hover {
  height: 4px; /* Se crece un poquito al pasar el mouse */
  transition: height 0.2s;
}
.progress-fill:hover {
  height: 90% /* Se crece un poquito al pasar el mouse */
 
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: .65rem;
  color: var(--ink-4);
  margin-top: 4px;
}

.podcast-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.ctrl-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--ink-2);
  transition: background .15s, transform .1s;
}
.ctrl-btn:hover { background: var(--surface-2); }
.ctrl-btn:active { transform: scale(.9); }

.ctrl-btn--play {
  width: 36px; height: 36px;
  background: var(--ink);
  color: var(--white);
  border-radius: 50%;
}
.ctrl-btn--play:hover { background: var(--ink-2); }

/* ── POST EDITORIAL BANNER ───────────────────────── */
.post__editorial-banner {
  border-radius: var(--radius-md);
  background: var(--ink);
  margin-bottom: 12px;
  padding: 24px 20px;
  position: relative;
  overflow: hidden;
  min-height: 120px;
  display: flex; align-items: flex-end;
}

.post__editorial-banner::before {
  content: '';
  position: absolute; inset: 0;
  background: 
    radial-gradient(ellipse at 0% 0%, rgba(26,26,255,.25), transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(255,255,255,.04), transparent 50%);
}

.editorial-text { position: relative; z-index: 1; }

.editorial-num {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  color: rgba(255,255,255,.2);
  line-height: 1;
  display: block;
  position: absolute;
  top: 5px; right: 5px;
  letter-spacing: -.03em;
}

.editorial-quote {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .95rem;
  color: #ffffff; 
  line-height: 1.5;
  letter-spacing: -.01em;
}

/* ── TAGS ────────────────────────────────────────── */
.post__tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.tag {
  font-size: .72rem;
  font-weight: 500;
  color: var(--ink-3);
  background: var(--surface-2);
  padding: 4px 10px;
  border-radius: 100px;
  letter-spacing: .01em;
  transition: background .15s, color .15s;
}
.tag:hover { background: var(--surface-3); color: var(--ink-2); }
.tag--identity {
  color: var(--accent);
  background: var(--accent-soft);
}

/* ── POST ACTIONS ────────────────────────────────── */
.post__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--surface-2);
  margin-top: 4px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  font-weight: 500;
  color: var(--ink-3);
  transition: background .15s, color .15s;
  flex: 1;
  justify-content: center;
}
.action-btn:hover { background: var(--surface-2); color: var(--ink); }
.action-btn:active { background: var(--surface-3); }

/* ── BOTTOM NAV ──────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--bottom-h) + env(safe-area-inset-bottom, 0px));
  background: rgba(250,250,250,.94);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--surface-3);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 12px 0;
  min-width: 48px;
  color: var(--ink-4);
  transition: color .15s, transform .1s;
  position: relative;
}

.nav-item span {
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .02em;
}

.nav-item:hover { color: var(--ink-2); }
.nav-item:active { transform: scale(.9); }

.nav-item--active { color: var(--ink); }
.nav-item--active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  width: 20px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

.nav-item--publish {
  color: var(--ink-4);
}

.publish-btn {
  width: 46px; height: 46px;
  border-radius: var(--radius-md);
  background: var(--ink);
  display: grid; place-items: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.22);
  margin-top: -10px;
  transition: transform .15s var(--ease-out), box-shadow .15s;
}

.nav-item--publish:hover .publish-btn {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
}
.nav-item--publish:active .publish-btn {
  transform: scale(.93);
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.nav-item--publish span { margin-top: 2px; }

/* ══════════════════════════════════════════════════
   DESKTOP LAYOUT (≥ 900px)
   Estructura: sidebar izquierda fija + feed centrado
   ══════════════════════════════════════════════════ */
@media (min-width: 900px) {
  :root {
    --sidebar-w: 240px;
    --content-w: 650px;
  }

  /* Ruido de fondo más pronunciado en desktop */
  body {
    padding-top: 0;
    padding-bottom: 0;
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100dvh;
  }

  /* ── Top nav → header de la sidebar ── */
  .top-nav {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100dvh;
    border-bottom: none;
    border-right: 1px solid var(--surface-3);
    background: var(--white);
    display: flex;
    flex-direction: column;
    z-index: 100;
    backdrop-filter: none;
  }

  .top-nav__inner {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    padding: 28px 24px 24px;
    gap: 0;
    border: none;
  }

  .top-nav__logo {
    font-size: 1.1rem;
    margin-bottom: 32px;
  }

  .top-nav__action {
    display: none; /* buscador se mueve a sidebar nav */
  }

  /* Inyectar nav items dentro del top-nav en desktop via CSS */
  /* Los nav items existen en .bottom-nav — en desktop los ocultamos
     y mostramos el .desktop-sidebar-nav que genera JS */
  .bottom-nav {
    display: none;
  }

  .desktop-nav {
    display: flex !important;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    padding: 0 12px;
  }

  .desktop-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: .9rem;
    font-weight: 500;
    color: var(--ink-3);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: background .15s, color .15s;
  }
  .desktop-nav-item:hover { background: var(--surface-2); color: var(--ink); }
  .desktop-nav-item--active {
    background: var(--surface-2);
    color: var(--ink);
    font-weight: 600;
  }
  .desktop-nav-item svg { flex-shrink: 0; }

  .desktop-nav-publish {
    margin-top: 16px;
    background: var(--ink) !important;
    color: var(--white) !important;
    border-radius: var(--radius-md);
    font-weight: 700 !important;
    font-family: var(--font-display) !important;
    letter-spacing: .04em;
    font-size: .82rem !important;
    padding: 14px 12px !important;
    justify-content: center !important;
    transition: opacity .15s !important;
  }
  .desktop-nav-publish:hover { opacity: .85 !important; background: var(--ink) !important; }

  .desktop-nav-footer-placeholder { /* moved outside media query */ }

  /* ── Área de contenido principal ── */
  .site-content {
    grid-column: 2;
    max-width: calc(var(--content-w) + 80px);
    padding: 0 40px;
    margin: 0 auto;
    width: 100%;
    min-height: 100dvh;
    padding-top: 32px;
    padding-bottom: 40px;
  }
/* ── DESKTOP: Stories centradas y círculos grandes ── */
@media (min-width: 900px) {
  .stories {
    max-width: none;              /* quita límite de 480px */
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
    margin-bottom: 16px;
    border-radius: var(--radius-lg);
    background: var(--white);
    border: 1px solid var(--surface-2);
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    box-sizing: border-box;
  }
  .stories::-webkit-scrollbar { display: none; }

  .stories__track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 16px;
    padding: 14px 20px;
    width: fit-content;           /* permite centrado con margin auto */
    margin: 0 auto;               /* centradas cuando caben en pantalla */
    pointer-events: none;
  }

  .story {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    pointer-events: auto;
  }

  .story__ring {
    width: 85px;                  /* círculos más grandes en escritorio */
    height: 85px;
    flex-shrink: 0;
    padding: 3px;
  }

  .story__avatar {
    width: 100%;
    height: 100%;
    border-width: 3px;
  }

  .story__label {
    font-size: .72rem;
    max-width: 85px;
    text-align: center;
  }
}
  
  .post:first-child { border-radius: var(--radius-md) var(--radius-md) 0 0; }
  .post:last-child  { border-radius: 0 0 var(--radius-md) var(--radius-md); }

  /* Page sections */
  .page-section { padding: 0; }
  .section-header { margin-bottom: 20px; padding-top: 4px; }
  .section-title  { font-size: 1.8rem; }

  /* Podcast card larger */
  .podcast-art { width: 130px; }

  /* Tipografía desktop escalada */
  .post__text           { font-size: 1rem; }
  .editorial-quote      { font-size: 1.05rem; }
  .podcast-title        { font-size: 1rem; }
  .top-nav__logo        { font-size: 1.1rem; }
  .modal__title         { font-size: 1.25rem; }
  .section-title        { font-size: 1.75rem; }
}

/* ── Tablet (640–899px): centrado simple ────────── */
@media (min-width: 640px) and (max-width: 899px) {
  .stories, .feed, .feed-label, .page-section {
    border-left: 1px solid var(--surface-3);
    border-right: 1px solid var(--surface-3);
  }
  .bottom-nav { justify-content: center; gap: 32px; }
  .top-nav__inner {
    border-left: 1px solid var(--surface-3);
    border-right: 1px solid var(--surface-3);
  }
}

/* ── Wrapper de contenido para desktop ─────────── */
.site-content { display: contents; }

@media (min-width: 900px) {
  .site-content { display: block; }
  /* Mover stories + label + feed + sections dentro del wrapper */
  /* Se gestiona con el wrapper en HTML */
}

/* ── Post highlight (llegada desde story Ep4) ──── */
@keyframes post-highlight {
  0%,100% { box-shadow: none; }
  30%,70% { box-shadow: 0 0 0 3px var(--accent); }
}
.post--highlight {
  animation: post-highlight 2.2s var(--ease-out) both;
}

/* ── ANIMATIONS — page load stagger ─────────────── */
.stories { animation: fade-up .4s var(--ease-out) both; }
.post:nth-child(1) { animation: fade-up .4s .1s var(--ease-out) both; }
.post:nth-child(2) { animation: fade-up .4s .18s var(--ease-out) both; }
.post:nth-child(3) { animation: fade-up .4s .26s var(--ease-out) both; }
.post:nth-child(4) { animation: fade-up .4s .34s var(--ease-out) both; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── MODAL ───────────────────────────────────────── */
.modal-open { overflow: hidden; }

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 500;                 /* above sidebar (100), above bottom-nav (100) */
  display: grid;
  place-items: flex-end center;
  opacity: 0;
  transition: opacity .28s var(--ease-out);
}
.modal-overlay[hidden] { display: none; }
.modal-overlay--visible { opacity: 1; }
.modal-overlay--visible .modal { transform: translateY(0); }

.modal {
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: var(--max-w);
  padding: 0 20px calc(32px + env(safe-area-inset-bottom,0px));
  max-height: 92dvh;
  overflow-y: auto;
  transform: translateY(60px);
  transition: transform .32s var(--ease-out);
  /* drag handle */
  &::before {
    content: '';
    display: block;
    width: 40px; height: 4px;
    background: var(--surface-3);
    border-radius: 2px;
    margin: 14px auto 20px;
  }
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
}

.modal__close {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink-3);
  transition: background .15s;
}
.modal__close:hover { background: var(--surface-2); }

.modal__desc {
  font-size: .85rem;
  color: var(--ink-3);
  line-height: 1.55;
  margin-bottom: 20px;
}

/* Fields */
.field { margin-bottom: 16px; position: relative; }

.field__label {
  display: block;
  font-family: var(--font-display);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ink-3);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.field__input {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--surface-3);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  resize: none;
  appearance: none;
}
.field__input::placeholder { color: var(--ink-4); }
.field__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field__input:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.field__textarea { min-height: 110px; line-height: 1.6; }

.field__counter {
  position: absolute;
  bottom: 10px; right: 12px;
  font-size: .7rem;
  color: var(--ink-4);
  pointer-events: none;
}

/* Toggle anónimo */
.toggle-row { display: flex; gap: 8px; }

.toggle-opt {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--surface-3);
  font-size: .85rem;
  font-weight: 500;
  color: var(--ink-3);
  transition: all .15s;
}
.toggle-opt--active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.modal__submit {
  width: 100%;
  margin-top: 20px;
  padding: 15px;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-display);
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .04em;
  border-radius: var(--radius-md);
  transition: opacity .15s, transform .1s;
}
.modal__submit:hover  { opacity: .88; }
.modal__submit:active { transform: scale(.98); }
.modal__submit--ghost {
  background: transparent;
  color: var(--ink-3);
  border: 1.5px solid var(--surface-3);
  margin-top: 12px;
}

/* Success state */
.success-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 0 8px;
}

.success-icon {
  width: 56px; height: 56px;
  background: var(--ink);
  border-radius: 50%;
  display: grid; place-items: center;
  margin-bottom: 18px;
  animation: pop-in .4s var(--ease-out) both;
}

@keyframes pop-in {
  from { transform: scale(.6); opacity:0; }
  to   { transform: scale(1);  opacity:1; }
}

.success-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 8px;
}
.success-text {
  font-size: .88rem;
  color: var(--ink-3);
  line-height: 1.55;
}

/* Shake input */
@keyframes input-shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-6px); }
  40%,80% { transform: translateX(6px); }
}
.input-shake { animation: input-shake .35s ease both; border-color: var(--danger) !important; }

/* New post animation */
.post--new { opacity:0; transform: translateY(-10px); transition: opacity .35s var(--ease-out), transform .35s var(--ease-out); }
.post--entered { opacity:1; transform: translateY(0); }

/* ── PAGE SECTIONS ───────────────────────────────── */
.page-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 20px 20px 40px;
  animation: fade-up .3s var(--ease-out) both;
}

.section-header { margin-bottom: 24px; }

.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--ink);
  letter-spacing: -.02em;
}
.section-sub {
  font-size: .82rem;
  color: var(--ink-3);
  margin-top: 4px;
}

/* Episode list */
.episode-list { display: flex; flex-direction: column; gap: 2px; }

.episode-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius-md);
  transition: background .15s;
}
.episode-card:hover { background: var(--surface); }
.episode-card--active { border-color: var(--accent); }

.episode-num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--surface-3);
  width: 36px;
  flex-shrink: 0;
  letter-spacing: -.04em;
}
.episode-card--active .episode-num { color: var(--accent); }

.episode-info { flex: 1; min-width: 0; }
.episode-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .9rem;
  color: var(--ink);
}
.episode-meta { font-size: .75rem; color: var(--ink-4); margin-top: 2px; }

.episode-play {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: opacity .15s, transform .1s;
}
.episode-play:hover  { opacity: .8; }
.episode-play:active { transform: scale(.9); }

/* Mapa transmedia */
.map-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.map-node {
  background: var(--white);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  font-size: .78rem;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.map-node:hover  { background: var(--surface); transform: translateY(-2px); }
.map-node--center { border-color: var(--accent); color: var(--accent); }

.map-node small { display: block; font-size: .66rem; color: var(--ink-4); font-weight: 400; }

.map-node__dot {
  width: 10px; height: 10px;
  background: var(--ink-4);
  border-radius: 50%;
}
.map-node--center .map-node__dot { background: var(--accent); }
.map-node__dot--pulse { animation: pulse-dot 2s ease-in-out infinite; }

.map-caption {
  text-align: center;
  font-size: .78rem;
  color: var(--ink-4);
}

/* Perfil */
.profile-cover {
  height: 100px;
  background: var(--ink);
  border-radius: var(--radius-lg);
  margin-bottom: -28px;
  background-image: radial-gradient(ellipse at 30% 50%, rgba(26,26,255,.3), transparent 60%);
}
.profile-body {
  background: var(--white);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius-lg);
  padding: 40px 20px 24px;
  text-align: center;
}
.profile-avatar-wrap {
  margin: -52px auto 12px;
  width: 64px;
}
.profile-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 3px solid var(--white);
  background: var(--accent);
  color: white;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  display: grid; place-items: center;
}
.profile-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.profile-bio {
  font-size: .85rem;
  color: var(--ink-3);
  line-height: 1.6;
  max-width: 280px;
  margin: 0 auto 20px;
}
.profile-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  border-top: 1px solid var(--surface-2);
  padding-top: 16px;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-n {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
}
.stat-l { font-size: .7rem; color: var(--ink-4); margin-top: 2px; }

/* ── TOAST ───────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-h) + 16px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-display);
  font-size: .82rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 100px;
  white-space: nowrap;
  z-index: 700;                 /* above everything else */
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s var(--ease-out);
  max-width: calc(100vw - 40px);
  text-align: center;
}
.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── MOBILE FIXES (@media max-width: 768px) ──────── */
@media (max-width: 768px) {

  /* 1. Feed: ancho completo en móvil */
  .feed,
  .feed-label,
  .stories {
    max-width: 100%;
    width: 100%;
  }

  /* Posts sin bordes laterales en móvil */
  .post {
    border-left: none;
    border-right: none;
    border-radius: 0;
  }

  /* 2. Texto legal del footer de la sidebar:
        en móvil se muestra inline dentro del top-nav
        o simplemente se oculta (está solo en desktop) */
  .desktop-nav-footer {
    display: none;
  }

  /* 3. Stories: garantizar z-index correcto y sin bloqueo */
  .stories {
    z-index: 1;
    overflow-x: auto;
    overflow-y: visible;
  }

  .stories__track {
    /* pointer-events:none en el track para que pasen al botón */
    pointer-events: none;
  }

  .story {
    pointer-events: auto;
    touch-action: manipulation;
  }

  /* 4. Bottom nav: siempre visible y por encima del contenido */
  .bottom-nav {
    z-index: 100;
    display: flex;
  }

  /* 5. Top nav: z-index correcto */
  .top-nav {
    z-index: 100;
  }

  /* 6. Modal overlay: cubre toda la pantalla */
  .modal-overlay {
    z-index: 500;
  }

  .modal {
    max-width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }

  /* 7. Story viewer: pantalla completa en móvil */
  .story-viewer {
    z-index: 600;
    border-radius: 0;
    top: 0; left: 0; right: 0; bottom: 0;
  }

  /* 8. Page sections: padding adecuado */
  .page-section {
    padding: 16px 16px 40px;
  }

  /* 9. Tipografía: ligeramente reducida en móvil */
  .section-title  { font-size: 1.3rem; }
  .post__text     { font-size: .92rem; }
  .editorial-quote { font-size: .9rem; }
}

/* ── LEGAL TEXT (desktop-nav-footer) — responsive ── */
.desktop-nav-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--surface-2);
  font-size: .72rem;
  color: var(--ink-4);
  line-height: 1.6;
  text-align: left;
}

/* ── LEGAL TEXT — mobile responsive ─────────────── */
.legal-mobile {
  display: none;
  text-align: center;
  font-size: .65rem;
  color: var(--ink-4);
  padding: 12px 24px;
  line-height: 1.7;
  border-top: 1px solid var(--surface-2);
  margin-top: 8px;
}

@media (max-width: 768px) {
  .legal-mobile { display: block; }
}

/* Extra pequeño: menos de 480px */
@media (max-width: 480px) {
  .legal-mobile {
    font-size: 10px;           /* 10px explícito según requerimiento */
    padding: 10px 20px;
    text-align: center;
    letter-spacing: .01em;
  }
}

/* ── LIVE POST BADGE ─────────────────────────────── */
.post__live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--accent);
  margin-bottom: 10px;
  transition: opacity .6s;
}
.live-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-dot 1.2s ease-in-out infinite;
}

/* ── RESONAR POP ANIMATION ───────────────────────── */
@keyframes resonar-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  70%  { transform: scale(.9); }
  100% { transform: scale(1); }
}
.resonar-pop { animation: resonar-pop .35s var(--ease-out) both; }

/* ── FEED EMPTY STATE ────────────────────────────── */
.feed-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--ink-4);
  font-size: .88rem;
  font-style: italic;
}

/* ── GHOSTFACE FILTER — Identidad revelada ───────── */
/*
   Concepto: todo el contenido visual nace en B&W (invisible).
   Solo cobra color —cobra identidad— cuando alguien lo mira.
*/
.post .post__avatar,
.post .post__editorial-banner,
.post .podcast-art {
  filter: grayscale(100%) contrast(1.06) brightness(.95);
  transition: filter .6s var(--ease-out);
}
/* Desktop: hover en el post revela el color */
.post:hover .post__avatar,
.post:hover .post__editorial-banner,
.post:hover .podcast-art,
.post:focus-within .post__avatar {
  filter: grayscale(0%) contrast(1) brightness(1);
}
/* Móvil: tap & hold revela el color */
@media (hover: none) {
  .post:active .post__avatar,
  .post:active .post__editorial-banner,
  .post:active .podcast-art {
    filter: grayscale(0%) contrast(1) brightness(1);
  }
}
/* Excepciones — nunca se desaturan */
.top-nav .logo-dot,
.profile-avatar,
.post__avatar--podcast {
  filter: none !important;
}

/* ── MAPA ESQUEMÁTICO SVG ────────────────────────── */
.smap-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--surface-3);
  box-shadow: var(--shadow-md);
  background: var(--surface-2);
  margin-bottom: 16px;
}
.smap { width: 100%; height: auto; display: block; }

/* Pines interactivos */
.map-pin { cursor: pointer; outline: none; }
.map-pin:focus-visible circle:nth-child(3) {
  stroke: white;
  stroke-width: 3;
}
.map-pin:active circle:nth-child(3) { r: 9; }
.map-pin--active circle:nth-child(3) {
  filter: drop-shadow(0 0 5px rgba(255,255,255,.6));
}

/* Pulso animado de los aros del pin */
.pin-pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: pin-pulse-anim 2.4s ease-out infinite;
}
.pin-pulse--delay { animation-delay: .9s; }

@keyframes pin-pulse-anim {
  0%   { opacity: .75; transform: scale(1); }
  70%  { opacity: 0;   transform: scale(1.7); }
  100% { opacity: 0;   transform: scale(1.7); }
}

/* Pop-over de micro-historias */
.map-popover {
  position: absolute;
  bottom: 12px; left: 12px; right: 12px;
  background: rgba(13,13,13,.93);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius-md);
  padding: 14px 40px 14px 16px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .28s var(--ease-out), transform .28s var(--ease-out);
  pointer-events: none;
}
.map-popover[hidden] { display: none; }
.map-popover--visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

.map-popover__close {
  position: absolute; top: 8px; right: 10px;
  width: 26px; height: 26px;
  border-radius: 50%;
  font-size: 1.1rem; line-height: 1;
  color: rgba(255,255,255,.5);
  display: grid; place-items: center;
  transition: color .15s;
}
.map-popover__close:hover { color: white; }

.map-popover__place {
  font-family: var(--font-display);
  font-weight: 700; font-size: .84rem;
  color: white; letter-spacing: .03em;
  margin-bottom: 5px;
}
.map-popover__story {
  font-size: .78rem; color: rgba(255,255,255,.7);
  line-height: 1.55; margin-bottom: 8px;
}
.map-popover__tag {
  font-family: var(--font-display);
  font-size: .62rem; font-weight: 700;
  letter-spacing: .1em; color: var(--accent);
}

/* Leyenda */
.smap-legend {
  display: flex; flex-wrap: wrap;
  gap: 10px 20px; margin-bottom: 8px;
}
.legend-item {
  display: flex; align-items: center;
  gap: 6px; font-size: .78rem; color: var(--ink-2);
}
.legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%; flex-shrink: 0;
}

/* ── PODCAST — DISCO GIRANDO AL REPRODUCIR ────────── */
/* Reemplaza la regla estática anterior */
.podcast-art__icon {
  transition: background .2s, transform .25s var(--ease-out);
  will-change: transform;
}

@keyframes disk-spin {
  from { transform: rotate(0deg) scale(1.1); }
  to   { transform: rotate(360deg) scale(1.1); }
}
@keyframes disk-glow {
  0%,100% { box-shadow: 0 0 0 0   rgba(255,255,255,.15); }
  50%      { box-shadow: 0 0 0 12px rgba(255,255,255,0); }
}

.podcast-art__icon--spinning {
  /* combina giro continuo + pulso de halo */
  animation:
    disk-spin 4s linear infinite,
    disk-glow 2s ease-in-out infinite;
}

/* Los anillos de fondo también aceleran cuando está activo */
.podcast-art__icon--spinning ~ .podcast-art__rings .ring {
  animation-duration: 1.4s;
}

/* ── PROGRESS BAR — cursor seek ─────────────────── */
.progress-bar {
  cursor: pointer;
  padding: 6px 0;
  margin: -6px 0;
}

/* ── STORY VIEWER ────────────────────────────────── */
.story-viewer {
  position: fixed; inset: 0;
  z-index: 600;                 /* highest layer — above everything */
  background: #000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity .22s var(--ease-out);
}
.story-viewer[hidden] { display: none; }
.story-viewer--visible { opacity: 1; }

/* Progress bar */
.sv-progress-bar {
  position: absolute;
  top: 12px; left: 12px; right: 12px;
  height: 2px;
  background: rgba(255,255,255,.25);
  border-radius: 2px;
  z-index: 10;
  overflow: hidden;
}
.sv-progress-fill {
  height: 100%;
  width: 0%;
  background: white;
  border-radius: 2px;
}

/* Header */
.sv-header {
  position: absolute;
  top: 24px; left: 14px; right: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
}
.sv-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.5);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700; font-size: .9rem;
  color: white; flex-shrink: 0;
}
.sv-meta { flex: 1; }
.sv-name {
  font-family: var(--font-display);
  font-weight: 600; font-size: .85rem;
  color: white;
}
.sv-time { font-size: .72rem; color: rgba(255,255,255,.55); }
.sv-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  display: grid; place-items: center;
  color: white; flex-shrink: 0;
  transition: background .15s;
}
.sv-close:hover { background: rgba(255,255,255,.2); }

/* Canvas */
.sv-canvas {
  flex: 1;
  display: grid; place-items: center;
  overflow: hidden;
  position: relative;
}
.sv-visual {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.sv-symbol {
  width: 100px; height: 100px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 800; font-size: 2.4rem;
  color: rgba(255,255,255,.9);
  border: 2px solid rgba(255,255,255,.15);
  animation: sv-symbol-breathe 3s ease-in-out infinite;
  position: relative; z-index: 1;
}
.sv-glow {
  position: absolute; inset: -40px;
  pointer-events: none;
}
@keyframes sv-symbol-breathe {
  0%,100% { transform: scale(1);    opacity: .9; }
  50%      { transform: scale(1.05); opacity: 1; }
}

/* Footer */
.sv-footer {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 80px 24px 40px;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, transparent 100%);
  z-index: 10;
}
.sv-quote {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: white;
  line-height: 1.55;
  letter-spacing: -.01em;
  margin-bottom: 10px;
}
.sv-tag {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
}

/* Tap zones */
.sv-tap {
  position: absolute;
  top: 0; bottom: 0;
  width: 35%;
  z-index: 5;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sv-tap--prev { left: 0; }
.sv-tap--next { right: 0; }

/* Desktop: story viewer max-width centrado */
@media (min-width: 900px) {
 .story-viewer {
    width: min(420px, calc(100vw - 40px));  /* ancho real, nunca colapsa */
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    border-radius: var(--radius-xl);
    top: 20px;
    bottom: 20px;
    height: auto;
  }
  .sv-footer { padding-bottom: 32px; }
}

/* ── ACCESSIBILITY ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ffffff;         /* El texto principal pasa a blanco */
    --ink-2: #e0e0e0;       /* Texto secundario a gris claro */
    --ink-3:       #888;
    --ink-4:       #555;
    --surface: #0d0d0d;     /* Fondo principal oscuro */
    --surface-2: #1a1a1a;   /* Fondos de tarjetas oscuros */
    --surface-3: #2a2a2a;   /* Bordes o líneas oscuras */
    --white:       #161616;
    --accent-soft: rgba(100,100,255,.12);
    --accent-mid:  rgba(100,100,255,.22);
  }
  .post__editorial-banner { background: #111; }
  .podcast-art            { background: #111; }
  .ctrl-btn--play         { background: var(--ink); color: var(--surface); }
}
