/* The Twenty-Fifth: front of house.
   Every color and face is a token here; change the look in this block. */
:root {
  --ink: #101311;        /* the room */
  --ink-raised: #171b18; /* a surface a shade above it */
  --hairline: #2b302b;   /* quiet rules */
  --ivory: #ede7da;      /* text */
  --mute: #a39e90;       /* secondary text */
  --dim: #7e796d;        /* the quietest text */
  --brass: #b9a26c;      /* the one accent */
  --stone: #d8d1c2;      /* the plate a photograph sits on */
  --stone-ink: #3a3832;  /* text on a plate */

  --serif: "Cormorant Garamond", "New York", ui-serif, Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;

  --slow: 0.7s;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--ink); }
body {
  color: var(--ivory);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; }
.noscript { padding: 40px; text-align: center; color: var(--mute); }

#stage {
  min-height: 100dvh;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: max(22px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
           max(26px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

/* ---- screens fade in and out, slowly ---- */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease);
}
.screen.in { opacity: 1; transform: none; }

/* ---- shared pieces ---- */
.kicker {
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 0;
}
.display {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(36px, 10.5vw, 56px);
  line-height: 1.06;
  letter-spacing: -0.005em;
  margin: 0;
  text-wrap: balance;
}
.body { font-size: 15px; line-height: 1.65; color: var(--mute); margin: 0; text-wrap: pretty; }
.italic { font-family: var(--serif); font-style: italic; font-size: clamp(21px, 5.8vw, 26px); line-height: 1.35; margin: 0; text-wrap: balance; }
.tick { width: 30px; height: 1px; background: var(--brass); border: 0; margin: 26px auto; }

.monogram {
  width: 62px; height: 62px;
  border: 1px solid var(--brass);
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 32px; line-height: 1; color: var(--brass);
  padding-bottom: 3px;
}
.monogram.small { width: 30px; height: 30px; font-size: 17px; padding-bottom: 2px; }

.action {
  appearance: none;
  background: transparent;
  border: 1px solid var(--brass);
  color: var(--brass);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 16px 44px;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.action:hover, .action:focus-visible { background: var(--brass); color: var(--ink); outline: none; }
.action:active { transform: scale(0.985); }

/* ---- the door, the invitation, the pauses, the end: centered ---- */
.centered { align-items: center; text-align: center; justify-content: center; padding: 24px 6px; }
.centered .monogram { margin-bottom: 34px; }
.centered .kicker { margin-bottom: 18px; }
.centered .display { margin-bottom: 20px; }
.centered .body { max-width: 30ch; }
.centered .how { max-width: 34ch; margin-bottom: 40px; }
.centered .action { margin-top: 8px; }
.centered .small { font-size: 12px; letter-spacing: 0.08em; color: var(--dim); margin-top: 34px; }

/* ---- the viewing ---- */
.bar { display: flex; align-items: center; justify-content: space-between; }
.count { font-size: 11px; letter-spacing: 0.22em; color: var(--mute); font-variant-numeric: tabular-nums; }
.progress { height: 1px; background: var(--hairline); margin: 14px 0 0; }
.progress i { display: block; height: 1px; background: var(--brass); transition: width 0.9s var(--ease); }

.prompt {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 8.6vw, 44px);
  line-height: 1.1;
  margin: clamp(22px, 5vh, 44px) 0 clamp(18px, 3.5vh, 30px);
  text-wrap: balance;
}

.middle { margin: auto 0; padding: 6px 0 10px; }
.pair { display: grid; gap: 12px; }
.pair.photo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pair.words { grid-template-columns: minmax(0, 1fr); }

.piece, .word {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.piece:focus-visible .plate, .word:focus-visible { outline: 1px solid var(--brass); outline-offset: 4px; }

.plate {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--stone);
  outline: 1px solid transparent;
  outline-offset: 5px;
  transition: outline-color 0.35s var(--ease);
  overflow: hidden;
}
.plate img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 7%;
  mix-blend-mode: multiply; /* a white studio background melts into the plate */
}
/* No photograph: the piece is set in type on the plate. */
.plate.typeset { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 14px; gap: 10px; }
.plate.typeset .t-house { font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: #6b665a; }
.plate.typeset .t-line { font-family: var(--serif); font-size: clamp(19px, 5.2vw, 26px); line-height: 1.15; color: var(--stone-ink); text-wrap: balance; }

.house { font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--brass); margin: 14px 0 4px; }
.line { font-family: var(--serif); font-size: clamp(17px, 4.7vw, 21px); line-height: 1.2; color: var(--ivory); text-wrap: balance; }

.word {
  border: 1px solid var(--hairline);
  min-height: clamp(104px, 17vh, 150px);
  display: grid; place-items: center;
  padding: 20px 22px;
  text-align: center;
  font-family: var(--serif);
  font-size: clamp(25px, 7vw, 34px);
  line-height: 1.14;
  color: var(--ivory);
  text-wrap: balance;
  transition: border-color 0.35s var(--ease), opacity 0.6s var(--ease), background 0.35s var(--ease);
}
@media (hover: hover) {
  .word:hover { border-color: var(--dim); }
  .piece:hover .plate { outline-color: var(--hairline); }
}

/* a piece shown without its house: the line sits where the house would */
.piece.bare .line { margin-top: 14px; }

/* a few answers in words about the piece just kept */
.kept { display: flex; align-items: center; gap: 14px; margin: 0 0 clamp(16px, 3vh, 26px); }
.kept .plate { width: 62px; flex: none; }
.kept .line { color: var(--mute); }
.pair.why { grid-template-columns: minmax(0, 1fr); }
.pair.why .word { min-height: clamp(76px, 11vh, 104px); font-size: clamp(22px, 6vw, 28px); }

/* after a choice */
.chosen .plate { outline-color: var(--brass); }
.word.chosen { border-color: var(--brass); background: var(--ink-raised); }
.passed { opacity: 0.22; }
.answered .piece, .answered .word, .answered .quiet { pointer-events: none; }

.more { display: flex; justify-content: center; gap: 34px; margin-top: clamp(22px, 4vh, 34px); min-height: 28px; }
.quiet {
  appearance: none; background: none; border: 0; padding: 4px 0 5px;
  border-bottom: 1px solid var(--hairline);
  font-size: 12px; letter-spacing: 0.14em; color: var(--mute); cursor: pointer;
  transition: color 0.3s, border-color 0.3s;
}
.quiet:hover, .quiet:focus-visible { color: var(--ivory); border-color: var(--brass); outline: none; }
.quiet.chosen { color: var(--brass); border-color: var(--brass); }

.sealed { padding-top: 20px; text-align: center; font-size: 11px; letter-spacing: 0.12em; color: var(--dim); }

/* ---- the file: one long page of sheets, each coming up as it is reached ---- */
.file { padding-bottom: 8vh; }
.sheet {
  padding-top: clamp(52px, 10vh, 92px);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
.sheet.in { opacity: 1; transform: none; }
.sheet::before { content: ""; display: block; width: 30px; height: 1px; background: var(--brass); margin-bottom: 26px; }
.sheet.big {
  min-height: 78dvh;
  padding-top: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.sheet.big::before { display: none; }
.sheet.big .monogram { margin-bottom: 34px; }
.sheet.big .kicker { margin-bottom: 18px; }
.sheet.big .display { margin-bottom: 22px; }
.sheet.big .body + .body { margin-top: 10px; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); }
.heading {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 8.2vw, 40px);
  line-height: 1.08;
  margin: 0 0 14px;
  text-wrap: balance;
}
.sheet .body { max-width: 44ch; }
.sheet .body + .body { margin-top: 8px; }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 12px; margin-top: 30px; }
.card { margin: 0; }
.card .note { font-size: 11px; letter-spacing: 0.16em; color: var(--dim); margin-top: 7px; font-variant-numeric: tabular-nums; }
.card.feature { max-width: 320px; margin: 32px auto 0; }
.card.feature .plate { outline-color: var(--brass); }
.card.passed { opacity: 0.4; }

.scales { display: grid; gap: 26px; margin: 34px 0 10px; }
/* the two ends are one width on every line, so that the middles line up */
.scale { display: grid; grid-template-columns: 84px 1fr 84px; align-items: center; gap: 12px; }
.scale .end { font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mute); }
.scale .end.right { text-align: right; }
.track { position: relative; height: 1px; background: var(--hairline); }
.track::before { content: ""; position: absolute; left: 50%; top: -4px; width: 1px; height: 9px; background: var(--hairline); }
.track i {
  position: absolute; top: 50%;
  width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  border-radius: 50%; border: 1px solid var(--brass); background: var(--ink);
}
.scale.strong .track i { background: var(--brass); }

.kicker.sub { margin-top: 34px; }
.rows { list-style: none; margin: 14px 0 0; padding: 0; }
.rows li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--hairline); }
.rows .name { font-family: var(--serif); font-size: clamp(20px, 5.4vw, 24px); line-height: 1.2; }
.rows .note { font-size: 11px; letter-spacing: 0.16em; color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.said { font-family: var(--serif); font-size: clamp(21px, 5.6vw, 25px); line-height: 1.3; margin: 18px 0 0; text-wrap: balance; }
.sheet .italic { margin-top: 18px; }
.sheet .small { font-size: 11px; letter-spacing: 0.12em; color: var(--dim); margin: 26px 0 0; }
.sheet[data-sheet="close"] { text-align: center; }
.sheet[data-sheet="close"]::before { margin-left: auto; margin-right: auto; }
.sheet[data-sheet="close"] .body { margin: 0 auto; }

/* ---- wider screens ---- */
@media (min-width: 620px) {
  #stage { padding-top: 44px; padding-bottom: 44px; }
  .pair { gap: 22px; }
  .pair.words { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .word { min-height: 220px; }
  .pair.why { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pair.why.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pair.why .word { min-height: 150px; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px 22px; }
  .cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 470px; }
  .scale { grid-template-columns: 104px 1fr 104px; gap: 14px; }
  .scale .end { font-size: 10.5px; letter-spacing: 0.2em; }
}

@media (prefers-reduced-motion: reduce) {
  .screen, .piece, .word, .plate, .progress i, .sheet { transition: none; }
  .screen, .sheet { transform: none; }
}

/* ---- a line the server may ask to have shown above the page ---- */
.mark {
  position: fixed; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; white-space: nowrap;
  color: var(--ink); background: var(--brass); padding: 4px 11px; z-index: 5; pointer-events: none;
}
