/* ── LIGHT VIEW: warm newsprint. Dark is the default; every visit starts dark. ── */
:root { color-scheme: dark; }
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #EEE8DA;
    --bg-2: #E6DFCF;
    --bg-3: #DCD4C2;
    --cream: #17140F;
    --cream-dim: rgba(23, 20, 15, 0.62);
    --cream-faint: rgba(23, 20, 15, 0.10);
    --rule: rgba(23, 20, 15, 0.14);
    --nav-scrolled: rgba(238, 232, 218, 0.94);
}

/* Paper fibres instead of screen grain; no scanlines on paper. */
:root[data-theme="light"] body::before { opacity: .11; mix-blend-mode: multiply; }
:root[data-theme="light"] body::after { opacity: 0; }

/* Physical objects keep their own colours in both views: the playing cards,
   the tickets, the coin and the switch are things, not page. */
.deck-face--details {
    --bg: #0B0B0B;
    --bg-2: #111111;
    --cream: #EDE7D9;
    --cream-dim: rgba(237, 231, 217, 0.55);
    --cream-faint: rgba(237, 231, 217, 0.10);
    --rule: rgba(237, 231, 217, 0.10);
    color: var(--cream);
}

:root[data-theme="light"] .product-store-link { border-color: rgba(23, 20, 15, .3); }
:root[data-theme="light"] .investor-modal { background: rgba(40, 34, 26, .55); }
:root[data-theme="light"] .investor-modal-panel { border-color: var(--rule); box-shadow: 0 30px 80px rgba(40, 30, 15, .35); }
:root[data-theme="light"] .art-ticket {
    filter: drop-shadow(0 1px 0 rgba(60, 45, 25, .28)) drop-shadow(0 10px 14px rgba(60, 45, 25, .28));
}
:root[data-theme="light"] .art-ticket::before { background-color: #F6F0E2; }
:root[data-theme="light"] .art-coin img {
    filter: drop-shadow(0 2px 0 rgba(40, 30, 15, .35)) drop-shadow(0 9px 10px rgba(40, 30, 15, .3));
}
:root[data-theme="light"] .deck-face { box-shadow: 0 1px 0 #e0d7c6, 0 3px 0 #70685b, 0 4px 0 #1b1814, 0 6px 8px #0004, 0 18px 30px #3a2a1440; }
:root[data-theme="light"] ::selection { background: var(--red); color: #fff; }

/* ── The switch: a tiny worn wall plate in the stone grey of the face's shadows. ── */
.theme-switch-item { display: flex; align-items: center; }
.theme-switch {
    position: relative;
    display: grid;
    place-items: center;
    width: 30px;
    height: 44px;
    margin: -10px -6px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.theme-switch:focus-visible { outline: 1px solid var(--red); outline-offset: -4px; }
.ts-plate {
    position: relative;
    display: block;
    width: 14px;
    height: 20px;
    border-radius: 2.5px 2px 2.5px 2px;
    background:
        url("data:image/svg+xml,%3Csvg viewBox='0 0 40 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.3' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .18 0 0 0 0 .15 0 0 0 .9 -.3'/%3E%3C/filter%3E%3Crect width='40' height='60' filter='url(%23g)'/%3E%3C/svg%3E") 0 0 / 100% 100%,
        radial-gradient(120% 90% at 30% 18%, #a39c92 0%, #857e75 45%, #5d5852 100%);
    box-shadow: inset .6px .6px 0 rgba(255, 250, 240, .28), inset -.6px -.8px 0 rgba(0, 0, 0, .35), 0 1px 1.5px rgba(0, 0, 0, .55);
}
.ts-plate::before, .ts-plate::after {
    content: '';
    position: absolute;
    left: 50%;
    width: 2px;
    height: 2px;
    margin-left: -1px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #8d877d, #3e3a35);
}
.ts-plate::before { top: 1.7px; }
.ts-plate::after { bottom: 1.7px; }
.ts-lever {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 4.2px;
    height: 8px;
    margin: -4px 0 0 -2.1px;
    border-radius: 1.4px;
    background: linear-gradient(#b4ada2, #6f6a62);
    box-shadow: 0 1.6px 1.4px rgba(0, 0, 0, .6);
    transform: perspective(30px) rotateX(-40deg) translateY(1.5px);
    transition: transform .16s cubic-bezier(.3, 1.6, .5, 1), box-shadow .16s;
}
.theme-switch[aria-checked="true"] .ts-lever {
    transform: perspective(30px) rotateX(40deg) translateY(-1.5px);
    background: linear-gradient(#6f6a62, #b4ada2);
    box-shadow: 0 -1.6px 1.4px rgba(0, 0, 0, .5);
}
:root[data-theme="light"] .ts-plate { box-shadow: inset .6px .6px 0 rgba(255, 250, 240, .3), inset -.6px -.8px 0 rgba(0, 0, 0, .3), 0 1px 1.5px rgba(40, 30, 15, .45); }

/* The light coming on: a short tube-light flicker. */
.theme-flicker {
    position: fixed;
    inset: 0;
    z-index: 9500;
    pointer-events: none;
    background: #0B0B0B;
    opacity: 0;
}

@media (max-width: 600px) {
    .theme-switch { width: 26px; margin: -10px -5px; }
    .ts-plate { width: 13px; height: 19px; }
}
@media (prefers-reduced-motion: reduce) {
    .ts-lever { transition: none; }
}
