/* ============================================
   FAMILY GAME - Editorial dossier redesign
   Wide layout · bottom nav · modern editorial
   ============================================ */

:root {
  --paper: #f3efe6;
  --paper-strong: #ece5d8;
  --paper-dark: #d9d0c2;
  --ink: #181511;
  --ink-soft: #4e473d;
  --line: rgba(24, 21, 17, 0.14);
  --accent-red: #b44e34;
  --accent-blue: #1f445c;
  --accent-gold: #8c6c29;
  --midnight: #101722;
  --midnight-soft: #172132;
  --midnight-line: rgba(255, 255, 255, 0.12);
  --white: #fffdf8;
  --shadow: 0 24px 80px rgba(20, 16, 10, 0.14);
  --shadow-strong: 0 24px 80px rgba(0, 0, 0, 0.24);
  --radius: 24px;
  --sheet-pad: clamp(1.6rem, 2.8vw, 2.8rem);
  --page-pad: clamp(1rem, 2vw, 2rem);
  --transition: 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(180, 78, 52, 0.08), transparent 24%),
    radial-gradient(circle at top right, rgba(31, 68, 92, 0.09), transparent 22%),
    linear-gradient(180deg, #efe8db 0%, #f8f5ef 50%, #efe9de 100%);
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
}

body.is-loading {
  overflow: hidden;
}

/* ---- Preloader ---- */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top left, rgba(180, 78, 52, 0.12), transparent 30%),
    radial-gradient(circle at bottom right, rgba(31, 68, 92, 0.14), transparent 30%),
    linear-gradient(180deg, #efe8db 0%, #f8f5ef 50%, #efe9de 100%);
  opacity: 1;
  transition: opacity 560ms cubic-bezier(0.22, 1, 0.36, 1);
}

body:not(.is-loading) .preloader {
  opacity: 0;
  pointer-events: none;
}

.preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  transform: translateY(0);
  animation: preloader-float 2.4s ease-in-out infinite;
}

.preloader-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0.75;
}

.preloader-title {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.preloader-bar {
  position: relative;
  display: block;
  width: min(240px, 50vw);
  height: 2px;
  background: rgba(24, 21, 17, 0.1);
  overflow: hidden;
  border-radius: 999px;
  margin-top: 0.5rem;
}

.preloader-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  background: linear-gradient(90deg, var(--accent-red), var(--accent-gold));
  border-radius: inherit;
  animation: preloader-scan 1.2s cubic-bezier(0.6, 0, 0.4, 1) infinite;
}

@keyframes preloader-scan {
  0% { left: -40%; }
  100% { left: 100%; }
}

@keyframes preloader-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@media (prefers-reduced-motion: reduce) {
  .preloader-inner,
  .preloader-bar-fill {
    animation: none;
  }
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(24, 21, 17, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 21, 17, 0.02) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at center, black 20%, transparent 85%);
  opacity: 0.55;
  z-index: 0;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

/* ---- Skip link ---- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--ink);
  color: var(--white);
  padding: 0.75rem 1rem;
  border-radius: 999px;
  z-index: 30;
  transition: top var(--transition);
}

.skip-link:focus {
  top: 1rem;
}

/* ---- Top bar (unified) ---- */

.site-bar {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  padding: 0.28rem;
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(24, 21, 17, 0.08);
  border-radius: 999px;
  box-shadow: 0 14px 40px rgba(40, 33, 23, 0.12);
  max-width: calc(100vw - 2rem);
}

.site-meta {
  display: none !important;
}

.site-brand {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.35rem 1rem 0.35rem 1.1rem;
  line-height: 1.05;
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}

.site-brand .site-title {
  font-family: "Fraunces", serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.site-brand .site-kicker {
  margin: 0.1rem 0 0;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

.page-controls {
  flex-shrink: 0;
}

.page-rail {
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
}

.bar-divider {
  width: 1px;
  margin: 0.4rem 0;
  background: rgba(24, 21, 17, 0.1);
}

.site-kicker,
.fact-label,
.card-label,
.note-label,
.eyebrow,
.sheet-head,
.sheet-foot,
.site-meta,
.page-rail span,
.page-counter {
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

.site-bar > div:first-child,
.site-meta {
  background: rgba(255, 253, 248, 0.84);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(24, 21, 17, 0.08);
  border-radius: 999px;
  padding: 0.75rem 1rem;
  box-shadow: 0 8px 30px rgba(40, 33, 23, 0.08);
}

.site-kicker {
  margin: 0 0 0.22rem;
  color: var(--ink-soft);
}

.site-title {
  font-family: "Fraunces", serif;
  font-size: 1.2rem;
  font-weight: 600;
}

.site-meta {
  display: flex;
  gap: 0.75rem;
  color: var(--ink-soft);
}

/* ---- Page rail (inside site-bar) ---- */

.page-rail {
  position: static;
  transform: none;
  display: flex;
  gap: 0.15rem;
  align-items: center;
  background: transparent;
  backdrop-filter: none;
  border: 0;
  border-radius: 0;
  padding: 0 0.25rem;
  box-shadow: none;
}

.page-rail a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--ink-soft);
  transition:
    background var(--transition),
    color var(--transition);
  white-space: nowrap;
}

.page-rail a strong {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page-rail a span {
  font-size: 0.68rem;
  opacity: 0.5;
}

.page-rail a:hover {
  background: rgba(24, 21, 17, 0.06);
  color: var(--ink);
}

.page-rail a.is-active {
  background: var(--ink);
  color: var(--white);
}

.page-rail a.is-active span {
  opacity: 0.7;
}

/* ---- Page controls (inside site-bar) ---- */

.page-controls {
  position: static;
  display: flex;
  gap: 0.25rem;
  align-items: center;
  background: transparent;
  backdrop-filter: none;
  border-radius: 0;
  border: 0;
  padding: 0 0.25rem;
  box-shadow: none;
}

.page-button {
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  background: var(--ink);
  color: var(--white);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  transition:
    transform var(--transition),
    opacity var(--transition),
    background var(--transition);
}

.page-button--icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(24, 21, 17, 0.06);
  color: var(--ink);
}

.page-button--icon:hover:not(:disabled) {
  background: var(--ink);
  color: var(--white);
  transform: none;
}

.page-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--accent-blue);
}

.page-button:disabled {
  cursor: default;
  opacity: 0.35;
}

.page-counter {
  min-width: 3.5rem;
  text-align: center;
  color: var(--ink-soft);
  padding: 0 0.2rem;
}

/* ---- Book / pages ---- */

.book {
  position: relative;
  z-index: 1;
}

.page {
  min-height: 100svh;
  padding: 6.5rem 2rem 2.25rem;
  display: flex;
  align-items: stretch;
  justify-content: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.sheet {
  width: min(1720px, 100%);
  min-height: calc(100svh - 8.75rem);
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid rgba(24, 21, 17, 0.08);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  padding: var(--sheet-pad);
  transition:
    transform var(--transition),
    box-shadow var(--transition);
  overflow: hidden;
}

.page.is-active .sheet {
  transform: translateY(-3px);
  box-shadow: 0 28px 90px rgba(27, 21, 11, 0.16);
}

/* ---- Sheet header / footer ---- */

.sheet-head,
.sheet-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink-soft);
}

.sheet-head {
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.sheet-foot {
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.sheet-foot--light,
.section-top--light,
.page-world .sheet-head {
  color: rgba(255, 255, 255, 0.72);
}

/* ---- Typography ---- */

.page h1,
.page h2,
.page h3 {
  margin: 0;
  font-family: "Fraunces", serif;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.page h1 {
  font-size: clamp(4rem, 9vw, 8rem);
}

.page h2 {
  font-size: clamp(2.4rem, 5vw, 5rem);
  max-width: 18ch;
}

.page h3 {
  font-size: clamp(1.45rem, 2vw, 2.4rem);
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--accent-red);
}

.lead,
.story-intro,
.budget-copy,
.section-aside,
.cover-quote,
.team-card--primary p {
  font-size: clamp(1.1rem, 1.7vw, 1.4rem);
  line-height: 1.55;
}

/* ---- Section top ---- */

.section-top {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 3rem;
  padding: 1.5rem 0 1.8rem;
}

.section-top .section-aside {
  max-width: 36rem;
  color: var(--ink-soft);
}

/* ---- Shared grid base ---- */

.cover-layout,
.story-layout,
.budget-layout,
.world-layout,
.process-bottom {
  display: grid;
  gap: 1.6rem;
}

/* ---- 01 · Cover ---- */

.page-cover .sheet {
  color: var(--white);
  background:
    radial-gradient(circle at top left, rgba(196, 145, 65, 0.24), transparent 22%),
    radial-gradient(circle at bottom right, rgba(54, 113, 149, 0.24), transparent 22%),
    linear-gradient(135deg, #0e1520 0%, #171f2e 46%, #2d1f24 100%);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-strong);
}

.page-cover .sheet-head,
.page-cover .sheet-foot {
  color: rgba(255, 255, 255, 0.68);
  border-color: rgba(255, 255, 255, 0.12);
}

.page-cover .eyebrow,
.page-cover .fact-label {
  color: rgba(255, 255, 255, 0.62);
}

.cover-layout {
  grid-template-columns: minmax(0, 0.9fr) minmax(400px, 1.1fr);
  flex: 1;
  padding: 1.8rem 0;
}

.cover-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
}

.cover-copy .lead {
  max-width: 36ch;
}

.cover-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.cover-facts > div {
  padding: 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cover-facts strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.08rem;
  line-height: 1.35;
}

.cover-quote {
  margin: 0;
  max-width: 36ch;
  color: rgba(255, 255, 255, 0.86);
}

.cover-art {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 1rem;
}

.hero-panel,
.story-figure,
.process-figure,
.world-center,
.world-panel,
.timeline-card,
.team-card,
.character-card,
.budget-lines article,
.story-note {
  border-radius: 18px;
}

.hero-panel {
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.thumb-grid img {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

/* ---- 02 · Historia ---- */

.page-story .sheet {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 20%),
    linear-gradient(180deg, var(--paper) 0%, #f7f3eb 100%);
}

.story-layout {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr);
  align-items: stretch;
  flex: 1;
  padding: 1.6rem 0 1.2rem;
}

.story-main {
  display: grid;
  align-content: start;
  gap: 1rem;
  padding-right: 2rem;
}

.story-main p {
  max-width: 48rem;
  margin: 0;
}

.story-side {
  display: grid;
  gap: 1rem;
  align-content: start;
  align-self: stretch;
}

.story-figure {
  margin: 0;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  line-height: 0;
  align-self: start;
}

.story-note {
  align-self: start;
}

.story-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.story-note {
  background: #f7f1e3;
  border: 1px solid rgba(180, 78, 52, 0.12);
  padding: 1.15rem;
}

.story-note p {
  margin: 0.5rem 0 0;
}

.duo-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 0.75rem;
  margin: 0.25rem 0 0.25rem;
}

.duo {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.1rem 1.2rem 1.2rem 1.35rem;
  border-radius: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(20, 16, 10, 0.05);
}

.duo::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: currentColor;
}

.duo--daughter {
  color: var(--accent-blue);
  background:
    radial-gradient(circle at top right, rgba(31, 68, 92, 0.09), transparent 55%),
    linear-gradient(180deg, #eef2f5 0%, #fff 70%);
}

.duo--father {
  color: var(--accent-red);
  background:
    radial-gradient(circle at top left, rgba(180, 78, 52, 0.1), transparent 55%),
    linear-gradient(180deg, #f7ece6 0%, #fff 70%);
}

.duo-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.duo-age {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: clamp(2.2rem, 3.2vw, 2.8rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: currentColor;
}

.duo-head > div {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  gap: 0.15rem;
}

.duo-name {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.duo-tag {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.duo p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.55;
}

.duo-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
}

.duo-divider::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--line) 18%, var(--line) 82%, transparent);
  transform: translateX(-50%);
}

.duo-divider span {
  position: relative;
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
  padding: 0.4rem 0.55rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.story-synthesis {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(1.1rem, 1.55vw, 1.3rem);
  line-height: 1.5;
  font-style: italic;
  color: var(--ink);
  padding: 0.95rem 1.1rem 0.95rem 1.3rem;
  border-left: 3px solid var(--accent-gold);
  background: linear-gradient(90deg, rgba(140, 108, 41, 0.09), rgba(140, 108, 41, 0) 75%);
  border-radius: 0 14px 14px 0;
}

.story-synthesis em {
  font-style: italic;
  color: var(--accent-red);
}

/* ---- 03 · Personajes ---- */

.page-characters .sheet {
  background:
    linear-gradient(180deg, rgba(180, 78, 52, 0.06), transparent 28%),
    linear-gradient(180deg, #f6f0e6 0%, #efe7d9 100%);
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
  padding-bottom: 1.2rem;
}

.character-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.character-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.character-card > div {
  padding: 1rem 1.2rem 1.2rem;
}

.character-card p {
  margin: 0.45rem 0 0;
  color: var(--ink-soft);
}

.character-card--amber {
  background: linear-gradient(180deg, rgba(31, 68, 92, 0.12), rgba(255, 255, 255, 0.75));
}

.character-card--leo {
  background: linear-gradient(180deg, rgba(140, 108, 41, 0.12), rgba(255, 255, 255, 0.75));
}

.character-card--avatar {
  background: linear-gradient(180deg, rgba(180, 78, 52, 0.14), rgba(255, 255, 255, 0.75));
}

/* ---- 04 · Mundo ---- */

.page-world .sheet {
  color: var(--white);
  background:
    radial-gradient(circle at top right, rgba(54, 113, 149, 0.28), transparent 20%),
    radial-gradient(circle at bottom left, rgba(180, 78, 52, 0.22), transparent 20%),
    linear-gradient(135deg, #111a28 0%, #0d1723 52%, #1c2734 100%);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-strong);
}

.page-world .sheet-foot {
  border-color: rgba(255, 255, 255, 0.12);
}

.world-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  flex: 1;
}

.world-panel,
.world-center {
  padding: 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.world-panel p,
.world-center p {
  color: rgba(255, 255, 255, 0.75);
}

.world-panel img,
.world-center img {
  width: 100%;
  border-radius: 14px;
  object-fit: cover;
}

.world-panel img {
  margin-top: 1rem;
  aspect-ratio: 4 / 3;
}

.world-center {
  display: grid;
  align-content: center;
  gap: 1rem;
}

.world-center img {
  aspect-ratio: 4 / 5;
}

/* ---- 05 · Pipeline ---- */

.page-process .sheet {
  background:
    linear-gradient(rgba(31, 68, 92, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 68, 92, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, #f5f3ed 0%, #ece7db 100%);
  background-size: 40px 40px, 40px 40px, auto;
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  padding-bottom: 1.2rem;
}

.process-step {
  min-height: 220px;
  padding: 1.2rem;
  border-radius: 18px;
  border: 1px solid rgba(31, 68, 92, 0.14);
  background: rgba(255, 255, 255, 0.75);
}

.process-step span {
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  margin-bottom: 0.8rem;
  background: var(--accent-blue);
  color: var(--white);
  font-weight: 800;
}

.process-step p {
  margin: 0.55rem 0 0;
  color: var(--ink-soft);
}

.process-bottom {
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.2rem;
}

.process-figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--white);
}

.process-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.process-note {
  display: grid;
  align-content: center;
  gap: 0.8rem;
  padding: 1.5rem;
  border-radius: 18px;
  border: 1px solid rgba(180, 78, 52, 0.14);
  background: linear-gradient(180deg, rgba(180, 78, 52, 0.08), rgba(255, 255, 255, 0.82));
}

.process-note p,
.phase-card li,
.team-card p,
.budget-note {
  color: var(--ink-soft);
}

.inline-link {
  color: var(--accent-blue);
  font-weight: 700;
}

/* ---- 06 · Plan ---- */

.page-production .sheet {
  background:
    linear-gradient(180deg, rgba(140, 108, 41, 0.08), transparent 24%),
    linear-gradient(180deg, #f2ebdd 0%, #f8f4ee 100%);
}

.plan-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 1.2rem;
}

/* Timeline bar */

.timeline-bar {
  padding: 0.3rem 0;
}

.timeline-bar__track {
  display: flex;
  height: 3.2rem;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(24, 21, 17, 0.05);
  border: 1px solid rgba(24, 21, 17, 0.08);
}

.timeline-bar__phase {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 1rem;
  min-width: 0;
}

.timeline-bar__phase--1 {
  flex: 3;
  background: var(--accent-blue);
  color: var(--white);
}

.timeline-bar__phase--2 {
  flex: 1;
  background: var(--accent-red);
  color: var(--white);
}

.timeline-bar__phase--3 {
  flex: 2;
  background: var(--accent-gold);
  color: var(--white);
}

.timeline-bar__label {
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-bar__months {
  font-size: 0.68rem;
  opacity: 0.8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.timeline-bar__markers {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0.5rem 0;
  font-size: 0.65rem;
  color: var(--ink-soft);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

/* Phase cards */

.phase-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  flex: 1;
}

.phase-card {
  padding: 1.2rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(24, 21, 17, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.phase-card--1 {
  border-top: 3px solid var(--accent-blue);
}

.phase-card--2 {
  border-top: 3px solid var(--accent-red);
}

.phase-card--3 {
  border-top: 3px solid var(--accent-gold);
}

.phase-card p {
  margin: 0;
  color: var(--ink-soft);
}

.phase-deliverables {
  margin-top: auto;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
}

.phase-deliverables .card-label {
  display: block;
  margin-bottom: 0.3rem;
}

.phase-deliverables ul {
  margin: 0;
  padding-left: 1rem;
}

.phase-deliverables li + li {
  margin-top: 0.3rem;
}

/* ---- 07 · Presupuesto ---- */

.page-budget .sheet {
  color: var(--white);
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.08), transparent 18%),
    linear-gradient(135deg, #7d3022 0%, #8f3c2f 26%, #231d1a 100%);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-strong);
}

.page-budget .sheet-head,
.page-budget .sheet-foot {
  color: rgba(255, 255, 255, 0.72);
  border-color: rgba(255, 255, 255, 0.12);
}

.page-budget .eyebrow,
.page-budget .budget-note {
  color: rgba(255, 255, 255, 0.76);
}

/* Budget header */

.budget-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  padding: 1rem 0 1.2rem;
}

.budget-header__copy {
  display: grid;
  align-content: start;
  gap: 0.6rem;
}

.budget-header__copy h2 {
  font-size: clamp(3rem, 6vw, 5.5rem);
  max-width: none;
}

.budget-header__copy p {
  margin: 0;
}

.budget-total-breakdown {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}

.budget-total-item {
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.budget-total-item span {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 0.15rem;
}

.budget-total-item strong {
  display: block;
  font-size: 1.1rem;
  font-family: "Fraunces", serif;
}

.budget-total-item--contingencia {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.03);
}

/* Budget phase columns */

.budget-phases {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.budget-phase {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.budget-phase__title {
  font-family: "Fraunces", serif;
  font-size: 1rem;
  margin: 0 0 0.1rem;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.budget-phase__title::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.budget-phase--1 .budget-phase__title::before {
  background: var(--accent-blue);
}

.budget-phase--2 .budget-phase__title::before {
  background: var(--accent-red);
}

.budget-phase--3 .budget-phase__title::before {
  background: var(--accent-gold);
}

.budget-phase__subtotal {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.6rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.budget-phase__lines {
  display: grid;
  gap: 0;
}

.budget-phase__lines article {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.35rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.budget-phase__lines article:last-child {
  border-bottom: none;
}

.budget-phase__lines article span {
  color: rgba(255, 255, 255, 0.7);
}

.budget-phase__lines article strong {
  white-space: nowrap;
  font-size: 0.85rem;
}

/* Roles grid */

.roles-section {
  padding-top: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.roles-title {
  font-family: "Fraunces", serif;
  font-size: 1.1rem;
  margin: 0 0 0.6rem;
}

.roles-grid {
  display: grid;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  overflow: hidden;
}

.role-row {
  display: grid;
  grid-template-columns: 10rem 7rem 1fr;
  gap: 0.7rem;
  align-items: center;
  padding: 0.45rem 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.role-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.06);
}

.role-row:last-child {
  border-bottom: none;
}

.role-row--header {
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
  padding: 0.4rem 0.9rem;
}

.role-name {
  font-weight: 700;
  font-size: 0.82rem;
}

.role-phases {
  display: flex;
  gap: 0.35rem;
}

.role-phase {
  width: 1.8rem;
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.role-phase--1 {
  background: var(--accent-blue);
}

.role-phase--2 {
  background: var(--accent-red);
}

.role-phase--3 {
  background: var(--accent-gold);
}

.role-phase--partial {
  opacity: 0.45;
}

.role-desc {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
}

/* ---- 08 · Equipo ---- */

.page-team .sheet {
  background:
    linear-gradient(180deg, rgba(31, 68, 92, 0.06), transparent 25%),
    linear-gradient(180deg, #f8f5ee 0%, #efe7d8 100%);
}

.team-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
  padding-bottom: 1rem;
}

.team-card {
  padding: 1.4rem;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(24, 21, 17, 0.08);
}

.team-card--primary {
  background: linear-gradient(180deg, rgba(31, 68, 92, 0.08), rgba(255, 255, 255, 0.76));
}

.team-card p {
  margin: 0.6rem 0 0;
}

.closing-block {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.closing-block h3 {
  font-size: clamp(1.7rem, 2.4vw, 2.8rem);
}

.closing-block p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 32rem;
}

.closing-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.8rem;
  text-align: right;
}

.closing-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.closing-logo__label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-soft);
}

.logo-3dar {
  width: 4.5rem;
  height: auto;
  color: var(--ink);
}

em {
  font-style: italic;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1200px) {
  .page-rail a strong {
    display: none;
  }

  .page-rail a {
    padding: 0.5rem 0.6rem;
  }
}

@media (max-width: 980px) {
  .page-rail {
    bottom: 0.75rem;
    padding: 0.25rem;
    gap: 0.15rem;
  }

  .page-rail a {
    padding: 0.4rem 0.55rem;
  }

  .page-rail a strong {
    display: none;
  }

  .page-controls {
    right: 0.75rem;
    bottom: 0.75rem;
  }
}

@media (max-width: 900px) {
  body {
    scroll-snap-type: y proximity;
  }

  .cover-layout,
  .story-layout,
  .budget-header,
  .process-bottom,
  .world-layout {
    grid-template-columns: 1fr;
  }

  .cover-facts,
  .character-grid,
  .process-grid,
  .phase-grid,
  .budget-phases,
  .team-layout,
  .duo-block {
    grid-template-columns: 1fr;
  }

  .duo-divider {
    width: auto;
    height: 36px;
    justify-self: center;
  }

  .duo-divider::before {
    top: 50%;
    bottom: auto;
    left: 0;
    right: 0;
    width: auto;
    height: 1px;
    transform: translateY(-50%);
    background: linear-gradient(90deg, transparent, var(--line) 18%, var(--line) 82%, transparent);
  }

  .role-row {
    grid-template-columns: 8rem 5.5rem 1fr;
    font-size: 0.82rem;
  }

  .section-top,
  .closing-block {
    align-items: start;
    flex-direction: column;
  }

  .sheet {
    min-height: auto;
  }

  .page {
    padding: 4.5rem 1rem 4.5rem;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .site-bar {
    position: static;
    padding: 1rem 1rem 0;
    gap: 0.6rem;
    flex-direction: column;
    align-items: stretch;
  }

  .site-bar > div:first-child,
  .site-meta {
    padding: 0.7rem 0.85rem;
  }

  .site-meta {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.45rem 0.75rem;
  }

  .page-rail {
    position: fixed;
    bottom: 0.6rem;
    left: 0.6rem;
    right: auto;
    transform: none;
    padding: 0.25rem;
    gap: 0.1rem;
  }

  .page-rail a {
    padding: 0.4rem 0.5rem;
  }

  .page-rail a strong {
    display: none;
  }

  .page-controls {
    position: fixed;
    right: 0.6rem;
    bottom: 0.6rem;
    padding: 0.25rem;
  }

  .page-button {
    padding: 0.5rem 0.7rem;
    font-size: 0.72rem;
  }

  .page {
    min-height: auto;
    padding: 1rem;
    scroll-snap-align: none;
  }

  .sheet {
    min-height: auto;
    border-radius: 20px;
  }

  .cover-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .cover-facts > div {
    padding: 0.65rem 0.7rem;
  }

  .cover-facts strong {
    font-size: 0.9rem;
  }

  .character-grid,
  .process-grid,
  .phase-grid,
  .budget-phases,
  .team-layout,
  .thumb-grid {
    grid-template-columns: 1fr;
  }

  .character-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .character-card img {
    aspect-ratio: 1 / 0.85;
  }

  .site-meta {
    flex-direction: column;
    align-items: start;
  }

  .timeline-bar__months {
    display: none;
  }

  .timeline-bar__label {
    font-size: 0.72rem;
  }

  .timeline-bar__track {
    height: 2.6rem;
  }

  .budget-total-breakdown {
    grid-template-columns: repeat(2, 1fr);
  }

  .budget-phase__lines article {
    flex-direction: column;
    align-items: start;
    gap: 0.1rem;
  }

  .budget-phase__lines article strong {
    white-space: normal;
  }

  .role-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
    padding: 0.5rem 0.9rem;
  }

  .role-row--header {
    display: none;
  }

  .role-phases {
    order: -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .sheet,
  .page-rail a,
  .page-button,
  .skip-link {
    transition: none;
  }
}
