/* Art2Artifact — app-style public site. Phone first; two panes from 900px up. */
:root {
  --maroon: #760000; --maroon-d: #590000; --gold: #f4c542; --gold-d: #b8860b;
  --ink: #1d1d22; --muted: #55555e; --label: #1b2a78; --line: #e4dcd8; --bg: #fbf8f5; --card: #fff;
  --font: "Open Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --bar-h: 56px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--font); }
img { max-width: 100%; height: auto; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--maroon); }
:focus-visible { outline: 3px solid var(--gold-d); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- splash ---------- */
#splash { position: fixed; inset: 0; z-index: 50; background: var(--maroon); display: grid; place-items: center;
          cursor: pointer; transition: opacity .35s; }
#splash.hide { opacity: 0; pointer-events: none; }
#splash svg { width: min(78vw, 420px); height: auto; grid-area: 1/1; }
.splash-title { grid-area: 1/1; text-align: center; color: var(--gold); font-size: clamp(18px, 5vw, 26px); line-height: 1.3; font-weight: 700; }
.splash-title strong { display: block; margin-bottom: .9em; font-size: 1.1em; }
.splash-title span { display: block; font-size: 1.05em; }

/* ---------- panes ---------- */
.app { min-height: 100vh; }
.pane { min-width: 0; }
body.view-list .pane-detail, body.view-detail .pane-list { display: none; }
.pane-detail:focus { outline: none; }

/* ---------- app bar ---------- */
.appbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px;
          height: var(--bar-h); padding: 0 8px 0 12px; background: var(--maroon); color: #fff; }
.appbar h1, .appbar .bar-title { flex: 1; margin: 0; font-size: 21px; font-weight: 600; line-height: 1.2;
          white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar a.bar-title { color: #fff; text-decoration: none; }
.bar-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; height: 44px;
           padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: #fff; font-size: 15px;
           font-weight: 600; text-decoration: none; cursor: pointer; }
.bar-btn:hover { background: rgba(255,255,255,.15); }
.bar-btn svg { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bar-btn[disabled] { opacity: .35; cursor: default; }
.bar-btn.outline { border: 1.5px solid rgba(255,255,255,.7); }

/* ---------- list pane ---------- */
.toolbar { display: grid; gap: 10px; padding: 12px; background: var(--card); border-bottom: 1px solid var(--line); }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; width: 22px; height: 22px; margin-top: -11px; stroke: var(--label); fill: none; stroke-width: 2; stroke-linecap: round; }
.search input { width: 100%; height: 46px; padding: 0 12px 0 44px; border: 0; border-bottom: 2px solid var(--label); background: #f4f1ee; border-radius: 6px 6px 0 0; font-size: 17px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; font-size: 15px; }
.controls label { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); }
.controls select { height: 40px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; background: #fff; }
.seg { display: inline-flex; border: 1px solid var(--maroon); border-radius: 8px; overflow: hidden; }
.seg button { height: 40px; padding: 0 14px; border: 0; background: #fff; color: var(--maroon); font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--maroon); color: #fff; }
.count { padding: 10px 14px 0; font-size: 14px; color: var(--muted); }

.coin-list { list-style: none; margin: 0; padding: 4px 0 40px; }
.coin-row a { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line);
              color: inherit; text-decoration: none; border-left: 4px solid transparent; }
.coin-row a:hover { background: #f3eeea; }
.coin-row a[aria-current="page"] { border-left-color: var(--maroon); background: #f6ecea; }
.coin-row img { width: 72px; height: 72px; object-fit: contain; flex: none; }
.coin-row .t { display: block; font-size: 18px; font-weight: 600; line-height: 1.3; }
.coin-row .r { display: block; font-size: 15px; color: var(--maroon); }
.coin-row .s { display: block; font-size: 15px; color: var(--muted); line-height: 1.4; margin-top: 2px;
               display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chev { margin-left: auto; width: 20px; height: 20px; flex: none; stroke: #9a9aa2; fill: none; stroke-width: 2; }

.cards .coin-row a { display: block; padding: 16px 16px 20px; }
.cards .coin-row img { width: min(100%, 260px); height: auto; margin: 0 auto 10px; display: block; }
.cards .coin-row .s { -webkit-line-clamp: 5; font-size: 16px; color: var(--ink); }
.cards .chev { display: none; }
.empty { padding: 32px 18px; color: var(--muted); text-align: center; }

/* ---------- detail pane ---------- */
.detail-head { position: sticky; top: 0; z-index: 20; }
.sections { display: flex; background: var(--maroon-d); overflow-x: auto; scrollbar-width: none; }
.sections a { flex: 1 0 auto; text-align: center; padding: 12px 16px; color: #f2dede; text-decoration: none; font-weight: 600;
              font-size: 16px; border-bottom: 4px solid transparent; white-space: nowrap; min-height: 48px; }
.sections a[aria-current="page"] { color: #fff; border-bottom-color: var(--gold); background: rgba(255,255,255,.08); }
.sections a:hover { background: rgba(255,255,255,.12); }
.sections small { font-weight: 400; opacity: .85; }

.content { max-width: 820px; margin: 0 auto; padding: 18px 16px 90px; }
.content h2 { margin: 0 0 2px; font-size: 26px; line-height: 1.25; color: var(--maroon); }
.by { margin: 0 0 18px; font-size: 16px; color: var(--muted); }
.by b { color: var(--ink); }
.label { display: block; margin: 26px 0 6px; font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--label); }
.prose p { margin: 0 0 1em; }
.prose { font-size: 17.5px; }
.faces { display: grid; grid-template-columns: 1fr; gap: 16px; }
.face { margin: 0; text-align: center; }
.face button, .gallery button, .big button { padding: 0; border: 0; background: none; cursor: zoom-in; }
.face img { max-height: 340px; width: auto; margin: 0 auto; }
figcaption { font-size: 15px; color: var(--muted); margin-top: 6px; }
.figlabel { font-size: 14px; font-weight: 700; color: var(--label); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }
.map img { width: 100%; max-width: 520px; margin: 0 auto; display: block; border-radius: 6px; }
.gallery { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 16px 0; }
.gallery img { max-height: 160px; width: auto; border-radius: 4px; }
.big { text-align: center; margin: 12px 0; }
.big img { max-height: 380px; width: auto; margin: 0 auto 10px; }
.big.several { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

.sym-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.sym-list a { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px;
              background: var(--card); color: inherit; text-decoration: none; }
.sym-list a:hover { border-color: var(--maroon); }
.sym-list img { width: 84px; height: 84px; object-fit: contain; flex: none; }
.sym-list .n { display: block; font-size: 13px; font-weight: 700; color: var(--label); letter-spacing: .06em; text-transform: uppercase; }
.sym-list .t { display: block; font-size: 18px; font-weight: 600; line-height: 1.3; }
.sym-list .s { display: block; font-size: 15px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 30px; }
.pager a { display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 16px; border: 1.5px solid var(--maroon);
           border-radius: 8px; color: var(--maroon); font-weight: 600; text-decoration: none; }
.pager a:hover { background: var(--maroon); color: #fff; }
.pager .gap { flex: 1; }
.crumb { display: inline-block; margin-bottom: 12px; font-size: 15px; font-weight: 600; }

.welcome { display: none; }

/* lightbox */
#lightbox { border: 0; padding: 14px; max-width: min(96vw, 900px); background: #fff; border-radius: 10px; text-align: center; }
#lightbox::backdrop { background: rgba(0,0,0,.75); }
#lightbox img { max-height: 80vh; width: auto; margin: 0 auto; }
#lightbox p { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.lb-close { position: absolute; right: 6px; top: 2px; border: 0; background: none; font-size: 34px; line-height: 1; cursor: pointer; color: var(--maroon); width: 44px; height: 44px; }

/* ---------- tablet ---------- */
@media (min-width: 600px) {
  .faces { grid-template-columns: 1fr 1fr; }
  .content { padding-left: 28px; padding-right: 28px; }
  .cards .coin-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; padding: 14px; }
  .cards .coin-row a { border: 1px solid var(--line); border-radius: 10px; background: var(--card); height: 100%; }
}

/* ---------- desktop: list + detail side by side ---------- */
@media (min-width: 900px) {
  body.view-list .pane-detail, body.view-detail .pane-list { display: block; }
  .app { display: grid; grid-template-columns: minmax(340px, 420px) 1fr; height: 100vh; overflow: hidden; }
  .pane { height: 100vh; overflow-y: auto; }
  .pane-list { border-right: 1px solid var(--line); background: var(--card); }
  .pane-list .cards .coin-list { display: block; padding: 4px 0 40px; }
  .pane-list .cards .coin-row a { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  .back-btn { display: none !important; }
  .welcome { display: block; padding: 60px 32px; text-align: center; max-width: 560px; margin: 0 auto; color: var(--muted); }
  .welcome h2 { color: var(--maroon); font-size: 30px; }
}
@media (min-width: 1200px) { .prose { font-size: 18px; } .content { padding: 26px 40px 90px; } }
@media (prefers-reduced-motion: reduce) { #splash { transition: none; } }
@media print { .appbar, .sections, .toolbar, .pane-list, .pager { display: none !important; } .pane-detail { display: block !important; } .app { display: block; height: auto; overflow: visible; } .pane { height: auto; overflow: visible; } }
