/* ============================================================
   Public crawlable pages - /shop and /listing/<slug>
   Deliberately separate from style.css, which owns the Game Boy UI.
   Same palette so the two halves feel like one site.
   ============================================================ */

:root {
    --ink: #0a0a0a;
    --panel: #161616;
    --panel-2: #1e1e1e;
    --line: #333;
    --green: #b2f2bb;
    --green-dim: #6dbb7a;
    --text: #e8e8e8;
    --muted: #9a9a9a;
    --red: #ff6b6b;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background-color: var(--ink);
    /* "Axiom" from transparenttextures.com - an 81px tile of faint light lines,
       re-hosted here as the site asks rather than hotlinked. */
    background-image: url('textures/axiom-pattern.png');
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--green); }

img { max-width: 100%; display: block; }

@font-face {
    font-family: 'GameboyFont';
    src: url('/static/fonts/pixel-font.ttf') format('truetype');
    font-display: optional;
}

/* ---------- header / footer ---------- */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: 18px 24px;
    border-bottom: 2px solid var(--line);
    background: var(--panel);
}

.brand {
    font-family: 'GameboyFont', monospace;
    font-size: 22px;
    letter-spacing: 1px;
    color: var(--green);
    text-decoration: none;
}

.site-nav { display: flex; gap: 20px; }
.site-nav a { text-decoration: none; font-size: 14px; }
.site-nav a:hover { text-decoration: underline; }

.site-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

/* ============================================================
   LANDING PAGE
   ============================================================ */

/* Copy on the left, the demo Game Boy on the right; stacked on small screens. */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 36px 56px;
    padding: 48px 0 40px;
    border-bottom: 1px solid var(--line);
}

.hero-copy { min-width: 0; }

@media (max-width: 780px) {
    .hero { grid-template-columns: minmax(0, 1fr); }
    .hero-console { justify-self: center; }
}

.hero-eyebrow {
    margin: 0 0 14px;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--green-dim);
}

.hero h1 {
    font-family: 'GameboyFont', monospace;
    font-size: clamp(30px, 6vw, 52px);
    line-height: 1.15;
    color: var(--green);
    margin: 0 0 20px;
}

.hero-lede {
    max-width: 58ch;
    font-size: 15px;
    color: var(--muted);
    margin: 0 0 30px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: stretch;
    margin-bottom: 26px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    background: var(--green);
    color: #0a0a0a;
    font-weight: bold;
    text-decoration: none;
    padding: 16px 26px;
    border: 2px solid var(--green);
    font-size: 15px;
}

.btn-primary:hover { background: #51cf66; border-color: #51cf66; }

/* The console CTA is deliberately not styled as a plain button - it should read
   as a doorway into something different, not a second identical action. */
.btn-console {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text);
    background: var(--panel);
    border: 2px solid var(--line);
    padding: 12px 22px 12px 16px;
    transition: border-color .15s ease, background .15s ease;
}

.btn-console:hover { border-color: var(--green); background: var(--panel-2); }
.btn-console strong { display: block; font-size: 14px; color: var(--green); }
.btn-console small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

.btn-console-icon {
    font-size: 9px;
    line-height: 1.15;
    letter-spacing: 1px;
    color: var(--green-dim);
    text-align: center;
    white-space: nowrap;
}

.btn-console.large { padding: 18px 30px 18px 22px; }
.btn-console.large strong { font-size: 16px; }

.hero-trust {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 12px;
    color: var(--muted);
}

.hero-trust li::before { content: '✓ '; color: var(--green); }

/* ---------- hero demo Game Boy ----------
   Positions are percentages of the SP's body inside gbasp.png: 297 x 553
   artwork pixels starting at 252,28 on its 800 x 600 canvas. Measured from the
   artwork - the transparent screen opening is 216 x 143 at 295,76 - and the
   D-pad and A centres match the /play button zones in style.css. */

.hero-console {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 250px;
    text-decoration: none;
    color: var(--muted);
}

.hero-console:focus-visible { outline: 2px solid var(--green); outline-offset: 8px; }

.demo-device {
    position: relative;
    width: 100%;
    aspect-ratio: 297 / 553;
    isolation: isolate;             /* keeps the shadow's z-index: -1 inside the device */
}

/* A soft floor shadow. Not a filter on the artwork: that would also cast a
   shadow into the transparent screen opening. */
.demo-device::after {
    content: '';
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: -4%;
    height: 6%;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, .7), transparent 70%);
    z-index: -1;
}

/* The screen sits behind the artwork, 1px larger than the opening on every
   side, so the bezel frames it. It is also the size container: the cqw units
   below are percentages of its width, so the text scales with the console. */
.demo-screen {
    position: absolute;
    left: 14.141%;
    top: 8.499%;
    width: 73.401%;
    height: 26.221%;
    overflow: hidden;
    scroll-behavior: smooth;
    background: #b2f2bb;
    color: #222;
    font-family: monospace;
    line-height: 1.2;
    container-type: inline-size;
}

/* The artwork's canvas is far wider than the SP itself; this box crops it to
   the console so its transparent margins cannot widen the page. */
.demo-body {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.demo-shell {
    position: absolute;
    left: -84.848%;
    top: -5.063%;
    width: 269.360%;
    max-width: none;                /* overrides the global img { max-width: 100% } */
    height: auto;
    user-select: none;
}

/* Sizes copy the real menu (16px text, 6px padding on a 218px screen), with
   px fallbacks for browsers without container units. */
.demo-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 12px;
    font-size: 7.339cqw;
}

.demo-menu li {
    padding: 4px;
    padding: 2.752cqw;
    overflow-wrap: anywhere;        /* long titles wrap, as in the real menu */
}

.demo-menu li.is-active { background: #444; color: #fff; }
.demo-menu.is-message { padding-top: 9cqw; text-align: center; }
/* Same layout as the real menu's row-split rows (style.css): the value sits
   beside a short title and right-aligned under a long one. */
.demo-menu li.row-split {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 1cqw 5.5cqw;               /* the real menu's 2px and 12px */
}

.demo-menu .meta { margin-left: auto; font-size: .85em; opacity: .8; white-space: nowrap; }
.demo-menu .is-empty .meta { opacity: .45; }
.demo-menu .is-out .meta,
.demo-menu .icon { color: #a33; opacity: 1; }
.demo-menu .icon { font-weight: bold; margin-right: 2cqw; }
.demo-menu .is-out.is-active .meta,
.demo-menu .is-out.is-active .icon { color: #f99; }
.demo-menu .title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-menu .photo { text-align: center; padding: 1cqw; }
.demo-menu .photo img {
    display: inline-block;
    max-height: 32cqw;              /* with a one-line title and the price, fits the screen */
    max-width: 100%;
    object-fit: contain;
    border: 1px solid #444;
    background: #222;
}
.demo-menu .notice { text-align: center; }

/* Ghost presses: the D-pad and A light up as the demo uses them. */
.demo-press {
    position: absolute;
    width: 11.448%;                 /* about 34 artwork pixels */
    aspect-ratio: 1;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(178, 242, 187, .95) 0%,
                rgba(178, 242, 187, .45) 40%, transparent 70%);
    opacity: 0;
    transition: opacity .1s ease;
    pointer-events: none;
}

.demo-press.is-pressed { opacity: 1; }
.demo-down { left: 26.599%; top: 74.684%; }
.demo-a    { left: 82.828%; top: 68.716%; }

/* "Press to play" sits on the hinge. Shown on hover or keyboard focus, and
   always on touch screens, which have no hover. */
.demo-hint {
    position: absolute;
    left: 50%;
    top: 49.186%;
    transform: translate(-50%, -50%);
    padding: 3px 10px;
    background: var(--green);
    color: var(--ink);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    transition: opacity .15s ease;
    pointer-events: none;
}

.hero-console:hover .demo-hint,
.hero-console:focus-visible .demo-hint { opacity: 1; }

@media (hover: none) { .demo-hint { opacity: 1; } }

.demo-caption {
    margin: 0;
    max-width: 250px;
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
}

.demo-caption strong { display: block; color: var(--green); font-size: 13px; }

@media (max-width: 780px) {
    .hero-console { width: 210px; }
}

/* ---------- bands ---------- */

.band { padding: 40px 0; border-bottom: 1px solid var(--line); }
.band:last-of-type { border-bottom: none; }

.band-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.band-head h2 {
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--green);
    margin: 0;
}

.band-head a { font-size: 13px; text-decoration: none; }
.band-head a:hover { text-decoration: underline; }

.band-lede { max-width: 60ch; color: var(--muted); margin: -6px 0 24px; }

/* ---------- process ---------- */

.process {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.process li {
    background: var(--panel);
    border: 1px solid var(--line);
    border-top: 2px solid var(--green-dim);
    padding: 16px;
}

.process .step {
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--green-dim);
}

.process h3 { font-size: 14px; margin: 6px 0 6px; color: var(--text); }
.process p { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- marketplace reviews ---------- */

.review-grid {
    list-style: none;
    padding: 0;
    margin: 0 0 18px;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.review-card a {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
    padding: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    text-decoration: none;
    color: var(--text);
    transition: border-color .15s ease;
}

.review-card a:hover { border-color: var(--green); }

.review-platform {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--green-dim);
}

.review-rating {
    font-size: 19px;
    font-weight: bold;
    display: flex;
    align-items: baseline;
    gap: 7px;
    flex-wrap: wrap;
}

.review-rating .stars { color: var(--green); font-size: 14px; letter-spacing: 1px; }
.review-sales { font-size: 12px; font-weight: normal; color: var(--muted); }
.review-note { font-size: 12px; color: var(--muted); flex: 1; }

.review-link {
    font-size: 12px;
    color: var(--green);
    margin-top: 4px;
}

.review-foot {
    max-width: 60ch;
    font-size: 13px;
    color: var(--muted);
    margin: 0;
}

/* ---------- services ---------- */

.service-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.service-card {
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.service-card h3 {
    font-family: 'GameboyFont', monospace;
    font-size: 17px;
    color: var(--green);
    margin: 0 0 10px;
}

.service-card p { margin: 0 0 16px; font-size: 13px; color: var(--muted); flex: 1; }
.service-card a { font-size: 13px; text-decoration: none; font-weight: bold; }
.service-card a:hover { text-decoration: underline; }

.card-note { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

/* ---------- closing console pitch ---------- */

.console-pitch { text-align: center; padding: 48px 0 8px; }

.console-pitch h2 {
    font-family: 'GameboyFont', monospace;
    font-size: clamp(18px, 3.4vw, 26px);
    color: var(--green);
    margin: 0 0 14px;
    text-transform: none;
    letter-spacing: 0;
}

.console-pitch p {
    max-width: 56ch;
    margin: 0 auto 24px;
    color: var(--muted);
    font-size: 14px;
}

.console-pitch .btn-console { text-align: left; }

/* ---------- newsletter signup ---------- */

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.signup-band {
    border-top: 2px solid var(--line);
    background: var(--panel-2);
    padding: 40px 24px;
}

.signup-inner { max-width: 640px; margin: 0 auto; text-align: center; }

.signup-inner h2 {
    font-family: 'GameboyFont', monospace;
    font-size: 22px;
    color: var(--green);
    margin: 0 0 10px;
}

.signup-inner > p { color: var(--muted); font-size: 14px; margin: 0 0 20px; }

.signup-form {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.signup-form input {
    flex: 1 1 260px;
    max-width: 340px;
    background: var(--ink);
    color: var(--text);
    border: 2px solid var(--line);
    padding: 12px 14px;
    font-family: inherit;
    font-size: 14px;
}

.signup-form input:focus { outline: none; border-color: var(--green); }

.signup-form button {
    background: var(--green);
    color: #0a0a0a;
    border: 2px solid var(--green);
    font-family: inherit;
    font-weight: bold;
    font-size: 14px;
    padding: 12px 22px;
    cursor: pointer;
}

.signup-form button:hover { background: #51cf66; border-color: #51cf66; }
.signup-form button:disabled { opacity: 0.6; cursor: default; }

.signup-status { font-size: 13px; margin: 12px 0 0; min-height: 1.2em; }
.signup-status.ok { color: var(--green); }
.signup-status.err { color: var(--red); }

.site-footer {
    border-top: 2px solid var(--line);
    background: var(--panel);
    padding: 32px 24px;
}

.footer-cols {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    gap: 28px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.footer-cols h2 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--green);
    margin: 0 0 8px;
}

.footer-cols p { margin: 0; font-size: 13px; color: var(--muted); }

.footer-legal {
    max-width: 1100px;
    margin: 28px auto 0;
    font-size: 12px;
    color: #666;
}

/* ---------- shop index ---------- */

.page-intro { margin-bottom: 36px; }

.page-intro h1 {
    font-family: 'GameboyFont', monospace;
    font-size: 34px;
    color: var(--green);
    margin: 0 0 8px;
}

.page-intro p { margin: 0; color: var(--muted); max-width: 60ch; }

.empty-state { color: var(--muted); }

.category-block { margin-bottom: 48px; scroll-margin-top: 20px; }

.category-block h2 {
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--green);
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
    margin: 0 0 20px;
}

.listing-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.listing-card {
    background: var(--panel);
    border: 2px solid var(--line);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.listing-card:hover { border-color: var(--green); transform: translateY(-2px); }
.listing-card a { text-decoration: none; color: inherit; display: block; }

.card-media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--panel-2);
    overflow: hidden;
}

.card-media img { width: 100%; height: 100%; object-fit: contain; }

.card-media-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #555;
    font-size: 12px;
}

.card-media-empty.large { aspect-ratio: 4 / 3; border: 2px solid var(--line); }

.stock-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 10px;
    letter-spacing: 1px;
    padding: 3px 7px;
    background: var(--green);
    color: #0a0a0a;
    font-weight: bold;
}

.is-sold .stock-badge { background: var(--red); color: #fff; }
.is-sold .card-media img { opacity: 0.45; filter: grayscale(0.7); }

.card-body { padding: 12px 14px 14px; }
.card-body h3 { margin: 0 0 4px; font-size: 14px; font-weight: normal; }
.card-price { margin: 0; color: var(--green); font-size: 16px; font-weight: bold; }

/* ---------- listing detail ---------- */

.breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 22px; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 6px; }

.listing-detail {
    display: grid;
    gap: 36px;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: start;
}

@media (max-width: 780px) {
    .listing-detail { grid-template-columns: 1fr; }
}

.gallery-main {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: var(--panel-2);
    border: 2px solid var(--line);
}

.gallery-thumbs {
    list-style: none;
    display: flex;
    gap: 8px;
    padding: 0;
    margin: 10px 0 0;
    flex-wrap: wrap;
}

.gallery-thumbs button {
    padding: 0;
    width: 68px;
    height: 52px;
    background: var(--panel-2);
    border: 2px solid var(--line);
    cursor: pointer;
    overflow: hidden;
}

.gallery-thumbs button.active { border-color: var(--green); }
.gallery-thumbs button img { width: 100%; height: 100%; object-fit: contain; }

.eyebrow {
    margin: 0 0 6px;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--green-dim);
}

.listing-info h1 {
    font-family: 'GameboyFont', monospace;
    font-size: 28px;
    color: var(--green);
    margin: 0 0 14px;
    line-height: 1.25;
}

.listing-price { font-size: 26px; font-weight: bold; margin: 0 0 6px; }

.listing-stock { margin: 0 0 20px; font-size: 13px; }
.listing-stock.in-stock { color: var(--green); }
.listing-stock.out-of-stock { color: var(--red); }

.listing-description { color: var(--muted); margin-bottom: 24px; }

/* Shown as typed in the admin panel: blank lines are paragraph breaks and
   leading spaces indent. pre-wrap still wraps long lines to the column. */
.listing-description p {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    tab-size: 4;
}

.buy-button {
    display: inline-block;
    background: var(--green);
    color: #0a0a0a;
    font-weight: bold;
    text-decoration: none;
    padding: 13px 24px;
    border: 2px solid var(--green);
}

.buy-button:hover { background: #51cf66; border-color: #51cf66; }

.buy-note { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

.listing-specs {
    margin: 28px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.listing-specs dt {
    color: var(--green-dim);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    margin-top: 12px;
}

.listing-specs dd { margin: 3px 0 0; color: var(--muted); }

.related { margin-top: 56px; }

.related h2 {
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--green);
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
    margin: 0 0 20px;
}

/* ---------- long-form text (privacy policy) ---------- */

.prose { max-width: 68ch; }
.prose h1 {
    font-family: 'GameboyFont', monospace;
    font-size: 30px;
    color: var(--green);
    margin: 0 0 6px;
}
.prose h2 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--green);
    margin: 34px 0 10px;
}
.prose h3 { font-size: 14px; margin: 20px 0 6px; color: var(--text); }
.prose p, .prose li { color: var(--muted); font-size: 14px; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 4px; }
.prose strong { color: var(--text); }
.prose .muted { font-size: 12px; margin: 0 0 24px; }
