/* ═══════════════════════════════════════════════════════════════
   LA SAGA DE LOS PUERCOS Y LAS CREATURAS
   Design System — The Abyss Aesthetic
   ═══════════════════════════════════════════════════════════════ */

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

/* ── Custom Properties ── */
:root {
  /* Colors — The Abyss (not pure black per WCAG dark mode research) */
  --abyss: #0a0a0b;
  --abyss-deep: #050506;
  --abyss-surface: #111113;
  --abyss-elevated: #18181b;

  /* Text — Parchment tones */
  --parchment: #ddd0bf;
  --parchment-bright: #f0e8dd;
  --parchment-dim: #b8aa96;
  --parchment-ghost: #8a7e6d;

  /* Accent — Blood & Rust */
  --blood: #8b1a1a;
  --blood-bright: #b22222;
  --blood-dim: #5c1010;
  --rust: #6b3a2a;

  /* Earth — Mud & Corral */
  --mud: #3a3228;
  --earth: #6b5e50;
  --straw: #8a7d6a;

  /* Special */
  --warau-gold: #e8c86e;
  --tocino-warm: #a0724a;
  --creatura-blush: #8a4a5a;

  /* Typography Scale — Musical thirds */
  --fs-xs: clamp(0.72rem, 0.68rem + 0.2vw, 0.83rem);
  --fs-sm: clamp(0.83rem, 0.78rem + 0.25vw, 0.96rem);
  --fs-base: clamp(1rem, 0.93rem + 0.35vw, 1.15rem);
  --fs-md: clamp(1.15rem, 1.05rem + 0.5vw, 1.38rem);
  --fs-lg: clamp(1.38rem, 1.2rem + 0.9vw, 1.73rem);
  --fs-xl: clamp(1.73rem, 1.45rem + 1.4vw, 2.3rem);
  --fs-2xl: clamp(2.3rem, 1.8rem + 2.5vw, 3.45rem);
  --fs-3xl: clamp(3rem, 2.2rem + 4vw, 5rem);
  --fs-hero: clamp(4rem, 2.5rem + 7.5vw, 8rem);

  /* Spacing */
  --space-xs: clamp(0.25rem, 0.2rem + 0.25vw, 0.5rem);
  --space-sm: clamp(0.5rem, 0.4rem + 0.5vw, 1rem);
  --space-md: clamp(1rem, 0.8rem + 1vw, 2rem);
  --space-lg: clamp(2rem, 1.5rem + 2.5vw, 4rem);
  --space-xl: clamp(4rem, 3rem + 5vw, 8rem);
  --space-2xl: clamp(6rem, 4rem + 10vw, 14rem);

  /* Reading measure */
  --measure: 65ch;
  --measure-narrow: 45ch;
  --measure-wide: 80ch;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-slow: 1.2s;
  --duration-normal: 0.6s;
  --duration-fast: 0.3s;
}

/* ── Base ── */
html {
  font-size: 100%;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--mud) var(--abyss);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Crimson Pro', Georgia, 'Times New Roman', serif;
  font-size: var(--fs-base);
  font-weight: 450;
  line-height: 1.75;
  letter-spacing: 0.015em;
  color: var(--parchment);
  background-color: var(--abyss);
  overflow-x: hidden;
  min-height: 100vh;
}

::selection {
  background-color: var(--blood-dim);
  color: var(--parchment-bright);
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--abyss);
}

::-webkit-scrollbar-thumb {
  background: var(--mud);
  border-radius: 3px;
}

/* ── Typography ── */

/* Headings — Cormorant Garamond */
h1, h2, h3, h4, h5, h6,
.heading {
  font-family: 'Cormorant Garamond', 'Garamond', Georgia, serif;
  font-weight: 600;
  line-height: 1.15;
  color: var(--parchment-bright);
  letter-spacing: 0.01em;
}

/* Part titles (PARTE I, II, etc.) */
.part-title {
  font-size: var(--fs-hero);
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--parchment-ghost);
  text-align: center;
}

.part-subtitle {
  font-size: var(--fs-2xl);
  font-weight: 600;
  font-style: italic;
  color: var(--parchment-bright);
  text-align: center;
  margin-top: var(--space-sm);
}

/* Chapter titles */
.chapter-title {
  font-size: var(--fs-2xl);
  font-weight: 600;
  color: var(--parchment-bright);
  margin-bottom: var(--space-md);
}

.chapter-subtitle {
  font-size: var(--fs-md);
  font-style: italic;
  color: var(--parchment-dim);
  margin-bottom: var(--space-lg);
}

/* Body text */
p {
  margin-bottom: 1.5em;
  max-width: var(--measure);
}

/* Strong / Bold — blood accent on key phrases */
strong, b {
  font-weight: 700;
  color: var(--parchment-bright);
}

/* Italic — stage directions feel */
em, i {
  font-style: italic;
  color: var(--parchment-dim);
}

/* ── Character Dialogue ── */
.dialogue {
  margin: var(--space-md) 0;
  padding-left: var(--space-md);
  border-left: 2px solid var(--mud);
}

.dialogue-speaker {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--parchment-bright);
  margin-bottom: var(--space-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dialogue-text {
  font-size: var(--fs-md);
  line-height: 1.8;
}

/* ── Stage Directions ── */
.stage-direction {
  font-style: italic;
  color: var(--parchment-dim);
  font-size: var(--fs-sm);
  line-height: 1.6;
  margin: var(--space-sm) 0;
}

.stage-direction::before {
  content: '';
}

/* ── Verdicts ── */
.verdict {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: var(--fs-xl);
  font-weight: 700;
  text-align: center;
  padding: var(--space-lg) 0;
  color: var(--blood-bright);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.verdict-puercos {
  color: var(--blood-bright);
}

.verdict-ganadora {
  color: var(--warau-gold);
}

/* ── Blockquotes (El Jefe habla) ── */
blockquote,
.jefe-speaks {
  position: relative;
  margin: var(--space-lg) 0;
  padding: var(--space-md) var(--space-lg);
  font-size: var(--fs-md);
  font-style: italic;
  color: var(--parchment-bright);
  background: linear-gradient(
    135deg,
    rgba(139, 26, 26, 0.08) 0%,
    rgba(8, 8, 8, 0) 60%
  );
  border-left: 3px solid var(--blood);
}

blockquote::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--blood-dim), transparent);
}

/* ── The Ecos Section ── */
.eco {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: var(--fs-lg);
  font-style: italic;
  text-align: center;
  color: var(--parchment-dim);
  padding: var(--space-sm) 0;
  opacity: 0.7;
}

.eco:hover {
  opacity: 1;
  color: var(--parchment-bright);
  transition: all var(--duration-slow) var(--ease-out);
}

/* ── WARAU moments ── */
.warau {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
  color: var(--warau-gold);
  letter-spacing: 0.15em;
}

/* ── Horizontal Rules / Scene Breaks ── */
hr,
.scene-break {
  border: none;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--mud),
    transparent
  );
  margin: var(--space-xl) auto;
  max-width: 200px;
}

.scene-break--major {
  max-width: 300px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--blood-dim),
    var(--blood),
    var(--blood-dim),
    transparent
  );
  margin: var(--space-2xl) auto;
}

/* ── Tables (El Festín, El Menú) ── */
table {
  width: 100%;
  max-width: var(--measure);
  border-collapse: collapse;
  margin: var(--space-lg) 0;
  font-size: var(--fs-sm);
}

th {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: var(--fs-base);
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 2px solid var(--mud);
  color: var(--parchment-bright);
}

td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid rgba(58, 50, 40, 0.4);
  vertical-align: top;
}

tr:last-child td {
  border-bottom: none;
}

/* ── Layout ── */
.page {
  width: 100%;
  min-height: 100vh;
}

.content {
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--space-md) var(--space-md);
}

.content--wide {
  max-width: var(--measure-wide);
}

.content--narrow {
  max-width: var(--measure-narrow);
}

/* Full viewport sections for dramatic moments */
.full-scene {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-xl) var(--space-md);
  text-align: center;
}

/* Chapter containers */
.chapter {
  padding: var(--space-2xl) 0;
  position: relative;
}

.chapter::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: var(--space-xl);
  background: linear-gradient(to bottom, transparent, var(--mud), transparent);
}

.chapter:first-child::before {
  display: none;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .content {
    padding: var(--space-sm) var(--space-sm);
  }

  .dialogue {
    padding-left: var(--space-sm);
  }

  .part-title {
    letter-spacing: 0.08em;
  }
}

@media (max-width: 480px) {
  body {
    line-height: 1.65;
  }
}

/* ── Print ── */
@media print {
  body {
    background: white;
    color: black;
  }

  .verdict {
    color: black;
  }
}
