/* The Atelier. Direction B with esoteric details: one object in a quiet room,
   plus the deck drawn on the wall, the old typeface for titles and asides,
   the moon on release day, and a mark for each shelf. */

:root {
  --room: #dcdcd7;
  --floor: #c9c9c3;
  --stone: #575651;
  --ink: #1c1c1a;
  --card: #f7f7f4;
  --seal: #b3261e;
  --gutter: clamp(20px, 5vw, 72px);
  --column: 30rem;
  --old: "IM Fell English", Georgia, serif;   /* titles and asides only */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--room);
  color: var(--ink);
  font: 500 0.875rem/1.45 "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: 0.005em;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--seal); outline-offset: 4px; }
img, video { max-width: 100%; display: block; }
.pad { padding-inline: var(--gutter); }

/* Shelf marks: circle (the Series), triangle (Stories), square (the Drawer) */
.mark { fill: none; stroke: currentColor; stroke-width: 1.4; vector-effect: non-scaling-stroke; overflow: visible; flex: none; }

/* Draft notice */
.draft { margin: 0; padding-block: 8px; background: var(--ink); color: var(--card); }

/* Top bar */
.top { display: flex; justify-content: space-between; gap: 20px; padding-block: 24px; }
.top .name { font-weight: 700; white-space: nowrap; }
.top nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 24px; }
.top nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 3px; }
.top nav .mark { width: 0.72em; height: 0.72em; margin-right: 0.45em; }

/* The room */
.room {
  position: relative;
  min-height: calc(100svh - 70px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-block: 40px 60px;
  background: linear-gradient(var(--room) 0 72%, var(--floor) 72% 100%);
}
.room .left {
  grid-column: 1; align-self: stretch;
  display: flex; flex-direction: column; justify-content: space-between; gap: 30px;
}

/* The deck, drawn small on the wall; one lit point per released card */
.deck { display: block; width: clamp(140px, 16vw, 220px); color: var(--stone); }
.deck:hover { text-decoration: none; color: var(--ink); }
.deck svg { display: block; width: 100%; height: auto; overflow: visible; margin-bottom: 10px; }
.deck .ln { fill: none; stroke: var(--stone); stroke-width: 0.5; }
.deck .star { fill: none; stroke: var(--stone); stroke-width: 0.3; opacity: 0.7; }
.deck .pt { fill: var(--room); stroke: var(--ink); stroke-width: 0.6; }
.deck .pt.lit { fill: var(--seal); stroke: var(--seal); }
.deck .dot { fill: var(--ink); }
.deck span { font: italic 1.02rem/1.25 var(--old); }


.room .caption { max-width: 17rem; margin-top: auto; }
.room .cue { margin: 14px 0 0; }
.room .cue a { text-decoration: underline; text-underline-offset: 3px; }
.room .cue .tap { display: none; }
@media (hover: none) { .room .cue .click { display: none; } .room .cue .tap { display: inline; } }
.room .caption .num { margin: 0; font-weight: 700; }
.room .caption h1 { margin: 0 0 8px; font: italic 1.9rem/1.1 var(--old); }
.room .caption ul { list-style: none; margin: 14px 0 0; padding: 0; }
.room .caption li { padding: 3px 0; }

/* The moon on the day the card was released */
.moon { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--stone); }
.moon svg { width: 13px; height: 13px; flex: none; }
.moon .moon-dark { fill: var(--ink); }
.moon .moon-lit { fill: var(--card); }
.room .object { grid-column: 2; position: relative; width: min(64vw, 44svh); margin-left: 6vw; }
.room .object::after {            /* contact shadow on the floor */
  content: ""; position: absolute; left: 4%; right: 4%; bottom: -5%; height: 9%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.32), transparent);
  filter: blur(6px);
}
.room .side {
  grid-column: 3; justify-self: end; align-self: center; margin: 0 var(--gutter) 0 0;
  writing-mode: vertical-rl; color: var(--stone); font: italic 1.02rem/1.2 var(--old);
}

/* A card, wherever it appears */
.card {
  position: relative; z-index: 1; aspect-ratio: 5 / 7; overflow: hidden;
  background: var(--card); border-radius: 2.2% / 1.6%;
  box-shadow: 0 30px 50px -28px rgba(0, 0, 0, 0.4);
}
.card img { width: 100%; height: 100%; object-fit: cover; }
/* A poster that opens its story */
.card-link { display: block; transition: transform .3s ease, box-shadow .3s ease; }
.card-link:hover { transform: translateY(-4px); box-shadow: 0 38px 56px -28px rgba(0, 0, 0, 0.45); }
.card-link:focus-visible { outline: 2px solid var(--seal); outline-offset: 6px; }
@media (prefers-reduced-motion: reduce) { .card-link, .card-link:hover { transition: none; transform: none; } }

/* A story read inside its card: the card fills the screen under the header */
.book { height: calc(100svh - 24px); min-height: 480px; }
.book iframe { display: block; width: 100%; height: 100%; border: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.card.slot {
  display: grid; place-items: center; background: none; box-shadow: none;
  border: 1px dashed var(--stone); color: var(--stone); font-size: 1.4rem;
}

/* Page heading, on every page but the front room */
.page-head { padding-block: clamp(36px, 8vw, 110px) clamp(26px, 4vw, 52px); border-bottom: 1px solid var(--ink); }
.page-head h1 { margin: 0; font-size: clamp(2.4rem, 9vw, 7rem); font-weight: 700; line-height: 0.9; letter-spacing: -0.045em; }
.page-head p { margin: 1.4em 0 0; max-width: 46ch; }
.page-head .kind { margin: 0 0 1em; color: var(--stone); }
.page-head a { text-decoration: underline; text-underline-offset: 3px; }

/* The welcome, the whole top of the home page */
.welcome {
  min-height: calc(88svh - 70px); display: flex; flex-direction: column; justify-content: center;
  padding-block: clamp(40px, 8vw, 110px);
}
.welcome p { margin: 0; max-width: 30ch; font: italic clamp(1.6rem, 3vw, 2.9rem)/1.15 var(--old); }
.welcome p + p { margin-top: 0.6em; }

/* Shelves on the front page */
.shelves { border-top: 1px solid var(--ink); }
.shelf {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr) auto; gap: 20px; align-items: end;
  padding-block: clamp(26px, 4vw, 52px); border-bottom: 1px solid var(--ink);
}
.shelf .mark { width: clamp(34px, 5vw, 58px); height: clamp(34px, 5vw, 58px); margin-bottom: 0.5em; }
.shelf:hover { text-decoration: none; background: var(--floor); }
.shelf h2 { margin: 0; font-size: clamp(2.4rem, 9vw, 7rem); font-weight: 700; line-height: 0.9; letter-spacing: -0.045em; }
.shelf p { margin: 0 0 0.6em; max-width: 30ch; }

/* Reading column: card text, stories, the "made" page */
.text, .reading, .own { display: grid; grid-template-columns: 1fr minmax(0, var(--column)) 1fr; }
.text > div, .reading > div, .own > div { grid-column: 2; }
.text { padding-block: clamp(70px, 13vw, 180px) clamp(50px, 8vw, 110px); }
.prose { font-size: 1.0625rem; font-weight: 400; line-height: 1.6; }
.prose p { margin: 0 0 1em; }
.prose h2 { margin: 2.4em 0 0.6em; font-size: 0.875rem; font-weight: 700; line-height: 1.45; }
.prose h2:first-child { margin-top: 0; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }

.reading, .own { padding-block: clamp(30px, 5vw, 60px); }
.reading h2, .own h2, .season { margin: 0 0 14px; font-size: inherit; font-weight: 700; }
.reading audio, .reading video { width: 100%; }
.own p { margin: 0 0 16px; max-width: 40ch; }
.own .free { margin: 22px 0 0; }
.own .free a { text-decoration: underline; text-underline-offset: 3px; }
/* The poster up close: details cut from the full-size print, the title and haiku across the foot */
.own .details { grid-column: 1 / -1; justify-self: center; width: min(100%, 980px); margin-top: clamp(30px, 5vw, 56px);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 2.4vw, 26px); }
.own .details figure { margin: 0; }
.own .details img { width: 100%; height: auto; border-radius: 2px; box-shadow: 0 18px 30px -22px rgba(0, 0, 0, 0.45); }
.own .details .wide { grid-column: 1 / -1; }
.own .details figcaption { margin-top: 8px; color: var(--stone); font: italic 1rem/1.3 var(--old); }
@media (max-width: 560px) { .own .details { grid-template-columns: 1fr; } }
.empty { color: var(--stone); }

.button {
  display: inline-block; padding: 12px 20px; border: 1px solid var(--ink); border-radius: 2px;
  background: var(--ink); color: var(--card); font-weight: 700;
}
a.button:hover { background: var(--seal); border-color: var(--seal); text-decoration: none; }
.button[aria-disabled="true"] { background: none; border-color: var(--stone); color: var(--stone); }

/* Previous and next */
.pager {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px;
  margin-top: clamp(50px, 8vw, 110px); padding-block: 26px; border-block: 1px solid var(--ink);
}
.pager span:last-child { text-align: right; }

/* The Series: the deck laid out */
.season { margin: 0; padding-block: clamp(30px, 5vw, 56px) 22px; }
.deck-grid {
  list-style: none; margin: 0; padding: 0 0 clamp(50px, 8vw, 110px);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 40vw), 1fr)); gap: clamp(22px, 4vw, 48px);
}
.deck-grid a:hover { text-decoration: none; }
.deck-grid a:hover span { text-decoration: underline; text-underline-offset: 3px; }
.deck-grid strong, .deck-grid span { display: block; }
.deck-grid strong { margin-top: 14px; }
.deck-grid li > span, .deck-grid a > span { color: var(--stone); }
.deck-grid .card { box-shadow: 0 18px 30px -20px rgba(0, 0, 0, 0.4); }
/* The card's haiku, as written under the title on its poster: in the old typeface, line by line */
/* Each line stays whole (a haiku's lines are its own): the type scales with the card's width */
.deck-grid li { container-type: inline-size; }
.deck-grid .haiku { margin: 10px 0 0; font: italic min(1rem, 8cqi)/1.35 var(--old); color: var(--ink); }
.deck-grid .haiku span { color: inherit; white-space: nowrap; }
.deck-grid .card.slot { box-shadow: none; }

/* Stories and the Drawer: rows */
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 5fr) minmax(0, 2fr); gap: 8px 20px; align-items: baseline;
  padding-block: clamp(18px, 2.6vw, 30px); border-bottom: 1px solid var(--ink);
}
a.row:hover { text-decoration: none; background: var(--floor); }
.row strong { font-size: clamp(1.25rem, 2.6vw, 1.9rem); line-height: 1.1; letter-spacing: -0.02em; }
.row em { font-style: normal; color: var(--stone); text-align: right; }

/* The foot of every page */
.join { display: grid; grid-template-columns: 1fr minmax(0, var(--column)) 1fr; padding-block: clamp(60px, 10vw, 120px) 50px; }
.join > div { grid-column: 2; }
.foot { margin: 0; color: var(--stone); }
.foot a { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 760px) {
  .room {
    grid-template-columns: 1fr; justify-items: center; gap: 44px; padding-block: 30px 44px;
    background: linear-gradient(var(--room) 0 58%, var(--floor) 58% 100%);
  }
  .room .left, .room .object, .room .side { grid-column: 1; }
  .room .left { width: 100%; gap: 22px; }
  .deck { width: 118px; flex: none; }
  .deck span { display: none; }
  .room .object { margin-left: 0; width: min(66vw, 46svh); }
  .room .side { display: none; }
  .text, .reading, .own, .join { grid-template-columns: 0 1fr 0; }
  .shelf { grid-template-columns: 1fr auto; gap: 12px 16px; align-items: center; }
  .shelf h2 { grid-row: 1; grid-column: 1; }
  .shelf .mark { grid-row: 1; grid-column: 2; margin: 0; }
  .shelf p { grid-row: 2; grid-column: 1 / -1; }
  .row { grid-template-columns: 1fr auto; }
  .row span { grid-column: 1 / -1; grid-row: 2; }
  .pager { grid-template-columns: 1fr; }
  .pager span:last-child { text-align: left; }
  .pager span:empty { display: none; }
}
