/* Loud Lantern — studio shelf. No build step. */

@font-face {
  font-family: "Gloock";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/gloock-latin.woff2) format("woff2");
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(fonts/golos-text-latin.woff2) format("woff2");
}
@font-face {
  font-family: "Rubik Mono One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/rubik-mono-one-latin.woff2) format("woff2");
}

:root {
  /* studio */
  --night: #0d0b09;
  --paper: #f1e8da;
  --muted: #a89d8b;
  --lamp: #f5b24a;
  --frame: rgb(241 232 218 / 0.07);
  --workshop: #15120e;

  /* Two Lies — values taken from the game's own CSS (app/globals.css) */
  --tl-coral: #e9573f;
  --tl-ink: #1f3a5f;
  --tl-paper: #f3e6cc;
  --tl-yellow: #f2b134;

  --gutter: clamp(20px, 4.2vw, 56px);
  --gap: clamp(12px, 1.9vw, 24px);
  --column: 1200px;
  --wordmark-ratio: 6.25; /* advance width of "Loud Lantern" in em, measured */

  --sans: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Gloock", Georgia, "Times New Roman", serif;
  --mono: "Rubik Mono One", Impact, sans-serif;
}

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

html {
  background: var(--night);
  color: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color-scheme: dark;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--night);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

p,
h1,
h2,
ul {
  margin: 0;
}

a {
  color: inherit;
}

/* ---------- the cursor lantern ---------- */

.sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.follow .sky {
  position: fixed;
}
.light {
  position: absolute;
  top: 0;
  left: 0;
  width: 1100px;
  height: 1100px;
  margin: 0;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    closest-side,
    rgb(245 178 74 / 0.105) 0%,
    rgb(245 178 74 / 0.06) 38%,
    rgb(245 178 74 / 0.02) 68%,
    rgb(245 178 74 / 0) 100%
  );
  transform: translate3d(calc(50vw - 550px), -640px, 0);
  will-change: transform;
}

.page {
  position: relative;
  z-index: 1;
  width: min(var(--column), 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding-block: clamp(28px, 5vh, 64px) clamp(24px, 3.6vh, 44px);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

/* ---------- hero ---------- */

.hero {
  container-type: inline-size;
}

.mark {
  display: block;
  width: 30px;
  height: 37px;
  margin-bottom: clamp(18px, 3.2vh, 30px);
  color: var(--paper);
}
.mark .flame {
  fill: var(--lamp);
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 15.5vw; /* fallback */
  font-size: calc(100cqw / var(--wordmark-ratio));
  line-height: 0.92;
  letter-spacing: 0;
  white-space: nowrap;
  color: var(--paper);
}

.lede {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 32px;
  margin-top: clamp(14px, 2.6vh, 26px);
}
.lede p:first-child {
  font-size: clamp(17px, 1.9vw, 22px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.005em;
}
.lede p:last-child {
  font-size: clamp(14px, 1.3vw, 16px);
  color: var(--muted);
}

/* ---------- shelf ---------- */

.shelf {
  list-style: none;
  padding: 0;
  margin-top: clamp(36px, 6vh, 64px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  align-items: start;
}

.slot {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  aspect-ratio: 3 / 4;
}

/* the shelf board each lantern stands on */
.slot::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: calc(var(--gap) / -2);
  right: calc(var(--gap) / -2);
  bottom: calc(var(--gap) / -2 - 1px);
  height: 1px;
  background: rgb(241 232 218 / 0.1);
}
.slot:first-child::after {
  left: 0;
}
.slot:last-child::after {
  right: 0;
}

.poster {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 2px;
  color: inherit;
  text-decoration: none;
}

/* tags: "01 · Out now" */
.tags {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: clamp(11px, 4cqw, 15px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.tags span {
  display: block;
  padding: 0.55em 0.75em 0.5em;
}

/* --- 01 lit: Two Lies --- */

.slot--lit::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -16% -14%;
  background: radial-gradient(
    closest-side,
    rgb(245 178 74 / 0.2),
    rgb(245 178 74 / 0.07) 55%,
    rgb(245 178 74 / 0) 100%
  );
  opacity: 0.7;
  transition: opacity 0.5s ease;
}

.poster--game {
  background: var(--tl-coral);
  /* the game's printed-paper dots */
  background-image: radial-gradient(rgb(31 58 95 / 0.1) 0.9px, transparent 1.2px);
  background-size: 7px 7px;
  --cw: 29.5cqw;
  --p1: 86%;
  --p2: 86%;
}
.poster--game::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 95% 62% at 50% 82%,
    rgb(255 226 170 / 0.5),
    rgb(255 205 130 / 0.14) 62%,
    rgb(255 205 130 / 0) 100%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
}
.slot--lit:hover::before,
.slot--lit:focus-within::before {
  opacity: 1;
}
.poster--game:hover::after,
.poster--game:focus-visible::after {
  opacity: 0.55;
}

.art {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  padding: 6cqw 6cqw 0;
}

.poster--game .tags {
  transform: rotate(-2deg);
  transform-origin: 0 50%;
  width: max-content;
}
.poster--game .no {
  background: var(--tl-ink);
  color: var(--tl-paper);
}
.poster--game .state {
  background: var(--tl-paper);
  color: var(--tl-ink);
}

.title {
  margin-top: 5.5cqw;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 13.4cqw;
  line-height: 1;
  letter-spacing: -0.04em;
  word-spacing: -0.28em;
  text-transform: uppercase;
  color: #fff5e2; /* a touch brighter than the card paper: 3:1 on coral */
  text-shadow: 0.9cqw 1.1cqw 0 var(--tl-ink);
}

/* fan of cards, drawn from public/og-en.png without the reveal */
.fan {
  position: absolute;
  left: var(--fan-x, 50%);
  bottom: var(--fan-y, 7cqw);
  width: 0;
  height: 0;
}
.card {
  position: absolute;
  left: calc(var(--cw) / -2);
  bottom: 0;
  width: var(--cw);
  aspect-ratio: 5 / 7;
  padding: 1.2cqw;
  border: 0.55cqw solid var(--tl-ink);
  border-radius: 2.2cqw;
  box-shadow: 1cqw 1.3cqw 0 rgb(31 58 95 / 0.36);
  color: var(--tl-ink);
  transform-origin: 50% 90%;
}
.card::before {
  content: "";
  position: absolute;
  inset: 1.1cqw;
  border: 0.35cqw solid currentColor;
  border-radius: 1.2cqw;
  opacity: 0.9;
  pointer-events: none;
}
.card--back {
  background: var(--tl-ink);
  color: var(--tl-paper);
  background-image:
    repeating-linear-gradient(45deg, rgb(243 230 204 / 0.16) 0 0.3cqw, transparent 0.3cqw 1.7cqw),
    repeating-linear-gradient(-45deg, rgb(243 230 204 / 0.16) 0 0.3cqw, transparent 0.3cqw 1.7cqw);
  transform: translate(calc(var(--p1) * -1), 6%) rotate(-8deg);
  display: grid;
  place-items: center;
}
.card--back .q {
  display: grid;
  place-items: center;
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--tl-ink);
  box-shadow: 0 0 0 0.45cqw var(--tl-paper);
  font-family: var(--mono);
  font-size: 7.4cqw;
  line-height: 1;
  color: var(--tl-paper);
}
.card--cream {
  background: var(--tl-paper);
  transform: translate(0, -7%) rotate(2deg);
}
.card--gold {
  background: var(--tl-yellow);
  transform: translate(var(--p2), 3%) rotate(8deg);
}
.card .n,
.card .k,
.card .t {
  position: relative;
  display: block;
  font-weight: 800;
}
.card .n {
  margin: 1.2cqw 0 0 1.2cqw;
  font-size: 5cqw;
  line-height: 1;
}
.card .k {
  margin: 0.5cqw 0 0 1.2cqw;
  font-size: 2cqw;
  line-height: 1;
  letter-spacing: 0.06em;
}
.card .t {
  margin: 1.4cqw 0 0 1.2cqw;
  font-size: 3.7cqw;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.band {
  flex: none;
  padding: 5cqw 6cqw 5.4cqw;
  background: var(--tl-ink);
  color: var(--tl-paper);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 1.8cqw 3cqw;
}
.claim {
  grid-column: 1 / -1;
  font-size: clamp(14px, 5.3cqw, 28px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.meta {
  font-size: clamp(11px, 3.9cqw, 16px);
  line-height: 1.3;
  color: var(--tl-paper);
  opacity: 0.86;
}
.go {
  font-size: clamp(12px, 4.4cqw, 18px);
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  transition: transform 0.3s ease;
}
/* Narrow four-in-a-row posters: Play takes its own line so "Free" never wraps alone. */
@container (max-width: 250px) {
  .meta,
  .go {
    grid-column: 1 / -1;
  }
}
.go span {
  display: inline-block;
  font-family: system-ui, sans-serif;
  transition: transform 0.3s ease;
}
.poster--game:hover .go span,
.poster--game:focus-visible .go span {
  transform: translateX(0.25em);
}

/* --- 02 workshop --- */

.poster--wip {
  background: var(--workshop);
  box-shadow: inset 0 0 0 1px rgb(245 178 74 / 0.1);
  padding: 6cqw;
  justify-content: space-between;
}
.poster--wip .tags {
  color: var(--muted);
}
.poster--wip .no {
  padding-left: 0;
  color: var(--paper);
}
.poster--wip .state {
  padding-left: 0.5em;
  padding-right: 0;
}
.poster--wip .tags .no + .state::before {
  content: "";
  display: inline-block;
  width: 1.6em;
  height: 1px;
  margin-right: 0.8em;
  vertical-align: middle;
  background: rgb(241 232 218 / 0.3);
}
.poster--wip .tags span {
  padding-block: 0.4em;
}

.embers {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -2%;
  height: 78%;
  pointer-events: none;
  background: radial-gradient(
    ellipse 62% 100% at 50% 100%,
    rgb(255 176 70 / 0.3) 0%,
    rgb(245 140 52 / 0.12) 42%,
    rgb(245 140 52 / 0) 74%
  );
  transform-origin: 50% 100%;
  opacity: 0.72;
  animation: ember 13s linear infinite;
}
.embers::after {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 0;
  height: 62%;
  background: radial-gradient(
    ellipse 60% 100% at 50% 100%,
    rgb(255 196 100 / 0.32),
    rgb(255 196 100 / 0) 72%
  );
  transform-origin: 50% 100%;
  animation: ember-core 8.7s linear infinite;
}
@keyframes ember {
  0%   { opacity: 0.66; transform: scale(1, 1); }
  9%   { opacity: 0.82; transform: scale(1.02, 1.04); }
  14%  { opacity: 0.58; transform: scale(0.99, 0.98); }
  31%  { opacity: 0.78; transform: scale(1.01, 1.03); }
  38%  { opacity: 0.7;  transform: scale(1, 1); }
  52%  { opacity: 0.86; transform: scale(1.03, 1.05); }
  57%  { opacity: 0.62; transform: scale(0.99, 0.97); }
  73%  { opacity: 0.8;  transform: scale(1.01, 1.02); }
  88%  { opacity: 0.64; transform: scale(1, 0.99); }
  100% { opacity: 0.66; transform: scale(1, 1); }
}
@keyframes ember-core {
  0%   { opacity: 0.5; transform: scale(1); }
  17%  { opacity: 0.9; transform: scale(1.06, 1.08); }
  23%  { opacity: 0.4; transform: scale(0.96, 0.94); }
  46%  { opacity: 0.8; transform: scale(1.03, 1.04); }
  61%  { opacity: 0.45; transform: scale(0.98, 0.97); }
  79%  { opacity: 0.85; transform: scale(1.05, 1.06); }
  100% { opacity: 0.5; transform: scale(1); }
}

.whisper {
  position: relative;
  font-size: clamp(22px, 10.8cqw, 56px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: var(--paper);
}
.whisper span {
  display: inline-block;
}
.poster--wip .meta {
  position: relative;
  margin-top: 4cqw;
  color: rgb(241 232 218 / 0.9); /* sits on the brightest part of the glow */
  opacity: 1;
  font-size: clamp(12px, 4.4cqw, 17px);
}
.wip-text {
  position: relative;
}

/* --- 03 / 04 open --- */

.poster--open {
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--frame);
}
.outline {
  position: absolute;
  left: 50%;
  top: 41%;
  display: block;
  width: 22cqw;
  height: auto;
  color: rgb(241 232 218 / 0.13);
  transform: translate(-50%, -50%);
}
.label {
  position: absolute;
  left: 0;
  right: 0;
  top: 57%;
  text-align: center;
}
.poster--open .no {
  font-size: clamp(13px, 5.6cqw, 22px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.08em;
}
.poster--open .word {
  margin-top: 2.4cqw;
  font-size: clamp(11px, 4cqw, 15px);
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
/* the frame and outline come up where the cursor's light passes */
.lit {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  border: 1px solid rgb(245 178 74 / 0.55);
  color: rgb(245 178 74 / 0.8);
  pointer-events: none;
  -webkit-mask-image: radial-gradient(circle 190px at var(--lx, -999px) var(--ly, -999px), #000 0%, rgb(0 0 0 / 0) 100%);
  mask-image: radial-gradient(circle 190px at var(--lx, -999px) var(--ly, -999px), #000 0%, rgb(0 0 0 / 0) 100%);
}
.lit .outline {
  color: inherit;
}

/* ---------- footer ---------- */

.foot {
  margin-top: auto;
  padding-top: clamp(44px, 7vh, 80px);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.foot a {
  color: var(--paper);
  text-decoration-line: underline;
  text-decoration-color: rgb(241 232 218 / 0.35);
  text-underline-offset: 3px;
}
.foot a:hover {
  text-decoration-color: var(--lamp);
}

/* ---------- focus ---------- */

a:focus-visible {
  outline: 2px solid var(--lamp);
  outline-offset: 4px;
}
.poster:focus-visible {
  outline-offset: 5px;
}

/* ---------- 404 ---------- */

.lost {
  margin-block: auto;
  padding-block: 10vh;
}
.lost .mark {
  width: 44px;
  height: 55px;
  margin-bottom: 28px;
  color: rgb(241 232 218 / 0.5);
}
.lost h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 10.5vw, 128px);
  line-height: 1;
  letter-spacing: 0;
  white-space: normal;
  text-wrap: balance;
  margin-left: 0;
}
.lost p {
  margin-top: 22px;
  font-size: 18px;
}
.lost a {
  text-decoration-line: underline;
  text-decoration-color: var(--lamp);
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

/* ---------- 600–999: 2 × 2 ---------- */

@media (max-width: 999px) {
  .shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: calc(var(--gap) * 1.7);
  }
  .slot:nth-child(odd)::after {
    left: 0;
    right: calc(var(--gap) / -2);
  }
  .slot:nth-child(even)::after {
    left: calc(var(--gap) / -2);
    right: 0;
  }
  .slot:first-child::after,
  .slot:last-child::after {
    left: 0;
  }
  .slot:nth-child(1)::after {
    right: calc(var(--gap) / -2);
  }
  .slot:nth-child(4)::after {
    left: calc(var(--gap) / -2);
    right: 0;
  }
  .slot::after {
    bottom: calc(var(--gap) * -0.85 - 1px);
  }
}

/* ---------- below 600: wide lit poster, wide workshop poster, two open ---------- */

@media (max-width: 599px) {
  .shelf {
    row-gap: calc(var(--gap) * 1.5);
  }
  .slot::after {
    bottom: calc(var(--gap) * -0.75 - 1px);
  }
  .slot:nth-child(1),
  .slot:nth-child(2) {
    grid-column: 1 / -1;
  }
  .slot:nth-child(1) {
    aspect-ratio: 4 / 3;
  }
  .slot:nth-child(2) {
    aspect-ratio: 16 / 9;
  }
  .slot:nth-child(1)::after,
  .slot:nth-child(2)::after {
    left: 0;
    right: 0;
  }
  .slot:nth-child(3)::after {
    left: 0;
    right: calc(var(--gap) / -2);
  }
  .slot:nth-child(4)::after {
    left: calc(var(--gap) / -2);
    right: 0;
  }

  .slot--lit::before {
    inset: -12% -5%;
  }

  /* 01 — title and fan side by side, band underneath */
  .poster--game {
    --cw: 20.5cqw;
    --p1: 72%;
    --p2: 80%;
    --fan-x: 66%;
    --fan-y: 5cqw;
  }
  .art {
    padding: 5cqw 5cqw 0;
  }
  .title {
    margin-top: 4.5cqw;
    font-size: 9cqw;
    width: 40cqw;
    line-height: 1.05;
  }
  .band {
    padding: 4cqw 5cqw 4.4cqw;
  }
  .claim {
    grid-column: 1 / -1;
    font-size: clamp(14px, 4.6cqw, 22px);
  }
  .meta {
    font-size: clamp(11px, 3.5cqw, 15px);
  }
  .go {
    font-size: clamp(13px, 3.9cqw, 17px);
  }
  .card .n { font-size: 3.4cqw; margin: 0.8cqw 0 0 1cqw; }
  .card .k { font-size: 1.4cqw; margin-left: 1cqw; }
  .card .t { font-size: 2.35cqw; margin: 1cqw 0 0 1cqw; }
  .card--back .q { font-size: 4.9cqw; }
  .card--cream .t { padding-right: 3cqw; }

  /* 02 — wide */
  .poster--wip {
    padding: 5cqw;
  }
  .whisper {
    font-size: clamp(22px, 8.6cqw, 40px);
  }
  .poster--wip .meta {
    margin-top: 2.4cqw;
    font-size: clamp(12px, 3.6cqw, 16px);
  }
  .embers {
    height: 90%;
  }

  /* open slots — small posters, small type */
  .outline {
    width: 24cqw;
  }
}

@media (max-width: 380px) {
  .poster--game .tags {
    font-size: 11px;
  }
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .embers,
  .embers::after {
    animation: none;
  }
  .embers {
    opacity: 0.7;
  }
  .embers::after {
    opacity: 0.55;
  }
  .poster--game::after,
  .slot--lit::before,
  .go,
  .go span {
    transition: none;
  }
}

/* the cursor lantern needs a pointer; elsewhere the light stands still */
@media (hover: none), (pointer: coarse) {
  .lit {
    display: none;
  }
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.mark,
.outline {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.outline {
  stroke-width: 1.2;
}
