/* RedM è autonomo: nessuna regola dipende dal CSS della homepage. */
:root {
  color-scheme: light;
  --paper: #d1d1d1;
  --panel: #d1d1d1;
  --white: #f7f7f4;
  --shadow: 4px 4px 0 rgba(0, 0, 0, .78);
  --ink: #111317;
  --muted: #33383e;
  --line: #0f1114;
  --gold: #d5d6d6;
  --reading-font: Georgia, 'Times New Roman', serif;
  --ui-font: 'Courier New', Courier, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.07), transparent 32rem),
    linear-gradient(180deg, #3e444a 0, #2b2f33 45%, #23272b 100%);
  color: var(--ink);
  font-family: var(--reading-font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; }
img { display: block; max-width: 100%; }
figure, h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 3px solid #111317; outline-offset: 5px; }
.skip-link { position: absolute; z-index: 5; left: 16px; top: -100px; padding: 12px; background: var(--paper); }
.skip-link:focus { top: 10px; }
.hero { height: 415px; position: relative; isolation: isolate; overflow: hidden; background: #4a3c2a; border-bottom: 4px double #a3916d; color: #f8efdc; }
.hero-image { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center 55%; z-index: -3; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, #1e1a15df 0%, #29221875 45%, #30271e08 76%), linear-gradient(0deg, #1d19174a, transparent 40%); z-index: -2; }
.hero-inner { max-width: 1184px; margin: auto; padding: 58px 32px 40px; }
.eyebrow { font-family: var(--ui-font); text-transform: uppercase; font-size: 11px; line-height: 1.6; letter-spacing: 2.4px; }
.hero .eyebrow { color: #e0c69b; }
h1 { font-size: clamp(64px, 7.8vw, 108px); line-height: 1.08; letter-spacing: -4px; margin: 13px 0 12px; text-shadow: 0 2px 16px #21170f42; }
.hero-description { font-size: 21px; line-height: 1.5; color: #eee4d3; }
.hero-caption { position: absolute; right: max(32px, calc((100vw - 1120px) / 2)); bottom: 22px; font: 10px var(--ui-font); letter-spacing: 3px; color: #efdebf; }
.page-shell { max-width: 1184px; padding: 0 32px; margin: 0 auto; }
.characters { padding-top: 45px; }
h2 { font-size: clamp(34px, 4vw, 48px); letter-spacing: -1.5px; line-height: 1.1; font-weight: bold; }
.character-card {
  position: relative;
  isolation: isolate;
  min-width: 0;
  overflow: hidden;
  margin-bottom: 23px;
  border: 3px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  box-shadow: inset 2px 2px 0 var(--white), inset -2px -2px 0 #6d7175, var(--shadow);
}
/* Stessa trama dei pannelli home, senza la barra del titolo. */
.character-card::before, .character-card::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2;
}
.character-card::before {
  opacity: .16;
  background: repeating-linear-gradient(180deg, transparent 0, transparent 3px, rgba(0,0,0,.33) 4px);
  mix-blend-mode: multiply;
}
.character-card::after {
  opacity: .07;
  background-image: repeating-radial-gradient(circle at 0 0, #000 0 1px, transparent 1px 3px);
  background-size: 5px 5px;
}
.character-summary { position: relative; list-style: none; display: grid; grid-template-columns: minmax(0, 1fr) 280px; grid-template-rows: 205px auto; gap: 13px 48px; padding: 27px 28px; cursor: pointer; border-radius: 0; }
.character-summary::-webkit-details-marker { display: none; }
.character-summary::marker { content: ''; }
.character-summary:focus-visible { outline-offset: -7px; }
.character-intro { grid-column: 1; grid-row: 1 / 3; align-self: center; padding: 0 0 2px 7px; }
.character-category { display: flex; align-items: center; gap: 9px; color: #474c52; font-family: var(--ui-font); font-size: 10px; letter-spacing: 1.8px; text-transform: uppercase; margin-bottom: 15px; }
.character-category > span { font-size: 16px; }
h3 { font-size: clamp(32px, 3.4vw, 46px); line-height: 1.12; letter-spacing: -1.5px; }
.character-origin { color: #50565c; font-size: 14px; margin-top: 10px; font-style: italic; }
.character-excerpt { max-width: 560px; font-size: 18px; line-height: 1.6; margin: 18px 0 22px; color: #33383e; }
.paper-label { display: inline-block; padding: 5px 8px; font-family: var(--ui-font); font-size: 9px; line-height: 1.3; letter-spacing: 1px; text-transform: uppercase; border: 1px solid #90959a; color: #33383e; background: #c3c5c7; }
.character-photo { grid-column: 2; grid-row: 1; padding: 5px; border: 1px solid #111317; background: #aaaeb1; box-shadow: inset 0 0 0 2px #ededed; overflow: hidden; }
.character-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; filter: sepia(.1); transition: filter .2s ease; }
.character-summary:hover .character-photo img { filter: sepia(0); }
.when-open { display: none; }
.character-card[open] .when-closed { display: none; }
.character-card[open] .when-open { display: inline; }
.character-card[open] { border-color: var(--line); }
.character-background { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 34px; margin: 0 28px; padding: 30px 7px 28px; border-top: 1px solid #90959a; }
.background-label { display: flex; align-items: center; gap: 9px; align-self: start; padding-top: 6px; font-family: var(--ui-font); font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: #474c52; }
.background-label > span { font-size: 17px; }
.background-copy { max-width: 740px; }
h4 { font-size: 28px; letter-spacing: -.5px; line-height: 1.25; margin-bottom: 18px; }
.background-copy > p { font-size: 18px; line-height: 1.85; margin-bottom: 17px; color: #33383e; }
.background-end { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding-top: 9px; color: #62686e; }
.text-button { border: 0; padding: 10px 0 10px 12px; background: transparent; font-size: 14px; color: #33383e; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.text-button span { margin-left: 10px; }
.placeholder-photo { background: #b8bdc1; }
.footer { margin-top: 34px; padding: 21px 0 26px; border-top: 1px solid #636a70; display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: 12px; color: #d5d6d6; }
.footer a { text-decoration: none; font-family: var(--ui-font); font-size: 11px; }
.footer a > span { color: #b7bdc3; }
.footer > span { font-style: italic; }
.footer > span > span { margin-left: 10px; font-style: normal; }
@media (min-width: 1600px) { .hero { height: 455px; } .hero-inner { padding-top: 74px; } }


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

/* Pulsanti con lo stile della homepage. */
.retro-button {
  --ink: #111317;
  --yellow: #ffd45d;
  font-family: "Courier New", "Lucida Console", monospace;
  font-weight: 700;
  letter-spacing: -.02em;
  -webkit-font-smoothing: auto;
}
.retro-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #111;
  background: #d8d8d8;
  border: 3px solid #111;
  box-shadow:
    inset 2px 2px 0 #fff,
    inset -2px -2px 0 #777,
    3px 3px 0 rgba(0,0,0,.7);
  text-decoration: none;
  text-shadow: none;
}

.retro-button {
  padding: 12px 18px;
  font-size: 1rem;
}

.retro-button:hover,
.retro-button:focus-visible {
  color: #fff;
  background: #33383d;
  outline: none;
}


.retro-button { position: relative; border-radius: 0; min-height: 0; transition: none; }
.discover-button { grid-column: 2; grid-row: 2; justify-self: end; width: auto; }
.toggle-sign { font: inherit; }
.toggle-sign::before { content: '→'; }
.character-card[open] .toggle-sign::before { content: '↑'; }
.character-summary:focus-visible .discover-button { color: #fff; background: #33383d; }
/* La trama della home si applica soltanto ai componenti condivisi. */
.retro-button::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: .16;
  background: repeating-linear-gradient(180deg, transparent 0, transparent 3px, rgba(0,0,0,.33) 4px);
  mix-blend-mode: multiply;
}
.retro-button::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1; opacity: .07;
  background-image: repeating-radial-gradient(circle at 0 0, #000 0 1px, transparent 1px 3px);
  background-size: 5px 5px;
}
.archive-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.archive-heading h2 { color: var(--gold); font-weight: 400; white-space: nowrap; }
.archive-heading p { font-size: 16px; line-height: 1.5; color: #d5d6d6; white-space: nowrap; }


/* Firma e documenti di Asa Slade. */
.signature-photo { display: flex; align-items: center; justify-content: center; background: #c3c5c7; }
.signature-photo img { width: 100%; height: 100%; object-fit: contain; object-position: center; filter: none; }
.story-chapter { margin-top: 32px; }
.story-documents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 22px 0; }
.story-documents figure > img { display: block; border: 2px solid var(--line); box-shadow: 3px 3px 0 rgba(0,0,0,.5); }
.story-documents img { width: 100%; height: auto; }
.story-documents figcaption {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.6;
}

.story-documents figcaption span {
  display: block;
  margin-top: 0;
  font: inherit;
  text-decoration: none;
}


/* Anteprime e pagine dei racconti. */
.story-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; margin: 24px 0 12px; }
.story-actions .retro-button { font-size: 13px; line-height: 1.5; text-align: center; }
.story-secondary-link { font: 13px/1.6 var(--ui-font); text-underline-offset: 4px; }
.story-shell { padding-top: 28px; }
.story-breadcrumb { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; color: #d5d6d6; font: 12px/1.6 var(--ui-font); margin-bottom: 24px; }
.story-breadcrumb a { text-underline-offset: 4px; }
.story-breadcrumb a:focus-visible { outline-color: #f7f7f4; }
.story-article { padding: 48px clamp(22px, 6vw, 88px); }
.story-header { position: relative; border-bottom: 1px solid #90959a; padding-bottom: 28px; margin-bottom: 34px; }
.story-header h1 { font-size: clamp(48px, 7vw, 80px); line-height: 1.1; letter-spacing: -2px; text-shadow: none; margin: 16px 0; }
.story-lead { max-width: 560px; font-size: 21px; line-height: 1.6; margin-top: 22px; }
.story-signature { width: 160px; height: auto; margin: 12px 0 0 auto; }
.story-copy { margin: 0 auto; }
.story-copy h2 { font-size: 28px; line-height: 1.25; letter-spacing: -.5px; margin-bottom: 18px; }
.story-return { max-width: 740px; margin: 36px auto 0; padding-top: 24px; border-top: 1px solid #90959a; }
.story-return .retro-button { font-size: 13px; }


/* Regole comuni alle schede dell’elenco, presenti e future. */
.characters .character-summary { column-gap: 24px; }
.characters .character-excerpt { max-width: none; margin-bottom: 0; }
.characters .character-background .background-copy { max-width: none; }
.characters .story-actions { justify-content: flex-end; margin: 26px 0 0; }


/* La firma affianca i dati del personaggio, senza interrompere i link. */
.story-header { display: grid; grid-template-columns: minmax(0, 1fr) 170px; column-gap: 24px; }
.story-header > .eyebrow, .story-header > h1, .story-header > .character-origin { grid-column: 1; }
.story-header > .story-signature { grid-column: 2; grid-row: 1 / 4; align-self: start; justify-self: end; width: 160px; max-width: 100%; margin: 0; }
.story-header > .story-actions { grid-column: 1 / -1; }


/* Ricordi originali: immagini intere, senza ritagli. */
.asa-portrait img { object-position: center 30%; filter: none; }
.memory-heading { font-size: 23px; letter-spacing: -.3px; line-height: 1.3; margin: 30px 0 18px; }
.memory-gallery { display: grid; gap: 28px; }
.memory-photo > img { display: block; border: 2px solid var(--line); box-shadow: 3px 3px 0 rgba(0,0,0,.5); }
.memory-photo img { width: 100%; height: auto; }
.memory-photo figcaption { margin-top: 12px; font-size: 15px; line-height: 1.6; }
.memory-photo figcaption strong, .memory-photo figcaption span { display: block; }
.memory-photo .memory-open { margin-top: 5px; font: 11px/1.5 var(--ui-font); text-decoration: underline; }
.memory-seals a { min-height: 180px; display: flex; align-items: center; justify-content: center; padding: 12px; background: #bfc2c4; }
.memory-seals img { width: auto; max-width: 100%; height: 180px; object-fit: contain; }


/* Ritratto e firma nella testata del racconto. */
.story-header { grid-template-columns: minmax(0, 1fr) 260px; grid-template-rows: auto auto auto 1fr; align-items: start; }
.story-header > .eyebrow { grid-row: 1; }
.story-header > h1 { grid-row: 2; }
.story-header > .character-origin { grid-row: 3; }
.story-header > .story-actions { grid-column: 1; grid-row: 4; }
.story-identity { grid-column: 2; grid-row: 1 / 5; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.story-portrait { width: 100%; height: auto; padding: 5px; border: 1px solid #111317; background: #aaaeb1; box-shadow: inset 0 0 0 2px #ededed; }
.story-identity .story-signature { width: 150px; height: auto; margin: 8px auto 0; }


/* Testata compatta: navigazione subito sopra la linea del racconto. */
.story-header { padding-bottom: 12px; margin-bottom: 24px; }
.story-header > .story-actions {
  grid-column: 1;
  grid-row: 4;
  align-self: end;
  margin: 12px 0 0;
}
/* Elimina lo spazio trasparente sotto la firma. */
.story-identity .story-signature {
  aspect-ratio: 201 / 54;
  height: auto;
  object-fit: cover;
  object-position: top;
}


/* Testata compatta: foto a destra e firma sul suo lato sinistro. */
.story-header {
  --portrait-width: 260px;
  --signature-width: 130px;
  --signature-angle: -25deg;

  grid-template-columns: minmax(0, 1fr) var(--portrait-width);
  grid-template-rows: auto auto auto 1fr;
  column-gap: 24px;
  align-items: start;

  padding-bottom: 12px;
  margin-bottom: 24px;
}

.story-header > .story-identity {
  position: relative;
  display: block;
  grid-column: 2;
  grid-row: 1 / 5;
  width: 100%;
  min-width: 0;
}

.story-header .story-portrait {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Firma nella metà inferiore, appena a sinistra della foto. */
.story-header .story-identity .story-signature {
  position: absolute;
  right: calc(100% + 12px);
  bottom: 30px;

  width: var(--signature-width);
  max-width: none;
  height: auto;
  margin: 0;

  object-fit: cover;
  object-position: top;

  transform: rotate(var(--signature-angle));
  transform-origin: right bottom;
}

/* Il collegamento segue i dati, senza essere spinto verso il basso. */
.story-header > .story-actions {
  grid-column: 1;
  grid-row: 4;
  align-self: start;

  margin: 28px 0 0;
  padding-right: calc(var(--signature-width) + 24px);
}

.story-header .story-identity .story-signature {
  aspect-ratio: auto;
  height: auto;
  object-fit: contain;
}
