:root {
  --ink: #25150f;
  --paper: #f3dfb6;
  --paper-deep: #d4ad72;
  --gold: #f5c15e;
  --ember: #db6b29;
  --wine: #6a2325;
  --moss: #314c3d;
  --night: #080a0b;
  --shadow: rgba(5, 4, 3, 0.68);
  --panel: rgba(247, 226, 185, 0.9);
  --panel-border: rgba(92, 50, 25, 0.45);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--night);
  color: #f8ecd4;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

body:not(.story-open) {
  overflow: hidden;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 28px;
  overflow: hidden;
  background-color: var(--night);
  background-image:
    linear-gradient(180deg, rgba(4, 7, 12, 0.2), rgba(4, 7, 12, 0.62)),
    radial-gradient(circle at 50% 82%, rgba(255, 135, 45, 0.36), transparent 32%),
    url("assets/campfire-intro.webp?v=2");
  background-position:
    center,
    center,
    center;
  background-repeat: no-repeat;
  background-size:
    auto,
    auto,
    cover;
  transition:
    opacity 900ms ease,
    transform 900ms ease,
    visibility 900ms ease;
}

.intro-screen::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at center, transparent 0 42%, rgba(3, 4, 5, 0.64) 78%),
    linear-gradient(90deg, rgba(6, 5, 4, 0.55), transparent 28% 72%, rgba(6, 5, 4, 0.55));
}

.story-open .intro-screen {
  visibility: hidden;
  opacity: 0;
  transform: translateY(-4vh) scale(1.02);
  pointer-events: none;
}

.intro-content {
  position: relative;
  width: min(1100px, 100%);
  text-align: center;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85);
}

.kicker {
  margin: 0 0 16px;
  color: var(--gold);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: clamp(0.78rem, 1.5vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.intro-content h1 {
  margin: 0;
  color: #fff4d2;
  font-size: clamp(2.6rem, 7vw, 6.6rem);
  line-height: 0.93;
}

.intro-content h1 > span {
  display: block;
  font-size: clamp(1.1rem, 2.7vw, 2.2rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro-content h1 strong {
  display: block;
  margin-top: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.quote-mark {
  display: inline-block;
  font-size: 0.48em;
  transform: translateY(-0.3em);
}

.enter-button,
.ghost-button,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid rgba(255, 218, 143, 0.58);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(110, 45, 22, 0.96), rgba(65, 24, 16, 0.96));
  color: #fff4d2;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.34);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.enter-button {
  margin-top: 34px;
  padding: 13px 22px;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.enter-button:hover,
.ghost-button:hover,
.ghost-link:hover {
  border-color: rgba(255, 232, 177, 0.92);
  transform: translateY(-2px);
}

.enter-button:focus-visible,
.ghost-button:focus-visible,
.ghost-link:focus-visible {
  outline: 3px solid rgba(245, 193, 94, 0.95);
  outline-offset: 4px;
}

.ember-field {
  position: absolute;
  inset: auto 0 10% 0;
  height: 52vh;
  pointer-events: none;
}

.ember-field span {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 163, 55, 0.95);
  box-shadow: 0 0 18px rgba(255, 120, 34, 0.92);
  animation: ember-rise 6s linear infinite;
}

.ember-field span:nth-child(1) {
  margin-left: -40px;
  animation-delay: -1s;
}

.ember-field span:nth-child(2) {
  margin-left: 22px;
  animation-delay: -2.1s;
  animation-duration: 7s;
}

.ember-field span:nth-child(3) {
  margin-left: -82px;
  animation-delay: -3.5s;
  animation-duration: 5.3s;
}

.ember-field span:nth-child(4) {
  margin-left: 74px;
  animation-delay: -4.4s;
}

.ember-field span:nth-child(5) {
  margin-left: 7px;
  animation-delay: -5.1s;
  animation-duration: 6.7s;
}

.ember-field span:nth-child(6) {
  margin-left: -118px;
  animation-delay: -1.7s;
  animation-duration: 8s;
}

.ember-field span:nth-child(7) {
  margin-left: 126px;
  animation-delay: -3.2s;
  animation-duration: 7.8s;
}

.ember-field span:nth-child(8) {
  margin-left: -8px;
  animation-delay: -0.6s;
  animation-duration: 5.9s;
}

@keyframes ember-rise {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.75);
  }

  14% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate3d(34px, -46vh, 0) scale(0.2);
  }
}

.site-shell {
  position: relative;
  z-index: 0;
  min-height: 100svh;
  padding: 24px;
  background: var(--night);
}

.site-shell::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(180deg, rgba(4, 5, 4, 0.36), rgba(4, 5, 4, 0.74)),
    url("assets/adventure-bg.webp?v=2");
  background-position:
    center top,
    center top;
  background-repeat: no-repeat;
  background-size:
    cover,
    cover;
  pointer-events: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1120px, 100%);
  min-height: 64px;
  margin: 0 auto 30px;
  padding: 12px 0;
}

.brand {
  color: #fff0c8;
  font-size: clamp(1.1rem, 3vw, 1.8rem);
  font-weight: 700;
  text-decoration: none;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.82);
}

.ghost-button,
.ghost-link {
  padding: 10px 14px;
  background: rgba(33, 22, 14, 0.74);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.chronicle-panel {
  width: min(900px, 100%);
  margin: 0 auto 80px;
  padding: clamp(22px, 5vw, 56px);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 239, 204, 0.9), rgba(232, 197, 139, 0.9)),
    radial-gradient(circle at 14% 8%, rgba(255, 255, 255, 0.48), transparent 28%);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.56),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  color: var(--ink);
}

.chronicle-heading {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(88, 51, 24, 0.3);
  text-align: center;
}

.chronicle-heading .kicker {
  color: var(--wine);
  text-shadow: none;
}

.chronicle-heading h2 {
  margin: 0;
  color: #2e1a10;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1;
}

.session-date {
  margin: 14px 0 0;
  color: #684629;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.session-entry {
  font-size: clamp(1.03rem, 2.1vw, 1.2rem);
  line-height: 1.75;
}

.session-entry p {
  margin: 0 0 1.15em;
}

.session-entry p:first-child,
.session-entry p:last-child {
  color: #5b2f1c;
}

.session-entry em {
  font-style: italic;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  width: min(900px, 100%);
  margin: -42px auto 38px;
  padding: 18px 0 0;
  border-top: 1px solid rgba(255, 226, 166, 0.2);
}

.site-footer a {
  color: #fff0c8;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
  text-transform: uppercase;
}

.site-footer a:hover,
.legal-copy a:hover {
  text-decoration: underline;
}

.legal-page .chronicle-panel {
  margin-bottom: 62px;
}

.legal-panel {
  max-width: 820px;
}

.legal-panel .chronicle-heading h1 {
  margin: 0;
  color: #2e1a10;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
}

.legal-copy {
  font-size: clamp(1rem, 2vw, 1.12rem);
  line-height: 1.7;
}

.legal-copy h2 {
  margin: 1.55em 0 0.35em;
  color: #4b2418;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  line-height: 1.2;
}

.legal-copy p {
  margin: 0 0 1em;
}

.legal-copy a {
  color: #5c211c;
  font-weight: 700;
}

.legal-note {
  margin-top: 1.8em !important;
  padding: 14px 16px;
  border-left: 4px solid var(--wine);
  background: rgba(255, 244, 214, 0.52);
}

@media (max-width: 700px) {
  .intro-screen,
  .site-shell {
    padding: 18px;
  }

  .intro-content h1 {
    line-height: 1;
  }

  .intro-content h1 strong {
    white-space: normal;
  }

  .site-header {
    position: relative;
    align-items: flex-start;
    min-height: 0;
  }

  .ghost-button,
  .ghost-link {
    padding-inline: 10px;
    font-size: 0.74rem;
  }

  .chronicle-panel {
    margin-bottom: 36px;
  }
}

@media (max-width: 460px) {
  .site-header {
    flex-direction: column;
  }

  .ghost-button,
  .ghost-link {
    width: 100%;
  }

  .chronicle-panel {
    padding: 20px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
