/* SCREEMO museum styles.
   Dark by default, one accent, no framework. Colours come from custom properties so
   the whole thing can be re-themed without touching a selector. */

:root {
  --bg:        #0d0b0a;
  --bg-2:      #151110;
  --bg-3:      #1e1917;
  --line:      #2e2622;
  --fg:        #f2ece6;
  --fg-2:      #b8aca2;
  --fg-3:      #7d726a;
  --accent:    #e8503a;
  --accent-2:  #f0a030;
  --ok:        #4fb477;
  --radius:    10px;
  --maxw:      1400px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf7f4; --bg-2: #f2ece6; --bg-3: #e8dfd7;
    --line: #d8ccc0; --fg: #1a1512; --fg-2: #4a3f38; --fg-3: #7d726a;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px;
}
.skip:focus { left: 8px; top: 8px; }

:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* ------------------------------- topbar ------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 20px;
  padding: 12px max(20px, calc((100vw - var(--maxw)) / 2));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1.1; }
.brand-mark { font-weight: 800; letter-spacing: 0.14em; font-size: 15px; }
.brand-sub { font-size: 11px; color: var(--fg-3); letter-spacing: 0.06em; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  text-decoration: none; color: var(--fg-2); font-size: 14px;
  padding: 8px 12px; border-radius: 999px;
}
.nav a:hover { color: var(--fg); background: var(--bg-3); }
#walletBtn { margin-left: 8px; }

/* ------------------------------- buttons ------------------------------ */
.btn {
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 10px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--fg);
  transition: transform 0.08s ease, background 0.15s ease, opacity 0.15s ease;
}
.btn:hover:not(:disabled) { background: var(--bg-3); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); background: var(--accent); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.linkish {
  background: none; border: none; color: var(--accent); font: inherit;
  cursor: pointer; text-decoration: underline; padding: 0;
}

/* -------------------------------- hero -------------------------------- */
/* Single centred column: headline, then the art strip beneath it, not beside it.
 * The two-column hero put art on the right where it dominated the first screen. */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: 72px max(20px, 3vw) 64px;
  display: block; text-align: center;
}
.hero-copy { max-width: 720px; margin: 0 auto; }
.hero-actions { justify-content: center; }
.hero-facts { justify-content: center; }
.eyebrow {
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-3); margin: 0 0 18px;
}
.hero h1 {
  font-size: clamp(44px, 7vw, 86px); line-height: 0.95; margin: 0 0 26px;
  letter-spacing: -0.03em; font-weight: 800;
}
.lede { color: var(--fg-2); font-size: 17px; max-width: 56ch; margin: 0 0 16px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 30px 0 40px; }

.hero-facts { display: flex; gap: 34px; flex-wrap: wrap; margin: 0; }
.hero-facts div { display: flex; flex-direction: column; }
.hero-facts dt {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3);
}
.hero-facts dd { margin: 2px 0 0; font-size: 20px; font-weight: 700; }

/* Hero art: small and centred under the headline.
 *
 * It was a two-up tilted stack filling the right half of the hero, which read as a
 * banner and pushed the actual work below the fold. Now it is a discreet strip of four
 * pieces sitting centred in the hero's lower band - present, but not shouting. */
.hero-stack {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 420px;
  margin: 34px auto 0;
}
.hero-stack img {
  width: 100%; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--bg-2); aspect-ratio: 1; opacity: .82;
}
.hero-stack img:nth-child(1) { transform: rotate(-1.5deg); }
.hero-stack img:nth-child(2) { transform: rotate(1.5deg); }

@media (min-width: 900px) {
  .hero-stack { grid-template-columns: repeat(4, 1fr); }
}

/* ------------------------------ sections ------------------------------ */
.section {
  max-width: var(--maxw); margin: 0 auto;
  padding: 80px max(20px, 3vw);
  border-top: 1px solid var(--line);
}
.section-alt { background: var(--bg-2); max-width: none; }
.section-alt > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section-head { margin-bottom: 36px; max-width: 70ch; }
.section-head h2 { font-size: clamp(28px, 4vw, 42px); margin: 0 0 12px; letter-spacing: -0.02em; }
.section-sub { color: var(--fg-2); margin: 0; font-size: 16px; }
.muted { color: var(--fg-2); }
.fine { font-size: 13px; }
.mono { font-family: var(--mono); }
.empty { text-align: center; color: var(--fg-2); padding: 60px 0; }

/* ------------------------------ controls ------------------------------ */
.controls {
  position: sticky; top: 61px; z-index: 30;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 28px;
}
.control-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
.control { display: flex; flex-direction: column; gap: 5px; }
.control > span {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-3);
}
.control input, .control select {
  font: inherit; font-size: 14px; padding: 9px 12px;
  background: var(--bg-2); color: var(--fg);
  border: 1px solid var(--line); border-radius: 8px; width: 100%;
}
.control input:focus, .control select:focus { border-color: var(--accent); outline: none; }

.filter-more { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.filter-more > summary {
  cursor: pointer; font-size: 13px; color: var(--fg-2); font-weight: 600;
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.filter-more > summary::-webkit-details-marker { display: none; }
.filter-more > summary::before { content: "\25B8"; transition: transform 0.15s; }
.filter-more[open] > summary::before { transform: rotate(90deg); }
.pill {
  background: var(--accent); color: #fff; border-radius: 999px;
  padding: 1px 8px; font-size: 11px; font-weight: 700;
}
.filter-traits {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px; margin: 16px 0; max-height: 420px; overflow-y: auto; padding-right: 6px;
}
.ftrait { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--bg-2); }
.ftrait h4 {
  margin: 0 0 8px; font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--fg-3);
}
.fvals { display: flex; flex-wrap: wrap; gap: 5px; }
.fval {
  font: inherit; font-size: 12px; cursor: pointer;
  background: var(--bg-3); color: var(--fg-2);
  border: 1px solid transparent; border-radius: 999px; padding: 3px 9px;
}
.fval:hover { color: var(--fg); }
.fval[aria-pressed="true"] { background: var(--accent); color: #fff; }
.fval small { opacity: 0.7; margin-left: 4px; }

.control-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.count { margin: 0; font-size: 13px; color: var(--fg-3); }

/* ------------------------------- gallery ------------------------------ */
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2); overflow: hidden; cursor: pointer;
  text-align: left; padding: 0; font: inherit; color: inherit;
  transition: transform 0.12s ease, border-color 0.15s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card-art { position: relative; aspect-ratio: 1; background: var(--bg-3); }
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.card-tier {
  position: absolute; top: 8px; left: 8px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.1em;
  background: rgba(0, 0, 0, 0.72); color: #fff;
  padding: 3px 7px; border-radius: 4px;
}
.tier-LEGEND  { background: #d4af37; color: #1a1512; }
.tier-OUTLAW  { background: #b5651d; color: #fff; }
.tier-MANIAC  { background: #a8341f; color: #fff; }
.tier-RIOTER  { background: #d1442a; color: #fff; }
.tier-SCREAKER { background: #e8503a; color: #fff; }
.tier-LOUD    { background: #6b4ea8; color: #fff; }
.tier-STRAY   { background: #4a6b7c; color: #fff; }
.tier-MUTT    { background: #3f3a36; color: #ddd; }

.card-meta { padding: 10px 12px 12px; }
.card-id { font-size: 13px; font-weight: 700; font-family: var(--mono); }
.card-sub {
  font-size: 11px; color: var(--fg-3); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* -------------------------------- table ------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--bg-3); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); position: sticky; top: 0; }
tbody tr:hover { background: var(--bg-2); cursor: pointer; }

/* ------------------------------- museum ------------------------------- */
.chapter-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.chapter-btn {
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--bg-3); color: var(--fg-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px;
}
.chapter-btn[aria-selected="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }

.chapter { margin-bottom: 40px; }
.chapter h3 { font-size: 22px; margin: 0 0 6px; }
.chapter > p { color: var(--fg-2); margin: 0 0 20px; max-width: 70ch; }
.mt-trait { margin-bottom: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.mt-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.mt-head h4 { margin: 0 0 4px; font-size: 16px; }
.mt-head p { margin: 0; font-size: 13px; color: var(--fg-2); max-width: 80ch; }
.mt-values { display: flex; flex-wrap: wrap; gap: 7px; padding: 14px 16px; }
.mt-v {
  display: inline-flex; align-items: baseline; gap: 7px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 10px; font-size: 12px; cursor: pointer;
}
.mt-v:hover { border-color: var(--accent); }
.mt-v b { font-weight: 600; }
.mt-v span { font-family: var(--mono); font-size: 11px; color: var(--fg-3); }
.mt-v[data-band="legendary"] { border-color: var(--accent-2); }
.mt-v[data-band="legendary"] span { color: var(--accent-2); }

/* ------------------------------- rarity ------------------------------- */
.tier-board { display: grid; gap: 10px; margin-bottom: 44px; }
.tier-row { display: grid; grid-template-columns: 110px 1fr 120px; gap: 14px; align-items: center; }
.tier-name { font-weight: 700; font-size: 13px; letter-spacing: 0.06em; }
.tier-bar { height: 26px; background: var(--bg-3); border-radius: 4px; overflow: hidden; }
.tier-fill { height: 100%; background: var(--accent); border-radius: 4px; min-width: 2px; }
.tier-num { font-family: var(--mono); font-size: 12px; color: var(--fg-2); text-align: right; }

.trait-bars { display: grid; gap: 10px; }
.tb-row { display: grid; grid-template-columns: 150px 1fr 90px; gap: 14px; align-items: center; font-size: 13px; }
.tb-label { color: var(--fg-2); }
.tb-bar { height: 8px; background: var(--bg-3); border-radius: 4px; overflow: hidden; }
.tb-fill { height: 100%; background: var(--accent-2); }
.tb-num { font-family: var(--mono); font-size: 12px; color: var(--fg-3); text-align: right; }

/* -------------------------------- mint -------------------------------- */
.mint-status {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 24px; font-size: 14px; background: var(--bg);
}
.mint-status[data-state="live"] { border-color: var(--ok); }
.mint-status[data-state="wl"] { border-color: var(--accent-2); }
.mint-status[data-state="closed"] { border-color: var(--line); color: var(--fg-2); }

.mint-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.mint-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--bg); }
.mint-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mint-card h3 { margin: 0; font-size: 20px; }
.tag {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--bg-3); color: var(--fg-2); border-radius: 999px; padding: 4px 10px;
}
.tag-wl { background: var(--accent-2); color: #1a1512; }
.big { font-size: 26px; font-weight: 800; margin: 14px 0 10px; letter-spacing: -0.02em; }
.mint-card .control { margin: 18px 0 14px; }
.result { font-size: 13px; margin: 12px 0 0; min-height: 1.4em; }
.result.ok { color: var(--ok); }
.result.err { color: var(--accent); }

.plain { margin-top: 28px; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 16px; }
.plain > summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 14px; }
.plain code { font-family: var(--mono); font-size: 12px; background: var(--bg-3); padding: 2px 6px; border-radius: 4px; }

/* ------------------------------- safety ------------------------------- */
.safety-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.safety-col { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--bg); }
.safety-col.good { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.safety-col.honest { border-color: color-mix(in srgb, var(--accent-2) 45%, var(--line)); }
.safety-col h3 { margin: 0 0 14px; font-size: 18px; }
.safety-col ul { margin: 0; padding-left: 20px; color: var(--fg-2); }
.safety-col li { margin-bottom: 8px; }
.safety-col p { color: var(--fg-2); }

/* ------------------------------- dialogs ------------------------------ */
.dialog {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--fg);
  padding: 24px; max-width: min(940px, 94vw); width: 100%;
}
.dialog::backdrop { background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(3px); }
.dialog-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; color: var(--fg-2);
  font-size: 26px; line-height: 1; cursor: pointer; padding: 4px 8px;
}
.dialog-close:hover { color: var(--fg); }
.dialog-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.dialog-art img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.dialog-info h2 { margin: 4px 0 16px; font-size: 26px; }
.dlg-traits { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 13px; }
.dlg-traits dt { color: var(--fg-3); letter-spacing: 0.04em; }
.dlg-traits dd { margin: 0; }

.wallet-list { display: flex; flex-direction: column; gap: 8px; margin: 18px 0; }
.wallet-btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  font: inherit; font-size: 15px; text-align: left; cursor: pointer;
  background: var(--bg-2); color: var(--fg);
  border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px;
}
.wallet-btn:hover { border-color: var(--accent); background: var(--bg-3); }
.wallet-btn img { width: 26px; height: 26px; border-radius: 6px; }

/* ------------------------------- footer ------------------------------- */
.footer { border-top: 1px solid var(--line); padding: 56px max(20px, 3vw); }
.footer-grid {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 32px;
}
.footer-grid a { display: block; font-size: 14px; color: var(--fg-2); text-decoration: none; margin-bottom: 6px; }
.footer-grid a:hover { color: var(--accent); }
.footer-h { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); margin: 0 0 10px; }
.footer-note { max-width: 80ch; margin: 40px auto 0; font-size: 12px; text-align: center; }

/* ------------------------------ responsive ---------------------------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 48px; gap: 40px; }
  .control-grid { grid-template-columns: 1fr; }
  .controls { position: static; }
  .dialog-body { grid-template-columns: 1fr; }
  .nav { display: none; }
  .tier-row { grid-template-columns: 84px 1fr 92px; }
  .tb-row { grid-template-columns: 110px 1fr 72px; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .hero-facts { gap: 20px; }
  .hero h1 { font-size: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .card:hover, .btn:active { transform: none; }
}

/* --------------------------------------------------------- eligibility popup */
.dialog-wide { max-width: 640px; }

.elig-head { text-align: center; margin-bottom: 1.25rem; }
.elig-badge {
  display: inline-block; font-weight: 800; letter-spacing: .14em;
  font-size: .82rem; padding: .45rem 1rem; border-radius: 999px;
  border: 1px solid var(--line);
}
.elig-head.yes .elig-badge { background: #0d3b2a; border-color: #2f7d5c; color: #7ee2b0; }
.elig-head.no  .elig-badge { background: #2b2620; border-color: #6b5a3c; color: #e2c07e; }
.elig-wallet { font-family: var(--mono); font-size: .78rem; opacity: .7;
  word-break: break-all; margin: .5rem 0 0; }

.elig-sums { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem;
  margin-bottom: 1.4rem; }
.elig-sums > div { background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: .9rem; text-align: center; }
.elig-sums .n { display: block; font-size: 2rem; font-weight: 800; line-height: 1.1; }
.elig-sums .l { display: block; font-size: .72rem; opacity: .65; margin-top: .3rem;
  text-transform: uppercase; letter-spacing: .08em; }

.elig-list { list-style: none; padding: 0; margin: 0 0 1.4rem;
  max-height: 300px; overflow-y: auto; }
.elig-list li { display: flex; align-items: baseline; gap: .6rem;
  padding: .5rem .2rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
.elig-list li.held { color: #7ee2b0; font-weight: 600; }
.elig-list li.not-held { opacity: .45; }
.elig-list .tick { width: 1rem; font-weight: 800; }
.elig-list .how { margin-left: auto; font-size: .68rem; opacity: .7;
  text-transform: uppercase; letter-spacing: .06em; }

.elig-money { display: grid; grid-template-columns: auto 1fr; gap: .55rem 1rem;
  margin: 0 0 1rem; font-size: .88rem; }
.elig-money dt { opacity: .6; }
.elig-money dd { margin: 0; }

.elig-actions { margin-top: 1.2rem; text-align: right; }
.result.warn { color: #e2c07e; }
.small { font-size: .76rem; }

/* Gallery paging. The sentinel is an invisible marker the IntersectionObserver watches,
 * so the next page of art is requested only as the user nears the end of what's shown.
 * Without it the browser's per-host connection cap leaves cards permanently blank. */
.gallery-more { height: 1px; margin: 8px 0; }
.gallery-count { text-align: center; margin: 18px 0 0; }

/* Centring overrides for the single-column hero. */
.hero-facts { display: flex; flex-wrap: wrap; gap: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-art { margin-top: 0; }
