@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: contain;
  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;
}

@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;
  }
}
