:root {
  --black: #030101;
  --night: #080303;
  --panel: rgba(8, 3, 3, 0.94);
  --bone: #f3dfb9;
  --ash: #c9b796;
  --bronze: #a66a2a;
  --bronze-bright: #e8af5e;
  --bronze-pale: #f7d593;
  --bronze-dark: #4b270d;
  --blood: #7d1018;
  --font-title: "Cinzel", Georgia, serif;
  --font-pixel: "Press Start 2P", "Courier New", monospace;
  --font-reader: "VT323", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  background: var(--black);
}

body {
  min-width: 320px;
  color: var(--bone);
  font-family: var(--font-reader);
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 50% 7%, rgba(166, 106, 42, 0.2), transparent 32rem),
    linear-gradient(rgba(255, 255, 255, 0.018) 50%, rgba(0, 0, 0, 0.018) 50%),
    var(--black);
  background-size: auto, 100% 4px, auto;
}

.site-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(rgba(3, 1, 1, 0.34), rgba(3, 1, 1, 0.54)),
    url("chamber_background.png") center / cover no-repeat;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 420ms ease;
  pointer-events: none;
}

.site-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at center, transparent 0 38%, rgba(0, 0, 0, 0.62) 100%),
    linear-gradient(rgba(255, 255, 255, 0.018) 50%, rgba(0, 0, 0, 0.018) 50%);
  background-size: auto, 100% 4px;
  opacity: 0;
  transition: opacity 420ms ease;
  pointer-events: none;
}

body.is-menu-open .site-shell::before {
  opacity: 0.82;
}

body.is-menu-open .site-shell::after {
  opacity: 1;
}

button,
a {
  font: inherit;
}

a {
  color: var(--bronze-bright);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--bronze-pale);
  text-shadow: 0 0 16px rgba(232, 175, 94, 0.62);
}

[hidden] {
  display: none !important;
}

.site-shell {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

.gate-stage {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-items: center;
  gap: clamp(1.1rem, 3vh, 2rem);
  width: 100%;
  height: 100dvh;
  padding: clamp(0.8rem, 2vw, 2rem);
  opacity: 1;
  z-index: 2;
  transition:
    opacity 360ms ease,
    transform 360ms ease;
}

.gate-stage.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-1.25rem);
}

.gate {
  position: relative;
  width: min(100%, 74rem);
  aspect-ratio: 1920 / 819;
  height: auto;
  max-height: min(62dvh, 31rem);
  overflow: hidden;
  background: #020101;
  box-shadow:
    0 0 0 1px rgba(247, 213, 147, 0.34),
    0 0 0 5px rgba(75, 39, 13, 0.7),
    0 20px 70px rgba(0, 0, 0, 0.86),
    0 0 52px rgba(166, 106, 42, 0.24);
  image-rendering: pixelated;
}

.gate::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), transparent 45%, rgba(0, 0, 0, 0.28)),
    radial-gradient(circle at 50% 48%, transparent 0 38%, rgba(0, 0, 0, 0.24) 80%);
}

.gate__image {
  position: absolute;
  inset: 0;
  background-image: url("bronze_gates_pixel.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  image-rendering: pixelated;
}

.gate__title {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 52%;
  width: min(82%, 48rem);
  margin: 0;
  transform: translate(-50%, -50%);
  color: var(--bronze-pale);
  font-family: var(--font-title);
  font-size: clamp(2.1rem, 5.4vw, 5.2rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 0.9;
  text-align: center;
  text-transform: uppercase;
  text-shadow:
    0 2px 0 #2f1607,
    0 4px 0 #050202,
    0 0 22px rgba(232, 175, 94, 0.5),
    0 0 42px rgba(0, 0, 0, 0.95);
}

.gate__title::before,
.gate__title::after {
  content: "";
  display: inline-block;
  width: clamp(1.5rem, 6vw, 5rem);
  height: 1px;
  margin: 0 clamp(0.45rem, 1.4vw, 1rem) 0.22em;
  background: linear-gradient(90deg, transparent, var(--bronze-bright), transparent);
  box-shadow: 0 0 10px rgba(232, 175, 94, 0.48);
}

.pixel-button {
  position: relative;
  min-width: min(100%, 14rem);
  min-height: 3.35rem;
  padding: 0.95rem 1.35rem;
  border: 1px solid rgba(247, 213, 147, 0.42);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(40, 18, 7, 0.92), rgba(9, 3, 2, 0.98));
  color: var(--bronze-pale);
  cursor: pointer;
  font-family: var(--font-title);
  font-size: clamp(0.88rem, 2vw, 1.06rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  box-shadow:
    0 0 0 3px rgba(75, 39, 13, 0.86),
    0 0 0 6px rgba(3, 1, 1, 0.94),
    inset 0 1px 0 rgba(247, 213, 147, 0.2),
    inset 0 -8px 0 rgba(0, 0, 0, 0.34),
    0 12px 34px rgba(0, 0, 0, 0.7);
  transition:
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.pixel-button:hover,
.pixel-button:focus-visible {
  color: #fff0c9;
  outline: none;
  transform: translateY(-2px);
  box-shadow:
    0 0 0 3px rgba(232, 175, 94, 0.9),
    0 0 0 6px rgba(3, 1, 1, 0.94),
    inset 0 1px 0 rgba(247, 213, 147, 0.28),
    inset 0 -8px 0 rgba(0, 0, 0, 0.28),
    0 0 24px rgba(232, 175, 94, 0.42),
    0 16px 38px rgba(0, 0, 0, 0.78);
}

.pixel-button:active {
  transform: translateY(1px);
}

.pixel-button--small {
  min-width: 7.4rem;
  min-height: 2.75rem;
  padding: 0.72rem 0.9rem;
  font-size: 0.82rem;
}

.enter-button {
  flex: 0 0 auto;
}

.panel {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(calc(100vw - 2rem), 58rem);
  max-width: 58rem;
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: clamp(1.1rem, 4vw, 2.35rem);
  border: 1px solid rgba(247, 213, 147, 0.28);
  background:
    linear-gradient(180deg, rgba(36, 15, 7, 0.96), rgba(5, 2, 2, 0.96)),
    var(--panel);
  box-shadow:
    0 0 0 4px rgba(75, 39, 13, 0.74),
    0 0 0 8px rgba(3, 1, 1, 0.95),
    inset 0 0 0 1px rgba(247, 213, 147, 0.08),
    0 22px 70px rgba(0, 0, 0, 0.78);
  opacity: 1;
  z-index: 2;
  transform: translate(-50%, -50%);
  scrollbar-color: var(--bronze-dark) var(--black);
  transition:
    opacity 360ms ease,
    transform 360ms ease;
}

.panel.is-entering {
  opacity: 0;
  transform: translate(-50%, calc(-50% + 4rem));
}

.sigil {
  margin: 0 0 0.75rem;
  color: var(--bronze-pale);
  font-family: var(--font-title);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  line-height: 1;
  text-align: center;
  transform: rotate(180deg);
  text-shadow:
    0 2px 0 #2f1607,
    0 0 16px rgba(232, 175, 94, 0.45);
}

h2 {
  margin: 0;
  color: var(--bronze-pale);
  font-family: var(--font-title);
  font-size: clamp(1.55rem, 4.2vw, 2.85rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  text-shadow:
    0 2px 0 #2f1607,
    0 0 18px rgba(232, 175, 94, 0.32);
}

.chamber-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(0.8rem, 2vw, 1.15rem);
  margin-top: clamp(1.45rem, 4vw, 2.25rem);
}

.chamber-grid .pixel-button {
  min-width: 0;
  width: 100%;
  font-size: clamp(0.72rem, 1.2vw, 0.88rem);
  letter-spacing: 0.1em;
}

.leave-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 14rem);
  margin: clamp(1.1rem, 3vw, 1.6rem) auto 0;
}

.content-panel__header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
}

.content-panel__header h2 {
  grid-column: 2;
}

.content-panel__body {
  margin-top: clamp(1.2rem, 4vw, 2rem);
  color: var(--ash);
  font-size: clamp(1.25rem, 3.3vw, 1.7rem);
  line-height: 1.35;
}

.content-panel__body p {
  margin: 0 0 1rem;
}

.content-panel__body p:last-child,
.content-panel__body ul:last-child {
  margin-bottom: 0;
}

.content-panel__body ul {
  display: grid;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.content-panel__body li {
  padding-left: 1.35rem;
  text-indent: -1.35rem;
}

.content-panel__body li::before {
  content: ">";
  margin-right: 0.45rem;
  color: var(--bronze-bright);
  font-family: var(--font-pixel);
  font-size: 0.7rem;
}

.empty-state {
  color: rgba(243, 223, 185, 0.72);
  font-family: var(--font-title);
  font-size: clamp(1.1rem, 2.6vw, 1.55rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-align: center;
  text-transform: uppercase;
}

.placeholder-line {
  margin-top: 1.1rem;
  color: rgba(201, 183, 150, 0.62);
  text-align: center;
}

.blog-post {
  display: grid;
  gap: 0.9rem;
}

.blog-post__meta {
  color: var(--bronze-bright);
  font-family: var(--font-title);
  font-size: clamp(0.82rem, 1.8vw, 1.04rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.blog-post__heading {
  margin: 0;
  color: var(--bronze-pale);
  font-family: var(--font-title);
  font-size: clamp(1.55rem, 4vw, 2.45rem);
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
}

.news-item {
  display: grid;
  gap: 0.35rem;
  border-left: 3px solid var(--bronze);
  padding: 0.9rem 0 0.9rem 1rem;
  background: rgba(125, 16, 24, 0.07);
}

.news-item + .news-item {
  margin-top: 0.9rem;
}

.news-item__date {
  color: var(--bronze-bright);
  font-family: var(--font-title);
  font-size: clamp(0.84rem, 1.8vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

.news-item__title {
  color: var(--bone);
}

.news-item__age {
  color: rgba(201, 183, 150, 0.68);
  font-size: 1.12rem;
}

@media (max-width: 64rem) {
  .chamber-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chamber-grid .pixel-button:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 42rem) {
  .panel {
    width: min(calc(100vw - 1.25rem), 82rem);
  }

  .gate {
    width: min(100%, 42rem);
    max-height: 45dvh;
  }

  .gate__title {
    top: 54%;
    width: 92%;
    font-size: clamp(1.75rem, 10vw, 3.5rem);
    letter-spacing: 0.04em;
  }

  .gate__title::before,
  .gate__title::after {
    display: none;
  }

  .pixel-button {
    width: 100%;
  }

  .chamber-grid {
    grid-template-columns: 1fr;
  }

  .chamber-grid .pixel-button:last-child {
    grid-column: auto;
  }

  .content-panel__header {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .content-panel__header h2 {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
}
