@font-face {
  font-family: "Patrick Hand";
  src: url("./assets/patrick-hand.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #eee9df;
  --muted-ink: #bdb7ad;
  --red-ink: #9b312b;
  --night: #080808;
  --hand: "Patrick Hand", "Segoe Print", sans-serif;
  --fade: 1000ms;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--night);
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--night);
  color: var(--ink);
  font-family: var(--hand);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  text-shadow: 0 0 0.35px rgb(238 233 223 / 32%);
}

body.intro-playing {
  overflow: hidden;
}

.site-atmosphere,
.site-atmosphere::after {
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
}

.site-atmosphere {
  background-image: url("./assets/cursed-river-atmosphere.jpeg");
  background-position: center;
  background-size: cover;
  filter: grayscale(0.35) brightness(0.34);
  opacity: 0.42;
}

.site-atmosphere::after {
  content: "";
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 28%, rgb(0 0 0 / 32%), rgb(0 0 0 / 78%) 78%),
    linear-gradient(180deg, rgb(5 5 5 / 65%), rgb(5 5 5 / 90%));
}

.site-shell {
  position: relative;
  z-index: 1;
  width: min(100% - 48px, 1050px);
  margin-inline: auto;
  padding: 58px 0 42px;
  opacity: 1;
  transition: opacity var(--fade) ease;
}

.has-js .site-shell {
  opacity: 0;
  pointer-events: none;
}

.has-js .site-shell.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.intro-screen {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #030303;
  opacity: 1;
  visibility: visible;
  transition: opacity var(--fade) ease;
}

.intro-screen.is-fading {
  opacity: 0;
}

.intro-screen.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.intro-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.intro-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(0 0 0 / 8%), transparent 44%, rgb(0 0 0 / 28%));
  pointer-events: none;
}

.site-header {
  padding: 0 0 56px;
  text-align: center;
}

.brand,
.tagline,
.case-file p,
.game-title,
.scroll-note p,
.about-section h2,
.story-hook,
.story-copy p,
.privacy-note,
.site-footer p {
  margin: 0;
  font-weight: 400;
}

.brand {
  color: var(--ink);
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  line-height: 1.65;
  letter-spacing: 0.035em;
  text-shadow: 0 1px 0 rgb(255 255 255 / 18%);
}

.tagline {
  margin-top: 4px;
  color: var(--muted-ink);
  font-size: clamp(0.73rem, 1.35vw, 0.92rem);
  line-height: 1.9;
  letter-spacing: 0.03em;
}

.header-mark {
  display: block;
  width: 44px;
  height: 1px;
  margin: 24px auto 0;
  background: var(--red-ink);
  opacity: 0.82;
  transform: rotate(-2deg);
}

.case-introduction {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(270px, 0.92fr);
  align-items: center;
  gap: clamp(34px, 6vw, 76px);
  min-height: 350px;
}

.art-frame {
  position: relative;
  width: 100%;
  max-width: 460px;
  justify-self: center;
  padding: 7px;
  border: 1px solid rgb(234 228 216 / 40%);
  background: rgb(4 4 4 / 46%);
  transform: rotate(-0.45deg);
}

.case-art {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center 54%;
  filter: grayscale(0.1) brightness(0.72) contrast(1.04);
}

.frame-mark {
  position: absolute;
  width: 30px;
  height: 1px;
  background: var(--ink);
  opacity: 0.45;
}

.frame-mark-top {
  top: -4px;
  right: 18px;
  transform: rotate(-3deg);
}

.frame-mark-bottom {
  bottom: -4px;
  left: 26px;
  transform: rotate(2deg);
}

.case-column {
  width: min(100%, 390px);
  justify-self: center;
}

.case-file {
  position: relative;
  padding: clamp(25px, 3.7vw, 38px) clamp(23px, 3.6vw, 36px) 29px;
  border: 1px solid rgb(234 228 216 / 55%);
  border-radius: 2px 5px 3px 1px;
  background: rgb(6 6 6 / 66%);
  box-shadow: 4px 5px 0 rgb(0 0 0 / 24%);
  transform: rotate(0.2deg);
}

.case-scratch {
  position: absolute;
  top: -3px;
  left: 26px;
  width: 36px;
  height: 1px;
  background: var(--red-ink);
  transform: rotate(-2deg);
}

.case-number {
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.8;
  letter-spacing: 0.035em;
}

.case-rule {
  display: block;
  width: 100%;
  height: 1px;
  margin: 17px 0 20px;
  background: rgb(238 233 223 / 26%);
  transform: rotate(-0.2deg);
}

.episode-number {
  color: var(--muted-ink);
  font-size: 0.79rem;
  line-height: 1.8;
}

.game-title {
  margin-top: 9px !important;
  color: var(--ink);
  font-size: clamp(1.17rem, 2vw, 1.42rem);
  line-height: 1.8;
  letter-spacing: 0.02em;
}

.game-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 20px !important;
  color: var(--muted-ink);
  font-size: 0.78rem;
  line-height: 1.8;
}

.status-mark {
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border: 1px solid var(--red-ink);
  border-radius: 50%;
}

.scroll-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 10px 0 3px;
}

.scroll-note p {
  color: var(--muted-ink);
  font-size: 0.76rem;
  line-height: 1.8;
  letter-spacing: 0.025em;
}

.down-arrow {
  width: 38px;
  height: 30px;
  overflow: visible;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
}

.about-section {
  position: relative;
  max-width: 760px;
  margin: 88px auto 0;
  padding: 42px 26px 0;
  text-align: center;
}

.about-rule {
  position: absolute;
  top: 0;
  left: 50%;
  width: 100%;
  max-width: 670px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(238 233 223 / 32%) 17%, rgb(238 233 223 / 32%) 82%, transparent);
  transform: translateX(-50%) rotate(-0.12deg);
}

.about-section h2 {
  color: var(--ink);
  font-size: 1.06rem;
  line-height: 1.9;
  letter-spacing: 0.04em;
}

.story-hook {
  margin-top: 18px;
  color: var(--ink);
  font-size: 0.99rem;
  line-height: 2;
}

.story-copy {
  max-width: 650px;
  margin: 22px auto 0;
  color: var(--muted-ink);
  font-size: 0.95rem;
  line-height: 2.1;
}

.story-copy p + p {
  margin-top: 13px;
}

.fiction-note {
  color: #c9c2b7;
}

.privacy-note {
  margin-top: 32px;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 2.2;
}

.site-footer {
  margin-top: 74px;
  padding: 24px 12px 0;
  text-align: center;
}

.footer-rule {
  display: block;
  width: 34px;
  height: 1px;
  margin: 0 auto 19px;
  background: var(--red-ink);
  opacity: 0.72;
  transform: rotate(1deg);
}

.footer-brand {
  color: var(--ink);
  font-size: 1.03rem;
  line-height: 1.9;
}

.copyright {
  margin-top: 10px !important;
  color: var(--muted-ink);
  font-size: 0.78rem;
  line-height: 2.2;
}

.closing-line {
  margin-top: 20px !important;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 2;
}

.email-line {
  margin-top: 19px !important;
  color: var(--muted-ink);
  font-size: 0.84rem;
  line-height: 2;
}

.email-line a {
  color: var(--ink);
  text-decoration-color: rgb(155 49 43 / 75%);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.email-line a:focus-visible {
  outline: 1px solid var(--red-ink);
  outline-offset: 5px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.case-introduction { display: block; }

.case-records {
  display: grid;
  gap: clamp(38px, 5vw, 58px);
}

.case-record-row {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(270px, 0.92fr);
  align-items: center;
  gap: clamp(34px, 6vw, 76px);
  min-height: 350px;
}

.case-open-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  min-height: 44px;
  margin-top: 17px;
  padding: 8px 13px;
  border: 1px solid rgb(238 233 223 / 42%);
  border-radius: 2px;
  background: rgb(5 5 5 / 68%);
  color: var(--ink);
  font: 400 0.83rem/1.4 var(--hand);
  letter-spacing: 0.055em;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.case-open-button span { color: var(--red-ink); font-size: 1.15rem; }
.case-open-button:hover,
.case-open-button:focus-visible { border-color: var(--red-ink); background: rgb(75 17 16 / 45%); outline: none; }

.locked-case {
  position: relative;
  margin-top: 0;
  padding: 20px 23px 21px;
  border: 1px solid rgb(234 228 216 / 24%);
  border-radius: 2px 5px 3px 1px;
  background: rgb(6 6 6 / 72%);
  box-shadow: 3px 4px 0 rgb(0 0 0 / 22%);
  opacity: 0.82;
}

.locked-case .case-number,
.locked-case .game-status { color: var(--muted-ink); }

.locked-case-title {
  margin: 0;
  color: #c9c2b7;
  font-size: 0.94rem;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0.035em;
}

.locked-case .game-status { margin-top: 6px !important; }
.locked-case .case-open-button { border-color: rgb(155 49 43 / 42%); color: #c8bfb3; }

.case-archive {
  position: fixed;
  z-index: 20;
  inset: 0;
  overflow: auto;
  padding: 0 0 30px;
  background: #080808;
  color: var(--ink);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 260ms ease, transform 260ms ease, visibility 260ms;
  isolation: isolate;
}

.case-archive::before,
.case-archive::after {
  position: fixed;
  z-index: 0;
  inset: 0;
  content: "";
  pointer-events: none;
}

.case-archive::before {
  background: url("./assets/case-file-001-background.jpeg") center / cover no-repeat;
  opacity: 0.5;
}

.case-archive::after {
  background: radial-gradient(ellipse at 50% 15%, rgb(0 0 0 / 36%), rgb(0 0 0 / 82%) 80%), linear-gradient(180deg, rgb(5 5 5 / 60%), rgb(5 5 5 / 88%));
}

.case-archive.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.archive-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 56px));
  margin: 0 auto;
  padding-top: 22px;
}

.archive-header,
.archive-topline,
.archive-section-heading,
.archive-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.archive-header { padding-bottom: 20px; border-bottom: 1px solid rgb(238 233 223 / 22%); }
.archive-brand,.archive-topline,.archive-section-label,.archive-kicker,.archive-footer,.archive-stamp { color: var(--muted-ink); font-size: 0.76rem; letter-spacing: 0.09em; line-height: 1.8; }
.archive-brand span { color: var(--red-ink); padding: 0 5px; }

.archive-close,.access-close {
  padding: 8px 11px;
  border: 1px solid rgb(238 233 223 / 36%);
  background: rgb(5 5 5 / 74%);
  color: var(--ink);
  font: 400 0.78rem/1.5 var(--hand);
  letter-spacing: 0.05em;
  cursor: pointer;
}

.archive-close:hover,.archive-close:focus-visible,.access-close:hover,.access-close:focus-visible { border-color: var(--red-ink); outline: none; }
.archive-close span { color: var(--red-ink); font-size: 1.1rem; padding-left: 6px; }
.archive-topline { padding: 16px 0 0; border-bottom: 1px solid rgb(238 233 223 / 13%); }

.archive-dossier {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: clamp(28px, 6vw, 76px);
  padding: clamp(34px, 5vw, 58px) 0 38px;
}

.archive-kicker { color: #c0a8a2; }
.archive-dossier-main h2 { margin: 8px 0 20px; color: var(--ink); font-size: clamp(1.3rem, 3vw, 2rem); font-weight: 400; line-height: 1.5; letter-spacing: 0.04em; }
.archive-dossier-main h2 span { color: #b5ada2; }
.archive-dossier-main > p:not(.archive-kicker) { max-width: 680px; color: #d1cbc1; font-size: 0.97rem; line-height: 1.95; }
.archive-dossier-main .archive-quote { color: var(--ink); font-size: 1.02rem; }
.archive-dossier-main .archive-fiction { margin-top: 22px; color: #c2bcb1; font-size: 0.84rem; }

.archive-case-notes {
  align-self: start;
  padding: 17px 19px 19px;
  border: 1px solid rgb(234 228 216 / 36%);
  background: rgb(4 4 4 / 58%);
  box-shadow: 3px 4px 0 rgb(0 0 0 / 22%);
}

.archive-case-notes .archive-section-label { margin: 0 0 12px; color: #c9c2b7; }
.archive-case-notes dl { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px 12px; margin: 0; font-size: 0.84rem; line-height: 1.7; }
.archive-case-notes dt { color: #c4bdb3; }
.archive-case-notes dd { margin: 0; color: var(--muted-ink); }

.archive-evidence { padding: 25px 0 30px; border-top: 1px solid rgb(238 233 223 / 21%); }
.archive-section-heading { align-items: flex-end; margin-bottom: 18px; }
.archive-section-heading h3,.suspect-board-heading h4 { margin: 3px 0 0; color: var(--ink); font-size: 1.04rem; font-weight: 400; letter-spacing: 0.06em; }
.archive-section-label { margin: 0; }
.archive-stamp { padding: 4px 9px; border: 1px solid rgb(155 49 43 / 62%); color: #c4877e; transform: rotate(-2deg); }

.evidence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.evidence-card { min-height: 95px; padding: 14px 17px; border: 1px solid rgb(234 228 216 / 25%); background: rgb(4 4 4 / 57%); }
.evidence-card span { color: #c4877e; font-size: 0.72rem; letter-spacing: 0.08em; }
.evidence-card p { margin: 9px 0 0; color: #d0c9bf; font-size: 0.9rem; line-height: 1.7; }

.suspect-board { margin-top: 30px; padding-top: 21px; border-top: 1px solid rgb(238 233 223 / 16%); }
.suspect-board-heading { margin-bottom: 15px; }
.suspect-board-heading h4 { font-size: 0.98rem; }
.suspect-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 180px)); gap: 14px; }
.suspect-card { margin: 0; padding: 7px; border: 1px solid rgb(234 228 216 / 30%); background: rgb(4 4 4 / 62%); }
.suspect-card img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 25%; filter: grayscale(0.8) brightness(0.75); }
.suspect-card figcaption { display: grid; gap: 4px; padding: 8px 2px 1px; color: var(--muted-ink); font-size: 0.67rem; letter-spacing: 0.045em; }
.suspect-card figcaption strong { color: #c4877e; font-size: 0.6rem; font-weight: 400; }
.archive-footer { padding-top: 17px; border-top: 1px solid rgb(238 233 223 / 19%); font-size: 0.68rem; }

body.archive-open,body.access-open { overflow: hidden; }

.access-modal {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgb(0 0 0 / 82%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms;
}

.access-modal.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.access-dialog { width: min(100%, 440px); padding: 30px; border: 1px solid rgb(155 49 43 / 70%); background: #090909; box-shadow: 0 0 50px rgb(80 12 12 / 24%); }
.access-dialog h2 { margin: 8px 0 12px; color: #bd6159; font-size: 1.45rem; font-weight: 400; letter-spacing: 0.08em; }
.access-dialog > p:not(.archive-section-label) { color: #c6beb3; font-size: 0.92rem; line-height: 1.8; }
.access-close { margin-top: 9px; }

@media (max-width: 720px) {
  .case-records { gap: 34px; }
  .case-record-row { grid-template-columns: minmax(0, 1fr); gap: 22px; min-height: 0; }
  .case-column { width: min(100%, 430px); }
  .case-file { padding: 25px 27px 25px; }
  .scroll-note { padding-top: 14px; }
  .archive-shell { width: min(100% - 38px, 540px); }
  .archive-header { align-items: flex-start; }
  .archive-brand { max-width: 180px; }
  .archive-topline { align-items: flex-start; font-size: 0.67rem; }
  .archive-dossier { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 35px; }
  .archive-case-notes dl { grid-template-columns: 95px minmax(0, 1fr); }
  .evidence-grid { grid-template-columns: minmax(0, 1fr); }
  .evidence-card { min-height: 0; }
  .archive-footer { align-items: flex-start; flex-direction: column; gap: 5px; }
}

@media (max-width: 440px) {
  .archive-shell { width: calc(100% - 30px); }
  .archive-close { white-space: nowrap; font-size: 0.69rem; }
  .archive-topline { flex-direction: column; gap: 3px; }
  .archive-section-heading { align-items: flex-start; }
  .archive-stamp { font-size: 0.62rem; }
  .suspect-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .intro-screen::before,.case-archive::before { animation: none; }
  .case-open-button,.case-archive,.access-modal,.access-dialog { transition-duration: 0.01ms; }
}

@media (max-width: 720px) {
  .site-shell {
    width: min(100% - 38px, 540px);
    padding-top: 39px;
  }

  .site-header {
    padding-bottom: 37px;
  }

  .case-introduction {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    min-height: 0;
  }

  .art-frame {
    width: 100%;
    max-width: 490px;
  }

  .case-column {
    width: min(100%, 430px);
  }

  .case-file {
    padding: 25px 27px 25px;
  }

  .scroll-note {
    padding-top: 14px;
  }

  .about-section {
    margin-top: 66px;
    padding: 34px 7px 0;
  }

  .about-section h2 {
    font-size: 0.98rem;
  }

  .story-copy {
    font-size: 0.9rem;
    line-height: 2;
  }

  .privacy-note {
    margin-top: 27px;
    font-size: 0.82rem;
  }

  .site-footer {
    margin-top: 57px;
  }
}

@media (max-width: 390px) {
  .site-shell {
    width: calc(100% - 30px);
  }

  .brand {
    font-size: 1.35rem;
  }

  .tagline {
    font-size: 0.66rem;
  }

  .game-status {
    font-size: 0.72rem;
  }

  .copyright {
    font-size: 0.72rem;
  }
}
