/* Composed of Nows — shared ground: palette, type, and the plate chrome every piece wears. */

@font-face { font-family: 'Cormorant'; font-weight: 300; font-style: normal; font-display: swap; src: url('../vendor/fonts/cormorant-garamond-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant'; font-weight: 300; font-style: italic; font-display: swap; src: url('../vendor/fonts/cormorant-garamond-latin-300-italic.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant'; font-weight: 400; font-style: normal; font-display: swap; src: url('../vendor/fonts/cormorant-garamond-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant'; font-weight: 400; font-style: italic; font-display: swap; src: url('../vendor/fonts/cormorant-garamond-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant'; font-weight: 500; font-style: normal; font-display: swap; src: url('../vendor/fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant'; font-weight: 500; font-style: italic; font-display: swap; src: url('../vendor/fonts/cormorant-garamond-latin-500-italic.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant'; font-weight: 600; font-style: normal; font-display: swap; src: url('../vendor/fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plex Mono'; font-weight: 300; font-style: normal; font-display: swap; src: url('../vendor/fonts/ibm-plex-mono-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plex Mono'; font-weight: 400; font-style: normal; font-display: swap; src: url('../vendor/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Plex Mono'; font-weight: 500; font-style: normal; font-display: swap; src: url('../vendor/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); }

:root {
  /* The whole series is lit by two lights on one ground.
     ember = the person. moon = the model. ash = what was possible and did not happen. */
  --ink: #08080b;
  --ink-2: #0f0e15;
  --bone: #ebe5d6;
  --moon: #9db7ff;
  --ember: #ff7a3d;
  --amber: #ffbe7a;
  --ash: #5f5a72;

  --text: var(--bone);
  --text-dim: rgba(235, 229, 214, 0.62);
  --text-faint: rgba(235, 229, 214, 0.34);
  --rule: rgba(235, 229, 214, 0.16);
  /* A soft dark halo keeps chrome text legible over busy imagery. */
  --halo: 0 0 14px rgba(8, 8, 11, 0.95), 0 0 5px rgba(8, 8, 11, 0.9), 0 0 2px rgba(8, 8, 11, 0.8);

  --serif: 'Cormorant', 'Cormorant Garamond', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --mono: 'Plex Mono', 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --edge: clamp(16px, 2.6vw, 34px);
}

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

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--text);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.piece { overflow: hidden; overscroll-behavior: none; }

canvas#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

::selection { background: rgba(255, 122, 61, 0.35); }

/* ───────── plate chrome ───────── */

.chrome {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  transition: opacity 1.4s ease;
  color: var(--text);
}
.chrome a, .chrome button { pointer-events: auto; }
body.chrome-idle .chrome { opacity: 0.3; }
body.chrome-hidden .chrome { opacity: 0; }
body.tone-light { --text: #17161c; --text-dim: rgba(23, 22, 28, 0.66); --text-faint: rgba(23, 22, 28, 0.4); --rule: rgba(23, 22, 28, 0.2); --halo: 0 0 14px rgba(235, 229, 214, 0.7), 0 0 4px rgba(235, 229, 214, 0.6); }
.chrome-head, .chrome-nav, .chrome-foot { text-shadow: var(--halo); }

.chrome .mono {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.chrome a { color: inherit; text-decoration: none; transition: color 0.25s ease; }
.chrome a:hover, .chrome button:hover { color: var(--amber); }
.chrome a:focus-visible, .chrome button:focus-visible { outline: 1px solid var(--amber); outline-offset: 4px; }

.chrome-head { position: absolute; top: var(--edge); left: var(--edge); max-width: min(70vw, 560px); }
.chrome-head .series { display: inline-block; margin-bottom: clamp(10px, 1.6vh, 18px); }
.chrome-head .title-row { display: flex; align-items: baseline; gap: 0.5em; }
.chrome-head .roman {
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(17px, 1.7vw, 24px); color: var(--text-dim); min-width: 1.2em;
}
.chrome-head h1 {
  margin: 0; font-family: var(--serif); font-weight: 300; font-size: clamp(34px, 4.4vw, 62px);
  line-height: 0.95; letter-spacing: -0.012em;
}
.chrome-head .facet { margin-top: clamp(8px, 1.2vh, 14px); }

.chrome-nav { position: absolute; top: var(--edge); right: var(--edge); display: flex; gap: 1.6em; align-items: center; }
.chrome-nav button {
  all: unset; cursor: pointer; pointer-events: auto;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim);
  transition: color 0.25s ease;
}
.chrome-nav .sep { color: var(--text-faint); }

.chrome-foot { position: absolute; left: var(--edge); right: var(--edge); bottom: var(--edge); display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; }
.chrome-epigraph { max-width: min(60ch, 56vw); }
.chrome-epigraph p {
  margin: 0 0 8px; font-style: italic; font-weight: 400; font-size: clamp(15px, 1.32vw, 19px); line-height: 1.34;
  color: var(--text-dim); white-space: pre-line; text-wrap: balance;
}
.chrome-side { text-align: right; display: flex; flex-direction: column; gap: 7px; align-items: flex-end; max-width: 46vw; }
.chrome-readout { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: pre-line; line-height: 1.6; }
.chrome-readout:empty { display: none; }
.chrome-readout b { font-weight: 400; color: var(--text); }
.chrome-readout .warm { color: var(--amber); }
.chrome-readout .cool { color: var(--moon); }
.chrome-hint { letter-spacing: 0.14em; }

.chrome-about {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 11;
  width: min(440px, 100vw); padding: calc(var(--edge) + 54px) clamp(22px, 3vw, 40px) var(--edge);
  background: linear-gradient(to left, rgba(8, 8, 11, 0.94) 60%, rgba(8, 8, 11, 0));
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(to left, #000 72%, transparent); mask-image: linear-gradient(to left, #000 72%, transparent);
  color: var(--bone); overflow-y: auto; pointer-events: none;
  opacity: 0; transform: translateX(24px); transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
body.about-open .chrome-about { opacity: 1; transform: none; pointer-events: auto; }
body.about-open.chrome-idle .chrome { opacity: 1; }
.chrome-about .inner { margin-left: auto; max-width: 320px; }
.chrome-about p { margin: 0 0 1.05em; font-size: 18.5px; line-height: 1.46; font-weight: 400; color: rgba(235, 229, 214, 0.9); }
.chrome-about p:first-child::first-letter { font-size: 1.9em; font-style: italic; line-height: 0.8; padding-right: 0.04em; color: var(--amber); }
.chrome-about .sig { margin-top: 2em; font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(235, 229, 214, 0.42); line-height: 1.9; }

@media (max-width: 640px) {
  .chrome-head h1 { font-size: 34px; }
  .chrome-foot { flex-direction: column; align-items: flex-start; gap: 12px; }
  .chrome-epigraph { max-width: 100%; }
  .chrome-epigraph p { font-size: 14px; }
  .chrome-side { text-align: left; align-items: flex-start; max-width: 100%; }
  .chrome .mono { font-size: 9.5px; }
  .chrome-nav { gap: 1.1em; }
  .chrome-about p { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .chrome, .chrome-about { transition: none; }
}
