/* =========================================================================
   WHEEL WONDER // SHARED THEME
   Design tokens + primitives used by index.html and billing.html.
   Everything visual should reference a token here rather than a literal.
   ========================================================================= */

:root {
    /* --- BRAND --- */
    --bronze:         #c7a87b;
    --bronze-bright:  #e6cd9a;
    --sakura:         #ffb7c5;
    --sakura-dim:     #ff8ea6;
    --cyan:           #67e8f9;

    /* --- SURFACES (dark, warm-neutral ramp) --- */
    --bg:        #0a0a0b;
    --bg-deep:   #060607;
    --surface:   #131316;
    --surface-2: #191920;
    --surface-3: #21212a;

    /* --- LINES --- */
    --line:        rgba(255, 255, 255, 0.07);
    --line-strong: rgba(255, 255, 255, 0.14);
    --line-brand:  rgba(199, 168, 123, 0.22);

    /* --- TEXT --- */
    --text:       #e8e6e3;
    --text-muted: #9d9a93;
    --text-dim:   #8a867e;   /* 5.1:1 on --surface — AA for body copy */
    --on-bronze:  #14100a;
    --on-sakura:  #2a0f16;

    /* --- ROLE COLOURS ---
       Named by job rather than by value, because "black input" and "white
       button fill" invert between themes. */
    --input-bg:   #000000;   /* form field ground   */
    --media-bg:   #000000;   /* letterbox behind product art */
    --invert:     #ffffff;   /* max-contrast fill on hover  */
    --invert-ink: #000000;   /* text on that fill   */
    --tint-1:     rgba(255, 255, 255, 0.02);
    --tint-2:     rgba(255, 255, 255, 0.05);
    --scrim:      rgba(0, 0, 0, 0.6);
    --overlay:    rgba(0, 0, 0, 0.86);
    --nav-bg:     rgba(10, 10, 11, 0.78);
    --chip-bg:    rgba(0, 0, 0, 0.78);   /* badges over product art */
    --flag-slate:   #9fb0c4;             /* budget tier, "good card" */
    --flag-chase:   #ffd166;
    --flag-damaged: #ff9a7a;
    --panel-tint: rgba(0, 0, 0, 0.45);   /* inset form panels */
    --noise-opacity: 0.5;
    --hero-ink:   #ffffff;   /* headline sits on the hero's own gradient */
    --hero-glow:  rgba(38, 34, 28, 0.55);
    --scanline:   rgba(255, 255, 255, 0.028);

    /* --- GLOWS / ELEVATION --- */
    --glow-bronze: 0 0 24px rgba(199, 168, 123, 0.30);
    --glow-sakura: 0 0 24px rgba(255, 183, 197, 0.32);
    --shadow-1: 0 2px 10px rgba(0, 0, 0, 0.45);
    --shadow-2: 0 12px 32px rgba(0, 0, 0, 0.55);
    --shadow-3: 0 24px 60px rgba(0, 0, 0, 0.70);

    /* --- MOTION --- */
    --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);
    --dur-1: 140ms;   /* taps, colour swaps      */
    --dur-2: 240ms;   /* hovers, small reveals   */
    --dur-3: 380ms;   /* panels, modals          */
    --dur-4: 620ms;   /* scroll reveals          */

    /* --- LAYERING --- */
    --z-base:    1;
    --z-raised:  10;
    --z-sticky:  100;
    --z-overlay: 200;
    --z-popover: 500;
    --z-modal:   1000;
    --z-toast:   1500;

    /* --- METRICS --- */
    --nav-h: 92px;
    --nav-h-scrolled: 68px;
    --announce-h: 38px;

    /* --- TYPE --- */
    --font-display: 'Chakra Petch', sans-serif;
    --font-body:    'Rajdhani', sans-serif;
}


/* -------------------------------------------------------------------------
   LIGHT THEME
   The site is dark by default because that is its identity, but a visitor
   whose system is set to light gets light unless they have explicitly chosen
   dark, and the toggle wins over both. Every value below was contrast-checked
   against the light grounds — the dark bronze and sakura are deliberate, the
   dark-mode versions are unreadable on paper.
   ------------------------------------------------------------------------- */
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bronze:         #7d5a18;
        --bronze-bright:  #6a4b12;
        --sakura:         #b03a56;
        --sakura-dim:     #93283f;
        --cyan:           #0b6b7a;

        --bg:        #f5f2ec;
        --bg-deep:   #ebe7de;
        --surface:   #ffffff;
        --surface-2: #faf8f4;
        --surface-3: #efebe2;

        --line:        rgba(28, 24, 21, 0.10);
        --line-strong: rgba(28, 24, 21, 0.20);
        --line-brand:  rgba(125, 90, 24, 0.30);

        --text:       #1c1815;
        --text-muted: #55504a;
        --text-dim:   #6b6459;
        --on-bronze:  #ffffff;
        --on-sakura:  #ffffff;

        --input-bg:   #ffffff;
        --media-bg:   #f2efe9;
        --invert:     #1c1815;
        --invert-ink: #ffffff;
        --tint-1:     rgba(28, 24, 21, 0.03);
        --tint-2:     rgba(28, 24, 21, 0.06);
        --scrim:      rgba(28, 24, 21, 0.45);
        --overlay:    rgba(245, 242, 236, 0.94);
        --nav-bg:     rgba(255, 255, 255, 0.86);
        --chip-bg:    rgba(255, 255, 255, 0.90);
        --flag-slate:   #445468;
        --flag-chase:   #7d6000;
        --flag-damaged: #a63f24;
        --panel-tint: rgba(28, 24, 21, 0.04);
        --noise-opacity: 0.22;
        --hero-ink:   #1c1815;
        --hero-glow:  rgba(125, 90, 24, 0.10);
        --scanline:   rgba(28, 24, 21, 0.030);

        --glow-bronze: 0 0 22px rgba(125, 90, 24, 0.20);
        --glow-sakura: 0 0 22px rgba(176, 58, 86, 0.20);
        --shadow-1: 0 2px 8px rgba(28, 24, 21, 0.08);
        --shadow-2: 0 10px 26px rgba(28, 24, 21, 0.12);
        --shadow-3: 0 20px 48px rgba(28, 24, 21, 0.18);
    }
}

:root[data-theme="light"] {
    --bronze:         #7d5a18;
    --bronze-bright:  #6a4b12;
    --sakura:         #b03a56;
    --sakura-dim:     #93283f;
    --cyan:           #0b6b7a;

    --bg:        #f5f2ec;
    --bg-deep:   #ebe7de;
    --surface:   #ffffff;
    --surface-2: #faf8f4;
    --surface-3: #efebe2;

    --line:        rgba(28, 24, 21, 0.10);
    --line-strong: rgba(28, 24, 21, 0.20);
    --line-brand:  rgba(125, 90, 24, 0.30);

    --text:       #1c1815;
    --text-muted: #55504a;
    --text-dim:   #6b6459;
    --on-bronze:  #ffffff;
    --on-sakura:  #ffffff;

    --input-bg:   #ffffff;
    --media-bg:   #f2efe9;
    --invert:     #1c1815;
    --invert-ink: #ffffff;
    --tint-1:     rgba(28, 24, 21, 0.03);
    --tint-2:     rgba(28, 24, 21, 0.06);
    --scrim:      rgba(28, 24, 21, 0.45);
    --overlay:    rgba(245, 242, 236, 0.94);
    --nav-bg:     rgba(255, 255, 255, 0.86);
    --chip-bg:    rgba(255, 255, 255, 0.90);
    --flag-slate:   #445468;
    --flag-chase:   #7d6000;
    --flag-damaged: #a63f24;
    --panel-tint: rgba(28, 24, 21, 0.04);
    --noise-opacity: 0.22;
    --hero-ink:   #1c1815;
    --hero-glow:  rgba(125, 90, 24, 0.10);
    --scanline:   rgba(28, 24, 21, 0.030);

    --glow-bronze: 0 0 22px rgba(125, 90, 24, 0.20);
    --glow-sakura: 0 0 22px rgba(176, 58, 86, 0.20);
    --shadow-1: 0 2px 8px rgba(28, 24, 21, 0.08);
    --shadow-2: 0 10px 26px rgba(28, 24, 21, 0.12);
    --shadow-3: 0 20px 48px rgba(28, 24, 21, 0.18);
}

/* Repaint smoothly when the toggle flips, but never animate on first paint. */
:root.theme-ready body,
:root.theme-ready .site-nav,
:root.theme-ready .announce {
    transition: background-color var(--dur-3) var(--ease-out),
                color var(--dur-3) var(--ease-out);
}

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

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* The UA's `[hidden] { display: none }` sits at the bottom of the cascade, so
   any author `display` rule silently defeats it — a row hidden in JS with
   `el.hidden = true` stays on screen. Restate it with authority. */
[hidden] { display: none !important; }

/* -------------------------------------------------------------------------
   FOCUS — visible for keyboard users, invisible for mouse users
   ------------------------------------------------------------------------- */
:focus { outline: none; }

:focus-visible {
    outline: 2px solid var(--bronze);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Screen-reader-only helper for labels that shouldn't render visually. */
.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 — first tab stop on every page. */
.skip-link {
    position: absolute;
    top: -100px; left: 16px;
    z-index: var(--z-toast);
    background: var(--bronze);
    color: var(--on-bronze);
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.8rem;
    padding: 12px 20px;
    text-decoration: none;
    transition: top var(--dur-2) var(--ease-out);
}
.skip-link:focus-visible { top: 16px; }

/* -------------------------------------------------------------------------
   SCROLLBAR
   ------------------------------------------------------------------------- */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--bg-deep); }
*::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border: 2px solid var(--bg-deep);
    transition: background var(--dur-2) var(--ease-out);
}
*::-webkit-scrollbar-thumb:hover { background: var(--bronze); }

/* -------------------------------------------------------------------------
   SELECTION
   ------------------------------------------------------------------------- */
::selection { background: var(--bronze); color: var(--on-bronze); }

/* -------------------------------------------------------------------------
   SHARED KEYFRAMES
   ------------------------------------------------------------------------- */
@keyframes ww-rise {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: none; }
}
@keyframes ww-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes ww-shimmer {
    from { background-position: -180% 0; }
    to   { background-position: 180% 0; }
}
@keyframes ww-sweep {
    from { transform: translateX(-120%) skewX(-18deg); }
    to   { transform: translateX(220%) skewX(-18deg); }
}

/* Skeleton placeholder for async content — reserves layout, avoids jump. */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--surface) 0%, var(--surface-2) 45%,
        var(--surface-3) 50%,
        var(--surface-2) 55%, var(--surface) 100%
    );
    background-size: 220% 100%;
    animation: ww-shimmer 1.5s var(--ease-in-out) infinite;
}

/* -------------------------------------------------------------------------
   REDUCED MOTION
   One authoritative override: strip decorative motion, keep state changes
   legible (opacity-only, near-instant) so nothing silently disappears.
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

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

    /* Anything that fades/slides in on scroll must end up visible. */
    .reveal-on-scroll,
    .hero-content,
    .hero-badges,
    .hero-cta,
    .card-inner {
        opacity: 1 !important;
        transform: none !important;
    }

    /* Purely decorative ambience is removed outright. */
    #sakura-container,
    .spotlight,
    .hero-scanlines { display: none !important; }
}

/* =========================================================================
   SHARED CHROME
   Announcement bar, navigation, drawer and footer used by the secondary
   pages. index.html carries its own copies because they are wired into the
   cart panel and catalog drawer.
   ========================================================================= */

.announce {
    position: relative;
    z-index: var(--z-sticky);
    background: linear-gradient(90deg, var(--bg-deep), var(--surface) 50%, var(--bg-deep));
    border-bottom: 1px solid var(--line-brand);
    overflow: hidden;
}
.announce-track {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 9px 16px;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: center;
}
.announce-track i { color: var(--bronze); margin-right: 6px; }
.announce-track a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    color: var(--bronze);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}
.announce-track a:hover { color: var(--bronze-bright); border-bottom-color: currentColor; }
.announce-sep { color: var(--line-strong); }

.site-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 50px;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--nav-bg);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid transparent;
    transition: padding var(--dur-3) var(--ease-out), border-color var(--dur-3) var(--ease-out);
}
.site-nav.scrolled { padding: 10px 50px; border-bottom-color: var(--line-brand); }
.site-nav .nav-logo { display: flex; }
.site-nav .nav-logo img {
    height: 42px;
    display: block;
    transition: height var(--dur-3) var(--ease-out);
}
.site-nav.scrolled .nav-logo img { height: 34px; }

.nav-actions { display: flex; gap: 12px; align-items: center; }
.nav-links { display: flex; gap: 4px; align-items: center; margin-right: 8px; }
.nav-link {
    position: relative;
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 13px 14px;
    transition: color var(--dur-2) var(--ease-out);
}
.nav-link::after {
    content: '';
    position: absolute;
    left: 14px; right: 14px; bottom: 4px;
    height: 1px;
    background: var(--bronze);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform var(--dur-2) var(--ease-out);
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after, .nav-link.current::after { transform: scaleX(1); }
.nav-link.current { color: var(--bronze); }

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--bronze);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition:
        color var(--dur-2) var(--ease-out),
        border-color var(--dur-2) var(--ease-out),
        background var(--dur-2) var(--ease-out),
        box-shadow var(--dur-2) var(--ease-out),
        transform var(--dur-1) var(--ease-out);
}
.nav-btn:hover {
    color: var(--bronze-bright);
    border-color: var(--bronze);
    background: rgba(199, 168, 123, 0.08);
    box-shadow: var(--glow-bronze);
}
.nav-btn:active { transform: scale(0.96); }
.menu-btn { width: 44px; padding: 0; }

.nav-scrim {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-sticky) + 1);
    background: var(--scrim);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-3) var(--ease-out);
}
.nav-scrim.open { opacity: 1; pointer-events: auto; }

#nav-drawer {
    position: fixed;
    top: 0; right: 0;
    height: 100dvh;
    width: min(320px, 84vw);
    z-index: calc(var(--z-sticky) + 2);
    background: var(--surface);
    border-left: 1px solid var(--line-brand);
    box-shadow: var(--shadow-3);
    padding: 26px 26px 40px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform var(--dur-3) var(--ease-out), visibility 0s linear var(--dur-3);
}
#nav-drawer.open {
    transform: none;
    visibility: visible;
    transition: transform var(--dur-3) var(--ease-out), visibility 0s;
}
.drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}
.drawer-title {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--bronze);
}
.drawer-close {
    width: 44px; height: 44px;
    display: grid; place-items: center;
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    transition: color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}
.drawer-close:hover { color: var(--sakura); border-color: var(--sakura); }
.drawer-link {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 52px;
    padding: 0 6px;
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--line);
    transition: color var(--dur-2) var(--ease-out);
}
.drawer-link:hover { color: var(--sakura); }

/* --- FOOTER --- */
.site-footer {
    background: var(--bg-deep);
    border-top: 1px solid var(--line-brand);
    padding: 70px 8% 30px;
    position: relative;
}
.site-footer::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 140px; height: 2px;
    background: linear-gradient(90deg, transparent, var(--bronze), transparent);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr 1fr 1fr;
    gap: 50px;
    max-width: 1200px;
    margin: 0 auto 50px;
}
.footer-col h4 {
    font-family: var(--font-display);
    color: var(--bronze);
    letter-spacing: 3px;
    text-transform: uppercase;
    font-size: 0.82rem;
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line-brand);
}
.footer-col p { color: var(--text-muted); line-height: 1.65; font-size: 0.93rem; margin: 0 0 18px; }
.footer-brand-tag {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text);
    letter-spacing: 4px;
    text-transform: uppercase;
    font-size: 1.1rem;
    margin-bottom: 14px;
}
.footer-brand-tag span { color: var(--sakura); }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 2px; color: var(--text-muted); font-size: 0.9rem; }
.footer-col li i { width: 20px; color: var(--bronze); margin-right: 8px; }
.footer-col a {
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    transition: color var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
.footer-col a:hover { color: var(--sakura); transform: translateX(4px); }
.footer-bottom {
    border-top: 1px solid var(--line);
    padding-top: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 10px;
}
.footer-bottom p {
    color: var(--text-dim);
    font-size: 0.78rem;
    font-family: var(--font-display);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0;
}

/* --- NEWSLETTER --- */
.field-label {
    display: block;
    color: var(--bronze);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.68rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.newsletter-row { display: flex; gap: 0; }
.newsletter-row input {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: 11px 13px;
    background: var(--input-bg);
    border: 1px solid var(--line-strong);
    border-right: none;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color var(--dur-2) var(--ease-out);
}
.newsletter-row input::placeholder { color: var(--text-dim); }
.newsletter-row input:focus { border-color: var(--bronze); }
.newsletter-btn {
    min-height: 44px;
    padding: 0 20px;
    background: var(--bronze);
    color: var(--on-bronze);
    border: 1px solid var(--bronze);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}
.newsletter-btn:hover:not(:disabled) { background: var(--invert); border-color: var(--invert); color: var(--invert-ink); }
.newsletter-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.newsletter-msg { margin: 9px 0 0; font-size: 0.82rem; min-height: 1em; color: var(--text-dim); }
.newsletter-msg.ok  { color: var(--sakura); }
.newsletter-msg.err { color: #ff7a7a; }

@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}
@media (max-width: 900px) {
    .site-nav .nav-links { display: none; }
}
@media (min-width: 901px) {
    .site-nav .menu-btn { display: none; }
}
@media (max-width: 850px) {
    .site-nav, .site-nav.scrolled { padding: 12px 20px; }
    .site-footer { padding: 55px 6% 25px; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .announce-track { font-size: 0.62rem; letter-spacing: 1.5px; gap: 8px; }
    .announce-sep { display: none; }
}

/* Three messages wrap to three lines on a phone — 112px of announcement before
   the visitor sees anything. Keep the one that earns its place. */
@media (max-width: 700px) {
    .announce-track > span:not(:first-child) { display: none; }
    .announce-track { padding: 6px 14px; }
    .announce-track a { min-height: 32px; }
}
@media (max-width: 500px) {
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
}
