:root {
  --ink: #f6f3ee;
  --ink-soft: rgba(246, 243, 238, 0.78);
  --sky-1: #0a0f1c;
  --sky-2: #0e1b2d;
  --sky-3: #13263a;
  --accent: #f6c177;
  --accent-2: #87c7ff;
  --card: rgba(16, 30, 45, 0.78);
  --card-strong: rgba(20, 38, 58, 0.92);
  --border: rgba(255, 255, 255, 0.12);
  --radius: 22px;
}

* { box-sizing: border-box; }

body.after-page {
  margin: 0;
  font-family: 'Kalam', sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 10%, #1b2c45 0%, var(--sky-2) 40%, var(--sky-1) 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.sky-dust {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 10% 15%, rgba(255, 255, 255, 0.12), transparent 40%),
                    radial-gradient(circle at 80% 35%, rgba(255, 255, 255, 0.08), transparent 45%),
                    radial-gradient(circle at 30% 80%, rgba(255, 255, 255, 0.08), transparent 50%);
  mix-blend-mode: screen;
  opacity: 0.6;
  z-index: 0;
}

.aurora {
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 55vh;
  background: conic-gradient(from 120deg, rgba(135, 199, 255, 0.25), rgba(246, 193, 119, 0.15), transparent 60%);
  filter: blur(10px);
  opacity: 0.7;
  z-index: 0;
  animation: auroraMove 12s ease-in-out infinite alternate;
}

@keyframes auroraMove {
  0% { transform: translateY(-4%) rotate(-1deg); }
  100% { transform: translateY(2%) rotate(1.5deg); }
}

.after-topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 1.4rem;
  background: linear-gradient(120deg, rgba(5, 10, 18, 0.92), rgba(12, 26, 40, 0.82));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.back-btn {
  text-decoration: none;
  color: var(--ink);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
}

.ghost-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
}

.title-block {
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-2);
}

h1 {
  margin: 0;
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  color: var(--ink);
}

.subtitle {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  font-size: 1rem;
}

.after-shell {
  width: min(1120px, 92vw);
  margin: 1.8rem auto 3rem;
  display: grid;
  gap: 1.6rem;
  position: relative;
  z-index: 1;
}

.manifest {
  background: var(--card-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem 2rem;
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.35);
  font-size: 1.05rem;
  line-height: 1.7;
}

.manifest p {
  margin: 0 0 1rem;
}

.manifest p:last-of-type {
  margin-bottom: 0.8rem;
}

.manifest h2 {
  margin-top: 0;
  font-family: 'DM Serif Display', serif;
  letter-spacing: 0.02em;
}

.signature {
  margin-top: 1.4rem;
  color: var(--accent);
  font-family: 'Space Grotesk', sans-serif;
}

.overlay-video {
  margin-top: 1.4rem;
}

.overlay-video__frame {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1.2rem 1.4rem;
  background: linear-gradient(140deg, rgba(10, 20, 32, 0.95), rgba(16, 28, 45, 0.95));
  overflow: hidden;
  cursor: pointer;
}

.overlay-video__frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.06) 6px,
    rgba(0, 0, 0, 0.12) 6px,
    rgba(0, 0, 0, 0.12) 12px
  );
  opacity: 0.6;
  pointer-events: none;
}

.overlay-video__content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.6rem;
}

.overlay-video__thumb {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: block;
  filter: grayscale(0.2);
  opacity: 0.9;
}

.locked-title {
  margin: 0 0 0.3rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
}

.locked-subtitle {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.locked-badge {
  position: absolute;
  inset: 0.9rem 0.9rem auto auto;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(7, 14, 24, 0.7);
  color: var(--ink-soft);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  z-index: 1;
}

.legacy {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.legacy-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.28);
}

.legacy-card h3 {
  margin: 0 0 0.8rem;
  font-family: 'Space Grotesk', sans-serif;
}

.legacy-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

.secrets {
  background: rgba(12, 22, 34, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem 1.8rem;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.35);
}

.secrets-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 14, 0.78);
  display: grid;
  place-items: center;
  padding: 1.6rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 20;
}

.overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.overlay-card {
  position: relative;
  width: min(760px, 92vw);
  max-height: 80vh;
  overflow: auto;
  padding: 1.6rem 1.8rem 1.9rem;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(140deg, rgba(12, 22, 34, 0.96), rgba(18, 32, 50, 0.96));
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

.overlay-card h3 {
  margin: 0 0 0.6rem;
  font-family: 'DM Serif Display', serif;
  letter-spacing: 0.02em;
}

.overlay-body {
  color: var(--ink-soft);
  line-height: 1.7;
}

.overlay-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.secrets-header h2 {
  margin: 0 0 0.35rem;
  font-family: 'DM Serif Display', serif;
}

.secrets-header p {
  margin: 0;
  color: var(--ink-soft);
}

.counter {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.secret-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.secret-card {
  position: relative;
  background: rgba(18, 30, 48, 0.9);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
  min-height: 170px;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
}

.secret-card.is-locked {
  opacity: 0.55;
  filter: grayscale(0.15);
  pointer-events: none;
}

.secret-card.is-locked::after {
  content: "bloqueado";
  position: absolute;
  inset: auto 1rem 1rem auto;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(7, 14, 24, 0.7);
  color: var(--ink-soft);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.secret-card.open {
  transform: rotateY(180deg);
}

.secret-face,
.secret-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  padding: 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.6rem;
}

.secret-face {
  background: linear-gradient(130deg, rgba(18, 33, 52, 0.95), rgba(10, 19, 32, 0.95));
  color: var(--ink);
  border: none;
  text-align: left;
  cursor: pointer;
}


.secret-face h4 {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
}

.secret-face p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.4;
}

.secret-back {
  background: linear-gradient(140deg, rgba(10, 16, 26, 0.95), rgba(20, 34, 52, 0.95));
  transform: rotateY(180deg);
  color: var(--ink);
  line-height: 1.5;
}

.seal {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(246, 193, 119, 0.2);
  display: grid;
  place-items: center;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--accent);
  border: 1px solid rgba(246, 193, 119, 0.35);
}

@media (max-width: 820px) {
  .after-topbar {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .ghost-btn { justify-self: center; }
  .back-btn { justify-self: center; }
  .secrets-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .after-shell { width: min(92vw, 420px); }
  .manifest { padding: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}
