/* Layout and structure. Color, type and character live in theme-cards.css. */

@font-face {
  font-family: "Big Shoulders Display";
  font-weight: 700 900;
  font-display: swap;
  src: url("/fonts/big-shoulders-display.woff2") format("woff2");
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--body-size, 16px) / 1.55 var(--body-font);
  caret-color: var(--accent);
}

::selection { background: var(--accent); color: var(--on-accent); }

a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 4px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--display-font); text-wrap: balance; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Top bar */

.top-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; padding-top: 16px; padding-bottom: 16px; }
.brand { font-family: var(--display-font); text-decoration: none; }
.top nav { display: flex; flex-wrap: wrap; gap: 6px; }
.top nav a { text-decoration: none; }

/* Hero: copy and the ID field on the left, the stage on the right. */

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 56px;
  padding-top: 40px;
  padding-bottom: 72px;
}

.hero--solo .hero-grid { grid-template-columns: minmax(0, 1fr); padding-bottom: 32px; }

h1 { margin: 0 0 16px; }
.lede { margin: 0; max-width: 46ch; }

.lookup-form { margin-top: 28px; max-width: 520px; }
.field-row { display: flex; gap: 10px; }
.field-row input { flex: 1; min-width: 0; }

input[type="text"],
input[type="date"],
input[type="time"] { width: 100%; font: inherit; }

button { font: inherit; cursor: pointer; white-space: nowrap; }

.field-error:not([hidden]) { display: inline-block; margin: 12px 0 0; }

.stage { display: grid; justify-items: center; gap: 12px; min-width: 0; }
.hero { overflow-x: clip; }
.note { margin: 0; max-width: 40ch; text-align: center; }

/* Result: the same markup reads as a roster character or a trading card. */

.card { position: relative; min-width: 0; }
.card-name { margin: 0; overflow-wrap: anywhere; }
.card-handle, .card-tier, .card-note { margin: 0; }
.card-avatar { display: block; width: 100%; height: 100%; object-fit: cover; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.card-foil { display: none; }

/* Recent lookups */

.collection ul { display: flex; flex-wrap: wrap; gap: 16px; margin: 0; padding: 0; list-style: none; }
.cell { display: grid; justify-items: center; gap: 6px; padding: 0; border: 0; background: none; color: inherit; }
.cell span { max-width: 96px; overflow: hidden; text-overflow: ellipsis; }

/* Extras under the hero: full-size images and the snowflake breakdown. */

.extras { display: grid; gap: 16px; padding-top: 32px; padding-bottom: 8px; }
.assets { display: grid; gap: 16px; }
.asset h3 { margin: 0 0 8px; }
.asset img { display: block; max-width: 100%; }
.asset-links { margin: 8px 0 0; }
.tech summary { cursor: pointer; }
.tech .facts { margin-top: 12px; }

/* Timestamp generator */

.tool { margin-bottom: 24px; }
.ts-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ts-fields label { display: block; margin-bottom: 6px; }
.ts-list { display: grid; gap: 10px; margin-top: 16px; }
.ts-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ts-label, .ts-preview { margin: 0; }
.hint { margin: 12px 0 0; }

/* Reading sections */

.band { padding: 56px 0; }
.prose h2 { margin: 0 0 14px; }
.prose h3 { margin: 0 0 8px; }
.prose p { margin: 0 0 12px; max-width: 68ch; }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 22px; max-width: 68ch; }
.prose li { margin-bottom: 6px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 20px; }
.faq details { max-width: 68ch; }
.faq summary { cursor: pointer; }
.faq details p { margin: 10px 0 0; }

.foot { padding: 28px 0; }
.foot-inner { display: grid; gap: 10px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot nav a { color: inherit; }
.foot p { margin: 0; }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: 24px; padding-bottom: 48px; }
  .two-col, .ts-fields { grid-template-columns: 1fr; }
  .band { padding: 40px 0; }
}

@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .field-row { flex-direction: column; }
  .field-row input { flex: none; }
}

.legal h2 { margin-top: 32px; }
.legal h2:first-child { margin-top: 0; }
