/* app.css — the page's own layout, on the --w-* tokens only: the house frame's (css/start.css, or the artist's
   start.css) on the start and account pages, a universe kit's tokens.css on its shelf, book pages and reader, and a
   DLC's overlay on top. The reader's split view is the kit's reader.css; this file adds only what the kit leaves to
   the page. No colour is written here, so a new universe or DLC never needs a change in this file. */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--w-ground); color: var(--w-ink);
  font: var(--w-font-ui-weight) var(--w-text-base)/var(--w-leading) var(--w-font-ui); }
a { color: var(--w-link); text-decoration: underline; text-underline-offset: .15em; }
h1, h2 { font-family: var(--w-font-display); font-weight: var(--w-font-display-weight); line-height: var(--w-leading-tight); }
img { max-width: 100%; }

.site-header { display: flex; align-items: center; gap: var(--w-space-4); padding: var(--w-space-3) var(--w-space-4);
  border-bottom: 1px solid var(--w-line); background: var(--w-surface); }
.house-link { margin-right: auto; color: var(--w-ink); font-weight: var(--w-font-ui-weight-strong); text-decoration: none; }
.house-link:hover, .house-link:focus-visible { text-decoration: underline; }
#header-credits { display: inline-flex; align-items: center; gap: .3em; color: var(--w-ink); }
html[data-view="read"] .site-header { display: none; }

main, .account { max-width: 64rem; margin: 0 auto; padding: var(--w-space-5) var(--w-space-4); }
.account { max-width: 28rem; }
#notice, #error { max-width: 64rem; margin: var(--w-space-3) auto 0; padding: var(--w-space-2) var(--w-space-3);
  border: 1px solid var(--w-line); border-radius: var(--w-radius-md); }
#error { border-color: var(--w-danger); color: var(--w-danger); }

button, .button { display: block; width: 100%; margin: var(--w-space-2) 0; padding: .75rem 1rem; border: 1px solid var(--w-accent);
  border-radius: var(--w-radius-md); background: var(--w-accent); color: var(--w-on-accent); font: inherit;
  font-weight: var(--w-font-ui-weight-strong); text-align: center; text-decoration: none; cursor: pointer; }
button.secondary { background: transparent; color: var(--w-ink); }
button.link { border-color: transparent; background: transparent; color: var(--w-link); text-decoration: underline; }
button.small { display: inline-block; width: auto; margin: 0 0 0 .25rem; padding: .15rem .5rem; font-size: .85rem; }
button:disabled { opacity: .55; cursor: not-allowed; }
input { width: 100%; padding: .6rem; border: 1px solid var(--w-line); border-radius: var(--w-radius-md);
  background: var(--w-surface); color: var(--w-ink); font: inherit; }
.account ul { padding: 0; list-style: none; }
.account li { padding: .5rem 0; border-bottom: 1px solid var(--w-line); }
.account li small { display: block; color: var(--w-ink-muted); }

/* an icon of the kit: its SVG draws in currentColor, so it is a mask filled with the text colour */
.ico { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -.15em; background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.ico.credit { color: var(--w-credit); }

/* the start page: the artist's start.css, doors.css and start-layout.css (W3, lifted by tools/kits/sync.mjs) style it.
   This file adds only what the build changes: the page fills the window, the glyphs are masks in
   the text colour (the mock-ups' inline SVGs draw in currentColor), the bar stays up while the offline notice is
   hidden (W3's :has(> .notice) also matches a hidden one), the sheet's scrim and its error line, and the app's
   generic button rule kept off W3's buttons. */
/* the motif's entrance plays once per page load (views/start.js adds motif--still from the second insertion on) */
svg.motif--still, svg.motif--still * { animation: none; }
html[data-view="start"] .site-header { display: none; }
html[data-view="start"] main { max-width: none; margin: 0; padding: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.btn { width: auto; margin: 0; }
.sheet::backdrop { background: rgb(0 0 0 / 0.5); }
.sheet__error { margin: 12px 0 0; color: var(--w-danger); font-weight: var(--w-font-ui-weight-strong); }
@media (min-width: 900px) { .page:has(> .notice[hidden]) .bar { top: 22px; } }

/* a universe's shelf and its cards: the kit's frame SVG over the window picture, slots from dlc-card.json */
.banner img { display: block; width: 100%; max-height: 40svh; object-fit: cover; border-radius: var(--w-radius-lg); }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: var(--w-space-4); }
.card { position: relative; display: block; aspect-ratio: var(--card-ratio); color: var(--w-ink); text-decoration: none; container-type: inline-size; }
.card-window { position: absolute; left: var(--window-x); top: var(--window-y); width: var(--window-w); height: var(--window-h); object-fit: cover; }
.card-frame img { position: absolute; inset: 0; width: 100%; height: 100%; }
.card-title { position: absolute; left: var(--title-x); top: var(--title-y); width: var(--title-w); height: var(--title-h);
  overflow: hidden; font: var(--w-font-display-weight) 7cqi/1.15 var(--w-font-display); text-decoration: underline; text-underline-offset: .15em; }
.card[data-state="active"] .card-title { color: var(--w-ground); }
.card-chips { position: absolute; left: var(--chips-x); top: var(--chips-y); width: var(--chips-w); height: var(--chips-h);
  display: flex; justify-content: space-between; align-items: center; gap: .4em; font-size: 4.5cqi; }
.card[data-state="active"] .card-chips { color: var(--w-ground); }
.chip { display: inline-flex; align-items: center; gap: .3em; }
.switch { display: flex; flex-wrap: wrap; gap: var(--w-space-4); margin-top: var(--w-space-6); }

/* a book page */
.book .hook { font: italic var(--w-text-lg)/1.4 var(--w-font-text); color: var(--w-ink-muted); }
.actions { max-width: 24rem; }
.ask p { font-weight: var(--w-font-ui-weight-strong); }
.chapters a { font-family: var(--w-font-text); }
.chapters .ico { margin-left: .4em; color: var(--w-ink-muted); }

/* the reader: the kit's reader.css lays it out; the page adds the top bar, the chapter steps, the progress, and the
   second cue for links in running text (WCAG 1.4.1: the DLC overlays tell links by colour only) */
.rd-top { flex: none; display: flex; align-items: center; height: 56px; padding: 0 var(--w-space-4); background: var(--w-surface);
  border-bottom: 1px solid var(--w-line); }
.rd-text a { text-decoration: underline; text-underline-offset: .15em; }
.rd-steps { display: flex; justify-content: space-between; gap: var(--w-space-4); padding: var(--w-space-5) 0; }
.rd-prog i { width: var(--rd-progress, 0%); }
.rd-prog b { left: var(--rd-progress, 0%); }
.rd-btns .ico { width: 24px; height: 24px; }
.rd-text figure img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
