/* fovearift.com
   Layout: the walk out from his table - the dealer's room full width, then one left-aligned column of
   text beside real pictures of the house, in the order you go down into it.
   One dark world, by choice: every picture is a candle-lit render and needs the dark of the room round it.
   Type: the game's own faces - IM Fell English for what the house says, EB Garamond for reading. */

@font-face { font-family: "IM Fell English"; src: url("fonts/fell-roman.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url("fonts/fell-italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IM Fell English SC"; src: url("fonts/fell-sc.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("fonts/garamond.woff") format("woff"); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("fonts/garamond-italic.woff") format("woff"); font-weight: 400 800; font-style: italic; font-display: swap; }

:root {
  --ground: #1a0c06;  /* the dark of the house's walls, away from the candles */
  --board: #26130a;   /* the table's wood in shadow: panels, the frame round a picture */
  --grain: #4a2814;   /* rules and edges: wood where the light catches it */
  --wax: #f2e2c4;     /* text: candle wax */
  --smoke: #c4a888;   /* quieter text */
  --flame: #f0b855;   /* the one accent: the candle's flame */
  --display: "IM Fell English", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --caps: "IM Fell English SC", "IM Fell English", "Iowan Old Style", Georgia, serif;
  --text: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --measure: 34rem;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ground); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--wax); font: 400 1.25rem/1.6 var(--text); font-variant-numeric: oldstyle-nums; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--flame); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--wax); }
a:focus-visible, button:focus-visible, video:focus-visible { outline: 2px solid var(--flame); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 6vw, 4rem); line-height: 1.05; }
h2 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; }
h3 { font-size: 1.5rem; line-height: 1.2; }
p, ul, ol, dl, dd, figure { margin: 0; }

/* the side gutter, once, on every band's inner wrapper */
.wrap { max-width: 76rem; margin-inline: auto; padding-left: max(1.25rem, env(safe-area-inset-left, 0px)); padding-right: max(1.25rem, env(safe-area-inset-right, 0px)); }

.skip { position: absolute; left: -999rem; top: 0; background: var(--flame); color: var(--ground); padding: 0.5rem 1rem; z-index: 5; }
.skip:focus { left: 0; }

/* ---- the bar at the top: the studio, and where to go */
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 2rem; padding-block: 1rem; }
.top .studio { display: block; }
.top .studio img { height: 3rem; width: auto; }
.top nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; }
.top nav a { font: 400 1.25rem/1.4 var(--caps); letter-spacing: 0.04em; color: var(--wax); text-decoration: none; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--flame); }

/* ---- his room */
.room { position: relative; display: grid; align-items: end; min-height: clamp(30rem, 50vw, 46rem); isolation: isolate; overflow: hidden; }
.room > picture, .room > picture img { position: absolute; inset: 0; width: 100%; height: 100%; }
.room > picture { z-index: -2; }
.room > picture img { object-fit: cover; object-position: 62% 42%; }
.room::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(26, 12, 6, 0.9) 0%, rgba(26, 12, 6, 0.62) 34%, rgba(26, 12, 6, 0) 62%),
              linear-gradient(0deg, var(--ground) 0%, rgba(26, 12, 6, 0) 26%); }
.room .wrap { width: 100%; padding-block: 3rem 3.5rem; }
.room .say { display: grid; gap: 1.25rem; max-width: 33rem; justify-items: start; }
.room h1 { line-height: 0; }
.room h1 img { width: min(100%, 36rem); }
.room .lede { font-size: 1.375rem; line-height: 1.5; text-wrap: pretty; }
.room .when { font: 400 1.25rem/1.4 var(--caps); letter-spacing: 0.04em; color: var(--flame); }
.go { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.75rem; }
.button { display: inline-block; background: var(--flame); color: var(--ground); font: 400 1.25rem/1 var(--caps); letter-spacing: 0.05em; text-decoration: none; padding: 0.85rem 1.5rem 0.9rem; }
.button:hover { background: var(--wax); color: var(--ground); }

/* ---- bands of the page */
.band { padding-block: clamp(3rem, 7vw, 5.5rem) 0; }
.band .wrap { display: grid; gap: 1.75rem; }
.band p, .band li, .band dd { max-width: var(--measure); text-wrap: pretty; }

.opening .line { font: italic 400 clamp(1.75rem, 3.6vw, 2.875rem)/1.28 var(--display); max-width: 24em; text-wrap: balance; }
.opening .what { color: var(--smoke); }

.film video { width: 100%; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--grain); }
.film .note, .plate figcaption, .small { font-size: 1.0625rem; line-height: 1.45; color: var(--smoke); }

/* a half of the game: its words beside a picture of it */
.half .wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; gap: 2rem 3.5rem; }
.half.turned .wrap { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.half .words { display: grid; gap: 1.25rem; }
.half.turned .words { grid-column: 2; grid-row: 1; }
.half.turned .wrap > .plate { grid-column: 1; grid-row: 1; }
.half .more { grid-column: 1 / -1; }

.plates { display: grid; gap: 1.5rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.plate { display: grid; gap: 0.5rem; min-width: 0; }
.plate a { display: block; border: 1px solid var(--grain); background: #000; }
.plate a:hover { border-color: var(--flame); }
.plate img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.finds ul { list-style: none; padding: 0; columns: 2; column-gap: 3.5rem; max-width: 72rem; }
.finds li { padding-left: 1.4rem; position: relative; break-inside: avoid; margin-bottom: 0.9rem; }
.finds li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 0.5rem; height: 0.5rem; background: var(--flame); transform: rotate(45deg); }

.where .wrap > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 3.5rem; }
.where .place { display: grid; gap: 0.6rem; align-content: start; border-top: 1px solid var(--grain); padding-top: 1.25rem; }
.where .store { font: 400 1.25rem/1.4 var(--caps); letter-spacing: 0.04em; color: var(--flame); }

.warn .wrap { gap: 1rem; }
.warn p { color: var(--smoke); }

/* ---- plain pages: press kit, privacy, credits */
.page { padding-block: clamp(2rem, 5vw, 3.5rem) 0; }
.page .wrap { display: grid; gap: 1.5rem; }
.page h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); margin-top: 1.5rem; }
.page h3 { margin-top: 0.75rem; }
.page p, .page li { max-width: 38rem; text-wrap: pretty; }
.page ul { padding-left: 1.2rem; display: grid; gap: 0.5rem; }
.page .dated { color: var(--smoke); }
.facts { display: grid; grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr); gap: 0.6rem 2rem; max-width: 52rem; border-top: 1px solid var(--grain); padding-top: 1.25rem; }
.facts dt { font-family: var(--caps); letter-spacing: 0.04em; color: var(--smoke); }
.facts dd { min-width: 0; overflow-wrap: anywhere; }
.files { display: grid; gap: 1.5rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.files.marks { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; }
.files.pair { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 60rem; }
.file { display: grid; gap: 0.5rem; min-width: 0; }
.file img { width: 100%; border: 1px solid var(--grain); background: #000; }
.file.mark img { background: var(--board); padding: 1.25rem; aspect-ratio: 3 / 2; object-fit: contain; }
.file .get { font-size: 1.0625rem; line-height: 1.45; }
.notices { white-space: pre-wrap; overflow-wrap: anywhere; font: 400 1.0625rem/1.55 var(--text); color: var(--smoke); max-width: 52rem; margin: 0; }
.lost { min-height: 50vh; align-content: center; }

/* ---- the foot */
.foot { margin-top: clamp(4rem, 9vw, 7rem); border-top: 1px solid var(--grain); background: var(--board); }
.foot .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 2rem 3.5rem; padding-block: 3rem 3.5rem; }
.foot .mark { width: 15rem; height: auto; }
.foot .by { display: grid; gap: 1rem; align-content: start; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; }
.foot nav a { font: 400 1.25rem/1.4 var(--caps); letter-spacing: 0.04em; }
.foot .legal { display: grid; gap: 0.75rem; }
.foot p { font-size: 1.0625rem; line-height: 1.5; color: var(--smoke); max-width: 40rem; }

/* ---- a picture, looked at closely */
.viewer { border: 0; padding: 0; background: var(--ground); color: var(--wax); max-width: none; max-height: none; width: 100vw; height: 100dvh; margin: 0; }
.viewer::backdrop { background: rgba(10, 4, 2, 0.94); }
.viewer .in { height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 0.75rem; padding: 1rem max(1rem, env(safe-area-inset-right, 0px)) 1rem max(1rem, env(safe-area-inset-left, 0px)); }
.viewer img { width: 100%; height: 100%; object-fit: contain; }
.viewer .bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; font-size: 1.0625rem; }
.viewer .said { min-width: 0; flex: 1 1 14rem; }
.viewer .count { color: var(--smoke); margin-left: 0.75rem; white-space: nowrap; }
.viewer .turn { display: flex; gap: 0.5rem; }
.viewer button { font: 400 1.125rem/1 var(--caps); letter-spacing: 0.04em; color: var(--wax); background: var(--board); border: 1px solid var(--grain); padding: 0.6rem 1rem; cursor: pointer; }
.viewer button:hover { border-color: var(--flame); color: var(--flame); }

.preview { background: var(--flame); color: var(--ground); font-size: 1.0625rem; line-height: 1.4; }
.preview .wrap { padding-block: 0.6rem; }

@media (max-width: 62rem) {
  .plates, .files, .files.pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .files.marks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 48rem) {
  body { font-size: 1.1875rem; }
  .half .wrap, .half.turned .wrap, .foot .wrap { grid-template-columns: minmax(0, 1fr); }
  .half.turned .words, .half.turned .wrap > .plate { grid-column: auto; grid-row: auto; }
  .where .wrap > div { grid-template-columns: minmax(0, 1fr); }
  .finds ul { columns: 1; }
  .room { display: block; min-height: 0; }
  .room > picture { position: relative; display: block; inset: auto; height: auto; aspect-ratio: 5 / 4; }
  .room > picture img { object-position: 64% 40%; }
  .room::before { inset: 0 0 auto 0; aspect-ratio: 5 / 4; background: linear-gradient(0deg, var(--ground) 0%, rgba(26, 12, 6, 0.8) 20%, rgba(26, 12, 6, 0) 52%); }
  .room .wrap { padding-block: 0 1rem; margin-top: -4.5rem; position: relative; }
  .room h1 img { width: min(100%, 24rem); }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; }
  .facts dd { margin-bottom: 0.75rem; }
}
@media (max-width: 34rem) {
  .plates, .files, .files.marks, .files.pair { grid-template-columns: minmax(0, 1fr); }
  .top .studio img { height: 2.5rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
