@font-face {
    font-family: 'American Typewriter';
    src: url('./fonts/AmericanTypewriter.woff2') format('woff2'),
        url('./fonts/AmericanTypewriter.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Druk Text';
    src: url('./fonts/Druk-Medium.woff2') format('woff2'),
        url('./fonts/Druk-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Druk Text';
    src: url('./fonts/DrukText-Medium.woff2') format('woff2'),
        url('./fonts/DrukText-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

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

:root {
  --red: #8B0000;
  --red-bright: #B22020;
  --black: #111;
  --white: #fff;
  --paper: #f4f0e8;
}

body.overlay-open {
  overflow: hidden;
  height: 100%;
}

body {
  font-family: 'Druk Text', sans-serif;
  background: #1a1a1a;
  overflow-x: hidden;
}

.visually-hidden {
    clip: rect(0 0 0 0); 
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap; 
  width: 1px;
}

.grid-lines {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.15) 1px, transparent 1px),
    linear-gradient(to right, rgba(0,0,0,0.15) 1px, transparent 1px),
    linear-gradient(to right, rgba(0,0,0,0.15) 1px, transparent 1px),
    linear-gradient(to right, rgba(0,0,0,0.15) 1px, transparent 1px),
    linear-gradient(to right, rgba(0,0,0,0.15) 1px, transparent 1px);
  background-size:
    1px 100%, 1px 100%, 1px 100%, 1px 100%, 1px 100%;
  background-position:
    4% 0, 37% 0, 51.5% 0, 53.2% 0, 96% 0;
  background-repeat: no-repeat;

  clip-path: inset(0 0 100% 0);
  animation: revealLines 3s cubic-bezier(0.4, 0, 0.2, 1) 1s forwards;
}

@keyframes revealLines {
  from { clip-path: inset(0 0 100% 0); }
  to   { clip-path: inset(0 0 0% 0); }
}

/* ══════════════════════════════
   LANDING PAGE
══════════════════════════════ */
#landing {
  position: relative;
  width: 100%;
}

#landing-content {
  position: relative;
}

.pointer {
    position: fixed;
    bottom: 4rem;
    left: 47.5%;
    transform: translate(-50%, 0);
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    animation: 
        pointerIn 0.6s ease forwards 1s,
        pulse 2s ease-in-out 1.6s infinite;

    img {
        transform: rotate(270deg);
        width: 90px;
    }
}

@keyframes pointerIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1;   transform: translateY(0); }
  50%       { opacity: 0.7; transform: translateY(20px); }
}

/* ── HERO: sección blanca superior ── */
#hero {
  background: #fff;
  min-height: 68vh;
  padding-bottom: 10vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  text-align: center;
}

.hero-content {
    width: clamp(350px, 40vw, 700px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-inline: 20px;

    .hero-intro {
        width: 100%;
    }
}

/* ── SVG LOGO responsive ── */
.logo {
  width: 100%;
}
 
.logo svg {
  width: 100%;
  height: auto;
  display: block;
}
 
/* La Ó empieza en rojo, luego se vuelve negra y cae */
#o-path {
  fill: #AD0017; /* mismo rojo inicial */
  transform-origin: 421px 170px; /* centro aproximado del path de la Ó */
  transform-box: fill-box;
}
 
/* Estado inicial: Ó en rojo, desplazada hacia arriba */
#o-path.o-initial {
  fill: #AD0017;
  transform: translateY(-94px) translateX(17px) rotate(-11deg);
}
 
/* Estado animado: cae a su sitio y se vuelve negra */
#o-path.o-animate {
  animation: oFall 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
 
@keyframes oFall {
  0%   { fill: #AD0017; transform: translateY(-94px) translateX(17px) rotate(-11deg); }
  100% { fill: #000000; transform: translateY(0px);}
}

/* Subtítulo con bloques censurados */
.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  max-width: 520px;
  width: 100%;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Druk Text', sans-serif;
  font-weight: 700;
  font-size: clamp(14px, 2.5vw, 18px);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--black);
}

.redacted {
  display: inline-block;
  background: var(--black);
  height: 1em;
  border-radius: 1px;
  vertical-align: middle;
}

/* ── SECCIÓN OSCURA ── */
#dark-section {
  position: relative;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 20vh;
}

/* Imagen de fondo oscura — sustituye bg-img src por tu imagen */
#bg-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top;
  z-index: 1;
}

/* Fallback texture si no hay imagen */
.bg-fallback {
  position: absolute;
  inset: 0;
  background: #1c1c1c;
  background-image:
    radial-gradient(ellipse at 30% 50%, rgba(80,20,20,0.3) 0%, transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='%23222'/%3E%3Crect width='1' height='1' fill='%23282828'/%3E%3C/svg%3E");
  z-index: 0;
}

.dark-content {
  position: relative;
  z-index: 10;
  width: clamp(350px, 40vw, 700px);
  margin-top: 24vh;
}

.dark-para {
  font-family: 'Druk Text', sans-serif;
  font-weight: 800;
  font-size: clamp(22px, 2.4vw, 39px);
  line-height: 1.25;
  text-transform: uppercase;
  color: var(--white);
  margin-top: 10vh;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(30px);
}

.dark-para:last-of-type { margin-bottom: 6vh; }

.btn-empezar {
  background-image: url('./img/btn.png');
  background-size: 100% 100%;
  background-color: transparent;
  border: none;
  cursor: pointer;
  padding: 18px 56px;
  transition: all 0.3s ease;
}

.btn-empezar:hover {
  background-color: transparent;
  filter: brightness(1.1);
}

.btn-empezar span { position: relative; z-index: 1; }

/* ══════════════════════════════
   TEST OVERLAY
══════════════════════════════ */

#test-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

#test-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;          /* siempre flex, nunca display:none */
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #1a1a1a4c;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#test-overlay.active {
  opacity: 1;
  pointer-events: all;
}

#test-bg-overlay {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 1;
}

.test-bg-fallback {
    display: none;
  position: absolute;
  inset: 0;
  background: #1c1c1c;
  background-image: radial-gradient(ellipse at 30% 50%, rgba(80,20,20,0.4) 0%, transparent 60%);
  z-index: 0;
}

.test-card {
  position: relative;
  z-index: 2;
  background: var(--paper);
  width: 100%;
  max-width: 700px;
  padding: 44px 44px 40px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.7), 0 0 0 1px rgba(139,0,0,0.2);
  animation: cardIn 0.5s cubic-bezier(0.4,0,0.2,1) forwards;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Torn top edge on card */
.test-card::before {
  content: '';
  position: absolute; top: -7px; left: 0; right: 0; height: 9px;
  background: var(--paper);
  clip-path: polygon(0%100%,1%25%,2%75%,3%10%,4%65%,5%30%,6%85%,7%15%,8%70%,9%40%,10%80%,11%20%,12%60%,13%5%,14%75%,15%40%,16%85%,17%20%,18%65%,19%30%,20%75%,21%15%,22%55%,23%30%,24%80%,25%10%,26%65%,27%35%,28%85%,29%20%,30%60%,31%5%,32%70%,33%30%,34%75%,35%15%,36%65%,37%40%,38%90%,39%15%,40%55%,41%25%,42%75%,43%10%,44%65%,45%30%,46%80%,47%20%,48%60%,49%35%,50%85%,51%15%,52%55%,53%25%,54%75%,55%40%,56%90%,57%20%,58%60%,59%10%,60%65%,61%30%,62%80%,63%20%,64%70%,65%35%,66%85%,67%15%,68%50%,69%25%,70%75%,71%10%,72%60%,73%35%,74%80%,75%15%,76%65%,77%40%,78%90%,79%15%,80%55%,81%30%,82%75%,83%5%,84%65%,85%25%,86%80%,87%15%,88%60%,89%35%,90%85%,91%10%,92%55%,93%25%,94%75%,95%40%,96%90%,97%15%,98%50%,99%25%,100%100%);
}

/* Card header */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
  padding-bottom: 10px;
  border-bottom: 2px solid #1a1a1a;
}

.card-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #888;
  line-height: 1.8;
}

.card-eyebrow strong {
  display: block;
  font-family: 'Druk Text', sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
  color: #1a1a1a;
}

.progress-info {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #888;
  text-align: right;
  letter-spacing: 0.1em;
}

.prog-bar {
  width: 110px;
  height: 3px;
  background: rgba(0,0,0,0.12);
  margin-top: 6px;
  margin-left: auto;
}

.prog-fill {
  height: 100%;
  background: var(--red);
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}

/* Question */
.q-wrap { animation: qIn 0.35s ease forwards; }
.q-wrap.out { animation: qOut 0.25s ease forwards; }

@keyframes qIn  { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
@keyframes qOut { from{opacity:1;transform:translateY(0)} to{opacity:0;transform:translateY(-16px)} }

.q-num {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.q-text {
  font-family: 'Druk Text', sans-serif;
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 800;
  line-height: 1.15;
  color: #1a1a1a;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.q-double {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--red);
  background: rgba(139,0,0,0.08);
  padding: 4px 10px;
  margin-top: 10px;
}

/* Options */
.options { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; }

.opt {
  position: relative;
  cursor: pointer;
  background: transparent;
  border: 1.5px solid rgba(26,26,26,0.18);
  padding: 14px 18px 14px 48px;
  text-align: left;
  font-family: 'Druk Text', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1a1a1a;
  transition: all 0.2s ease;
  overflow: hidden;
}

.opt::before {
  content: attr(data-l);
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-family: 'DM Mono', monospace;
  font-size: 11px; color: #999;
  transition: color 0.2s;
}

.opt::after {
  content: '';
  position: absolute; inset: 0;
  background: #1a1a1a;
  transform: translateX(-101%);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  z-index: 0;
}

.opt span { position: relative; z-index: 1; }

.opt:hover { border-color: #1a1a1a; color: #fff; }
.opt:hover::after { transform: translateX(0); }
.opt:hover::before { color: var(--red); }

.opt.chosen {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
  pointer-events: none;
}
.opt.chosen::before { color: rgba(255,255,255,0.7); }
.opt.chosen::after { display: none; }

/* Card footer */
.card-foot {
  margin-top: 24px; padding-top: 14px;
  border-top: 1px solid rgba(0,0,0,0.1);
  display: flex; justify-content: space-between;
  font-family: 'DM Mono', monospace;
  font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: #aaa;
}

/* ══════════════════════════════
   RESULT
══════════════════════════════ */
.result-stamp {
  position: absolute; top: 36px; right: 36px;
  width: 100px; height: 100px;
  border: 5px solid var(--res-color, #8B0000);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(12deg);
  opacity: 0.8;
}

.stamp-txt {
  font-family: 'Druk Text', sans-serif;
  font-size: 12px; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase;
  text-align: center; line-height: 1.4;
  color: var(--res-color, #8B0000);
}

.res-score-lbl {
  font-family: 'DM Mono', monospace;
  font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: #888;
  margin-bottom: 6px;
}

.res-score-max {
  font-family: 'DM Mono', monospace;
  font-size: 12px; color: #aaa; margin-bottom: 24px;
}

.res-cat {
  font-family: 'Druk Text', sans-serif;
  font-size: clamp(28px, 4vw, 50px); 
  font-weight: 900;
  letter-spacing: -1px;
  text-transform: uppercase;
  color: var(--res-color, #8B0000);
  line-height: 1.05; margin-bottom: 14px;
  padding-right: 90px;
}

.res-block {
    font-family: 'American Typewriter', 'DM Mono', monospace;
    margin-bottom: 10px;
    line-height: 1.55;
    font-size: 18px;
}

.res-desc {
  font-family: 'Druk Text', sans-serif;
  font-size: 15px; color: #555; line-height: 1.65;
  margin-bottom: 28px; padding-bottom: 24px;
  border-bottom: 1px solid rgba(0,0,0,0.12);
}

.res-bar-lbl {
  font-family: 'DM Mono', monospace;
  font-size: 12px; 
  letter-spacing: 0.15em;
  text-transform: uppercase; 
  color: #8c0000; 
  margin-top: 25px;
  margin-bottom: 5px;
}

.res-bar-track {
  height: 5px; background: rgba(0,0,0,0.1); margin-bottom: 32px;
}

.res-bar-fill {
  height: 100%; background: var(--res-color, #8B0000);
  width: 0%; transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}

.res-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn-res {
    flex: 1;
    min-width: 140px;
    padding: 11px 14px;
    font-family: 'Druk Text', sans-serif;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.08em;
    line-height: 2;
    text-transform: uppercase;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    border: 2px solid #1a1a1a;
    transition: all 0.2s;
}

.btn-res.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-res.primary:hover { background: #a00; border-color: #a00; }
.btn-res.secondary { background: transparent; color: #1a1a1a; }
.btn-res.secondary:hover { background: #1a1a1a; color: #fff; }

/* Canvas (hidden) */
#share-canvas { display: none; }

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */
@media (max-width: 767px) {

    #hero {
        min-height: 50vh;
    }

    #bg-img {
        margin-top: -5px;
    }

    .dark-content {
        margin-top: 14vh;
    }

    .dark-para {
        margin-top: 5vh;
    }

    .dark-para:last-of-type {
        margin-bottom: 5vh;
    }

    #landing-content {
        padding-bottom: 25vh;
    }


  #dark-section { padding: 40px 24px 60px; }
  .test-card { padding: 32px 24px 28px; }
  .result-stamp { width: 76px; height: 76px; top: 24px; right: 20px; }
  .stamp-txt { font-size: 8px; }
  .res-score-big { font-size: 72px; }
  .res-cat { padding-right: 70px; }
}

#share-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: auto;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  min-width: 180px;
  z-index: 10;
  animation: qIn 0.15s ease forwards;
}

#share-menu a {
  padding: 12px 18px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.15s;
}

#share-menu a:last-child { border-bottom: none; }
#share-menu a:hover { background: rgba(255,255,255,0.08); }

@media (min-width: 768px) {
    #share-menu a:last-child {
        display: none;
    }
}

#img-preview {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.preview-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-height: 90vh;
}

.preview-inner img {
  max-width: min(500px, 90vw);
  max-height: 70vh;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.preview-actions {
  display: flex;
  gap: 12px;
}