/* ============================================================
   Base — reset, page layout, typography, header/footer.
   No component styling lives here.
   ============================================================ */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    /* Fintech Clean Dark: flat charcoal canvas. */
    background: var(--color-bg);
    color: var(--color-text);
    /* Dynamic viewport height: fits the real visible area on desktop
       and on phones (where the browser bar shrinks the viewport). */
    min-height: 100vh;
    min-height: 100dvh;
    /* A normal website page: the whole document scrolls, on every
       screen size. No flex centering, no height caps, no scroll
       locks — the frame that trapped the site is gone. */
    display: block;
    padding: 0;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--color-text);
    color: var(--color-text-inverse);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-sm);
    z-index: 10;
}
.skip-link:focus { left: var(--space-4); top: var(--space-4); }

/* --- Page container: NOT a framed panel. The page itself is the
       website — full width, no border, no rounded frame, no glass.
       Product tiles and form fields keep their own styling; the
       outer page is just content on the dark background. --- */
.page {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 28px 24px 32px;
    animation: fadeUp 0.4s ease both;
}
/* Focused flows (checkout, cart, payment, policies) read best as a
   centered column — still frameless, just narrower. */
.page:not(.page-wide) { max-width: 640px; margin: 0 auto; text-align: center; }
.page-wide { width: 100%; text-align: left; }
.page-wide h1, .page-wide .eyebrow { text-align: center; }
.hero-eyebrow {
    margin: 0 0 10px;
    font-size: var(--font-size-xs);
    font-weight: 800;
    letter-spacing: 0.16em;
    color: var(--color-text-faint);
}
/* The one gold moment in the headline: gradient text, not a flat color. */
.hero-gold {
    background: var(--color-brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-sub {
    margin: 0 0 22px;
    font-size: var(--font-size-lg);
    line-height: 1.6;
    color: var(--color-text-muted);
    max-width: 420px;
}
.hero-coins { display: flex; gap: 10px; margin-bottom: 20px; }
.hero-coins .coin { width: 32px; height: 32px; }
.hero-trust { color: var(--color-text-muted); font-size: var(--font-size-sm); line-height: 1.5; }

@media (max-width: 920px) {
    /* Tablets/phones: the page just flows — no special layout. */
    .page { padding: 22px 16px 28px; }
    .hero-sub { margin-left: auto; margin-right: auto; }
    .hero-coins { justify-content: center; }
}
@media (max-width: 640px) {
    /* Phones: compact hero text. */
    .hero-sub { font-size: var(--font-size-base); }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Site header: a real website header bar — full width, sticky
       at the top, translucent so the page glows faintly through it. --- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 24px;
    background: rgba(10, 13, 19, 0.86);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
}
.brand {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    font-size: var(--font-size-base);
}
.brand-logo { display: block; }
.secure-badge {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-success);
    background: var(--color-success-bg);
    border-radius: var(--radius-pill);
    padding: 5px 11px;
}

.eyebrow {
    margin: 0 0 6px;
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-faint);
}
h1 {
    margin: 0 0 var(--space-2);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.hint { color: var(--color-text-muted); line-height: 1.5; margin: 0 0 var(--space-1); }
.small { color: var(--color-text-faint); font-size: var(--font-size-sm); line-height: 1.5; }
/* --- Site footer: a full-width footer bar, not a card footnote. --- */
.footer {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 24px 16px 32px;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-faint);
    font-size: var(--font-size-xs);
    line-height: 1.6;
    text-align: center;
}
a { color: var(--color-brand); }

:focus-visible {
    outline: 3px solid var(--color-brand-soft);
    outline-offset: 2px;
}

@media (max-width: 420px) {
    .page { padding: 18px 14px 24px; }
    .topbar { padding: 12px 14px; }
    /* Smaller, calmer glow on phones: less paint work, same feel. */
}

/* Respect users who prefer no motion: everything becomes static. */
@media (prefers-reduced-motion: reduce) {
}

/* ============================================================
   Midnight Bazaar 2.0 — base layer (2026-11-01): deeper stage,
   gold selection, slim scrollbars, glassier header.
   ============================================================ */

/* Text selection wears the brand gold. */
::selection { background: var(--color-brand); color: var(--color-text-inverse); }

/* Slim dark scrollbar with a gold thumb on hover (desktop). */
html { scrollbar-color: #2b3139 transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2b3139; border-radius: 8px; border: 2px solid var(--color-bg); }
::-webkit-scrollbar-thumb:hover { background: var(--color-brand); }
::-webkit-scrollbar-track { background: transparent; }



/* Header: stronger glass, a whisper of gold on the hairline. */
.topbar {
    background: rgba(11, 14, 17, 0.94);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
    box-shadow: inset 0 -1px 0 rgba(240, 185, 11, 0.14);
}
.brand { font-weight: 800; letter-spacing: -0.01em; }

h1 { letter-spacing: -0.02em; }

/* The closing brand statement gets a touch more presence. */
.hero-gold { background: linear-gradient(90deg, #f0b90b, #f0b90b 45%, #f0b90b); -webkit-background-clip: text; background-clip: text; }

/* Short pages: the footer rests at the bottom of the screen
   instead of stranding mid-page above a black void. Plain
   column flow — the page still scrolls normally and nothing
   is height-capped or scroll-locked. */
body { display: flex; flex-direction: column; }
.footer { margin-top: auto; }

/* ============================================================
   IVORY LIGHT — base layer: the aurora stage is retired, the
   page is warm ivory with a soft white wash at the top, and
   the header is white glass.
   ============================================================ */
body { background: linear-gradient(180deg, #0b0e11 0, var(--color-bg) 420px); }

.topbar {
    background: rgba(255, 255, 255, 0.88);
    box-shadow: inset 0 -1px 0 rgba(240, 185, 11, 0.18), 0 6px 20px rgba(0, 0, 0, 0.05);
}

a { color: var(--color-brand-text); }

/* Gold gradient text, re-graded for a light background. */
.hero-gold { background: linear-gradient(90deg, #f0b90b, #f0b90b 55%, #f0b90b); -webkit-background-clip: text; background-clip: text; }

:focus-visible { outline: 3px solid var(--color-brand); outline-offset: 2px; } /* Batch 5: solid gold — the 40%-alpha outline was too faint to see (audit) */

html { scrollbar-color: #2b3139 transparent; }
::-webkit-scrollbar-thumb { background: #2b3139; border-color: var(--color-bg); }
::-webkit-scrollbar-thumb:hover { background: var(--color-brand); }

/* ============================================================
   LEDGER BAZAAR — base layer (2026-11-06): the stall awning.
   Deep-green bands bookend the page (header + footer) with a
   gold rule; eyebrows drop the tracked-out caps; headlines use
   Archivo's expanded width so the type itself carries the look.
   ============================================================ */
.topbar {
    background: var(--color-awning);
    border-bottom: 2px solid var(--color-brand);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
.topbar .brand { color: var(--color-awning-text); }
.topbar .brand-logo { border-radius: 6px; box-shadow: 0 0 0 1px rgba(233, 199, 103, 0.55); }
.topbar .topnav .nav-link { color: #848e9c; }
.topbar .topnav .nav-link:hover { color: #ffffff; }
.topbar .topnav .nav-link.active { color: #ffffff; box-shadow: inset 0 -2px 0 var(--color-brand); }
.topbar .secure-badge { background: rgba(255, 255, 255, 0.14); color: #bfe3c8; }
.footer {
    background: var(--color-awning);
    color: #848e9c;
    border-top: 2px solid var(--color-brand);
}
.footer a { color: #f0b90b; }
.eyebrow {
    text-transform: none;
    letter-spacing: 0.01em;
    font-size: 13px;
    font-weight: 650;
    color: var(--color-brand-text);
}
.hero-gold { background: none; color: inherit; -webkit-text-fill-color: currentColor; }
h1, .brand-close h2 { font-stretch: 112%; }

/* Ledger Bazaar audit (2026-11-07): the hero eyebrow gets the
   same sentence-case treatment as .eyebrow. */
.hero-eyebrow { text-transform: none; letter-spacing: 0.01em; font-size: 13px; font-weight: 650; color: var(--color-brand-text); }

/* ============================================================
   SHOPIFY-STYLE — base layer (2026-11-07): the awning comes
   down. Dawn's header is plain white with a single hairline;
   the active nav keeps its gold underline as the one accent.
   ============================================================ */
.topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--color-border);
}
.topbar .brand { color: var(--color-text); }
.topbar .brand-logo { box-shadow: none; }
.topbar .topnav .nav-link { color: var(--color-text-muted); }
.topbar .topnav .nav-link:hover { color: var(--color-text); }
.topbar .topnav .nav-link.active { color: var(--color-text); box-shadow: inset 0 -2px 0 var(--color-brand); }
.topbar .secure-badge { background: var(--color-success-bg); color: var(--color-success); }

/* ============================================================
   BUTTONS + TYPE — base layer (2026-11-07): the reading
   rhythm. Body copy breathes at 1.6 line-height, headings
   tighten their tracking as they grow (the grotesque
   convention), and content links get an underline offset so
   descenders never strike through.
   ============================================================ */
body { line-height: 1.6; }
h1 { letter-spacing: -0.02em; }
h2 { letter-spacing: -0.015em; }
h3 { letter-spacing: -0.01em; }
a { text-underline-offset: 3px; }
.small, .hint { line-height: 1.55; }

/* ============================================================
   QUALITY PASS (2026-11-08): the skip link was black text on
   a black background (the token flip inverted its background
   but not its pairing) — it is white on ink now. The warm
   ivory wash over the top of every page and the beige
   scrollbar retire, the header's warm shadow goes (Dawn's
   header is a flat hairline), and the active nav link drops
   the gold-pill background an older layer left under the
   Dawn underline.
   ============================================================ */
.skip-link { color: #ffffff; }
body { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: #2b3139; }
.topbar { box-shadow: none; }
.topbar .topnav .nav-link.active { background: transparent; border-color: transparent; }

/* ============================================================
   MIDNIGHT FINTECH — canvas (dot mesh + ambient glows),
   frosted glass header, dark footer.
   ============================================================ */
html { color-scheme: dark; }


::selection { background: rgba(240, 185, 11, 0.32); color: #ffffff; }
::-webkit-scrollbar-thumb { background: #2b3139; }
::-webkit-scrollbar-thumb:hover { background: #3a4149; }
::-webkit-scrollbar-track { background: #0b0e11; }
.skip-link { background: var(--color-brand); color: var(--color-text-inverse); }
.announce-bar {
    background: linear-gradient(90deg, rgba(240, 185, 11, 0.16), rgba(14, 203, 129, 0.10), rgba(240, 185, 11, 0.16));
    color: #f0b90b;
    border-bottom: 1px solid rgba(240, 185, 11, 0.22);
}
.announce-bar a { color: #f0b90b; }
.topbar {
    background: rgba(13, 19, 34, 0.78);
    backdrop-filter: blur(16px) saturate(1.5);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 10px 34px -20px rgba(0, 0, 0, 0.9);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: #ffffff; font-weight: 800; letter-spacing: -0.01em; }
.brand-logo { border-radius: 9px; border: 1px solid rgba(240, 185, 11, 0.35); box-shadow: 0 6px 18px -6px rgba(240, 185, 11, 0.45); }
.brand-text { display: inline-flex; flex-direction: column; line-height: 1.12; }
.brand-tag { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 9.5px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--color-text-faint); }
.topbar .topnav .nav-link { color: #b7bdc6; }
.topbar .topnav .nav-link:hover { color: #f0b90b; }
.topbar .topnav .nav-link.active { color: #ffffff; }
.secure-badge { background: rgba(14, 203, 129, 0.10); border: 1px solid rgba(14, 203, 129, 0.25); color: #0ecb81; }
.footer { background: #0b0e11; border-top: 1px solid rgba(255, 255, 255, 0.07); color: var(--color-text-muted); }
.footer a { color: #eaecef; }
.footer a:hover { color: #f0b90b; }

/* The brand is a home link (2026-11-09 owner fix): no
   underline in any state, the name warms to amber and the
   logo tile's glow deepens on hover. */
a.brand { text-decoration: none; cursor: pointer; transition: color 0.25s ease; }
a.brand:hover { color: #f0b90b; text-decoration: none; }
a.brand:hover .brand-logo { border-color: rgba(240, 185, 11, 0.65); box-shadow: 0 8px 22px -6px rgba(240, 185, 11, 0.65); }
.brand-logo { transition: box-shadow 0.25s ease, border-color 0.25s ease; }

/* The page never scrolls sideways (2026-11-09): overflow-x
   clip guards against any stray wide element pushing the
   layout past the right edge of the screen. */
html, body { overflow-x: clip; }

/* ============================================================
   SWISS SLATE — base (2026-11-10 theme rebuild, ui-ux-pro-max
   design system): slate canvas with the dot grid, flat glass
   header, Inter brand + headings, deep-slate footer.
   ============================================================ */


h1, h2 { font-family: var(--font-display); letter-spacing: 0.01em; }
.topbar {
    background: rgba(11, 14, 17, 0.82);
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.brand-name { font-family: var(--font-display); letter-spacing: 0.02em; color: var(--color-text); }
.brand-tag { color: var(--color-brand-text); }
.topnav a { color: var(--color-text-muted); }
.topnav a:hover { color: var(--color-text); }
.topnav a.active { color: var(--color-brand-text); }
.icon-btn { background: var(--color-surface); border-color: var(--color-border); color: var(--color-text); }
.icon-btn:hover { border-color: var(--color-border-strong); }
.badge-count { background: var(--color-brand-grad); color: var(--color-text-inverse); }
.footer { background: #0b0e11; border-top: 1px solid var(--color-border); color: var(--color-text-muted); }
.footer strong, .footer-brand { color: var(--color-text); }
.footer a { color: var(--color-text-muted); }
.footer a:hover { color: var(--color-brand-text); }
.brand-logo { border-color: rgba(240, 185, 11, 0.35); box-shadow: 0 6px 18px -6px rgba(240, 185, 11, 0.4); }
a.brand:hover .brand-logo { border-color: rgba(240, 185, 11, 0.65); box-shadow: 0 8px 22px -6px rgba(240, 185, 11, 0.6); }
.skip-link { background: var(--color-brand); color: var(--color-text-inverse); }
::selection { background: rgba(240, 185, 11, 0.35); }

/* Fintech Clean Dark: the canvas is flat charcoal — no orbs, no dot grid, no drifting washes. */

/* ============================================================
   FINTECH — phone header (2026-11-12): the nav now carries
   four links (Shop, Cart, Checkout, Track Order); on small
   screens the bar stays one slim row — the tagline and the
   Secure badge step aside and the nav scrolls if it must.
   ============================================================ */
@media (max-width: 700px) {
    .topbar { flex-wrap: nowrap; gap: 8px; padding: 10px 12px; }
    .brand-tag { display: none; }
    .topbar .secure-badge { display: none; }
    .topnav { gap: 2px; overflow-x: auto; scrollbar-width: none; }
    .topnav::-webkit-scrollbar { display: none; }
    .topbar .topnav .nav-link { padding: 6px 7px; font-size: 13px; white-space: nowrap; }
    .brand-name { font-size: 15px; }
    .brand-logo { width: 26px; height: 26px; }
}

/* ============================================================
   Pill nav (2026-11-18, owner's example): the top nav links
   become outline pills — a subtle border and muted text at
   rest, a brighter border on hover, and the current page
   gets a gold border with a soft gold glow, replacing the
   old gold underline.
   ============================================================ */
.topbar .topnav { gap: 10px; }
.topbar .topnav .nav-link {
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.02);
    color: #b7bdc6;
    box-shadow: none;
}
.topbar .topnav .nav-link:hover {
    color: #ffffff;
    border-color: var(--color-border-strong);
    background: rgba(255, 255, 255, 0.04);
}
.topbar .topnav .nav-link.active {
    color: #ffffff;
    background: rgba(240, 185, 11, 0.08);
    border-color: var(--color-brand);
    box-shadow: 0 0 16px rgba(240, 185, 11, 0.35), inset 0 0 10px rgba(240, 185, 11, 0.07);
}

/* ============================================================
   Background depth combo (2026-11-18, owner's pick): a soft
   gold glow at the top of the canvas, a faint grain over the
   whole page, and panel tones on alternating homepage
   sections. Pure CSS plus one tiny SVG — no animation, no
   weight. Storefront only; the admin keeps its flat canvas.
   ============================================================ */
body:not(.admin-body) {
    background-image: url('/assets/img/grain.svg'), radial-gradient(ellipse 90% 520px at 50% -140px, rgba(240, 185, 11, 0.075), rgba(240, 185, 11, 0) 70%);
    background-repeat: repeat, no-repeat;
    background-size: 180px 180px, 100% 520px;
    background-position: 0 0, top center;
}
.land-section.band {
    background: #10141a;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    padding: 24px 22px;
}
/* (The footer already carries its own lighter tone, #1e2329 —
   it stays as the closing band.) */

/* Interface-quality pass (jakubkrehel/skills, 2026-11-26). */
html { scroll-padding-top: 84px; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
a { text-underline-position: from-font; text-decoration-thickness: from-font; }
button, .paybtn, .mini-btn, .add-btn, .catchip { -webkit-tap-highlight-color: transparent; }
@media (hover: none) {
    .product-card:hover, .paybtn:hover, .add-btn:hover, .mini-btn:hover, .catchip:hover, .nav-link:hover, .tile:hover span { transform: none; box-shadow: none; filter: none; }
}

/* ============================================================
   Premium Fintech Polish (2026-11-26): typography smoothing,
   consistent focus rings, aligned header controls, refined
   motion, and clean mobile navigation.
   ============================================================ */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Crisp, unmistakable keyboard focus across all interactive elements */
:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 2px;
}
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Topbar: crisp glass depth + unified control baseline */
.topbar {
    background: rgba(11, 14, 17, 0.88);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 28px -20px rgba(0, 0, 0, 0.85);
    gap: 14px;
}
.topbar .topnav {
    display: flex;
    align-items: center;
    gap: 8px;
}
.topbar .topnav .nav-link,
.topbar .header-search-link,
.topbar .secure-badge {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    transition: color var(--dur) var(--ease-out),
                background-color var(--dur) var(--ease-out),
                border-color var(--dur) var(--ease-out),
                box-shadow var(--dur) var(--ease-out),
                transform var(--dur) var(--ease-out);
}
.topbar .topnav .nav-link {
    padding: 0 13px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    color: #c2c9d4;
}
.topbar .topnav .nav-link:hover {
    color: #ffffff;
    border-color: rgba(240, 185, 11, 0.42);
    background: rgba(255, 255, 255, 0.05);
}
.topbar .topnav .nav-link.active {
    color: #ffffff;
    background: rgba(240, 185, 11, 0.12);
    border-color: var(--color-brand);
    box-shadow: 0 0 14px rgba(240, 185, 11, 0.24), inset 0 0 8px rgba(240, 185, 11, 0.08);
}
.topbar .header-search-link {
    padding: 0 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.02);
    color: #c2c9d4;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.topbar .header-search-link:hover {
    color: #ffffff;
    border-color: var(--color-border-strong);
    background: rgba(255, 255, 255, 0.05);
}
.topbar .secure-badge {
    padding: 0 12px;
    gap: 6px;
    white-space: nowrap;
}

/* Footer: balanced spacing and readable contrast */
.footer {
    background: #0d1015;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    padding: 32px 24px 36px;
}
.footer a {
    color: #cfd5df;
    transition: color var(--dur) var(--ease-out);
}
.footer a:hover {
    color: var(--color-brand);
}

@media (max-width: 700px) {
    .topbar {
        padding: 10px 12px;
        gap: 8px;
    }
    .topbar .topnav {
        gap: 6px;
        padding-right: 4px;
    }
    .topbar .topnav .nav-link {
        min-height: 36px;
        padding: 0 10px;
        font-size: 13px;
    }
    .topbar .header-search-link {
        display: none;
    }
}

@media (max-width: 480px) {
    .page {
        padding: 18px 14px 28px;
    }
    .footer {
        padding: 24px 16px 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Anti-slop R-39: every enabled control shows it can be used. */
a[href], button, summary, select, label[for], input[type="checkbox"], input[type="radio"] { cursor: pointer; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; }
