/* ---------------------------------------------------------------------------
   shadowra.store — storefront and admin styling.

   One sheet for both surfaces. Everything is driven by the tokens in :root —
   colour, spacing, radius, elevation and motion — so retheming means editing
   that block and nothing else.

   Conventions used throughout:
     * Borders are translucent white (color-mix) rather than solid hex, so they
       read correctly over the page's background gradients instead of forming
       visible seams.
     * Elevation is a layered pair of shadows (a tight contact shadow plus a
       wide ambient one). A single blurred shadow looks like a sticker.
     * Every transition uses the shared easing tokens, and all motion is
       disabled under prefers-reduced-motion at the end of this file.
   --------------------------------------------------------------------------- */

:root {
    /* --- Surfaces ---------------------------------------------------------- */
    --bg:            #0a0812;
    --bg-raised:     #14111e;
    --bg-inset:      #1c1829;
    --bg-hover:      #221d31;

    /* Solid values. Translucent equivalents are swapped in under @supports
       below — a second declaration would NOT work here, because a custom
       property holding an unsupported function stays "valid" until it is used
       and then collapses to unset, which would turn every border into
       currentColor. @supports is the only correct guard. */
    --border:        #262137;
    --border-strong: #352f4b;

    /* --- Text -------------------------------------------------------------- */
    --text:          #f3f0fa;
    --text-muted:    #b6aecd;   /* ≥ 7:1 on --bg-raised */
    --text-faint:    #8f87ab;   /* ≥ 4.5:1 on --bg-raised, safe for small text */

    /* --- Brand ------------------------------------------------------------- */
    --accent:        #8b5cf6;
    --accent-hot:    #a78bfa;
    --accent-deep:   #5b21b6;
    --accent-glow:   rgba(139, 92, 246, .35);
    --gold:          #f7bf47;

    --success:       #3ddc9a;
    --danger:        #fb7185;
    --warn:          #fbbf24;
    --info:          #60a5fa;

    /* --- Geometry ---------------------------------------------------------- */
    --r-xs:   6px;
    --r-sm:  10px;
    --r-md:  14px;
    --r-lg:  20px;
    --r-xl:  28px;
    --r-pill: 999px;

    /* Back-compat aliases for the original two-step scale. */
    --radius:    var(--r-md);
    --radius-sm: var(--r-sm);

    --wrap: 1180px;

    /* --- Elevation --------------------------------------------------------- */
    --e1: 0 1px 2px rgba(0, 0, 0, .28),
          0 2px 8px rgba(0, 0, 0, .18);
    --e2: 0 2px 4px rgba(0, 0, 0, .3),
          0 8px 24px rgba(0, 0, 0, .32);
    --e3: 0 4px 8px rgba(0, 0, 0, .32),
          0 20px 48px rgba(0, 0, 0, .44);
    --shadow: var(--e3);

    /* --- Motion ------------------------------------------------------------ */
    /* A decelerating curve: quick to start, gentle to settle. This single
       choice is most of what "smooth" means in a UI. */
    --ease:     cubic-bezier(.22, 1, .36, 1);
    --ease-in-out: cubic-bezier(.65, 0, .35, 1);
    --t-fast:   140ms;
    --t-base:   240ms;
    --t-slow:   420ms;
}

/* Translucent borders read correctly over the background gradients instead of
   forming visible seams — but only where color-mix() exists (Chrome 111+,
   Safari 16.2+, Firefox 113+). Older browsers keep the solid values above. */
@supports (color: color-mix(in oklab, #fff 50%, transparent)) {
    :root {
        --border:        color-mix(in oklab, #fff 7%, transparent);
        --border-strong: color-mix(in oklab, #fff 13%, transparent);
    }
}

/* ---------------------------------------------------------------------------
   Reset & base
   --------------------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 90px;   /* the sticky header must not cover anchors */
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;

    background:
        radial-gradient(1200px 560px at 12% -10%, rgba(139, 92, 246, .18), transparent 62%),
        radial-gradient(980px 520px at 96% -4%,  rgba(247, 191, 71, .07), transparent 58%),
        radial-gradient(760px 760px at 50% 108%, rgba(91, 33, 182, .14),  transparent 60%),
        var(--bg);
    background-attachment: fixed;

    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    font-synthesis-weight: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* <picture> wrappers must not become the flex/grid item themselves. */
picture { display: contents; }

a {
    color: var(--accent-hot);
    text-decoration: none;
    transition: color var(--t-fast) var(--ease);
}
a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 {
    margin: 0 0 .5em;
    line-height: 1.2;
    font-weight: 660;
    letter-spacing: -.018em;
    text-wrap: balance;          /* stops a lone trailing word on its own line */
}
h1 { font-size: clamp(1.75rem, 1.15rem + 1.9vw, 2.55rem); letter-spacing: -.028em; }
h2 { font-size: clamp(1.2rem, 1.08rem + .4vw, 1.4rem); }
h3 { font-size: 1.05rem; }

p { text-wrap: pretty; }

code {
    font-family: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: .86em;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--r-xs);
    padding: .12em .42em;
    word-break: break-word;
}

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

/* Restrained scrollbars that match the surface instead of the OS. */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border: 3px solid transparent;
    background-clip: content-box;
    border-radius: var(--r-pill);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-deep); background-clip: content-box; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.site-main { flex: 1; padding: 2.5rem 0 5rem; }
.right { text-align: right; }

.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;
}

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 100;
    background: var(--accent); color: #fff;
    padding: .7rem 1.1rem; border-radius: 0 0 var(--r-sm) 0;
    font-weight: 600;
}
.skip-link:focus { left: 0; }

/* One focus treatment for the whole site: a ring that never shifts layout. */
:focus-visible {
    outline: 2px solid var(--accent-hot);
    outline-offset: 3px;
    border-radius: var(--r-xs);
}

/* ---------------------------------------------------------------------------
   Header
   --------------------------------------------------------------------------- */

.site-header,
.admin-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: color-mix(in oklab, var(--bg) 78%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    border-bottom: 1px solid var(--border);
}

/* --- Tier 1: identity and account ------------------------------------------ */

.topbar { background: color-mix(in oklab, #000 34%, transparent); }
.topbar-inner {
    display: flex; align-items: center; gap: 1.5rem;
    min-height: 62px; flex-wrap: wrap;
}

/* --- Tier 2: catalogue navigation and search ------------------------------- */

.navbar { border-top: 1px solid var(--border); }
.navbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1.25rem; min-height: 52px; flex-wrap: wrap;
}

.browse-nav { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }

.browse-link {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .48rem .8rem;
    border: 0; border-radius: var(--r-sm);
    background: transparent;
    color: var(--text-muted);
    font: inherit; font-size: .92rem; font-weight: 550;
    cursor: pointer;
    transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.browse-link:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }

.chev { transition: transform var(--t-base) var(--ease); }

.browse-menu { position: relative; }

.browse-dropdown {
    position: absolute; top: calc(100% + .45rem); left: 0; z-index: 40;
    min-width: 210px;
    padding: .45rem;
    display: grid; gap: .1rem;
    background: var(--bg-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    box-shadow: var(--e3);

    /* Hidden but still measurable, so the open transition has somewhere to go. */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition:
        opacity var(--t-base) var(--ease),
        transform var(--t-base) var(--ease),
        visibility var(--t-base);
}
.browse-dropdown a {
    padding: .5rem .75rem;
    border-radius: var(--r-xs);
    color: var(--text-muted);
    font-size: .9rem;
}
.browse-dropdown a:hover { background: var(--accent-deep); color: #fff; text-decoration: none; }

/* Without JavaScript the menus open on hover and on keyboard focus. */
.browse-menu:hover > .browse-dropdown,
.browse-menu:focus-within > .browse-dropdown {
    opacity: 1; visibility: visible; transform: none;
}
.browse-menu:hover > .browse-toggle .chev,
.browse-menu:focus-within > .browse-toggle .chev { transform: rotate(180deg); }

/* With JavaScript, aria-expanded takes over so hover cannot fight the click. */
.js .browse-menu:hover > .browse-dropdown,
.js .browse-menu:focus-within > .browse-dropdown {
    opacity: 0; visibility: hidden; transform: translateY(-6px);
}
.js .browse-toggle[aria-expanded="true"] + .browse-dropdown {
    opacity: 1; visibility: visible; transform: none;
}
.js .browse-menu:hover > .browse-toggle .chev,
.js .browse-menu:focus-within > .browse-toggle .chev { transform: none; }
.js .browse-toggle[aria-expanded="true"] { background: var(--bg-hover); color: var(--text); }
.js .browse-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }

/* --- Search ---------------------------------------------------------------- */

.searchbox { display: flex; align-items: stretch; margin-left: auto; }
.searchbox input {
    width: clamp(180px, 26vw, 320px);
    margin: 0;
    border-radius: var(--r-sm) 0 0 var(--r-sm);
    border-right: 0;
    background: color-mix(in oklab, #000 30%, var(--bg-inset));
    font-size: .9rem;
    padding: .5rem .85rem;
}
.searchbox input:focus { box-shadow: none; border-color: var(--accent); }
.searchbox button {
    display: grid; place-items: center;
    width: 44px;
    border: 1px solid var(--accent);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    color: #fff;
    cursor: pointer;
    transition: filter var(--t-fast) var(--ease);
}
.searchbox button:hover { filter: brightness(1.15); }
.searchbox:focus-within button { border-color: var(--accent-hot); }

/* A hairline highlight along the top edge — the detail that stops a flat bar
   from looking like a rectangle sitting on the page. */
.site-header::after,
.admin-header::after {
    content: "";
    position: absolute; inset: auto 0 -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
    opacity: .5;
}

.admin-header { background: color-mix(in oklab, var(--bg-raised) 88%, transparent); }

/* The admin surface is deliberately cooler and calmer than the storefront —
   no warm glow, no coin — so it is obvious at a glance which side you are on. */
body.admin {
    background:
        radial-gradient(1100px 520px at 50% -12%, rgba(139, 92, 246, .1), transparent 62%),
        var(--bg);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-height: 70px;
    flex-wrap: wrap;
}

.brand {
    display: flex; align-items: center; gap: .7rem;
    color: var(--text); font-weight: 700;
    transition: opacity var(--t-fast) var(--ease);
}
.brand:hover { text-decoration: none; color: var(--text); opacity: .82; }
.brand-logo {
    width: 38px; height: 38px; object-fit: contain;
    filter: drop-shadow(0 2px 8px var(--accent-glow));
}
.brand-text { font-size: 1.06rem; letter-spacing: -.01em; }

.main-nav { display: flex; gap: 1.4rem; margin-right: auto; }
.main-nav a {
    position: relative;
    color: var(--text-muted); font-weight: 500;
    padding: .4rem 0;
}
.main-nav a:hover { color: var(--text); text-decoration: none; }

/* Underline grows from the centre rather than snapping on. */
.main-nav a::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 2px; border-radius: var(--r-pill);
    background: var(--accent);
    transform: scaleX(0);
    transition: transform var(--t-base) var(--ease);
}
.main-nav a:hover::after { transform: scaleX(.4); }
.main-nav a.is-active { color: var(--text); }
.main-nav a.is-active::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: .8rem; }
.account-menu { display: flex; align-items: center; gap: .8rem; }
.account-link { color: var(--text-muted); font-size: .9rem; }

.cart-link { position: relative; color: var(--text-muted); font-weight: 500; }
.cart-link:hover { color: var(--text); text-decoration: none; }

.badge {
    display: inline-block; min-width: 20px; padding: 0 .38rem;
    background: var(--accent); color: #fff;
    border-radius: var(--r-pill);
    font-size: .72rem; font-weight: 700; text-align: center;
    vertical-align: text-top;
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
}

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .7rem 1.3rem;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    font: inherit; font-weight: 600; line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition:
        transform var(--t-fast) var(--ease),
        box-shadow var(--t-base) var(--ease),
        background-color var(--t-base) var(--ease),
        border-color var(--t-base) var(--ease),
        filter var(--t-base) var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.985); transition-duration: 60ms; }
.btn:disabled { opacity: .5; pointer-events: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--accent-hot), var(--accent) 45%, var(--accent-deep));
    background-size: 160% 160%;
    background-position: 0% 50%;
    color: #fff;
    box-shadow: var(--e1), 0 0 0 0 var(--accent-glow);
    transition:
        transform var(--t-fast) var(--ease),
        box-shadow var(--t-base) var(--ease),
        background-position var(--t-slow) var(--ease);
}
.btn-primary:hover {
    color: #fff;
    background-position: 100% 50%;
    box-shadow: var(--e2), 0 8px 28px var(--accent-glow);
}

.btn-ghost {
    background: color-mix(in oklab, #fff 4%, transparent);
    border-color: var(--border-strong);
    color: var(--text);
}
.btn-ghost:hover { background: var(--bg-hover); border-color: var(--accent); color: var(--text); }

.btn-paypal { background: #ffc439; color: #0b0a10; box-shadow: var(--e1); }
.btn-paypal:hover { background: #ffd166; color: #0b0a10; box-shadow: var(--e2), 0 8px 26px rgba(255, 196, 57, .28); }

.btn-sm { padding: .45rem .9rem; font-size: .875rem; border-radius: var(--r-xs); }
.btn-block { width: 100%; }

.link-button {
    background: none; border: 0; padding: 0;
    color: var(--text-muted); font: inherit; font-size: .875rem;
    cursor: pointer;
    text-decoration: underline; text-underline-offset: 3px;
    text-decoration-color: color-mix(in oklab, currentColor 40%, transparent);
    transition: color var(--t-fast) var(--ease);
}
.link-button:hover { color: var(--text); text-decoration-color: currentColor; }
.link-danger { color: var(--danger); }
.link-danger:hover { color: #fda4af; }

.inline { display: inline; }

/* ---------------------------------------------------------------------------
   Flashes & notices
   --------------------------------------------------------------------------- */

.flash {
    position: relative;
    padding: .9rem 1.15rem .9rem 1.3rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    margin-bottom: 1.25rem;
    background: var(--bg-raised);
    box-shadow: var(--e1);
    overflow: hidden;
    animation: flash-in var(--t-slow) var(--ease) both;
}
.flash::before {
    content: "";
    position: absolute; inset: 0 auto 0 0; width: 3px;
    background: var(--text-faint);
}
.flash-success::before { background: var(--success); }
.flash-error::before   { background: var(--danger); }
.flash-info::before    { background: var(--info); }

.flash-success { background: linear-gradient(90deg, color-mix(in oklab, var(--success) 9%, transparent), transparent 40%), var(--bg-raised); }
.flash-error   { background: linear-gradient(90deg, color-mix(in oklab, var(--danger) 10%, transparent), transparent 40%), var(--bg-raised); }
.flash-info    { background: linear-gradient(90deg, color-mix(in oklab, var(--info) 9%, transparent), transparent 40%), var(--bg-raised); }

@keyframes flash-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}

.notice {
    padding: .9rem 1.15rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    margin-bottom: 1.5rem;
    background: var(--bg-inset);
    font-size: .93rem;
}
.notice-warn { border-color: color-mix(in oklab, var(--warn) 40%, transparent); background: color-mix(in oklab, var(--warn) 7%, var(--bg-inset)); }
.notice-info { border-color: color-mix(in oklab, var(--info) 40%, transparent); background: color-mix(in oklab, var(--info) 7%, var(--bg-inset)); }

.hint  { color: var(--text-faint); font-size: .85rem; margin: .35rem 0 1rem; }
.empty { color: var(--text-muted); padding: 2.5rem 0; text-align: center; }
.warn-text { color: var(--warn); }

/* ---------------------------------------------------------------------------
   Panels & page headings
   --------------------------------------------------------------------------- */

.panel {
    position: relative;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--e1);
}
.panel-narrow { max-width: 440px; margin-inline: auto; }
.panel-sub { color: var(--text-muted); margin-top: -.35rem; }
.panel-foot { margin: 1.25rem 0 0; font-size: .9rem; color: var(--text-muted); }

.page-head { margin-bottom: 1.9rem; }
.page-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.page-sub { color: var(--text-muted); margin: 0; }

/* Page wrappers — a single hook for per-page rhythm. */
.cart-page, .checkout-page, .library-page, .account-page, .order-page { display: block; }

/* ---------------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------------- */

.hero {
    position: relative;
    display: grid;
    grid-template-columns: 1.5fr .8fr;
    gap: 2rem;
    align-items: center;
    padding: clamp(2rem, 1rem + 4vw, 3.5rem);
    margin-bottom: 3.5rem;
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    background:
        radial-gradient(700px 320px at 8% 0%, color-mix(in oklab, var(--accent) 22%, transparent), transparent 70%),
        linear-gradient(135deg, color-mix(in oklab, var(--accent-deep) 26%, transparent), transparent 55%),
        var(--bg-raised);
    box-shadow: var(--e2);
    overflow: hidden;
}
.hero-text h1 { margin-bottom: .65rem; }
.hero-text p { color: var(--text-muted); font-size: 1.06rem; max-width: 48ch; margin-bottom: 1.6rem; }

.hero-art {
    justify-self: center;
    width: min(210px, 100%);
    height: auto;
    filter: drop-shadow(0 18px 36px rgba(247, 191, 71, .28));
    animation: coin-float 7s var(--ease-in-out) infinite;
}
@keyframes coin-float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50%      { transform: translateY(-14px) rotate(2deg); }
}

/* ---------------------------------------------------------------------------
   Catalogue
   --------------------------------------------------------------------------- */

/* ---------------------------------------------------------------------------
   Section headings & shelves
   --------------------------------------------------------------------------- */

.section-title {
    margin: 0;
    font-size: clamp(1.15rem, 1.05rem + .4vw, 1.4rem);
    font-weight: 650;
    letter-spacing: -.02em;
}

.shelf { margin-bottom: 3rem; }
.shelf-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    margin-bottom: 1.15rem;
    padding-bottom: .7rem;
    border-bottom: 1px solid var(--border);
}
.shelf-more { font-size: .88rem; color: var(--text-muted); white-space: nowrap; }
.shelf-more:hover { color: var(--accent-hot); text-decoration: none; }

/* A horizontally scrolling row. Snap points stop it drifting between cards. */
.rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(210px, 1fr);
    gap: 1.25rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding: .25rem .25rem 1.1rem;
    margin: -.25rem -.25rem -.35rem;    /* let card hover shadows breathe */
    overscroll-behavior-x: contain;
}
.rail > .card { scroll-snap-align: start; }
.rail:focus-visible { outline: 2px solid var(--accent-hot); outline-offset: 4px; }

@media (min-width: 1100px) {
    .rail { grid-auto-columns: minmax(216px, 1fr); }
}

/* ---------------------------------------------------------------------------
   Featured carousel

   Hidden radios sit before the slides, so :checked ~ can reach both the slide
   and its thumbnail. No JavaScript, and it degrades to the first slide if CSS
   fails to load.
   --------------------------------------------------------------------------- */

.featured { margin-bottom: 3.25rem; }

.featured-stage {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 1rem;
    align-items: stretch;
}

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

.featured-slides {
    position: relative;
    display: grid;
    min-height: 380px;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--e2);
}

.featured-slide {
    grid-area: 1 / 1;
    position: relative;
    display: grid;
    grid-template-columns: minmax(150px, 220px) 1fr;
    gap: 1.75rem;
    align-items: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.015);
    transition:
        opacity var(--t-slow) var(--ease),
        transform var(--t-slow) var(--ease),
        visibility var(--t-slow);
}

/* The cover art, blurred and dimmed, becomes the backdrop — portrait artwork
   filling a wide banner without stretching it. */
.featured-backdrop {
    position: absolute; inset: -40px;
    background-size: cover;
    background-position: center;
    filter: blur(38px) saturate(140%) brightness(.42);
    transform: scale(1.1);
    z-index: 0;
}
.featured-slide::after {
    content: "";
    position: absolute; inset: 0; z-index: 0;
    background: linear-gradient(105deg,
        color-mix(in oklab, var(--bg) 88%, transparent) 0%,
        color-mix(in oklab, var(--bg) 62%, transparent) 45%,
        color-mix(in oklab, var(--accent-deep) 30%, transparent) 100%);
}

.featured-art, .featured-info { position: relative; z-index: 1; }

.featured-art img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: var(--r-md);
    border: 1px solid var(--border-strong);
    box-shadow: var(--e3);
    transition: transform var(--t-base) var(--ease);
}
.featured-art:hover img { transform: translateY(-4px) scale(1.02); }

.featured-eyebrow {
    margin: 0 0 .4rem;
    color: var(--accent-hot);
    font-size: .78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .09em;
}
.featured-info h3 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); margin-bottom: .5rem; }
.featured-info h3 a { color: var(--text); }
.featured-info h3 a:hover { color: var(--accent-hot); text-decoration: none; }
.featured-tagline { color: var(--text-muted); max-width: 52ch; margin: 0 0 1.4rem; }

.featured-buy { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* --- Thumbnail rail --------------------------------------------------------- */

.featured-thumbs {
    list-style: none;
    display: grid;
    gap: .5rem;
    align-content: start;
    margin: 0; padding: 0;
    max-height: 380px;
    overflow-y: auto;
}
.featured-thumb {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: .7rem;
    align-items: center;
    padding: .5rem;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    background: color-mix(in oklab, #fff 3%, transparent);
    cursor: pointer;
    transition:
        background-color var(--t-base) var(--ease),
        border-color var(--t-base) var(--ease),
        transform var(--t-base) var(--ease);
}
.featured-thumb:hover { background: var(--bg-hover); transform: translateX(-3px); }
.featured-thumb img { width: 44px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r-xs); }
.featured-thumb-text { display: grid; gap: .1rem; min-width: 0; }
.featured-thumb-title {
    font-size: .86rem; font-weight: 600; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.featured-thumb-price { font-size: .78rem; color: var(--gold); }

/* --- Which slide is showing ------------------------------------------------- */

.feat-radio:nth-of-type(1):checked ~ .featured-slides .featured-slide:nth-child(1),
.feat-radio:nth-of-type(2):checked ~ .featured-slides .featured-slide:nth-child(2),
.feat-radio:nth-of-type(3):checked ~ .featured-slides .featured-slide:nth-child(3),
.feat-radio:nth-of-type(4):checked ~ .featured-slides .featured-slide:nth-child(4),
.feat-radio:nth-of-type(5):checked ~ .featured-slides .featured-slide:nth-child(5),
.feat-radio:nth-of-type(6):checked ~ .featured-slides .featured-slide:nth-child(6) {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.feat-radio:nth-of-type(1):checked ~ .featured-thumbs li:nth-child(1) .featured-thumb,
.feat-radio:nth-of-type(2):checked ~ .featured-thumbs li:nth-child(2) .featured-thumb,
.feat-radio:nth-of-type(3):checked ~ .featured-thumbs li:nth-child(3) .featured-thumb,
.feat-radio:nth-of-type(4):checked ~ .featured-thumbs li:nth-child(4) .featured-thumb,
.feat-radio:nth-of-type(5):checked ~ .featured-thumbs li:nth-child(5) .featured-thumb,
.feat-radio:nth-of-type(6):checked ~ .featured-thumbs li:nth-child(6) .featured-thumb {
    background: color-mix(in oklab, var(--accent) 22%, transparent);
    border-color: color-mix(in oklab, var(--accent) 55%, transparent);
    transform: none;
}

/* Keyboard users must be able to see which thumbnail has focus. */
.feat-radio:focus-visible ~ .featured-thumbs li .featured-thumb { outline: none; }
.featured-thumb:has(:focus-visible),
.feat-radio:nth-of-type(1):focus-visible ~ .featured-thumbs li:nth-child(1) .featured-thumb,
.feat-radio:nth-of-type(2):focus-visible ~ .featured-thumbs li:nth-child(2) .featured-thumb,
.feat-radio:nth-of-type(3):focus-visible ~ .featured-thumbs li:nth-child(3) .featured-thumb,
.feat-radio:nth-of-type(4):focus-visible ~ .featured-thumbs li:nth-child(4) .featured-thumb,
.feat-radio:nth-of-type(5):focus-visible ~ .featured-thumbs li:nth-child(5) .featured-thumb,
.feat-radio:nth-of-type(6):focus-visible ~ .featured-thumbs li:nth-child(6) .featured-thumb {
    outline: 2px solid var(--accent-hot);
    outline-offset: 2px;
}

/* The hero's "Browse the store" link jumps here; keep it clear of the header. */
.catalogue { scroll-margin-top: 96px; }

.catalogue-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.75rem;
}
.catalogue-head h2 { margin: 0; }

.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { margin: 0; }

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

.card {
    display: flex;
    flex-direction: column;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--e1);
    transition:
        transform var(--t-base) var(--ease),
        border-color var(--t-base) var(--ease),
        box-shadow var(--t-base) var(--ease);
}
.card:hover {
    transform: translateY(-6px);
    border-color: var(--border-strong);
    box-shadow: var(--e3);
}

.card-cover {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    background: var(--bg-inset);
    overflow: hidden;
}
.card-cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform var(--t-slow) var(--ease);
}
.card:hover .card-cover img { transform: scale(1.06); }

/* Scrim so a bright cover never fights the badge sitting on it. */
.card-cover::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .3) 0%, transparent 32%, transparent 68%, rgba(0, 0, 0, .35) 100%);
    pointer-events: none;
}

.tag {
    position: absolute; top: .75rem; left: .75rem; z-index: 1;
    padding: .28rem .65rem;
    border-radius: var(--r-pill);
    font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.tag-owned { background: color-mix(in oklab, var(--success) 88%, transparent); color: #04241a; }
.tag-free  { background: color-mix(in oklab, var(--accent-hot) 90%, transparent); color: #1a0838; }

.card-body { padding: 1.05rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.card-title { margin: 0; font-size: 1rem; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent-hot); text-decoration: none; }
.card-meta { color: var(--text-faint); font-size: .8rem; margin: 0; }
.card-tagline { color: var(--text-muted); font-size: .88rem; margin: 0; flex: 1; }

.card-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .7rem; }

.price { font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.price-lg { font-size: 1.7rem; letter-spacing: -.02em; }

/* ---------------------------------------------------------------------------
   Product page
   --------------------------------------------------------------------------- */

.product { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 2.75rem; margin-bottom: 2.75rem; }
.product-media img {
    width: 100%;
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    box-shadow: var(--e2);
}
.product-info { min-width: 0; }
.crumbs { color: var(--text-faint); font-size: .85rem; margin: 0 0 .5rem; }
.product-tagline { color: var(--text-muted); font-size: 1.06rem; }

.product-facts { display: grid; gap: .55rem; margin: 1.6rem 0; }
.product-facts > div { display: flex; gap: .75rem; }
.product-facts dt { color: var(--text-faint); min-width: 110px; font-size: .9rem; }
.product-facts dd { margin: 0; font-size: .9rem; }

.buybox {
    display: flex; align-items: center; gap: 1.35rem; flex-wrap: wrap;
    background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 10%, transparent), transparent 60%), var(--bg-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    padding: 1.35rem 1.6rem;
    margin-top: 1.6rem;
    box-shadow: var(--e1);
}
.owned-note { color: var(--success); margin: 0; font-weight: 500; }

.product-description { max-width: 75ch; color: var(--text-muted); margin-bottom: 2.75rem; }
.product-description h2 { color: var(--text); }
.product-builds { margin-bottom: 2rem; }

/* ---------------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------------- */

.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td {
    padding: .8rem .65rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}
.table th {
    color: var(--text-faint);
    font-weight: 600; font-size: .76rem;
    text-transform: uppercase; letter-spacing: .06em;
}
.table tbody tr { transition: background-color var(--t-fast) var(--ease); }
.table tbody tr:hover { background: color-mix(in oklab, #fff 3%, transparent); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot th { border-bottom: 0; color: var(--text); font-size: 1rem; text-transform: none; letter-spacing: 0; }
.table td.right, .table th.right { font-variant-numeric: tabular-nums; }

.table-admin { font-size: .88rem; }
.row-thumb { width: 44px; height: 58px; object-fit: cover; border-radius: var(--r-xs); }
.row-sub { color: var(--text-faint); font-size: .8rem; margin-top: .15rem; }
.row-actions { display: flex; gap: .65rem; justify-content: flex-end; align-items: center; flex-wrap: wrap; }

.status {
    display: inline-block; padding: .2rem .62rem;
    border-radius: var(--r-pill);
    font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
    border: 1px solid transparent;
}
.status-paid, .status-published {
    background: color-mix(in oklab, var(--success) 15%, transparent);
    border-color: color-mix(in oklab, var(--success) 30%, transparent);
    color: var(--success);
}
.status-pending {
    background: color-mix(in oklab, var(--warn) 15%, transparent);
    border-color: color-mix(in oklab, var(--warn) 30%, transparent);
    color: var(--warn);
}
.status-failed, .status-cancelled, .status-refunded {
    background: color-mix(in oklab, var(--danger) 15%, transparent);
    border-color: color-mix(in oklab, var(--danger) 30%, transparent);
    color: var(--danger);
}
.status-draft, .status-hidden {
    background: color-mix(in oklab, var(--text-muted) 14%, transparent);
    border-color: var(--border-strong);
    color: var(--text-muted);
}

/* ---------------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------------- */

.form label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .4rem; color: var(--text-muted); }

input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="date"], input[type="file"], select, textarea {
    width: 100%;
    padding: .7rem .9rem;
    background: var(--bg-inset);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    color: var(--text);
    font: inherit;
    margin-bottom: 1rem;
    transition:
        border-color var(--t-base) var(--ease),
        box-shadow var(--t-base) var(--ease),
        background-color var(--t-base) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }

input:hover, select:hover, textarea:hover { border-color: color-mix(in oklab, #fff 22%, transparent); }

/* A soft ring rather than a hard outline — same affordance, less jarring. */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-hover);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 25%, transparent);
}

textarea { resize: vertical; min-height: 120px; line-height: 1.6; }

/* Native select arrows differ per platform and never match a dark theme. */
select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%238f87ab' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .9rem center;
    background-size: 11px;
    padding-right: 2.4rem;
}
select option { background: var(--bg-inset); color: var(--text); }

input[type="file"] { padding: .55rem .9rem; cursor: pointer; }
input[type="file"]::file-selector-button {
    margin-right: .9rem;
    padding: .4rem .85rem;
    background: var(--bg-hover);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-xs);
    color: var(--text);
    font: inherit; font-size: .85rem; font-weight: 600;
    cursor: pointer;
    transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
input[type="file"]::file-selector-button:hover { background: var(--accent-deep); border-color: var(--accent); }

input[type="checkbox"], input[type="radio"] {
    accent-color: var(--accent);
    width: 1.05rem; height: 1.05rem;
    cursor: pointer;
}

.filters input, .filters select { width: auto; min-width: 152px; }
.select-sm { width: auto; padding: .28rem 1.8rem .28rem .55rem; font-size: .8rem; margin: 0; background-position: right .5rem center; }

.checkbox, .radio {
    display: flex; gap: .65rem; align-items: flex-start;
    margin-bottom: 1rem; font-weight: 400; color: var(--text-muted);
    cursor: pointer;
}
.checkbox input, .radio input { width: auto; margin: .3rem 0 0; flex: none; }
.checkbox:hover, .radio:hover { color: var(--text); }

.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }

fieldset.source-choice {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 1.2rem 1.35rem .3rem;
    margin: 1rem 0 1.6rem;
    background: color-mix(in oklab, #fff 2%, transparent);
}
fieldset.source-choice legend { padding: 0 .55rem; color: var(--text-faint); font-size: .85rem; font-weight: 600; }

.form-actions { display: flex; gap: 1rem; align-items: center; margin-bottom: 3rem; flex-wrap: wrap; }
.cover-preview { width: 120px; border-radius: var(--r-sm); border: 1px solid var(--border); margin-bottom: .8rem; box-shadow: var(--e1); }

/* ---------------------------------------------------------------------------
   Auth
   --------------------------------------------------------------------------- */

.auth-page { padding: 3.5rem 0; }
.auth-page .panel { box-shadow: var(--e3); }
.admin-login .auth-page { width: min(100% - 2.5rem, 440px); margin-inline: auto; }
.auth-logo {
    width: 64px; height: 64px;
    margin: 0 auto 1.1rem;
    filter: drop-shadow(0 6px 18px var(--accent-glow));
}

/* ---------------------------------------------------------------------------
   Cart & checkout
   --------------------------------------------------------------------------- */

.cart-layout, .checkout-layout { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; align-items: start; }
.checkout-layout { grid-template-columns: 1fr 1fr; }

.cart-summary { position: sticky; top: 96px; }

.cart-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.cart-item {
    display: grid; grid-template-columns: 72px 1fr auto; gap: 1.25rem; align-items: center;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 1rem;
    box-shadow: var(--e1);
    transition: border-color var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.cart-item:hover { border-color: var(--border-strong); transform: translateX(3px); }
.cart-thumb { width: 72px; height: 96px; object-fit: cover; border-radius: var(--r-sm); }
.cart-item-body h2 { font-size: 1rem; margin: 0 0 .25rem; }
.cart-item-body h2 a { color: var(--text); }
.cart-item-side { text-align: right; display: grid; gap: .45rem; justify-items: end; }

.summary-lines { margin: 0 0 1.25rem; display: grid; gap: .55rem; }
.summary-lines > div { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; }
.summary-lines dt { color: var(--text-faint); }
.summary-lines dd { margin: 0; }
.summary-total {
    border-top: 1px solid var(--border);
    padding-top: .7rem;
    font-size: 1.12rem !important;
    font-weight: 700;
}
.summary-total dd { color: var(--gold); font-variant-numeric: tabular-nums; }

.checkout-items { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: .65rem; }
.checkout-items li { display: flex; justify-content: space-between; gap: 1rem; font-size: .92rem; }

.receipt-hero {
    position: relative;
    padding: 2.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid color-mix(in oklab, var(--success) 32%, transparent);
    border-radius: var(--r-xl);
    background:
        radial-gradient(600px 260px at 10% 0%, color-mix(in oklab, var(--success) 18%, transparent), transparent 70%),
        var(--bg-raised);
    box-shadow: var(--e2);
    animation: receipt-in var(--t-slow) var(--ease) both;
}
.receipt-hero p { color: var(--text-muted); margin-bottom: 1.6rem; }
@keyframes receipt-in {
    from { opacity: 0; transform: translateY(10px) scale(.99); }
    to   { opacity: 1; transform: none; }
}

.receipt-parties {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.receipt-parties h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); }
.receipt-parties .legal-address { font-size: .88rem; margin: 0; }

/* ---------------------------------------------------------------------------
   Library
   --------------------------------------------------------------------------- */

.library-item {
    display: grid; grid-template-columns: 110px 1fr; gap: 1.6rem; align-items: start;
    transition: border-color var(--t-base) var(--ease);
}
.library-item:hover { border-color: var(--border-strong); }
.library-cover {
    width: 110px; aspect-ratio: 3 / 4; object-fit: cover;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    box-shadow: var(--e1);
}
.library-body { min-width: 0; }
.library-body h2 { font-size: 1.18rem; margin-bottom: .25rem; }
.library-body h2 a { color: var(--text); }
.license-key { font-size: .82rem; color: var(--text-faint); margin: .5rem 0 1rem; }

.build-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .65rem; }
.build-row {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: .85rem 1.05rem;
    transition: background-color var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.build-row:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.build-meta { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; min-width: 0; }
.platform-pill {
    background: color-mix(in oklab, var(--accent) 26%, transparent);
    border: 1px solid color-mix(in oklab, var(--accent) 42%, transparent);
    color: #ddd0ff;
    padding: .2rem .68rem;
    border-radius: var(--r-pill);
    font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
}
.build-name { font-weight: 600; }
.build-sub { color: var(--text-faint); font-size: .82rem; }
.build-checksum { color: var(--text-faint); font-size: .74rem; padding-left: 1.05rem; word-break: break-all; }

/* ---------------------------------------------------------------------------
   Admin
   --------------------------------------------------------------------------- */

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(184px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat {
    position: relative;
    display: flex; flex-direction: column; gap: .25rem;
    padding: 1.3rem;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--e1);
    overflow: hidden;
    transition: transform var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.stat::before {
    content: "";
    position: absolute; inset: 0 0 auto 0; height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: .7;
}
.stat:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.stat-value { font-size: 1.7rem; font-weight: 700; letter-spacing: -.028em; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--text-faint); font-size: .82rem; }

.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }

.tab-bar {
    display: flex; gap: 1.2rem; flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.35rem; padding-bottom: .65rem;
}
.tab-bar a { position: relative; color: var(--text-muted); font-size: .9rem; padding-bottom: .65rem; }
.tab-bar a::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
    border-radius: var(--r-pill);
    background: var(--accent);
    transform: scaleX(0);
    transition: transform var(--t-base) var(--ease);
}
.tab-bar a.is-active { color: var(--text); font-weight: 600; }
.tab-bar a.is-active::after, .tab-bar a:hover::after { transform: scaleX(1); }
.tab-bar a:hover { text-decoration: none; color: var(--text); }

.admin-footer { border-top: 1px solid var(--border); padding: 1.6rem 0; color: var(--text-faint); font-size: .84rem; }

/* Featured toggle in the catalogue list. */
.star-toggle {
    background: none; border: 0; padding: .1rem .2rem;
    color: var(--text-faint);
    font-size: 1.25rem; line-height: 1;
    cursor: pointer;
    transition: color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.star-toggle:hover { color: var(--gold); transform: scale(1.15); }
.star-toggle.is-on { color: var(--gold); }

/* ---------------------------------------------------------------------------
   Legal & error pages
   --------------------------------------------------------------------------- */

.legal-page { max-width: 75ch; margin-inline: auto; color: var(--text-muted); }
.legal-page h1, .legal-page h2 { color: var(--text); }
.legal-page h2 { margin-top: 2.2rem; font-size: 1.1rem; }
.legal-page ul { padding-left: 1.25rem; }
.legal-page li { margin-bottom: .4rem; }
.legal-page li::marker { color: var(--accent); }
.legal-page .table { margin: 1rem 0 1.5rem; }

.legal-lead { font-size: .95rem; color: var(--text-faint); margin-top: -.25rem; }

.legal-address {
    font-style: normal;
    line-height: 1.75;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--r-sm);
    padding: .95rem 1.15rem;
    margin: 0 0 1rem;
}

.legal-note { color: var(--text-faint); font-size: .85em; }

.legal-updated {
    margin-top: 2.5rem; padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-faint); font-size: .85rem;
}

.error-page { text-align: center; padding: 5.5rem 0; }
.error-page h1 {
    font-size: clamp(4rem, 2rem + 9vw, 7rem);
    margin-bottom: .25rem;
    line-height: 1;
    background: linear-gradient(135deg, var(--accent-hot), var(--accent-deep));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.error-page p { color: var(--text-muted); margin-bottom: 2rem; }

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 2.75rem 0;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .3));
}
.footer-inner { display: grid; gap: 1.35rem; }
.footer-brand { display: flex; align-items: center; gap: 1rem; }
.footer-logo { width: 42px; height: 42px; object-fit: contain; opacity: .9; }
.footer-brand p { color: var(--text-muted); margin: 0; font-size: .92rem; }
.footer-nav { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.footer-nav a { color: var(--text-muted); font-size: .88rem; }
.footer-copy { color: var(--text-faint); font-size: .82rem; margin: 0; }

/* ---------------------------------------------------------------------------
   Narrow screens
   --------------------------------------------------------------------------- */

@media (max-width: 980px) {
    /* Thumbnails move under the stage and scroll sideways. */
    .featured-stage { grid-template-columns: 1fr; }
    .featured-thumbs {
        grid-auto-flow: column;
        grid-auto-columns: minmax(180px, 1fr);
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: .35rem;
    }
    .featured-thumb:hover { transform: none; }
}

@media (max-width: 900px) {
    .featured-slides { min-height: 0; }
    .featured-slide { grid-template-columns: 1fr; gap: 1.25rem; padding: 1.5rem; text-align: center; }
    .featured-art { max-width: 190px; margin-inline: auto; }
    .featured-tagline { margin-inline: auto; }
    .featured-buy { justify-content: center; }

    .hero { grid-template-columns: 1fr; text-align: center; }
    .hero-text p { margin-inline: auto; }
    .hero-art { display: none; }
    .product { grid-template-columns: 1fr; gap: 1.75rem; }
    .product-media img { max-width: 300px; margin-inline: auto; }
    .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
    .cart-summary { position: static; }
}

@media (max-width: 640px) {
    .header-inner, .topbar-inner { min-height: auto; padding: .8rem 0; gap: .8rem; }
    .main-nav { order: 3; width: 100%; margin: 0; gap: 1.15rem; }
    .header-actions { margin-left: auto; }

    .navbar-inner { padding: .6rem 0; gap: .6rem; }
    .searchbox { width: 100%; margin-left: 0; order: -1; }
    .searchbox input { width: 100%; }
    .browse-nav { width: 100%; }
    .browse-dropdown { left: auto; right: 0; }

    .rail { grid-auto-columns: minmax(158px, 1fr); gap: .9rem; }
    .shelf { margin-bottom: 2.25rem; }

    .panel { padding: 1.3rem; border-radius: var(--r-md); }
    /* Wide admin tables scroll inside their panel instead of the whole page. */
    .panel { overflow-x: auto; }

    .library-item { grid-template-columns: 1fr; }
    .library-cover { width: 92px; }
    .build-row { align-items: flex-start; }

    .cart-item { grid-template-columns: 56px 1fr; }
    .cart-thumb { width: 56px; height: 75px; }
    .cart-item-side { grid-column: 1 / -1; justify-items: start; text-align: left; }

    .table-admin { font-size: .8rem; }
    .row-actions { justify-content: flex-start; }
    .grid { gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* ---------------------------------------------------------------------------
   Accessibility preferences
   --------------------------------------------------------------------------- */

/* Honour the OS setting: keep the state changes, drop the movement. */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }

    .btn:hover, .card:hover, .stat:hover, .cart-item:hover { transform: none; }
    .card:hover .card-cover img { transform: none; }
}

/* Windows high-contrast mode: let the system own the colours. */
@media (forced-colors: active) {
    .btn, .panel, .card, .stat, .flash, .notice { border: 1px solid ButtonBorder; }
    .card-cover::after { display: none; }
}
