:root {
  --lore-paper: #d8c39d;
  --lore-paper-bright: #efe1c4;
  --lore-gold: #b88b4b;
  --lore-rust: #714433;
  --lore-ink: #080908;
  --lore-panel: rgba(8, 9, 9, 0.9);
  --lore-line: rgba(184, 139, 75, 0.3);
  --lore-muted: rgba(228, 215, 190, 0.66);
  --lore-max: 1280px;
  --lore-edge: clamp(28px, 5vw, 76px);
  --lore-title-offset: clamp(34px, 5.5vw, 110px);
  --lore-inner-title-offset: clamp(18px, 2.75vw, 52px);
  --lore-title-drop: clamp(28px, 3.5vw, 64px);
  --lore-section-title-drop: clamp(72px, 7vw, 132px);
}

body.lore-universe-body {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 8%, rgba(120, 75, 42, 0.11), transparent 28%),
    radial-gradient(circle at 82% 22%, rgba(185, 139, 75, 0.07), transparent 24%),
    linear-gradient(180deg, #050706 0%, #020303 56%, #070503 100%);
  color: var(--lore-paper-bright);
}

body.lore-universe-body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.22;
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.01) 3px 4px),
    radial-gradient(circle at center, transparent 40%, #000 100%);
}

.lore-stage {
  min-height: 100vh;
}

.lore-stage header {
  position: relative;
  top: auto;
  z-index: auto;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.lore-stage img {
  display: block;
}

.lore-kicker,
.lore-file-number,
.lore-status-label,
.lore-filter-button,
.lore-access-label,
.lore-fact dt,
.lore-page-number {
  font-size: 0.68rem;
  line-height: 1.4;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.lore-kicker {
  margin: 0 0 12px;
  color: var(--lore-gold);
}

.lore-title {
  margin: 0;
  color: var(--lore-paper-bright);
  font-size: clamp(2.3rem, 5.5vw, 5.5rem);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.lore-copy {
  max-width: 650px;
  margin: 16px 0 0;
  color: var(--lore-muted);
  font-size: clamp(0.98rem, 1.35vw, 1.14rem);
  line-height: 1.72;
}

.lore-button {
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid rgba(184, 139, 75, 0.5);
  border-radius: 999px;
  background: rgba(7, 7, 6, 0.76);
  color: var(--lore-paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 220ms ease, color 220ms ease, border-color 220ms ease, background 220ms ease;
}

.lore-button:hover,
.lore-button:focus-visible {
  transform: translateY(-2px);
  border-color: var(--lore-paper);
  background: rgba(184, 139, 75, 0.12);
  color: #fff1d5;
}

.lore-button--solid {
  border-radius: 4px;
  border-color: rgba(219, 181, 119, 0.75);
  background: linear-gradient(135deg, #7e572a, #c39a59 58%, #765027);
  color: #100b06;
  font-weight: 700;
}

.lore-lock {
  width: 78px;
  height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 5px 6px #000) drop-shadow(0 0 18px #000);
}

/* Landing */

.lore-home {
  width: 100%;
}

.lore-home-section {
  position: relative;
  width: min(calc(100% - (var(--lore-edge) * 2)), var(--lore-max));
  margin: 0 auto;
  padding: clamp(70px, 8vw, 118px) 0;
  border-bottom: 1px solid var(--lore-line);
}

.lore-home-section:last-child {
  border-bottom: 0;
}

.lore-orientation {
  width: 100%;
  max-width: none;
  min-height: min(860px, calc(100vh - 92px));
  padding-inline: max(var(--lore-edge), calc((100vw - var(--lore-max)) / 2));
  display: flex;
  align-items: center;
  isolation: isolate;
  overflow: hidden;
}

.lore-orientation::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(3, 5, 4, 0.96), rgba(3, 5, 4, 0.74) 42%, rgba(3, 5, 4, 0.22) 78%, rgba(3, 5, 4, 0.82)),
    linear-gradient(180deg, rgba(2, 3, 3, 0.24), #030403 96%),
    url("../images/lore-still.jpg") center / cover no-repeat;
  filter: saturate(0.74) contrast(1.06);
}

.lore-orientation::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  z-index: -1;
  background: linear-gradient(transparent, #030403);
}

.lore-orientation-copy {
  width: min(100%, 670px);
  margin-left: var(--lore-title-offset);
  max-width: calc(100% - var(--lore-title-offset));
}

.lore-file-stamp {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  color: var(--lore-gold);
}

.lore-file-stamp::before,
.lore-file-stamp::after {
  content: "";
  width: 52px;
  height: 1px;
  background: var(--lore-line);
}

.lore-orientation .lore-title {
  font-size: clamp(3.1rem, 6.5vw, 6.2rem);
}

.lore-orientation-brief {
  max-width: 530px;
  margin-top: 24px;
  padding: 24px 0 0;
  border-top: 1px solid rgba(184, 139, 75, 0.34);
}

.lore-orientation-brief p {
  margin: 0;
  color: var(--lore-muted);
  line-height: 1.75;
}

.lore-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 34px;
}

.lore-gallery-stage .lore-heading {
  box-sizing: border-box;
  padding-left: var(--lore-inner-title-offset);
  padding-top: clamp(18px, 2.4vw, 38px);
}

.lore-character-files {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.lore-character-file {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--lore-line);
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  isolation: isolate;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.4);
}

.lore-character-file::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--character-image) center / cover no-repeat;
  filter: saturate(0.6) sepia(0.12);
  transition: transform 650ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 300ms ease;
}

.lore-character-file::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08) 25%, rgba(2, 3, 3, 0.94) 88%),
    linear-gradient(90deg, color-mix(in srgb, var(--character-accent) 15%, transparent), transparent 55%);
}

.lore-character-file:hover::before,
.lore-character-file:focus-visible::before {
  transform: scale(1.04);
  filter: saturate(0.82) sepia(0.08);
}

.lore-character-file-copy {
  position: absolute;
  inset: auto 0 0;
  padding: 28px;
}

.lore-character-file h3 {
  margin: 8px 0 5px;
  font-size: clamp(2rem, 3.6vw, 3.4rem);
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}

.lore-character-file p {
  margin: 0;
  color: var(--lore-muted);
}

.lore-character-file .lore-file-number {
  color: var(--character-accent);
}

.lore-status-bar {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border: 1px solid var(--lore-line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(184, 139, 75, 0.035), transparent 28% 72%, rgba(184, 139, 75, 0.035)),
    rgba(5, 7, 6, 0.9);
}

.lore-status-bar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 150px;
  opacity: 0.18;
  background: linear-gradient(90deg, transparent, rgba(228, 196, 137, 0.32), transparent);
  animation: loreStatusSweep 8s linear infinite;
}

@keyframes loreStatusSweep {
  from { left: -180px; }
  to { left: calc(100% + 180px); }
}

.lore-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.lore-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #9db85c;
  box-shadow: 0 0 14px rgba(157, 184, 92, 0.74);
}

.lore-status-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid rgba(184, 139, 75, 0.15);
}

.lore-status-item {
  min-width: 0;
  padding: 20px 18px 4px;
  border-right: 1px solid rgba(184, 139, 75, 0.15);
}

.lore-status-item:last-child {
  border-right: 0;
}

.lore-status-label {
  display: block;
  color: rgba(216, 195, 157, 0.5);
}

.lore-status-item strong,
.lore-status-item span {
  display: block;
}

.lore-status-item strong {
  margin-top: 7px;
  color: var(--lore-paper);
  font-weight: 400;
  line-height: 1.3;
}

.lore-status-item span:last-child {
  margin-top: 3px;
  color: var(--lore-muted);
  font-size: 0.82rem;
}

.lore-gallery-door {
  position: relative;
  min-height: 540px;
  overflow: hidden;
  border: 1px solid var(--lore-line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: clamp(34px, 7vw, 86px);
  isolation: isolate;
}

.lore-gallery-door::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(3, 4, 4, 0.94), rgba(3, 4, 4, 0.46) 60%, rgba(3, 4, 4, 0.72)),
    url("../images/lore-still.jpg") center / cover no-repeat;
  filter: saturate(0.78) contrast(1.05);
  transition: transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lore-gallery-door::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 74% 40%, rgba(231, 189, 113, 0.15), transparent 26%);
}

.lore-gallery-door:hover::before {
  transform: scale(1.025);
}

.lore-gallery-door-copy {
  max-width: 590px;
}

.lore-gallery-door .lore-title {
  font-size: clamp(2.6rem, 5vw, 5rem);
}

.lore-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

/* Character chapters */

body.lore-character-body {
  --character-accent: var(--lore-gold);
}

.lore-character-stage {
  position: relative;
  min-height: calc(100vh - 92px);
  isolation: isolate;
}

.lore-character-stage::before {
  content: "";
  position: fixed;
  inset: 92px 0 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(3, 4, 4, 0.97) 0%, rgba(3, 4, 4, 0.83) 42%, rgba(3, 4, 4, 0.36) 76%, rgba(3, 4, 4, 0.82)),
    linear-gradient(180deg, rgba(3, 4, 4, 0.22), rgba(3, 4, 4, 0.95)),
    var(--character-image) center / cover no-repeat;
  filter: saturate(0.7);
}

.lore-character-stage::after {
  content: "";
  position: fixed;
  inset: 92px 0 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 75% 30%, color-mix(in srgb, var(--character-accent) 15%, transparent), transparent 28%);
}

.lore-character-shell {
  width: min(calc(100% - 120px), 1120px);
  margin: 0 auto;
  padding: clamp(70px, 8vw, 116px) 0;
}

.lore-character-hero {
  min-height: 430px;
  display: flex;
  align-items: center;
}

.lore-character-hero-copy {
  max-width: 740px;
}

.lore-character-hero .lore-title {
  font-size: clamp(3.5rem, 7vw, 6rem);
}

.lore-page-number {
  color: var(--character-accent);
}

.lore-character-record {
  width: min(100%, 920px);
  margin-left: auto;
  border-top: 1px solid color-mix(in srgb, var(--character-accent) 55%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--character-accent) 28%, transparent);
  background: linear-gradient(90deg, rgba(5, 6, 6, 0.93), rgba(5, 6, 6, 0.68));
}

.lore-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--character-accent) 25%, transparent);
}

.lore-fact {
  padding: 22px;
  border-right: 1px solid color-mix(in srgb, var(--character-accent) 20%, transparent);
}

.lore-fact:last-child {
  border-right: 0;
}

.lore-fact dt {
  color: var(--character-accent);
}

.lore-fact dd {
  margin: 8px 0 0;
  color: var(--lore-paper);
}

.lore-chapter-copy {
  display: grid;
  gap: 0;
}

.lore-chapter-section {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 28px;
  padding: 32px 24px;
  border-bottom: 1px solid rgba(184, 139, 75, 0.12);
}

.lore-chapter-section:last-child {
  border-bottom: 0;
}

.lore-chapter-section h2 {
  margin: 0;
  color: var(--character-accent);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.lore-chapter-section p {
  margin: 0;
  color: rgba(238, 225, 197, 0.82);
  line-height: 1.78;
}

.lore-page-arrow {
  position: fixed;
  top: 50%;
  z-index: 30;
  width: 58px;
  height: 100px;
  border: 1px solid color-mix(in srgb, var(--character-accent) 48%, transparent);
  background: rgba(2, 3, 3, 0.78);
  color: var(--lore-paper);
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 1.7rem;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: width 220ms ease, background 220ms ease;
}

.lore-page-arrow:hover,
.lore-page-arrow:focus-visible {
  width: 68px;
  background: color-mix(in srgb, var(--character-accent) 15%, rgba(2, 3, 3, 0.9));
}

.lore-page-arrow--previous {
  left: 0;
  border-left: 0;
  border-radius: 0 8px 8px 0;
}

.lore-page-arrow--next {
  right: 0;
  border-right: 0;
  border-radius: 8px 0 0 8px;
}

.lore-character-end {
  display: flex;
  justify-content: center;
  padding: 54px 0 0;
}

/* Gallery */

.lore-gallery-stage {
  position: relative;
}

.lore-gallery-hero {
  position: relative;
  min-height: 580px;
  padding: clamp(80px, 10vw, 140px) max(var(--lore-edge), calc((100vw - var(--lore-max)) / 2));
  display: flex;
  align-items: end;
  isolation: isolate;
}

.lore-gallery-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(2, 4, 3, 0.94), rgba(2, 4, 3, 0.46) 58%, rgba(2, 4, 3, 0.84)),
    linear-gradient(180deg, transparent 35%, #030403 100%),
    url("../images/lore-still.jpg") center / cover no-repeat;
  filter: saturate(0.72);
}

.lore-gallery-hero-copy {
  max-width: 760px;
  margin-left: var(--lore-title-offset);
  transform: translateY(var(--lore-title-drop));
}

.lore-gallery-shell {
  width: min(calc(100% - (var(--lore-edge) * 2)), var(--lore-max));
  margin: 0 auto;
  padding: 58px 0 100px;
}

.lore-gallery-controls {
  position: sticky;
  top: 108px;
  z-index: 25;
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--lore-line);
  border-radius: 7px;
  background: rgba(4, 6, 5, 0.92);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.42);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.lore-search {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(184, 139, 75, 0.24);
  border-radius: 4px;
  outline: none;
  background: rgba(0, 0, 0, 0.42);
  color: var(--lore-paper-bright);
}

.lore-search:focus {
  border-color: rgba(222, 186, 124, 0.72);
}

.lore-filters {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.lore-filter-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(184, 139, 75, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
  color: rgba(228, 215, 190, 0.66);
  white-space: nowrap;
}

.lore-filter-button.is-active,
.lore-filter-button:hover,
.lore-filter-button:focus-visible {
  border-color: rgba(222, 186, 124, 0.62);
  color: var(--lore-paper-bright);
  background: rgba(184, 139, 75, 0.1);
}

.lore-era-doors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 42px 0 74px;
}

.lore-era-door {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--lore-line);
  border-radius: 6px;
  isolation: isolate;
}

.lore-era-door::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--era-door) center / cover no-repeat;
  filter: saturate(0.7);
}

.lore-era-door::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent 30%, rgba(2, 3, 3, 0.96) 88%);
}

.lore-era-door-copy {
  position: absolute;
  inset: auto 0 0;
  padding: 24px;
}

.lore-era-door h2 {
  margin: 6px 0;
  font-size: clamp(1.7rem, 3vw, 2.7rem);
  font-weight: 400;
  text-transform: uppercase;
}

.lore-era-door p {
  margin: 0;
  color: var(--lore-muted);
}

.lore-era-routes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.lore-era-route {
  padding: 6px 8px;
  border: 1px solid rgba(184, 139, 75, 0.22);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  color: rgba(228, 215, 190, 0.72);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lore-era-door .lore-lock {
  position: absolute;
  top: 18px;
  right: 18px;
}

.lore-gallery-group {
  margin-top: 58px;
  scroll-margin-top: 210px;
}

.lore-gallery-group[hidden] {
  display: none;
}

.lore-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.lore-gallery-file {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid rgba(184, 139, 75, 0.22);
  border-radius: 5px;
  background: rgba(6, 7, 6, 0.86);
  color: inherit;
  text-decoration: none;
  isolation: isolate;
}

button.lore-gallery-file {
  width: 100%;
  padding: 0;
  font-family: inherit;
  text-align: left;
}

.lore-gallery-file::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--file-image) center / cover no-repeat;
  filter: saturate(0.55);
  transition: transform 520ms ease, filter 260ms ease;
}

.lore-gallery-file::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08) 20%, rgba(3, 4, 4, 0.96) 84%);
}

.lore-gallery-file:hover::before,
.lore-gallery-file:focus-visible::before {
  transform: scale(1.035);
  filter: saturate(0.75);
}

.lore-gallery-file.is-locked::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.48), rgba(3, 4, 4, 0.98));
}

.lore-gallery-file-copy {
  position: absolute;
  inset: auto 0 0;
  padding: clamp(26px, 3vw, 38px);
}

.lore-gallery-file h3 {
  margin: 6px 0;
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1.15;
  text-transform: uppercase;
}

.lore-gallery-file p {
  margin: 0;
  color: var(--lore-muted);
  line-height: 1.55;
}

.lore-access-label {
  color: var(--lore-gold);
}

.lore-gallery-file .lore-lock {
  position: absolute;
  z-index: 3;
  top: 16px;
  right: 16px;
  width: 64px;
  height: 64px;
}

.lore-gallery-empty {
  padding: 50px 20px;
  border: 1px solid var(--lore-line);
  color: var(--lore-muted);
  text-align: center;
}

.lore-file-dialog {
  width: min(calc(100% - 32px), 720px);
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid var(--lore-line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(184, 139, 75, 0.06), transparent 42%),
    #070907;
  color: var(--lore-paper-bright);
  box-shadow: 0 38px 100px rgba(0, 0, 0, 0.82);
}

.lore-file-dialog::backdrop {
  background: rgba(0, 0, 0, 0.82);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.lore-file-dialog form {
  margin-top: 28px;
}

.lore-main-folder-group {
  margin-top: 0;
}

.lore-main-doors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.lore-main-door {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  padding: clamp(30px, 4vw, 48px);
  border: 1px solid rgba(184, 139, 75, 0.25);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: inherit;
  text-decoration: none;
  isolation: isolate;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
}

.lore-main-door::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--door-image) center / cover no-repeat;
  filter: saturate(0.64) contrast(1.04);
  transition: transform 650ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 260ms ease;
}

.lore-main-door::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 78% 18%, rgba(222, 186, 124, 0.14), transparent 27%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.1) 18%, rgba(2, 3, 3, 0.96) 88%);
}

.lore-main-door:hover::before,
.lore-main-door:focus-visible::before {
  transform: scale(1.045);
  filter: saturate(0.86) contrast(1.08);
}

.lore-main-door h2 {
  margin: 8px 0 8px;
  color: var(--lore-paper-bright);
  font-size: clamp(1.7rem, 3vw, 2.75rem);
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
}

.lore-main-door p {
  max-width: 360px;
  margin: 0;
  color: var(--lore-muted);
  line-height: 1.55;
}

.lore-main-door.is-locked::after {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.45), rgba(2, 3, 3, 0.97) 82%),
    radial-gradient(circle at 50% 28%, rgba(0, 0, 0, 0.72), transparent 34%);
}

.lore-lock--door {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 70px;
  height: 70px;
}

.lore-section-stage {
  min-height: 100vh;
}

.lore-section-hero {
  position: relative;
  min-height: 520px;
  padding: clamp(92px, 12vw, 150px) max(var(--lore-edge), calc((100vw - var(--lore-max)) / 2)) clamp(54px, 7vw, 96px);
  display: flex;
  align-items: end;
  isolation: isolate;
}

.lore-section-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(2, 4, 3, 0.96), rgba(2, 4, 3, 0.54) 60%, rgba(2, 4, 3, 0.86)),
    linear-gradient(180deg, transparent 30%, #030403 100%),
    var(--section-hero) center / cover no-repeat;
  filter: saturate(0.72) contrast(1.04);
}

.lore-section-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 76% 26%, rgba(184, 139, 75, 0.16), transparent 25%),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(255, 255, 255, 0.018) 5px 6px);
  opacity: 0.8;
}

.lore-section-hero-copy {
  max-width: 760px;
  margin-left: var(--lore-title-offset);
  transform: translateY(var(--lore-section-title-drop));
}

.lore-back-link {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(184, 139, 75, 0.32);
  border-radius: 999px;
  margin: 0;
  background: rgba(2, 3, 3, 0.68);
  color: var(--lore-gold);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.lore-back-link::before {
  content: "←";
  margin-right: 9px;
}

.lore-section-file-card {
  position: relative;
  width: 100%;
  min-height: 150px;
  margin-bottom: 18px;
  padding: clamp(30px, 4vw, 44px);
  overflow: hidden;
  border: 1px solid rgba(184, 139, 75, 0.28);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  text-align: left;
  background: rgba(6, 8, 7, 0.88);
  color: inherit;
  isolation: isolate;
}

.lore-section-file-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--section-card-image) center / cover no-repeat;
  opacity: 0.2;
  filter: saturate(0.64);
}

.lore-section-file-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(3, 4, 4, 0.98), rgba(3, 4, 4, 0.72));
}

.lore-section-file-card strong {
  color: var(--lore-paper-bright);
  font-size: clamp(1.5rem, 2.4vw, 2.3rem);
  font-weight: 400;
  text-transform: uppercase;
}

.lore-section-file-card span:last-child {
  max-width: 820px;
  color: var(--lore-muted);
  line-height: 1.62;
}

.lore-section-lock-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  margin: 22px 0;
  padding: 22px;
  border: 1px solid rgba(184, 139, 75, 0.25);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(184, 139, 75, 0.08), rgba(5, 7, 6, 0.92));
}

.lore-section-lock-note h2,
.lore-section-lock-note p {
  margin: 0;
}

.lore-section-lock-note h2 {
  color: var(--lore-paper-bright);
  font-weight: 400;
  text-transform: uppercase;
}

.lore-section-lock-note p {
  margin-top: 8px;
  color: var(--lore-muted);
}

.lore-section-intro {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at center, rgba(184, 139, 75, 0.12), transparent 35%),
    rgba(0, 0, 0, 0.88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: opacity 240ms ease;
}

.lore-section-intro.is-active {
  opacity: 1;
  pointer-events: auto;
}

.lore-section-intro-card {
  position: relative;
  width: min(100%, 820px);
  min-height: min(72vh, 620px);
  overflow: hidden;
  padding: clamp(30px, 6vw, 62px);
  border: 1px solid rgba(224, 184, 116, 0.48);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow:
    0 0 40px rgba(184, 139, 75, 0.14),
    0 0 110px rgba(184, 139, 75, 0.1),
    0 42px 100px rgba(0, 0, 0, 0.86);
  isolation: isolate;
}

.lore-section-intro-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(2, 3, 3, 0.08), rgba(2, 3, 3, 0.95) 80%),
    var(--intro-image) center / cover no-repeat;
  filter: saturate(0.72) contrast(1.08);
}

.lore-section-intro-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(255, 255, 255, 0.026) 4px 5px),
    radial-gradient(circle at center, transparent 46%, rgba(0, 0, 0, 0.66));
  mix-blend-mode: screen;
  opacity: 0.36;
}

.lore-section-intro-card h2 {
  margin: 10px 0 12px;
  color: var(--lore-paper-bright);
  font-size: clamp(2.7rem, 7vw, 5.6rem);
  font-weight: 400;
  line-height: 0.95;
  text-transform: uppercase;
}

.lore-section-intro-card p {
  max-width: 620px;
  margin: 0 0 24px;
  color: rgba(238, 225, 197, 0.82);
  font-size: 1.05rem;
  line-height: 1.68;
}

.lore-section-intro.is-closing .lore-section-intro-card {
  animation: loreTvOff 560ms cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

.lore-section-intro.is-closing {
  opacity: 0;
  transition-delay: 420ms;
}

@keyframes loreTvOff {
  0% {
    opacity: 1;
    transform: scale(1);
    filter: brightness(1);
  }

  62% {
    opacity: 0.92;
    transform: scaleX(1.02) scaleY(0.055);
    filter: brightness(2.1);
  }

  100% {
    opacity: 0;
    transform: scaleX(0.04) scaleY(0.01);
    filter: brightness(2.8);
  }
}

.lore-file-dialog {
  width: min(calc(100% - 28px), 1180px);
  max-height: min(88vh, 900px);
  padding: 0;
  overflow: hidden;
}

.lore-file-dialog[open] {
  display: block;
}

.lore-dialog-close,
.lore-panel-close {
  position: absolute;
  z-index: 5;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(184, 139, 75, 0.36);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.64);
  color: var(--lore-paper-bright);
  font-size: 1.3rem;
}

.lore-dialog-close {
  top: 16px;
  right: 16px;
}

.lore-panel-close {
  top: 14px;
  right: 14px;
}

.lore-file-compare-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-height: min(88vh, 900px);
  overflow-y: auto;
}

.lore-file-compare-grid.has-compare {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lore-file-panel {
  position: relative;
  min-height: 720px;
  display: grid;
  grid-template-rows: minmax(260px, 42vh) auto;
  background: #070907;
}

.lore-file-panel + .lore-file-panel {
  border-left: 1px solid rgba(184, 139, 75, 0.24);
}

.lore-file-panel-image {
  position: relative;
  min-height: 260px;
  background:
    linear-gradient(180deg, transparent 28%, #070907 100%),
    var(--panel-image) center / cover no-repeat;
  filter: saturate(0.72);
}

.lore-file-panel-copy {
  padding: clamp(24px, 4vw, 44px);
}

.lore-file-panel .lore-title {
  font-size: clamp(2.1rem, 4vw, 4rem);
}

.lore-file-panel .lore-copy {
  max-width: none;
}

.lore-compare-button {
  min-height: 44px;
  margin-top: 22px;
  padding: 0 16px;
  border: 1px solid rgba(184, 139, 75, 0.34);
  border-radius: 999px;
  background: rgba(184, 139, 75, 0.08);
  color: var(--lore-paper);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lore-compare-button span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 50%;
  background: rgba(184, 139, 75, 0.22);
}

.lore-related-tray {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.lore-related-file {
  position: relative;
  min-height: 78px;
  padding: 12px;
  border: 1px solid rgba(184, 139, 75, 0.22);
  border-radius: 6px;
  display: grid;
  gap: 4px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--lore-paper);
  text-align: left;
}

.lore-related-file span {
  color: var(--lore-gold);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lore-related-file strong {
  font-weight: 400;
}

.lore-related-file.is-locked {
  opacity: 0.6;
}

.lore-related-lock {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 3px 5px #000);
}

.lore-file-locations {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(184, 139, 75, 0.18);
}

.lore-file-locations span,
.lore-file-locations b {
  min-height: 30px;
  padding: 7px 10px;
  border: 1px solid rgba(184, 139, 75, 0.18);
  border-radius: 999px;
  color: rgba(228, 215, 190, 0.72);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lore-file-locations span {
  border-color: transparent;
  color: var(--lore-gold);
}

@media (max-width: 1000px) {
  .lore-status-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .lore-status-item:nth-child(3) {
    border-right: 0;
  }

  .lore-status-item:nth-child(-n+3) {
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(184, 139, 75, 0.15);
  }

  .lore-character-shell {
    width: min(calc(100% - 92px), 1120px);
  }

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

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

  .lore-file-compare-grid.has-compare {
    grid-template-columns: 1fr;
  }

  .lore-file-panel + .lore-file-panel {
    border-top: 1px solid rgba(184, 139, 75, 0.24);
    border-left: 0;
  }
}

@media (max-width: 760px) {
  .lore-home-section,
  .lore-gallery-shell {
    width: min(calc(100% - (var(--lore-edge) * 2)), var(--lore-max));
    padding-block: 64px;
  }

  .lore-orientation {
    width: 100%;
    min-height: 700px;
    padding-inline: var(--lore-edge);
    align-items: end;
  }

  .lore-orientation::before {
    background:
      linear-gradient(180deg, rgba(3, 5, 4, 0.2), rgba(3, 5, 4, 0.94) 62%, #030403),
      url("../images/lore-still.jpg") 62% top / auto 620px no-repeat;
  }

  .lore-orientation .lore-title {
    font-size: clamp(3rem, 17vw, 5rem);
  }

  .lore-heading {
    align-items: start;
    flex-direction: column;
    margin-bottom: 24px;
  }

  .lore-title {
    font-size: clamp(2.1rem, 11vw, 3.5rem);
  }

  .lore-character-files {
    grid-template-columns: 1fr;
  }

  .lore-character-file {
    min-height: 420px;
  }

  .lore-status-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .lore-status-item,
  .lore-status-item:nth-child(3) {
    padding-bottom: 18px;
    border-right: 1px solid rgba(184, 139, 75, 0.15);
    border-bottom: 1px solid rgba(184, 139, 75, 0.15);
  }

  .lore-status-item:nth-child(even) {
    border-right: 0;
  }

  .lore-gallery-door {
    min-height: 500px;
    align-items: end;
    padding: 30px 22px;
  }

  .lore-character-stage::before,
  .lore-character-stage::after {
    inset: 82px 0 0;
  }

  .lore-character-shell {
    width: min(calc(100% - (var(--lore-edge) * 2)), 1120px);
    padding-block: 56px;
  }

  .lore-character-hero {
    min-height: 500px;
    align-items: end;
  }

  .lore-character-hero .lore-title {
    font-size: clamp(3.2rem, 18vw, 5.5rem);
  }

  .lore-facts {
    grid-template-columns: repeat(2, 1fr);
  }

  .lore-fact:nth-child(2) {
    border-right: 0;
  }

  .lore-fact:nth-child(-n+2) {
    border-bottom: 1px solid color-mix(in srgb, var(--character-accent) 20%, transparent);
  }

  .lore-chapter-section {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .lore-page-arrow {
    position: fixed;
    top: auto;
    bottom: 16px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--character-accent) 48%, transparent);
  }

  .lore-page-arrow--previous {
    left: 14px;
  }

  .lore-page-arrow--next {
    right: 14px;
  }

  .lore-page-arrow:hover,
  .lore-page-arrow:focus-visible {
    width: 52px;
  }

  .lore-gallery-hero {
    min-height: 520px;
    padding-inline: var(--lore-edge);
  }

  .lore-gallery-hero-copy {
    transform: translateY(clamp(18px, 6vw, 34px));
  }

  .lore-section-hero-copy {
    transform: translateY(clamp(58px, 14vw, 92px));
  }

  .lore-gallery-controls {
    top: 92px;
  }

  .lore-era-doors {
    grid-template-columns: 1fr;
  }

  .lore-era-door {
    min-height: 380px;
  }

  .lore-gallery-grid {
    grid-template-columns: 1fr;
  }

  .lore-main-doors {
    grid-template-columns: 1fr;
  }

  .lore-main-door {
    min-height: 320px;
  }

  .lore-section-hero {
    min-height: 480px;
    padding-inline: var(--lore-edge);
  }

  .lore-back-link {
    top: 12px;
    left: 12px;
  }

  .lore-section-file-card {
    padding: 22px;
  }

  .lore-section-lock-note {
    grid-template-columns: 1fr;
  }

  .lore-section-intro {
    padding: 14px;
  }

  .lore-section-intro-card {
    min-height: min(74vh, 560px);
  }

  .lore-section-intro-card h2 {
    font-size: clamp(2.35rem, 14vw, 4.2rem);
  }

  .lore-file-panel {
    min-height: 0;
    grid-template-rows: 230px auto;
  }

  .lore-related-tray {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .lore-status-grid {
    grid-template-columns: 1fr;
  }

  .lore-status-item,
  .lore-status-item:nth-child(even),
  .lore-status-item:nth-child(3) {
    border-right: 0;
  }

  .lore-file-stamp::before,
  .lore-file-stamp::after {
    width: 30px;
  }

  .lore-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .lore-actions .lore-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lore-status-bar::after {
    animation: none;
  }
}
