/* ============================================================
   horror - stylesheet
   Victorian gothic revival: arches, filigree, damask and fog.
   Ornament is inline SVG or CSS only - no image files.
   No border-radius anywhere.
   ============================================================ */

:root {
  --ink:        #0d0b0c;
  --ink-raised: #131011;
  --ink-panel:  #14100f;
  --ivory:      #f2ece3;
  --oxblood:    #7a1220;
  --gold:       #b89b5e;

  --ivory-dim:   rgba(242, 236, 227, 0.62);
  --ivory-faint: rgba(242, 236, 227, 0.34);
  --gold-line:   rgba(184, 155, 94, 0.34);
  --gold-faint:  rgba(184, 155, 94, 0.16);
  --gold-dim:    rgba(184, 155, 94, 0.72);
  --oxblood-lift: #8f1826;

  --serif-display: "Playfair Display", "Times New Roman", serif;
  --serif-body: Georgia, "Times New Roman", serif;

  --caps: 0.2em;
  --ease: 220ms ease;
  --ease-lift: 380ms cubic-bezier(0.32, 0.06, 0.28, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background-color: var(--ink);
  /* damask: an ogee lattice with a fleur at each centre, held at a whisper */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cg fill='none' stroke='%23b89b5e' stroke-opacity='0.055' stroke-width='1'%3E%3Cpath d='M0 70C35 70 35 0 70 0C105 0 105 70 140 70'/%3E%3Cpath d='M0 70C35 70 35 140 70 140C105 140 105 70 140 70'/%3E%3Cpath d='M70 52c2.4 4 2.9 7.3 0 11.5-2.9-4.2-2.4-7.5 0-11.5z'/%3E%3Cpath d='M69 62c-3.2-2.9-7.2-1.4-7.2 2.6 0 3 2.8 4.6 5.3 3.4-2-.6-2.8-1.9-2.5-3.2.5-1.7 2.7-2.1 4.4-.8'/%3E%3Cpath d='M71 62c3.2-2.9 7.2-1.4 7.2 2.6 0 3-2.8 4.6-5.3 3.4 2-.6 2.8-1.9 2.5-3.2-.5-1.7-2.7-2.1-4.4-.8'/%3E%3Cpath d='M65.5 69.5h9M70 63.5v15'/%3E%3Cpath d='M70 0l3 4-3 4-3-4zM70 132l3 4-3 4-3-4zM0 66l3 4-3 4-3-4zM140 66l3 4-3 4-3-4z'/%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed;
}

body {
  position: relative;
  margin: 0;
  background: transparent;
  color: var(--ivory);
  font-family: var(--serif-body);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

body.is-locked { overflow: hidden; }

h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
img { display: block; max-width: 100%; }

button, input, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
}
button { cursor: pointer; }

:focus-visible {
  outline: 1px solid var(--gold-dim);
  outline-offset: 3px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 60;
  padding: 10px 16px;
  background: var(--ink-panel);
  border: 1px solid var(--gold-line);
  color: var(--ivory);
  font-size: 0.72rem;
  letter-spacing: var(--caps);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ============================================================
   Ornament layers - all sit beneath the content
   ============================================================ */

.frame {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.frame-corner {
  position: absolute;
  width: clamp(58px, 9vw, 126px);
  aspect-ratio: 1;
  color: var(--gold);
  opacity: 0.3;
}
.frame-corner svg { width: 100%; height: 100%; }
.frame-corner--tl { top: 14px; left: 14px; }
.frame-corner--tr { top: 14px; right: 14px; transform: scaleX(-1); }
.frame-corner--bl { bottom: 14px; left: 14px; transform: scaleY(-1); }
.frame-corner--br { bottom: 14px; right: 14px; transform: scale(-1); }

/* fog gathering along the foot of the viewport */
.fog {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28vh;
  background:
    linear-gradient(to top,
      rgba(242, 236, 227, 0.075) 0%,
      rgba(242, 236, 227, 0.035) 34%,
      rgba(184, 155, 94, 0.012) 62%,
      transparent 100%);
}

.webs {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  z-index: 0;
  pointer-events: none;
}
.web {
  position: absolute;
  top: 0;
  width: clamp(120px, 21vw, 250px);
  aspect-ratio: 1;
  color: var(--gold);
  opacity: 0.17;
}
.web svg { width: 100%; height: 100%; }
.web--left { left: 0; }
.web--right { right: 0; transform: scaleX(-1); }

/* ---------- ornamental hairline rules ---------- */

.rule {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.rule-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold-line) 20%, var(--gold-line) 80%, transparent);
}
.diamond {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border: 1px solid var(--gold-dim);
  transform: rotate(45deg);
}
.rule-fleur {
  flex: 0 0 auto;
  width: 15px;
  height: 21px;
  color: var(--gold);
  opacity: 0.75;
}
.rule--wide { max-width: 380px; margin: 26px auto 22px; }
.rule--foot { max-width: 520px; margin: clamp(56px, 7vw, 84px) auto 30px; }

/* ============================================================
   Masthead and its arch
   ============================================================ */

.masthead {
  position: relative;
  z-index: 1;
  padding: clamp(30px, 5vw, 60px) 20px 0;
  text-align: center;
}

.arch {
  position: absolute;
  top: clamp(18px, 3vw, 44px);
  left: 50%;
  transform: translateX(-50%);
  width: min(960px, 96vw);
  color: var(--gold);
  opacity: 0.5;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 66%, rgba(0, 0, 0, 0.25) 88%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 66%, rgba(0, 0, 0, 0.25) 88%, transparent 100%);
}
.arch svg { width: 100%; height: auto; }

.masthead-inner {
  position: relative;
  padding-top: clamp(128px, 31vw, 300px);
}

.wordmark {
  font-family: var(--serif-display);
  font-size: clamp(3.7rem, 15.5vw, 10.6rem);
  line-height: 0.86;
  letter-spacing: -0.028em;
  color: var(--ivory);
}

.tagline {
  font-family: var(--serif-body);
  font-style: italic;
  font-size: clamp(0.82rem, 2.4vw, 0.98rem);
  color: var(--gold);
  letter-spacing: 0.02em;
}

/* ============================================================
   Tabs
   ============================================================ */

.tabs {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(10px, 2vw, 26px);
  margin: clamp(34px, 6vw, 58px) auto 0;
  padding: 0 20px 16px;
  max-width: 1280px;
  border-bottom: 1px solid var(--gold-faint);
}

.tab {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 2px 10px;
  border-bottom: 2px solid transparent;
  color: var(--ivory-dim);
  font-family: var(--serif-body);
  font-size: 0.7rem;
  letter-spacing: var(--caps);
  text-transform: uppercase;
  transition: color var(--ease), border-color var(--ease);
}
.tab:hover { color: var(--ivory); }
.tab[aria-selected="true"] {
  color: var(--ivory);
  border-bottom-color: var(--oxblood);
}
.tab-count {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.tab-sep {
  display: flex;
  align-items: center;
  width: 11px;
  height: 16px;
  color: var(--gold);
  opacity: 0.42;
}
.tab-sep svg { width: 100%; height: 100%; }

@media (max-width: 560px) {
  .tabs {
    display: grid;
    grid-template-columns: repeat(2, auto);
    justify-content: center;
    column-gap: 30px;
    row-gap: 4px;
    padding-bottom: 14px;
  }
  .tab { justify-content: center; }
  .tab-sep { display: none; }
}

/* ---------- shell ---------- */

.shell {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(34px, 5vw, 58px) clamp(18px, 4vw, 42px) 60px;
}

.collection { min-height: 300px; }

/* ============================================================
   Grid and tiles
   ============================================================ */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(16px, 3vw, 30px);
  row-gap: clamp(30px, 4vw, 46px);
}
@media (min-width: 620px)  { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px)  { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.tile {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0;
  background: none;
  cursor: pointer;
}

.tile-art {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: linear-gradient(163deg, #171314 0%, #0f0c0d 52%, #131010 100%);
  border: 1px solid var(--gold-faint);
  container-type: inline-size;
  transition: border-color var(--ease), opacity var(--ease), transform var(--ease-lift);
}
.tile:hover .tile-art,
.tile:focus-visible .tile-art { border-color: var(--gold-line); }

/* ---- poster as a physical object ---- */

.tile-art.has-poster {
  border-color: rgba(184, 155, 94, 0.46);
  background: #0b0909;
}

.tile-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* one sepia treatment across the grid, so fourteen sets of
     marketing art read as one shelf of objects */
  filter: sepia(0.58) saturate(0.62) brightness(0.84) contrast(1.06);
  transition: filter var(--ease-lift);
}

/* oxblood tint and the depth along the spine edge */
.tile-art.has-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(9, 6, 7, 0.62) 0%, rgba(9, 6, 7, 0.16) 7%, rgba(9, 6, 7, 0) 17%),
    linear-gradient(180deg, rgba(122, 18, 32, 0.22) 0%, rgba(122, 18, 32, 0.12) 55%, rgba(122, 18, 32, 0.2) 100%);
  box-shadow:
    inset 18px 0 26px -20px rgba(0, 0, 0, 0.95),
    inset -12px 0 22px -20px rgba(0, 0, 0, 0.8),
    inset 0 -10px 20px -18px rgba(0, 0, 0, 0.7);
  transition: opacity var(--ease-lift);
}

.tile:hover .tile-img,
.tile:focus-visible .tile-img { filter: sepia(0) saturate(1) brightness(1) contrast(1); }
.tile:hover .tile-art.has-poster::after,
.tile:focus-visible .tile-art.has-poster::after { opacity: 0.18; }
.tile:hover .tile-art,
.tile:focus-visible .tile-art { transform: translateY(-4px); }

/* ---- the fallback plate: shown while loading and when nothing is found ---- */

.plate {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4cqw;
  padding: 13cqw 9cqw;
  text-align: center;
}
.tile-art.has-poster .plate { display: none; }

.plate::before,
.plate::after {
  content: "";
  position: absolute;
  pointer-events: none;
  transition: border-color var(--ease);
}
.plate::before {
  inset: 5cqw;
  border: 1px solid var(--gold-line);
}
.plate::after {
  inset: 7.4cqw;
  border: 1px solid var(--gold-faint);
}
.tile:hover .plate::before,
.tile:focus-visible .plate::before { border-color: var(--gold-dim); }
.tile:hover .plate::after,
.tile:focus-visible .plate::after { border-color: var(--gold-line); }

.plate-mark {
  width: 2.6cqw;
  height: 2.6cqw;
  min-width: 4px;
  min-height: 4px;
  border: 1px solid var(--gold-dim);
  transform: rotate(45deg);
  margin-bottom: 2cqw;
}

.plate-title {
  font-family: var(--serif-display);
  font-size: clamp(0.95rem, 11.4cqw, 1.62rem);
  line-height: 1.14;
  letter-spacing: -0.008em;
  color: var(--ivory);
  text-wrap: balance;
}

.plate-rule {
  width: 22cqw;
  height: 1px;
  background: var(--gold-line);
  margin: 1.5cqw 0 0.6cqw;
}

.plate-year {
  font-family: var(--serif-body);
  font-size: clamp(0.52rem, 3.4cqw, 0.7rem);
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--gold);
}

.tile[data-status="banished"] .tile-art { opacity: 0.66; }
.tile[data-status="banished"]:hover .tile-art,
.tile[data-status="banished"]:focus-visible .tile-art { opacity: 1; }

/* ---------- tile caption ---------- */

.tile-meta { padding-top: 14px; }

.tile-title {
  font-family: var(--serif-display);
  font-size: 1.02rem;
  line-height: 1.28;
  color: var(--ivory);
  transition: color var(--ease);
}
.tile:hover .tile-title { color: #fffaf2; }

.tile-year {
  margin-top: 4px;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(184, 155, 94, 0.78);
}

.tile-ratings {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.tile-ratings .bar {
  width: 1px;
  height: 11px;
  background: var(--gold-faint);
}
.rating-mini { display: flex; align-items: center; gap: 4px; }

/* ============================================================
   Rating icons - heart for enjoyment, ghost for fear
   ============================================================ */

.icon {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.4;
  stroke-linejoin: round;
  opacity: 0.4;
  transition: opacity var(--ease), fill var(--ease), stroke var(--ease);
}
.icon--mini { width: 13px; height: 13px; stroke-width: 1.7; opacity: 0.5; }

.icon.is-on { stroke: none; opacity: 1; }
[data-rating="enjoyment"] .icon.is-on,
.rating-mini[data-rating="enjoyment"] .icon.is-on { fill: var(--oxblood); }
[data-rating="fear"] .icon.is-on,
.rating-mini[data-rating="fear"] .icon.is-on { fill: var(--ivory); }

.rating {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rate-btn {
  padding: 5px;
  line-height: 0;
  transition: transform var(--ease);
}
.rate-btn:hover .icon { opacity: 0.9; }
.rate-btn:hover .icon.is-on { opacity: 1; }

.rate-read {
  margin-left: 8px;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ivory-faint);
  transition: color var(--ease);
}
.rate-read.is-set { color: var(--gold); }

/* ============================================================
   Empty states and Discover
   ============================================================ */

.empty {
  position: relative;
  border: 1px solid var(--gold-faint);
  padding: clamp(46px, 8vw, 86px) clamp(24px, 5vw, 56px);
  text-align: center;
}
.empty::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid var(--gold-faint);
  pointer-events: none;
}
.empty-mark {
  width: 6px;
  height: 6px;
  margin: 0 auto clamp(22px, 4vw, 30px);
  border: 1px solid var(--gold-dim);
  transform: rotate(45deg);
}
.empty-title {
  font-family: var(--serif-display);
  font-size: clamp(1.5rem, 4vw, 2.15rem);
  color: var(--ivory);
}
.empty-kicker {
  margin-top: 8px;
  font-size: 0.64rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
}
.empty-body {
  max-width: 52ch;
  margin: 24px auto 0;
  text-align: left;
  font-style: italic;
  color: var(--ivory-dim);
}

/* drop cap on the longer body copy */
.empty-body::first-letter {
  float: left;
  margin: 0.06em 0.07em 0 0;
  font-family: var(--serif-display);
  font-style: normal;
  font-size: 3.5em;
  line-height: 0.8;
  color: var(--gold);
}

/* ---------- colophon ---------- */

.colophon {
  text-align: center;
  font-size: 0.63rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ivory-faint);
}

/* ============================================================
   Scrim and panel
   ============================================================ */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(16px, 5vh, 64px) clamp(14px, 4vw, 32px);
  background: rgba(7, 5, 6, 0.93);
  overflow-y: auto;
}
.scrim[hidden] { display: none; }

.panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: auto;
  padding: clamp(34px, 5vw, 50px) clamp(24px, 4.5vw, 46px) clamp(28px, 4vw, 38px);
  background: var(--ink-panel);
  border: 1px solid var(--gold-line);
  outline: none;
}
.panel::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid var(--gold-faint);
  pointer-events: none;
}

.panel-corner {
  position: absolute;
  width: clamp(36px, 7vw, 54px);
  aspect-ratio: 1;
  color: var(--gold);
  opacity: 0.34;
  pointer-events: none;
}
.panel-corner svg { width: 100%; height: 100%; }
.panel-corner--tl { top: 3px; left: 3px; }
.panel-corner--tr { top: 3px; right: 3px; transform: scaleX(-1); }
.panel-corner--bl { bottom: 3px; left: 3px; transform: scaleY(-1); }
.panel-corner--br { bottom: 3px; right: 3px; transform: scale(-1); }

.panel-close {
  position: absolute;
  top: clamp(18px, 3vw, 24px);
  right: clamp(18px, 3vw, 24px);
  z-index: 2;
  padding: 4px 2px;
  font-size: 0.6rem;
  letter-spacing: var(--caps);
  text-transform: uppercase;
  color: var(--ivory-faint);
  border-bottom: 1px solid transparent;
  transition: color var(--ease), border-color var(--ease);
}
.panel-close:hover {
  color: var(--ivory);
  border-bottom-color: var(--gold-line);
}

.panel-eyebrow {
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
}
.panel-title {
  margin-top: 12px;
  font-family: var(--serif-display);
  font-size: clamp(1.9rem, 5.4vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: -0.014em;
}
.panel-sub {
  margin-top: 10px;
  font-style: italic;
  font-size: 0.92rem;
  color: var(--ivory-dim);
}
.panel .rule { margin: clamp(24px, 4vw, 32px) 0; }

/* ---------- fields ---------- */

.field { margin-bottom: clamp(22px, 3.4vw, 28px); }

.field-label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.6rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

.field-note {
  margin-top: 9px;
  font-size: 0.72rem;
  font-style: italic;
  color: var(--ivory-faint);
}

.segmented { display: flex; flex-wrap: wrap; gap: 8px; }

.opt {
  padding: 9px 15px;
  border: 1px solid var(--gold-faint);
  background: transparent;
  color: var(--ivory-dim);
  font-size: 0.63rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: color var(--ease), border-color var(--ease), background-color var(--ease);
}
.opt:hover { color: var(--ivory); border-color: var(--gold-line); }
.opt[aria-pressed="true"] {
  background: var(--oxblood);
  border-color: var(--oxblood-lift);
  color: var(--ivory);
}

.text-input,
.text-area {
  display: block;
  width: 100%;
  padding: 9px 0;
  background: transparent;
  border-bottom: 1px solid var(--gold-faint);
  color: var(--ivory);
  font-family: var(--serif-body);
  transition: border-color var(--ease);
}
.text-area {
  padding: 12px 14px;
  border: 1px solid var(--gold-faint);
  line-height: 1.68;
  resize: vertical;
  min-height: 130px;
}
.text-input::placeholder,
.text-area::placeholder { color: var(--ivory-faint); font-style: italic; }
.text-input:focus,
.text-area:focus { outline: none; border-color: var(--gold-dim); }
.text-input:focus-visible,
.text-area:focus-visible { outline: none; }

.panel-foot {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--gold-faint);
  font-size: 0.68rem;
  font-style: italic;
  color: var(--ivory-faint);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; }
  .tile:hover .tile-art { transform: none; }
}
