@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700;800&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --black: #06060a;
  --ink: #0b0a10;
  --panel: #121118;
  --gold: #b9964e;
  --gold-bright: #efd88f;
  --gold-dark: #5e4821;
  --ivory: #f3ead8;
  --muted: #b7aa92;
  --line: rgba(185, 150, 78, 0.3);
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ivory);
  background:
    radial-gradient(circle at 78% 8%, rgba(101, 76, 133, 0.22), transparent 26rem),
    linear-gradient(180deg, #08070c 0%, #0c0a10 48%, #06060a 100%);
  font-family: "Libre Baskerville", Georgia, serif;
  line-height: 1.75;
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: .16;
  pointer-events: none;
  background-image: repeating-linear-gradient(115deg, transparent 0 34px, rgba(255,255,255,.025) 35px, transparent 36px);
}
img { display: block; max-width: 100%; }
a { color: inherit; }
.skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 100;
  padding: .8rem 1rem;
  color: var(--black);
  background: var(--gold-bright);
  font-family: Cinzel, serif;
  font-weight: 700;
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 3rem), var(--max));
  min-height: 88px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: .9rem; text-decoration: none; font-family: Cinzel, serif; letter-spacing: .08em; text-transform: uppercase; }
.brand img { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 0 14px rgba(215,170,82,.28)); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .85rem; }
.brand small { color: var(--muted); font-size: .52rem; letter-spacing: .2em; }
.site-header nav { display: flex; align-items: center; gap: 1.3rem; }
.site-header nav a, .site-header nav span { color: var(--muted); font-family: Cinzel, serif; font-size: .65rem; font-weight: 700; letter-spacing: .1em; text-decoration: none; text-transform: uppercase; }
.site-header nav a:hover, .site-header nav a:focus-visible { color: var(--gold-bright); }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, .55fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 7rem);
  width: min(calc(100% - 3rem), var(--max));
  min-height: calc(100vh - 88px);
  margin: 0 auto;
  padding: 5rem 0 6rem;
  overflow: hidden;
}
.hero-atmosphere {
  position: absolute;
  inset: 3rem -8rem 3rem 30%;
  opacity: .48;
  background: linear-gradient(90deg, var(--ink), transparent 38%), url("assets/homepage_hero.jpg") center/cover no-repeat;
  mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent);
}
.hero-copy, .cover-frame { position: relative; z-index: 2; }
.eyebrow { margin: 0 0 .8rem; color: var(--gold); font-family: Cinzel, serif; font-size: .7rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.hero h1 { max-width: 850px; margin: 0; font-family: Cinzel, serif; font-size: clamp(3.4rem, 7.8vw, 7.6rem); font-weight: 700; letter-spacing: -.045em; line-height: .92; text-transform: uppercase; text-wrap: balance; }
.hero blockquote { max-width: 680px; margin: 2rem 0 0; padding-left: 1.3rem; color: #e8dac1; border-left: 2px solid var(--gold); font-size: clamp(1rem, 1.8vw, 1.3rem); font-style: italic; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.2rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .75rem 1.1rem; border: 1px solid var(--line); font-family: Cinzel, serif; font-size: .65rem; font-weight: 700; letter-spacing: .12em; text-decoration: none; text-transform: uppercase; transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.button:hover, .button:focus-visible { transform: translateY(-2px); border-color: var(--gold); background: rgba(215,170,82,.1); }
.button.primary { color: #160e04; background: linear-gradient(135deg, var(--gold-bright), var(--gold)); border-color: var(--gold-bright); }
.cover-frame { justify-self: end; width: min(32vw, 390px); margin: 0; padding: .75rem; border: 1px solid var(--line); background: rgba(5,5,4,.74); box-shadow: 0 35px 100px rgba(0,0,0,.65), 0 0 70px rgba(215,170,82,.09); transform: rotate(1.2deg); }
.cover-frame::before, .cover-frame::after { position: absolute; width: 46px; height: 46px; content: ""; pointer-events: none; }
.cover-frame::before { top: -1px; left: -1px; border-top: 2px solid var(--gold-bright); border-left: 2px solid var(--gold-bright); }
.cover-frame::after { right: -1px; bottom: -1px; border-right: 2px solid var(--gold-bright); border-bottom: 2px solid var(--gold-bright); }
.cover-frame img { width: 100%; height: auto; }
.cover-frame figcaption { padding: .8rem .25rem .1rem; color: var(--muted); font-family: Cinzel, serif; font-size: .6rem; letter-spacing: .18em; text-align: center; text-transform: uppercase; }
.document-mark { position: absolute; right: 29%; bottom: 0; color: transparent; -webkit-text-stroke: 1px rgba(215,170,82,.16); font: 800 clamp(8rem, 20vw, 18rem)/.8 Cinzel, serif; letter-spacing: -.08em; }

.overview, .chapter-index, .closing, .timeline, .chapter { width: min(calc(100% - 3rem), var(--max)); margin-inline: auto; }
.overview { display: grid; grid-template-columns: minmax(0, .9fr) minmax(320px, 1.1fr); gap: clamp(2rem, 8vw, 9rem); padding: clamp(6rem, 12vw, 11rem) 0; border-top: 1px solid var(--line); }
.overview h2, .chapter-index h2, .closing h2 { margin: 0; font: 700 clamp(2.4rem, 5vw, 5rem)/1.04 Cinzel, serif; letter-spacing: -.035em; text-transform: uppercase; text-wrap: balance; }
.overview > p { margin: 0; color: #d8ccb6; font-size: clamp(1.05rem, 1.7vw, 1.28rem); }

.chapter-index { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: end; padding: 0 0 clamp(5rem, 10vw, 8rem); }
.chapter-index ol { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin: 0; padding: 0; border-top: 1px solid var(--line); list-style: none; counter-reset: trials; }
.chapter-index li { counter-increment: trials; border-bottom: 1px solid var(--line); }
.chapter-index a { display: flex; align-items: center; min-height: 52px; color: var(--muted); font-family: Cinzel, serif; font-size: .68rem; letter-spacing: .1em; text-decoration: none; text-transform: uppercase; }
.chapter-index a::before { content: "0" counter(trials); width: 2.5rem; color: var(--gold); }
.chapter-index a:hover, .chapter-index a:focus-visible { color: var(--gold-bright); }

.chapter-gallery { border-top: 1px solid var(--line); }
.chapter { position: relative; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(280px, .58fr); align-items: center; gap: clamp(3rem, 9vw, 10rem); min-height: 680px; padding: clamp(5rem, 10vw, 9rem) 0; border-bottom: 1px solid var(--line); }
.chapter:nth-child(even) { grid-template-columns: minmax(280px, .58fr) minmax(0, 1.12fr); }
.chapter:nth-child(even) .chapter-copy { grid-column: 2; }
.chapter:nth-child(even) figure { grid-column: 1; grid-row: 1; }
.chapter-copy { position: relative; z-index: 1; }
.chapter-number { position: absolute; top: -3.2rem; left: -1.2rem; z-index: -1; color: transparent; -webkit-text-stroke: 1px rgba(215,170,82,.2); font: 800 clamp(5rem, 11vw, 10rem)/1 Cinzel, serif; }
.chapter h2 { max-width: 800px; margin: 0 0 2rem; font: 700 clamp(2.5rem, 5vw, 5rem)/1 Cinzel, serif; letter-spacing: -.04em; text-transform: uppercase; text-wrap: balance; }
.chapter p:not(.eyebrow) { max-width: 760px; color: #d3c7b1; }
.chapter p:not(.eyebrow):first-of-type { color: var(--ivory); font-style: italic; }
.chapter figure { position: relative; justify-self: center; width: min(100%, 390px); margin: 0; padding: .65rem; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(215,170,82,.11), rgba(5,5,4,.7)); box-shadow: 0 28px 70px rgba(0,0,0,.52); }
.chapter figure::before, .chapter figure::after { position: absolute; width: 42px; height: 42px; content: ""; pointer-events: none; }
.chapter figure::before { top: -1px; left: -1px; border-top: 2px solid var(--gold); border-left: 2px solid var(--gold); }
.chapter figure::after { right: -1px; bottom: -1px; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); }
.chapter figure img { width: 100%; height: auto; background: #0c0a08; }
.chapter figure figcaption { padding: .7rem .9rem .2rem; color: var(--muted); font-family: Cinzel, serif; font-size: .56rem; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.chapter-wide-art figure { width: min(100%, 520px); }

.closing { padding: clamp(6rem, 12vw, 11rem) 0; text-align: center; }
.closing h2 { max-width: 1080px; margin-inline: auto; color: var(--gold-bright); }
.timeline { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: clamp(5rem, 10vw, 9rem); border: 1px solid var(--line); }
.timeline > * { position: relative; min-height: 200px; padding: 2rem; text-decoration: none; }
.timeline > * + * { border-left: 1px solid var(--line); }
.timeline small, .timeline strong, .timeline em { display: block; }
.timeline small { margin-bottom: .8rem; color: var(--gold); font: 700 .65rem/1.4 Cinzel, serif; letter-spacing: .16em; text-transform: uppercase; }
.timeline strong { font: 700 clamp(1.25rem, 2.2vw, 2rem)/1.2 Cinzel, serif; text-transform: uppercase; }
.timeline em { margin-top: 1rem; color: var(--muted); font-size: .75rem; }
.timeline a { transition: background .2s ease; }
.timeline a:hover, .timeline a:focus-visible { background: rgba(215,170,82,.08); }
.timeline .current { background: linear-gradient(135deg, rgba(215,170,82,.16), rgba(215,170,82,.03)); }

.lore-section, .entity-section, .timeline-panel, .utility-grid, .developer-notes { width: min(calc(100% - 3rem), var(--max)); margin: 0 auto; padding: clamp(4rem, 8vw, 8rem) 0; border-top: 1px solid var(--line); }
.section-heading { max-width: 760px; margin-bottom: 2.4rem; }
.section-heading h2, .timeline-panel h2, .downloads h2, .share-panel h2, .developer-notes h2 { margin: 0; font-family: Cinzel, serif; font-size: clamp(1.8rem, 3.8vw, 3.6rem); line-height: 1.08; text-transform: uppercase; }
.section-heading > p:last-child { color: var(--muted); }
.lore-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.lore-card { min-height: 260px; padding: 1.5rem; background: linear-gradient(145deg, rgba(19,16,10,.98), rgba(7,6,4,.98)); text-decoration: none; transition: transform .25s ease, background .25s ease; }
.lore-card:hover, .lore-card:focus-visible { position: relative; z-index: 2; transform: translateY(-5px); background: #181108; outline: 1px solid var(--gold); }
.lore-card span, .entity-grid article > span { color: var(--gold); font-family: Cinzel, serif; font-size: .58rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.lore-card h3, .entity-grid h3 { margin: 3.2rem 0 .8rem; font-family: Cinzel, serif; font-size: 1.25rem; line-height: 1.15; text-transform: uppercase; }
.lore-card p, .entity-grid p { margin: 0; color: var(--muted); font-size: .88rem; }
.entity-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.entity-grid article { min-height: 290px; padding: 1.7rem; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(215,170,82,.05), transparent); }
.split-lore { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 7rem); }
.entity-list { display: grid; border-top: 1px solid var(--line); }
.entity-list > a, .entity-list > span { display: grid; grid-template-columns: minmax(150px, .55fr) 1fr; gap: 1.2rem; padding: 1.15rem 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.entity-list > a:hover strong, .entity-list > a:focus-visible strong { color: var(--gold-bright); }
.entity-list strong { font-family: Cinzel, serif; font-size: .75rem; text-transform: uppercase; }
.entity-list span span { color: var(--muted); font-size: .82rem; }
.timeline-panel { display: grid; grid-template-columns: .65fr 1fr; gap: clamp(2rem, 7vw, 8rem); }
.timeline-panel ol { margin: 0; padding: 0; list-style: none; }
.timeline-panel li { display: grid; grid-template-columns: 45px 1fr; gap: 1rem; padding: 0 0 1.6rem; }
.timeline-panel li > span { display: grid; place-items: center; align-self: start; width: 40px; height: 40px; color: #170f05; border-radius: 50%; background: var(--gold); font: 700 .65rem Cinzel, serif; }
.timeline-panel strong { font-family: Cinzel, serif; text-transform: uppercase; }
.timeline-panel li p { margin: .25rem 0 0; color: var(--muted); font-size: .88rem; }
.timeline-panel > .button { grid-column: 2; justify-self: start; }
.utility-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1px; }
.downloads, .share-panel { padding: clamp(1.6rem, 4vw, 3.5rem); border: 1px solid var(--line); background: rgba(14,12,8,.72); }
.downloads > p, .share-panel > p { color: var(--muted); }
.download-list, .share-actions { display: grid; gap: .7rem; margin-top: 2rem; }
.download-list a, .share-actions a, .share-actions button { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 58px; padding: .8rem 1rem; color: var(--ivory); border: 1px solid var(--line); background: transparent; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.download-list a:hover, .download-list a:focus-visible, .share-actions a:hover, .share-actions a:focus-visible, .share-actions button:hover, .share-actions button:focus-visible { border-color: var(--gold); background: rgba(215,170,82,.08); }
.download-list strong, .share-actions a, .share-actions button { font-family: Cinzel, serif; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.download-list span { color: var(--muted); font-size: .72rem; }
.copy-status { min-height: 1.5rem; font-size: .75rem; }
.developer-notes { display: grid; grid-template-columns: .7fr 1.3fr; gap: clamp(2rem, 7vw, 8rem); }
.notes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.notes-grid p { margin: 0; padding: 1.5rem; color: var(--muted); background: var(--ink); font-size: .83rem; }
.notes-grid strong { display: block; margin-bottom: .8rem; color: var(--gold-bright); font-family: Cinzel, serif; font-size: .65rem; letter-spacing: .1em; text-transform: uppercase; }

footer { display: flex; justify-content: space-between; gap: 1rem; padding: 2rem max(1.5rem, calc((100vw - var(--max))/2)); color: var(--muted); border-top: 1px solid var(--line); background: #030303; font-family: Cinzel, serif; font-size: .65rem; letter-spacing: .1em; text-transform: uppercase; }
footer a { color: var(--gold); text-decoration: none; }
footer p { margin: 0; }

@media (max-width: 900px) {
  .site-header { align-items: flex-start; gap: 1.5rem; padding: 1rem 0; }
  .site-header nav { flex-wrap: wrap; justify-content: flex-end; gap: .55rem 1rem; }
  .hero { grid-template-columns: 1fr .48fr; gap: 2rem; min-height: auto; padding-block: 5rem; }
  .hero-atmosphere { inset: 2rem -4rem 2rem 20%; }
  .hero h1 { font-size: clamp(3.1rem, 9vw, 5rem); }
  .document-mark { display: none; }
  .overview, .chapter-index { grid-template-columns: 1fr; gap: 2rem; }
  .chapter, .chapter:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(210px, 300px); min-height: 560px; gap: 2.5rem; }
  .chapter:nth-child(even) .chapter-copy { grid-column: 2; }
  .chapter h2 { font-size: clamp(2rem, 5vw, 3.4rem); }
  .timeline > * { padding: 1.4rem; }
  .lore-grid { grid-template-columns: 1fr 1fr; }
  .entity-grid, .split-lore, .timeline-panel, .utility-grid, .developer-notes { grid-template-columns: 1fr; }
  .timeline-panel > .button { grid-column: auto; }
}

@media (max-width: 680px) {
  .site-header { width: min(calc(100% - 2rem), var(--max)); flex-direction: column; }
  .site-header nav { justify-content: flex-start; }
  .site-header nav span { display: none; }
  .hero { grid-template-columns: 1fr; width: min(calc(100% - 2rem), var(--max)); padding: 4rem 0; }
  .hero-atmosphere { inset: 0 -5rem 35% 10%; opacity: .18; }
  .hero-copy { order: 1; }
  .cover-frame { order: 2; justify-self: center; width: min(82vw, 330px); margin-top: 1rem; }
  .hero h1 { font-size: clamp(2.8rem, 15vw, 4.6rem); }
  .hero-actions { display: grid; }
  .button { width: 100%; }
  .overview, .chapter-index, .closing, .timeline, .chapter { width: min(calc(100% - 2rem), var(--max)); }
  .chapter-index ol { grid-template-columns: 1fr; }
  .chapter, .chapter:nth-child(even) { grid-template-columns: 1fr; min-height: auto; padding-block: 5rem; }
  .chapter:nth-child(even) .chapter-copy, .chapter:nth-child(even) figure { grid-column: auto; grid-row: auto; }
  .chapter figure, .chapter-wide-art figure { width: min(86vw, 380px); }
  .chapter h2 { font-size: clamp(2rem, 10vw, 3.2rem); }
  .chapter-number { top: -2.1rem; left: -.2rem; }
  .timeline { grid-template-columns: 1fr; }
  .timeline > * + * { border-top: 1px solid var(--line); border-left: 0; }
  .lore-section, .entity-section, .timeline-panel, .utility-grid, .developer-notes { width: min(calc(100% - 2rem), var(--max)); }
  .lore-grid, .notes-grid { grid-template-columns: 1fr; }
  .entity-list > a, .entity-list > span { grid-template-columns: 1fr; gap: .35rem; }
  .download-list a { align-items: flex-start; flex-direction: column; }
  footer { flex-direction: column; }
}

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