/* IDENTITY VERIFIED — landing de validación.
   Dos voces: el sistema habla en Archivo (sans, ancho), Lira en Newsreader cursiva.
   Los colores de nivel codifican información: Full azul-blanco, Conditional ámbar, Residual rojo ladrillo. */

@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("assets/fonts/newsreader-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("assets/fonts/newsreader.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0c121a;
  --bg-2: #121a25;
  --line: #2a3646;
  --text: #dce4ec;
  --muted: #9aa8ba;
  --full: #cfe3f2;
  --cond: #e8a24a;
  --resid: #e0607c;
  --ghost: #9aa8ba;
  --focus: #f4c36f;
  --gutter: clamp(1rem, 4vw, 2rem);
  --measure: 62rem;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--sans);
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
button, input { font: inherit; touch-action: manipulation; }

.wrap { width: 100%; max-width: calc(var(--measure) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -4rem; background: var(--text); color: var(--bg); padding: 0.6rem 1rem; z-index: 10; border-radius: 3px; }
.skip:focus { top: 0.75rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--bg);
}
.hero-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 52% 30%;
}
@media (min-width: 60rem) {
  .hero-img {
    left: 28%; width: 72%;
    object-position: 50% 30%;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28%);
    mask-image: linear-gradient(to right, transparent 0, #000 28%);
  }
}
.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--bg) 0%, rgba(12, 18, 26, 0.88) 22%, rgba(12, 18, 26, 0) 62%),
    linear-gradient(to right, rgba(12, 18, 26, 0.7) 0%, rgba(12, 18, 26, 0) 55%);
}
.hero-copy { position: relative; padding-block: clamp(2rem, 8vh, 5rem); }
h1 {
  margin: 0;
  font-weight: 800;
  font-stretch: 125%;
  font-size: clamp(2.3rem, 10.4vw, 5.25rem);
  line-height: 0.95;
  letter-spacing: -0.005em;
  text-transform: uppercase;
}
h1 span { display: block; }
.lema {
  margin: 1.25rem 0 0;
  max-width: 28ch;
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  line-height: 1.35;
  color: var(--text);
  text-wrap: balance;
}

/* El lector de la puerta: una línea de luz recorre el marco una sola vez (escena 1 del teaser). */
.reader {
  position: relative;
  display: inline-block;
  margin: 2rem 0 0 -1.1rem;
  padding: 1rem 1.1rem 1.1rem;
  max-width: 26rem;
  background: rgba(12, 18, 26, 0.72);
  backdrop-filter: blur(6px);
  border-radius: 4px;
}
.reader-msg { margin: 0 0 0.9rem; font-size: 0.95rem; line-height: 1.4; color: var(--muted); text-wrap: balance; }
.reader-line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.reader-line rect {
  width: calc(100% - 2px); height: calc(100% - 2px);
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
@media (prefers-reduced-motion: no-preference) {
  .reader-line rect {
    stroke: var(--full);
    stroke-dasharray: 14 86;
    stroke-dashoffset: 14;
    animation: travel 2.4s 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  @keyframes travel {
    0% { stroke-dashoffset: 14; opacity: 1; }
    92% { stroke-dashoffset: -86; opacity: 1; }
    100% { stroke-dashoffset: -86; opacity: 0; }
  }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.9rem;
  padding: 0.7rem 1.4rem;
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  border-radius: 3px;
  font-weight: 650;
  font-stretch: 110%;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover { background: #fff; border-color: #fff; color: #000; }
.btn:active { background: var(--full); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-2); color: #fff; border-color: var(--muted); }
.reader-btn { width: 100%; }
.link-btn { background: none; border: 0; padding: 0.4rem 0; color: var(--muted); text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.link-btn:hover { color: #fff; }

/* ---------- Secciones ---------- */
.section { padding-block: clamp(3rem, 9vw, 6rem); scroll-margin-top: 0; }
h2 {
  margin: 0 0 0.75rem;
  font-weight: 750;
  font-stretch: 112%;
  font-size: clamp(1.7rem, 4.6vw, 2.6rem);
  line-height: 1.1;
  text-wrap: balance;
}
.intro { margin: 0 0 0.5rem; max-width: 40ch; font-size: 1.2rem; text-wrap: pretty; }
.fine { margin: 0 0 1.75rem; max-width: 62ch; font-size: 0.875rem; color: var(--muted); text-wrap: pretty; }

/* ---------- Test ---------- */
.panel {
  max-width: 40rem;
  margin-top: 1.5rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.quiz-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.quiz-count { margin: 0; font-size: 0.9rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar { flex: 1; height: 3px; background: var(--line); }
.bar span { display: block; height: 100%; width: 0; background: var(--text); transform-origin: left; transition: width 0.25s ease-out; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 1.1rem; font-size: clamp(1.2rem, 3.2vw, 1.45rem); line-height: 1.3; font-weight: 600; text-wrap: balance; }
legend:focus { outline: none; }
.options { display: grid; gap: 0.6rem; }
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.opt span {
  display: block;
  padding: 0.85rem 1rem 0.85rem 2.6rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg);
  position: relative;
  transition: border-color 0.15s, background-color 0.15s;
}
.opt span::before {
  content: ""; position: absolute; left: 0.95rem; top: 50%;
  width: 0.95rem; height: 0.95rem; margin-top: -0.475rem;
  border: 1.5px solid var(--muted); border-radius: 50%;
}
.opt:hover span { border-color: var(--muted); background: #0f1722; }
.opt input:checked + span { border-color: var(--text); background: #16212e; }
.opt input:checked + span::before { border-color: var(--text); background: radial-gradient(var(--text) 0 38%, transparent 42%); }
.opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 3px; }
.quiz-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.error { margin: 1rem 0 0; color: #ff8fa5; font-size: 0.95rem; }

/* ---------- Resultado ---------- */
.result-label { margin: 0 0 0.25rem; color: var(--muted); font-size: 0.95rem; }
.result-label:focus { outline: none; }
.score-row { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.score {
  font-size: clamp(4.5rem, 20vw, 7.5rem);
  font-weight: 800; font-stretch: 125%;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.tier { font-size: clamp(1.4rem, 5vw, 2rem); font-weight: 700; font-stretch: 110%; }
.system-line { margin: 0.9rem 0 0; font-size: 1rem; color: var(--muted); }
.verdict { margin: 0.5rem 0 0; font-size: 1.15rem; max-width: 36ch; text-wrap: pretty; }
[data-tier="full"] .score, [data-tier="full"] .tier { color: var(--full); }
[data-tier="conditional"] .score, [data-tier="conditional"] .tier { color: var(--cond); }
[data-tier="residual"] .score, [data-tier="residual"] .tier { color: var(--resid); }
[data-tier="ghost"] .score, [data-tier="ghost"] .tier { color: var(--ghost); }

.scale { margin: 2.5rem 0 2rem; padding-top: 1.4rem; }
.scale-track { position: relative; display: flex; height: 10px; border-radius: 2px; }
.band { display: block; height: 100%; }
.band-res { flex: 279; background: var(--resid); border-radius: 2px 0 0 2px; }
.band-con { flex: 160; background: var(--cond); }
.band-full { flex: 111; background: var(--full); border-radius: 0 2px 2px 0; }
.mark { position: absolute; top: -0.5rem; width: 0; height: calc(100% + 1rem); border-left: 2px solid var(--text); }
.mark b { position: absolute; bottom: calc(100% + 0.15rem); left: 0; transform: translateX(-50%); font-size: 0.8rem; font-weight: 650; white-space: nowrap; }
.mark-lira { border-left-style: dashed; border-color: var(--muted); }
.mark-lira b { color: var(--muted); }
.mark-lira.low b { transform: translateX(-100%); }
.mark-lira.high b { transform: none; }
.scale-ends { position: relative; height: 1.2rem; margin-top: 0.5rem; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.scale-ends span { position: absolute; top: 0; transform: translateX(-50%); }
.scale-ends span:first-child { left: 0; transform: none; }
.scale-ends span:nth-child(2) { left: 50.9%; }
.scale-ends span:nth-child(3) { left: 80%; }
.scale-ends span:last-child { right: 0; transform: none; }

.reasons-title { margin: 0 0 0.5rem; font-size: 1.05rem; font-weight: 650; }
.reasons { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.reasons li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-top: 1px solid var(--line); font-size: 0.97rem; }
.reasons li:last-child { border-bottom: 1px solid var(--line); }
.reasons li span:first-child { min-width: 0; overflow-wrap: anywhere; }
.reasons .pts { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }

.join { margin-top: 2.25rem; padding-top: 1.75rem; border-top: 1px solid var(--line); }
.join h3 { margin: 0 0 0.25rem; font-size: 1.35rem; font-weight: 700; font-stretch: 108%; }
.join p { margin: 0 0 1.1rem; color: var(--muted); }

/* ---------- Lista de espera ---------- */
.waitlist { display: grid; gap: 0.9rem; max-width: 26rem; }
.field label { display: block; margin-bottom: 0.35rem; font-weight: 600; font-size: 0.95rem; }
.field input {
  width: 100%; min-height: 2.9rem; padding: 0.6rem 0.8rem;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--muted); border-radius: 3px;
}
.field input::placeholder { color: #6f7f93; }
.field input:hover { border-color: var(--text); }
.field input[aria-invalid="true"] { border-color: var(--resid); }
.check { display: flex; gap: 0.7rem; align-items: flex-start; font-size: 0.92rem; color: var(--muted); cursor: pointer; }
.check input { flex: none; width: 1.15rem; height: 1.15rem; margin: 0.15rem 0 0; accent-color: var(--full); }
.check a { color: var(--text); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-error { margin: 0; }
.ok { margin: 0; padding: 0.8rem 1rem; border-left: 3px solid var(--full); background: #0f1a26; color: var(--text); }

/* ---------- Serie ---------- */
.series { border-top: 1px solid var(--line); }
.series h2 { margin-bottom: 1.5rem; }
.lira {
  margin: 0 0 1.5rem;
  max-width: 24ch;
  font: italic 400 clamp(1.7rem, 4.6vw, 2.6rem)/1.2 var(--serif);
  font-optical-sizing: auto;
  text-wrap: balance;
}
.body { margin: 0 0 1rem; max-width: 56ch; text-wrap: pretty; }


/* ---------- Barra superior ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 5;
  background: rgba(12, 18, 26, 0.82);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(42, 54, 70, 0.7);
}
.topbar-in { display: flex; align-items: center; gap: 1.5rem; height: 3.5rem; }
.brand { font-weight: 800; font-stretch: 125%; font-size: 0.95rem; letter-spacing: 0.02em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.nav { display: none; gap: 1.4rem; margin-left: auto; }
.nav a { text-decoration: none; color: var(--muted); font-size: 0.95rem; padding: 0.5rem 0; }
.nav a:hover { color: #fff; }
.top-join { margin-left: auto; font-size: 0.9rem; font-weight: 600; text-decoration: none; padding: 0.45rem 0.9rem; border: 1px solid var(--muted); border-radius: 3px; white-space: nowrap; transition: background-color 0.15s, border-color 0.15s; }
.top-join:hover { background: var(--bg-2); border-color: #fff; }
@media (max-width: 30rem) {
  .topbar-in { gap: 0.75rem; }
  .brand { font-size: 0.78rem; }
  .top-join { font-size: 0.8rem; padding: 0.4rem 0.65rem; }
}
@media (min-width: 56rem) {
  .nav { display: flex; }
  .top-join { margin-left: 0; }
}

/* ---------- Ver: corto y tráiler ---------- */
.feature, .soon { display: grid; gap: 1.25rem; margin-top: 1.75rem; align-items: start; }
.feature-media video, .soon-frame { width: 100%; aspect-ratio: 16 / 9; border-radius: 3px; background: #000; }
.feature-media video { display: block; height: auto; }
.feature-text h3, .track-head h3 { margin: 0 0 0.25rem; font-size: 1.35rem; font-weight: 700; font-stretch: 108%; }
.feature-text p { margin: 0 0 0.6rem; max-width: 42ch; text-wrap: pretty; }
.meta { color: var(--muted); font-size: 0.9rem; }
.soon { margin-top: 2.5rem; }
.soon-img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px; background: #000; }
.soon-frame { display: grid; place-items: center; border: 1px dashed var(--line); background: var(--bg-2); color: var(--muted); font-size: 1.1rem; }
@media (min-width: 56rem) {
  .feature, .soon { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 2rem; }
  .soon { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .soon .soon-frame { max-width: 100%; }
}

/* ---------- Escuchar ---------- */
.tracks { list-style: none; margin: 1.5rem 0 0; padding: 0; max-width: 40rem; }
.track { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.track:last-child { border-bottom: 1px solid var(--line); }
.track audio { display: block; width: 100%; margin-top: 0.75rem; }
.track-head .meta { margin: 0; }
.track-head .alt { font-weight: 400; font-stretch: 100%; font-size: 0.9em; color: var(--muted); }

:lang(ja) { font-family: var(--sans), "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", sans-serif; }

/* ---------- La serie: personaje ---------- */
.series-grid { display: grid; gap: 2rem; align-items: start; }
.series-text .ep { margin-top: 1.5rem; }
.character { margin: 0; max-width: 20rem; }
.character img { width: 100%; height: auto; border-radius: 3px; }
.character figcaption { margin-top: 0.7rem; font-size: 0.92rem; color: var(--muted); text-wrap: pretty; }
.character figcaption strong { color: var(--text); font-weight: 650; }
@media (min-width: 56rem) {
  .series-grid { grid-template-columns: minmax(0, 1fr) 20rem; gap: 3rem; }
}

/* ---------- El mundo: niveles ---------- */
.tiers { display: grid; gap: 0.75rem; margin: 1.75rem 0 1.5rem; max-width: 46rem; }
.tier-item { padding: 0.9rem 1.1rem; background: var(--bg-2); border: 0; border-left: 4px solid var(--ghost); border-radius: 0 3px 3px 0; }
.tier-item dt { font-weight: 700; font-stretch: 108%; font-size: 1.1rem; }
.tier-item dt span { margin-left: 0.6rem; font-weight: 400; font-size: 0.88rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tier-item dd { margin: 0.2rem 0 0; color: var(--text); }
.tier-item[data-tier="full"] { border-color: var(--full); }
.tier-item[data-tier="conditional"] { border-color: var(--cond); }
.tier-item[data-tier="residual"] { border-color: var(--resid); }
.tier-item[data-tier="ghost"] { border-left: 3px dashed var(--ghost); }
@media (min-width: 56rem) {
  .tiers { grid-template-columns: 1fr 1fr; }
}
.words { margin: 0; padding-left: 1.1rem; max-width: 46rem; color: var(--muted); }
.words li { margin-bottom: 0.4rem; text-wrap: pretty; }

/* ---------- Pie ---------- */
.foot { border-top: 1px solid var(--line); padding-block: 2rem 3rem; font-size: 0.875rem; color: var(--muted); }
.foot p { margin: 0 0 0.5rem; max-width: 60ch; }

/* ---------- Página legal ---------- */
.legal { padding-block: 3rem 5rem; max-width: 46rem; }
.legal h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); line-height: 1.1; margin-bottom: 0.5rem; text-transform: none; font-stretch: 112%; font-weight: 750; }
.legal h2 { margin-top: 2.5rem; font-size: clamp(1.3rem, 3.6vw, 1.7rem); scroll-margin-top: 1.5rem; }
.legal h3 { margin: 1.75rem 0 0.4rem; font-size: 1.05rem; }
.legal p, .legal li { max-width: 62ch; text-wrap: pretty; }
.legal .back { display: inline-block; margin-bottom: 2rem; }
.legal .pending { background: #2a2010; color: var(--cond); padding: 0.05em 0.35em; border-radius: 2px; }

@media (max-width: 30rem) {
  .reader { max-width: none; display: block; }
  .quiz-actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bar span { transition: none; }
}
