/* 3dmodels.pc.am — storefront.
   One stylesheet, no framework, no webfont, no CDN. The landing page's job is
   to be fast and to make untextured grey geometry look deliberate. */

:root {
    --bg:        #0d1117;
    --bg-raise:  #161b22;
    --bg-sink:   #0a0e14;
    --line:      #232b36;
    --line-soft: #1b222c;
    --text:      #e6edf3;
    --muted:     #8b98a8;
    --accent:    #58a6ff;
    --accent-dk: #1f6feb;
    --ok:        #3fb950;
    --warn:      #d29922;
    --err:       #f85149;
    --radius:    10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: 2rem; letter-spacing: -.02em; }
h2 { font-size: 1.35rem; letter-spacing: -.01em; }
h3 { font-size: 1rem; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pos { color: var(--ok); }
.neg { color: var(--err); }

/* ── header ───────────────────────────────────────────────── */

.site-head {
    background: var(--bg-sink);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20;
}
.head-inner {
    display: flex; align-items: center; gap: 20px;
    padding-top: 12px; padding-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 22px; height: 22px; border-radius: 5px;
    background: linear-gradient(135deg, var(--accent) 0%, #a371f7 100%);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.brand-text { letter-spacing: -.02em; }

.search { display: flex; flex: 1; max-width: 420px; }
.search input {
    flex: 1; min-width: 0;
    background: var(--bg); border: 1px solid var(--line); color: var(--text);
    padding: 8px 12px; border-radius: var(--radius) 0 0 var(--radius); font-size: .95rem;
}
.search input:focus { outline: none; border-color: var(--accent-dk); }
.search button {
    background: var(--bg-raise); border: 1px solid var(--line); border-left: 0;
    color: var(--muted); padding: 8px 14px; border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer; font-size: .95rem;
}
.search button:hover { color: var(--text); }
.search-big { max-width: 100%; margin-top: 14px; }

.head-nav { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.nav-link { color: var(--muted); font-size: .95rem; }
.nav-link:hover { color: var(--text); text-decoration: none; }
.credit-pill {
    background: var(--bg-raise); border: 1px solid var(--line);
    padding: 3px 10px; border-radius: 999px; font-size: .85rem; color: var(--accent);
}

.cat-bar { border-top: 1px solid var(--line-soft); overflow-x: auto; }
.cat-bar-inner { display: flex; gap: 6px; padding-top: 8px; padding-bottom: 8px; }
.cat-chip {
    white-space: nowrap; font-size: .85rem; color: var(--muted);
    padding: 4px 11px; border-radius: 999px; border: 1px solid transparent;
}
.cat-chip:hover { background: var(--bg-raise); border-color: var(--line); color: var(--text); text-decoration: none; }
.cat-chip em { font-style: normal; opacity: .55; margin-left: 6px; font-size: .8em; }

/* ── buttons ──────────────────────────────────────────────── */

.btn {
    display: inline-block; padding: 9px 16px; border-radius: var(--radius);
    background: var(--bg-raise); border: 1px solid var(--line); color: var(--text);
    font-size: .95rem; cursor: pointer; text-align: center;
}
.btn:hover { border-color: #3d4855; text-decoration: none; }
.btn-sm { padding: 5px 11px; font-size: .85rem; }
.btn-primary { background: var(--accent-dk); border-color: var(--accent-dk); color: #fff; font-weight: 600; }
.btn-primary:hover { background: #388bfd; border-color: #388bfd; }
.btn-block { display: block; width: 100%; }

/* ── home ─────────────────────────────────────────────────── */

.hero { padding: 56px 0 36px; border-bottom: 1px solid var(--line-soft); }
.hero h1 { font-size: 2.6rem; }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 62ch; margin: 0 0 1em; }
.hero-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 26px; }
.hero-points div { font-size: .92rem; color: var(--muted); }
.hero-points strong { display: block; color: var(--text); margin-bottom: 3px; }

.section { padding: 36px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.page-head { padding: 30px 0 18px; }

.empty-state {
    text-align: center; padding: 56px 24px;
    border: 1px dashed var(--line); border-radius: var(--radius); background: var(--bg-sink);
}
.empty-state h2 { color: var(--text); }
.empty-state p { color: var(--muted); max-width: 52ch; margin: 0 auto; }

/* ── grid ─────────────────────────────────────────────────── */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }

.card {
    background: var(--bg-raise); border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden; color: var(--text);
    transition: border-color .12s, transform .12s;
}
.card:hover { border-color: #3d4855; transform: translateY(-2px); text-decoration: none; }
.card-shot { aspect-ratio: 4 / 3; background: var(--bg-sink); display: grid; place-items: center; }
.card-shot img { width: 100%; height: 100%; object-fit: contain; display: block; }
.card-noshot { color: #55606e; font-size: .8rem; }
.card-body { padding: 10px 12px 12px; }
.card-body h3 { font-size: .92rem; font-weight: 600; margin: 0 0 6px; }
.card-meta { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); }
.card-meta .price { color: var(--accent); font-weight: 600; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.cat-card {
    display: block; padding: 16px; border: 1px solid var(--line);
    border-radius: var(--radius); background: var(--bg-raise); color: var(--text);
}
.cat-card:hover { border-color: #3d4855; text-decoration: none; }
.cat-card p { color: var(--muted); font-size: .85rem; margin: 4px 0 10px; }
.cat-count { font-size: .78rem; color: var(--accent); }

.crumbs { padding: 16px 0 0; font-size: .85rem; color: var(--muted); }
.crumbs span { margin: 0 6px; opacity: .5; }
.subcats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.result-count { margin-bottom: 14px; font-size: .85rem; }
.pager { display: flex; gap: 20px; align-items: center; justify-content: center; padding: 30px 0; }

/* ── product page ─────────────────────────────────────────── */

.product { display: grid; grid-template-columns: 1fr 340px; gap: 28px; padding: 18px 0 10px; }
@media (max-width: 860px) { .product { grid-template-columns: 1fr; } }

.viewer {
    aspect-ratio: 4 / 3; width: 100%;
    background: var(--bg-sink); border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden; position: relative;
}
.viewer canvas { display: block; width: 100%; height: 100%; }
.viewer-empty { display: grid; place-items: center; color: var(--muted); }

/* Load failures are reported as failures, never as missing content — five
   working models once stayed invisible for a session because the viewer said
   "not generated yet" (docs/05-VIEWER.md §3). */
.viewer-error {
    position: absolute; inset: 0; display: grid; place-items: center;
    padding: 24px; text-align: center; background: rgba(10,14,20,.94);
}
.viewer-error strong { color: var(--err); display: block; margin-bottom: 6px; }
.viewer-error code { font-size: .78rem; color: var(--muted); word-break: break-all; }

.viewer-bar {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 10px 12px; margin-top: 8px;
    background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius);
    font-size: .85rem;
}
.viewer-bar label { display: flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; }
.viewer-bar button {
    background: var(--bg); border: 1px solid var(--line); color: var(--text);
    padding: 4px 12px; border-radius: 6px; cursor: pointer; font-size: .85rem;
}
.viewer-bar button:hover { border-color: #3d4855; }
.viewer-bar input[type=color] {
    width: 30px; height: 24px; padding: 0; border: 1px solid var(--line);
    border-radius: 5px; background: none; cursor: pointer;
}
.viewer-stats { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.viewer-note { font-size: .8rem; margin-top: 8px; }
.turntable { width: 100%; margin-top: 14px; border-radius: var(--radius); border: 1px solid var(--line); }

.product-buy h1 { font-size: 1.5rem; }
.specs { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; font-size: .87rem; margin: 18px 0; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.buy-box { background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.price-row { display: flex; align-items: baseline; gap: 7px; }
.price-big { font-size: 2.1rem; font-weight: 700; color: var(--accent); line-height: 1; }
.price-unit { color: var(--muted); font-size: .9rem; }
.buy-box form { margin: 14px 0 8px; }
.owned-note { color: var(--ok); font-weight: 600; margin: 0 0 12px; }
.lod-list { display: grid; gap: 8px; }
.btn-dl { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; text-align: left; }
.btn-dl strong { text-transform: uppercase; font-size: .78rem; letter-spacing: .06em; }
.btn-dl .muted { font-size: .78rem; }

.licence-box { margin-top: 16px; font-size: .85rem; }
.licence-box summary { cursor: pointer; color: var(--muted); }
.licence-box p { color: var(--muted); }
.licence-note { border-top: 1px solid var(--line-soft); }

/* ── forms, tables, banners ───────────────────────────────── */

.auth-card {
    max-width: 420px; margin: 48px auto; padding: 28px;
    background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius);
}
.auth-card label { display: block; margin-bottom: 14px; font-size: .88rem; color: var(--muted); }
.auth-card input[type=email], .auth-card input[type=password], .auth-card input[type=text] {
    display: block; width: 100%; margin-top: 5px; padding: 9px 11px;
    background: var(--bg); border: 1px solid var(--line); border-radius: 7px;
    color: var(--text); font-size: .95rem;
}
.auth-card input:focus { outline: none; border-color: var(--accent-dk); }
.hint { display: block; margin-top: 4px; font-size: .78rem; opacity: .7; }

.banner { padding: 11px 14px; border-radius: var(--radius); margin: 14px 0; font-size: .9rem; border: 1px solid; }
.banner-ok   { background: rgba(63,185,80,.1);  border-color: rgba(63,185,80,.35);  color: #7ee787; }
.banner-err  { background: rgba(248,81,73,.1);  border-color: rgba(248,81,73,.35);  color: #ff9a94; }
.banner-warn { background: rgba(210,153,34,.1); border-color: rgba(210,153,34,.35); color: #e3b341; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs a { padding: 9px 15px; color: var(--muted); font-size: .92rem; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }

.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th {
    text-align: left; padding: 9px 12px; color: var(--muted); font-weight: 500;
    border-bottom: 1px solid var(--line); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
.table tbody tr:hover { background: var(--bg-raise); }

.prose { max-width: 68ch; padding: 30px 0 60px; }
.prose h2 { margin-top: 1.7em; }
.prose p { color: var(--muted); }

/* ── footer ───────────────────────────────────────────────── */

.site-foot { border-top: 1px solid var(--line); margin-top: 60px; padding: 28px 0 44px; background: var(--bg-sink); }
.foot-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot-inner p { margin: 4px 0 0; font-size: .87rem; }
.site-foot nav { display: flex; gap: 18px; font-size: .88rem; align-items: flex-start; }

/* ── PCN top-up ───────────────────────────────────────────── */

.pcn-box {
    display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
    background: var(--bg-raise); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px; margin: 18px 0;
}
.pcn-qr { background: #fff; padding: 8px; border-radius: 8px; line-height: 0; }
.pcn-qr img, .pcn-qr canvas { display: block; }
.pcn-addr { flex: 1; min-width: 260px; }
.pcn-addr label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
.pcn-addr code {
    display: block; word-break: break-all; font-size: .92rem; line-height: 1.5;
    background: var(--bg); border: 1px solid var(--line); border-radius: 7px;
    padding: 10px 12px; margin-bottom: 8px; color: var(--text);
}

/* ── wPCN top-up (BEP-20 on BSC) ──────────────────────────── */

/* The pill beside the wPCN heading. It carried the +10% bonus until that was
   repealed on 2026-09-11; it now carries whatever the rail's real advantage is
   -- speed, or a live bonus figure should one ever be posted again. Purely
   presentational: the template decides what goes in it, and renders no
   percentage at all unless /health reports one above zero. */
.badge-bonus {
    display: inline-block; vertical-align: middle; margin-left: 8px;
    padding: 2px 9px; border-radius: 999px;
    background: rgba(63,185,80,.14); border: 1px solid rgba(63,185,80,.4);
    color: #7ee787; font-size: .7rem; font-weight: 600; letter-spacing: .02em;
}

.wpcn-form { margin: 18px 0; }
.wpcn-form label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
.wpcn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.wpcn-row input[type="text"] {
    flex: 1; min-width: 280px;
    background: var(--bg); border: 1px solid var(--line); border-radius: 7px;
    padding: 10px 12px; color: var(--text); font-family: var(--mono, monospace); font-size: .92rem;
}
.wpcn-row input[type="text"]:focus { outline: none; border-color: var(--accent, #58a6ff); }
.wpcn-row .btn { flex: none; }

/* ── third-party sign-in ──────────────────────────────────── */

.btn-google {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 10px 16px; margin-bottom: 4px;
    background: #fff; color: #1f1f1f; border: 1px solid #dadce0; border-radius: var(--radius);
    font-size: .95rem; font-weight: 500; cursor: pointer;
}
.btn-google:hover { background: #f7f8f8; border-color: #d2d5d9; text-decoration: none; }
.btn-google svg { width: 18px; height: 18px; flex: none; }

.auth-or {
    display: flex; align-items: center; gap: 12px;
    margin: 18px 0; color: var(--muted); font-size: .8rem;
}
.auth-or::before, .auth-or::after {
    content: ''; flex: 1; height: 1px; background: var(--line);
}
