/* Intriga: la web con la luz, la paleta y las fuentes de la app (web/DESIGN.md). */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/fonts/cormorant-garamond.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/fonts/cormorant-garamond-italic.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/source-sans-3.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #120f0e;
  --surface: #1d1917;
  --surface-raised: #28221f;
  --hairline: #2e2724;
  --outline: #7d7064;
  --text: #f2eadf;
  --text-secondary: #b8ac9e;
  --accent: #e9b24e;
  --on-accent: #1c1306;
  --accent-soft: #3a2b12;
  --brass-edge: rgb(233 178 78 / 0.5);
  --lamp: rgb(233 178 78 / 0.16);
  --serif: "Cormorant Garamond", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(20px, 5vw, 48px);
  --measure: 68ch;
  --radius: 14px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: hidden;
}

/* Una sola lámpara arriba a la izquierda y una viñeta, fijas detrás de todo. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
body::before {
  background: radial-gradient(circle at 7% -3%, var(--lamp), rgb(233 178 78 / 0) min(110vmax, 1400px));
  animation: lamp 11s ease-in-out infinite alternate;
}
body::after {
  background: radial-gradient(ellipse at center, transparent 55%, rgb(0 0 0 / 0.42) 120%);
}
@keyframes lamp {
  from { opacity: 0.82; }
  to { opacity: 1; }
}

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--serif);
  font-variant-numeric: lining-nums;
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  border-radius: 8px;
  z-index: 10;
}
.skip:focus { top: 12px; }

/* Cabecera y pie */

.site-header,
.site-footer {
  width: min(100% - 2 * var(--gutter), 1120px);
  margin-inline: auto;
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
}
.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.625rem;
  line-height: 1;
  color: var(--text);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.lang {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding-inline: 4px;
}
.lang:hover { color: var(--text); }

.site-footer {
  margin-top: clamp(80px, 12vw, 140px);
  padding-block: 32px 48px;
  border-top: 1px solid var(--hairline);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
}
.site-footer nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
}
.site-footer nav a {
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.site-footer nav a:hover { text-decoration: underline; }
.site-footer p { align-self: center; }

/* Etiquetas */

/* El género de un caso, como en la app: versalitas con una raya delante. */
.genre {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: 0.125em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.genre::before {
  content: "";
  width: 1.25em;
  height: 1px;
  background: currentColor;
}

.hook {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.1875rem;
  line-height: 1.38;
  color: var(--text-secondary);
}

/* Arranque */

.hero {
  width: min(100% - 2 * var(--gutter), 1120px);
  margin-inline: auto;
  padding-block: clamp(16px, 4vw, 56px) clamp(72px, 10vw, 128px);
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}
.keyhole {
  width: clamp(120px, 30vw, 168px);
  mix-blend-mode: lighten;
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent);
  mask-image: radial-gradient(closest-side, #000 72%, transparent);
}
.hero h1 {
  font-size: clamp(3.75rem, 14vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
  margin-top: 4px;
}
.hero .lead {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.5rem, 4.6vw, 2.125rem);
  line-height: 1.25;
  max-width: 22ch;
  margin-top: 20px;
}
.hero .what {
  color: var(--text-secondary);
  max-width: 44ch;
  margin-top: 20px;
}
.hero .free {
  margin-top: 28px;
  font-weight: 600;
  font-size: 1.1875rem;
  max-width: 34ch;
}
.hero .free strong { color: var(--accent); font-weight: 600; }

.stores {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.stores li {
  display: grid;
  gap: 2px;
  min-width: 168px;
  padding: 10px 20px 12px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: rgb(29 25 23 / 0.7);
  text-align: left;
}
.stores .soon {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-secondary);
}
.stores .store {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.2;
}

@media (min-width: 880px) {
  .hero {
    grid-template-columns: minmax(0, 34rem) minmax(0, 1fr);
    grid-template-areas:
      "title keyhole"
      "lead keyhole"
      "what keyhole"
      "free keyhole"
      "stores keyhole";
    justify-items: start;
    align-content: center;
    text-align: left;
    column-gap: clamp(48px, 8vw, 120px);
    min-height: min(78vh, 720px);
  }
  .hero h1 { grid-area: title; }
  .hero .lead { grid-area: lead; }
  .hero .what { grid-area: what; }
  .hero .free { grid-area: free; }
  .hero .stores { grid-area: stores; justify-content: flex-start; }
  .keyhole { grid-area: keyhole; align-self: center; justify-self: center; width: clamp(200px, 22vw, 300px); }
}

/* Secciones */

.section {
  width: min(100% - 2 * var(--gutter), 1120px);
  margin-inline: auto;
  margin-top: clamp(88px, 13vw, 160px);
}
.section > h2 {
  font-size: clamp(2.125rem, 6vw, 3.25rem);
}
.section > .intro {
  color: var(--text-secondary);
  margin-top: 12px;
  max-width: 52ch;
}

/* Expediente: un panel con pestaña de carpeta, como en la app. */
.dossier {
  position: relative;
  margin-top: 34px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
}
.dossier .tab {
  position: absolute;
  left: -1px;
  bottom: 100%;
  padding: 7px 16px 5px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.125em;
  text-transform: uppercase;
  color: var(--accent);
}

/* El caso gratis */

.free-case {
  margin-top: clamp(56px, 8vw, 80px);
  overflow: visible;
}
.free-case .inner {
  display: grid;
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  overflow: hidden;
}
.cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-raised);
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgb(18 15 14 / 0) 45%, var(--fade, var(--background)) 100%);
}
.free-case .cover { --fade: var(--surface); }
.free-case .body {
  padding: 4px 24px 28px;
  display: grid;
  gap: 12px;
  max-width: 62ch;
}
.free-case h3 { font-size: clamp(2rem, 6vw, 2.75rem); }
.badge {
  justify-self: start;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--brass-edge);
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 600;
}

@media (min-width: 880px) {
  .free-case .inner { grid-template-columns: 1.25fr 1fr; align-items: center; }
  .free-case .cover { aspect-ratio: auto; height: 100%; min-height: 380px; }
  .free-case .cover::after {
    background: linear-gradient(to right, rgb(29 25 23 / 0) 55%, var(--surface) 100%);
  }
  .free-case .body { padding: 40px 44px 40px 8px; }
}

/* Cómo se juega */

.steps {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  gap: 36px;
  counter-reset: step;
}
.steps li {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  column-gap: 16px;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  font-family: var(--serif);
  font-variant-numeric: lining-nums;
  font-weight: 500;
  font-size: 3.5rem;
  line-height: 0.9;
  color: var(--outline);
}
.steps h3 { font-size: 1.625rem; }
.steps p { color: var(--text-secondary); margin-top: 6px; max-width: 46ch; }

@media (min-width: 880px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 48px; }
}

/* Más casos: lista alterna, no una cuadrícula. */

.cases {
  list-style: none;
  margin: 48px 0 0;
  padding: 0;
  display: grid;
  gap: clamp(56px, 8vw, 96px);
}
.case {
  display: grid;
  gap: 16px;
}
.case .cover { border-radius: var(--radius); overflow: hidden; }
.case .text { display: grid; gap: 12px; align-content: center; max-width: 52ch; }
.case h3 { font-size: clamp(1.75rem, 5vw, 2.375rem); }

@media (min-width: 760px) {
  .case {
    grid-template-columns: 1.2fr 1fr;
    gap: clamp(32px, 5vw, 64px);
    align-items: center;
  }
  .case:nth-child(even) .cover { order: 2; }
}

/* Preguntas */

.faq {
  margin-top: 32px;
  max-width: var(--measure);
  border-top: 1px solid var(--hairline);
}
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding-block: 14px;
  font-weight: 600;
  font-size: 1.125rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-right: 1.5px solid var(--text-secondary);
  border-bottom: 1.5px solid var(--text-secondary);
  transform: translateY(-3px) rotate(45deg);
  transition: transform 300ms var(--ease-out);
}
.faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.faq summary:hover { color: var(--accent); }
.faq details p { color: var(--text-secondary); padding-bottom: 20px; max-width: 62ch; }

/* Páginas para leer: privacidad, términos y soporte */

.page {
  width: min(100% - 2 * var(--gutter), var(--measure));
  margin-inline: auto;
  padding-top: clamp(24px, 5vw, 56px);
}
.page h1 { font-size: clamp(2.5rem, 8vw, 3.5rem); }
.page .updated { color: var(--text-secondary); margin-top: 10px; font-size: 0.9375rem; }
.page h2 { font-size: clamp(1.625rem, 4.5vw, 2rem); margin-top: 56px; }
.page h3 { font-size: 1.375rem; margin-top: 32px; }
.page p, .page ul { margin-top: 16px; }
.page ul { padding-left: 1.25em; }
.page li + li { margin-top: 10px; }
.page .lede { font-size: 1.1875rem; margin-top: 28px; }
.page a { overflow-wrap: anywhere; }
.page .dossier { margin-top: 52px; padding: 20px 24px; }
.page .dossier p { margin: 0; }
.page .faq { margin-top: 20px; }

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 0.96875rem;
}
.table th,
.table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 10px 12px 0;
  border-top: 1px solid var(--hairline);
}
.table th { color: var(--text-secondary); font-weight: 600; }
@media (max-width: 600px) {
  .table, .table tbody, .table tr, .table td { display: block; }
  .table thead { display: none; }
  .table tr { border-top: 1px solid var(--hairline); padding-block: 12px; }
  .table td { border: 0; padding: 2px 0; }
  .table td:first-child { font-weight: 600; }
  .table td[data-label]::before {
    content: attr(data-label) ": ";
    color: var(--text-secondary);
    font-weight: 600;
  }
}

.notfound { text-align: center; padding-top: clamp(48px, 10vw, 120px); }
.notfound .keyhole { margin-inline: auto; }
.notfound h1 { margin-top: 16px; }
.notfound p { margin-top: 16px; color: var(--text-secondary); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.contact .mail {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 6vw, 2rem);
  line-height: 1.3;
  display: inline-block;
  padding-block: 4px;
}
.page .contact p + p { margin-top: 8px; color: var(--text-secondary); }
