/*
 * Themes. VaultCorp (in app.css) is the default; each theme below only swaps the palette.
 * Picked per browser from the footer; the collector can also set the theme everyone sees.
 */

/* ---------- Halloween: pumpkin on a haunted purple-black ---------- */
[data-theme="halloween"] {
  --accent: #FF7A1A; --accent-ink: #140A02;
  --bg: #0B0710; --panel: #18111F; --panel-2: #120C18; --sunk: #0E0913;
  --line: #2E2238; --line-2: #3A2B47; --hover-line: #5A4270;
  --text: #F4EEF8; --muted: #B7A8C4; --muted-2: #9A8AA8; --warn: #FF9F5A;
  --auto-bg: #2A1838; --auto: #C9A2FF; --patch-bg: #33200F; --patch: #FFB27A;
  --rc-bg: #1C2A12; --rc: #A6E36B; --sp-bg: #2E1D10; --sp: #FFC79A;
  --tile-hi: #241830; --tile-lo: #0A060E;
}
[data-theme="halloween"] body {
  background-image:
    radial-gradient(60rem 30rem at 85% -10%, rgba(255, 122, 26, .10), transparent 60%),
    radial-gradient(40rem 25rem at 0% 110%, rgba(140, 70, 220, .12), transparent 60%);
  background-attachment: fixed;
}
[data-theme="halloween"] .brand svg { filter: drop-shadow(0 0 6px rgba(255, 122, 26, .55)); }

/* ---------- Christmas: snow on pine, with cranberry ---------- */
[data-theme="christmas"] {
  --accent: #E8475A; --accent-ink: #FFFFFF;
  --bg: #061410; --panel: #0E211A; --panel-2: #0A1A14; --sunk: #08160F;
  --line: #1D3A2E; --line-2: #26483A; --hover-line: #3F6B58;
  --text: #F3FAF6; --muted: #A9C4B8; --muted-2: #8CAA9D; --warn: #F2B8C0;
  --auto-bg: #12302A; --auto: #9FE3D0; --patch-bg: #3A1820; --patch: #FFB3BE;
  --rc-bg: #133A24; --rc: #8FE8AE; --sp-bg: #2E2A2A; --sp: #F1E4E4;
  --tile-hi: #15302A; --tile-lo: #04100C;
}
[data-theme="christmas"] body {
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, rgba(255,255,255,.55), transparent),
    radial-gradient(1px 1px at 120px 80px, rgba(255,255,255,.4), transparent),
    radial-gradient(2px 2px at 200px 150px, rgba(255,255,255,.35), transparent),
    radial-gradient(1px 1px at 60px 190px, rgba(255,255,255,.45), transparent),
    radial-gradient(1.5px 1.5px at 260px 40px, rgba(255,255,255,.3), transparent);
  background-size: 300px 220px;
  animation: vc-snow 40s linear infinite;
}
@keyframes vc-snow { to { background-position: 60px 660px, -40px 660px, 30px 660px, 0 660px, -20px 660px; } }
@media (prefers-reduced-motion: reduce) { [data-theme="christmas"] body { animation: none; } }

/* ---------- Midnight: deep navy, electric blue ---------- */
[data-theme="midnight"] {
  --accent: #4DA3FF; --accent-ink: #04101F;
  --bg: #050A14; --panel: #0E1626; --panel-2: #0A111F; --sunk: #080E1A;
  --line: #1C2940; --line-2: #26354F; --hover-line: #3D5277;
  --text: #EDF3FC; --muted: #A2B1C8; --muted-2: #8496B0;
  --auto-bg: #142A45; --auto: #8CC4FF; --rc-bg: #10302B; --rc: #6FE3C6;
  --tile-hi: #152036; --tile-lo: #040810;
}

/* ---------- Ultraviolet: black light ---------- */
[data-theme="ultraviolet"] {
  --accent: #A97BFF; --accent-ink: #0C0518;
  --bg: #08060E; --panel: #15111F; --panel-2: #0F0C17; --sunk: #0B0912;
  --line: #2A2240; --line-2: #352B50; --hover-line: #54467E;
  --text: #F1EDFB; --muted: #B0A7C6; --muted-2: #958BAD;
  --auto-bg: #1E2240; --auto: #9DB4FF; --patch-bg: #33173A; --patch: #F0A8FF;
  --tile-hi: #1E1830; --tile-lo: #06040B;
}

/* ---------- Steel: gunmetal and ice ---------- */
[data-theme="steel"] {
  --accent: #5CE1E6; --accent-ink: #031314;
  --bg: #0C0E10; --panel: #181C20; --panel-2: #13161A; --sunk: #101316;
  --line: #2A3036; --line-2: #353D45; --hover-line: #56616C;
  --text: #EEF2F4; --muted: #A8B2BA; --muted-2: #8C979F;
  --auto-bg: #17303A; --auto: #9FDDEB; --tile-hi: #22282E; --tile-lo: #090B0D;
}

/* ---------- Neon: arcade pink on black ---------- */
[data-theme="neon"] {
  --accent: #FF4FD8; --accent-ink: #1A0316;
  --bg: #050507; --panel: #111116; --panel-2: #0C0C10; --sunk: #09090C;
  --line: #24242E; --line-2: #2F2F3C; --hover-line: #4E4E63;
  --text: #F5F3FA; --muted: #ABA8BA; --muted-2: #8F8CA0;
  --auto-bg: #102A33; --auto: #5CE8FF; --patch-bg: #33102C; --patch: #FF9BEA;
  --rc-bg: #10301F; --rc: #5CFFA8; --tile-hi: #1A1622; --tile-lo: #040405;
}
[data-theme="neon"] .accent, [data-theme="neon"] h1 .accent { text-shadow: 0 0 18px rgba(255, 79, 216, .45); }

/* ---------- Deep Sea: dark teal and aqua ---------- */
[data-theme="deepsea"] {
  --accent: #2EE6C8; --accent-ink: #02130F;
  --bg: #031014; --panel: #0A1D22; --panel-2: #07171B; --sunk: #051418;
  --line: #15343B; --line-2: #1D424A; --hover-line: #326670;
  --text: #EAF7F6; --muted: #9DBFC0; --muted-2: #80A4A6;
  --auto-bg: #0F2B3D; --auto: #86CFFF; --tile-hi: #0F2A30; --tile-lo: #020A0C;
}

/* ---------- Noir: black and white, nothing else ---------- */
[data-theme="noir"] {
  --accent: #F2F2F2; --accent-ink: #0A0A0A;
  --bg: #080808; --panel: #141414; --panel-2: #0E0E0E; --sunk: #0B0B0B;
  --line: #262626; --line-2: #303030; --hover-line: #555555;
  --text: #F2F2F2; --muted: #A8A8A8; --muted-2: #8C8C8C; --warn: #D8D8D8;
  --auto-bg: #1F1F1F; --auto: #D6D6D6; --patch-bg: #1F1F1F; --patch: #C8C8C8;
  --rc-bg: #1F1F1F; --rc: #E6E6E6; --sp-bg: #1F1F1F; --sp: #CFCFCF;
  --tile-hi: #1C1C1C; --tile-lo: #070707;
}
[data-theme="noir"] .tile-img img, [data-theme="noir"] .view-img img { filter: grayscale(1) contrast(1.05); transition: filter .3s; }
[data-theme="noir"] .tile:hover .tile-img img, [data-theme="noir"] .view-img:hover img { filter: none; }

/* ---------- Archive: light, paper and green ink ---------- */
[data-theme="archive"] {
  color-scheme: light;
  --accent: #0F8A55; --accent-ink: #FFFFFF;
  --bg: #F3F0E8; --panel: #FBF9F4; --panel-2: #F6F3EC; --sunk: #ECE8DE;
  --line: #DDD7C9; --line-2: #CFC8B8; --hover-line: #A79F8C;
  --text: #1C1F1D; --muted: #5C625D; --muted-2: #6E736E; --warn: #9A5B12;
  --auto-bg: #E1ECF8; --auto: #1F5C99; --patch-bg: #EDE4F8; --patch: #5E3C99;
  --rc-bg: #DFF1E6; --rc: #146B3E; --sp-bg: #F1EBDD; --sp: #6E5523;
  --tile-hi: #FFFFFF; --tile-lo: #E6E1D5;
}

/* ---------- Arctic: light, cool blue ---------- */
[data-theme="arctic"] {
  color-scheme: light;
  --accent: #1D6FE0; --accent-ink: #FFFFFF;
  --bg: #EEF3F8; --panel: #FFFFFF; --panel-2: #F6F9FC; --sunk: #E6ECF3;
  --line: #D5DFEA; --line-2: #C5D2E0; --hover-line: #92A6BE;
  --text: #132033; --muted: #55657A; --muted-2: #697A90; --warn: #9A5B12;
  --auto-bg: #E2EEFF; --auto: #1D5BB8; --patch-bg: #EEE6FF; --patch: #5B3BB0;
  --rc-bg: #DDF4EA; --rc: #0F7048; --sp-bg: #EEF0F4; --sp: #4A5568;
  --tile-hi: #FFFFFF; --tile-lo: #DCE5EF;
}

/* The theme picker in the footer */
.theme-pick { display: inline-flex; align-items: center; gap: .4rem; }
.theme-pick select { min-height: 0; width: auto; padding: .25rem 1.6rem .25rem .5rem; font: 11px var(--f-mono); letter-spacing: .06em; background-color: var(--panel-2); }
.theme-pick .link { font: 11px var(--f-mono); }
.foot-links { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
@media (max-width: 700px) {
  .foot-links { display: flex; margin-top: .6rem; }
  .theme-pick { flex-basis: 100%; }
  .theme-pick select { flex: 1; }
}

/* =====================================================================
 * Whimsy. Each theme (not the default) gets a few tricks of its own.
 * Decorations sit behind the page (body::before) and never catch clicks.
 * ===================================================================== */
[data-theme]:not([data-theme="vault"]) body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
[data-theme]:not([data-theme="vault"]) .tile { position: relative; }
.brand-name::after { font-size: .8em; margin-left: .35em; }

/* ---- Halloween: fog, candlelight, things that go bump ---- */
[data-theme="halloween"] .brand-name::after { content: '🎃'; }
[data-theme="halloween"] body::before {
  background:
    radial-gradient(45rem 14rem at 20% 85%, rgba(190, 160, 230, .07), transparent 70%),
    radial-gradient(38rem 12rem at 75% 95%, rgba(190, 160, 230, .06), transparent 70%);
  animation: vc-fog 26s ease-in-out infinite alternate;
}
@keyframes vc-fog { to { transform: translateX(6%); } }
[data-theme="halloween"] .hero h1 .accent { animation: vc-candle 3.2s infinite; }
@keyframes vc-candle { 0%, 100% { opacity: 1; } 42% { opacity: 1; } 44% { opacity: .55; } 46% { opacity: .95; } 48% { opacity: .7; } 50% { opacity: 1; } 78% { opacity: .9; } }
[data-theme="halloween"] .tile:hover { transform: translateY(-2px) rotate(-1.2deg); box-shadow: 0 10px 30px rgba(255, 122, 26, .18); }
[data-theme="halloween"] .tile-body { border-top-style: dashed; }

/* ---- Christmas: snow, fairy lights, candy canes ---- */
[data-theme="christmas"] .brand-name::after { content: '🎄'; }
[data-theme="christmas"] .topbar { border-bottom: 0; }
[data-theme="christmas"] .topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -7px; height: 9px; pointer-events: none;
  background:
    radial-gradient(circle at 8px 5px, #FF5C6C 3px, transparent 3.6px) 0 0 / 64px 9px repeat-x,
    radial-gradient(circle at 24px 5px, #5CFFA0 3px, transparent 3.6px) 0 0 / 64px 9px repeat-x,
    radial-gradient(circle at 40px 5px, #FFFFFF 3px, transparent 3.6px) 0 0 / 64px 9px repeat-x,
    radial-gradient(circle at 56px 5px, #6FB8FF 3px, transparent 3.6px) 0 0 / 64px 9px repeat-x,
    linear-gradient(to bottom, transparent 3px, #1D3A2E 3px, #1D3A2E 4px, transparent 4px);
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, .35));
  animation: vc-twinkle 1.6s steps(2) infinite;
}
@keyframes vc-twinkle { 50% { filter: drop-shadow(0 0 7px rgba(255, 255, 255, .6)) brightness(1.35); } }
[data-theme="christmas"] .tile-body { border-top: 6px solid transparent; border-image: repeating-linear-gradient(45deg, var(--accent) 0 7px, #F3FAF6 7px 14px) 6; }
[data-theme="christmas"] .meter > div { background: repeating-linear-gradient(45deg, var(--accent) 0 8px, #F3FAF6 8px 16px); }
[data-theme="christmas"] .tile:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .15); }

/* ---- Midnight: a sky full of stars and a moon ---- */
[data-theme="midnight"] .brand-name::after { content: '☾'; color: #CFE3FF; }
[data-theme="midnight"] body::before {
  background:
    radial-gradient(14rem 14rem at 88% 8%, rgba(210, 228, 255, .10), transparent 60%),
    radial-gradient(1px 1px at 10% 20%, #fff, transparent), radial-gradient(1px 1px at 30% 70%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 55% 35%, #fff, transparent), radial-gradient(1px 1px at 72% 60%, #fff, transparent),
    radial-gradient(1px 1px at 90% 85%, #fff, transparent), radial-gradient(1.5px 1.5px at 42% 92%, #fff, transparent),
    radial-gradient(1px 1px at 18% 52%, #fff, transparent), radial-gradient(1px 1px at 64% 12%, #fff, transparent);
  background-size: 100% 100%, 420px 380px, 420px 380px, 420px 380px, 420px 380px, 420px 380px, 420px 380px, 420px 380px, 420px 380px;
  opacity: .8; animation: vc-stars 5s ease-in-out infinite alternate;
}
@keyframes vc-stars { to { opacity: .45; } }
[data-theme="midnight"] .tile:hover { box-shadow: 0 0 0 1px rgba(77, 163, 255, .4), 0 10px 40px rgba(77, 163, 255, .18); }

/* ---- Ultraviolet: everything glows under the black light ---- */
[data-theme="ultraviolet"] .brand-name::after { content: '✦'; color: var(--accent); }
[data-theme="ultraviolet"] body::before { background: radial-gradient(60rem 40rem at 50% 120%, rgba(169, 123, 255, .14), transparent 65%); }
[data-theme="ultraviolet"] .hero h1 .accent, [data-theme="ultraviolet"] .stat-num { text-shadow: 0 0 14px rgba(169, 123, 255, .55); }
[data-theme="ultraviolet"] .hero h1 .accent { animation: vc-uv 4s ease-in-out infinite; }
@keyframes vc-uv { 50% { text-shadow: 0 0 26px rgba(169, 123, 255, .9), 0 0 4px #fff; } }
[data-theme="ultraviolet"] .tile:hover { box-shadow: 0 0 0 1px var(--accent), 0 0 30px rgba(169, 123, 255, .35); }
[data-theme="ultraviolet"] .stamp { text-shadow: 0 0 8px currentColor; box-shadow: 0 0 10px color-mix(in srgb, currentColor 40%, transparent); }

/* ---- Steel: brushed metal, rivets and a polish on hover ---- */
[data-theme="steel"] .brand-name::after { content: '⚙'; color: var(--muted); }
[data-theme="steel"] .panel, [data-theme="steel"] .tile, [data-theme="steel"] .stat-grid > div, [data-theme="steel"] .stat-grid > a {
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 3px), linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 40%);
}
[data-theme="steel"] .tile::before {
  content: ''; position: absolute; inset: 5px; z-index: 2; pointer-events: none;
  background:
    radial-gradient(circle at 3px 3px, #8C979F 1.6px, transparent 2.2px) top left / 7px 7px no-repeat,
    radial-gradient(circle at 3px 3px, #8C979F 1.6px, transparent 2.2px) top right / 7px 7px no-repeat,
    radial-gradient(circle at 3px 3px, #8C979F 1.6px, transparent 2.2px) bottom left / 7px 7px no-repeat,
    radial-gradient(circle at 3px 3px, #8C979F 1.6px, transparent 2.2px) bottom right / 7px 7px no-repeat;
}
[data-theme="steel"] .tile-img::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .16) 50%, transparent 65%) -150% 0 / 200% 100% no-repeat;
  transition: background-position .7s;
}
[data-theme="steel"] .tile:hover .tile-img::after { background-position: 250% 0; }
[data-theme="steel"] .stamp { text-shadow: 0 1px 0 rgba(255, 255, 255, .15), 0 -1px 0 rgba(0, 0, 0, .6); }

/* ---- Neon: a synthwave sunset grid and a sign that won't stop flickering ---- */
[data-theme="neon"] .brand-name { text-shadow: 0 0 8px rgba(255, 79, 216, .7), 0 0 2px #fff; }
[data-theme="neon"] .brand-name::after { content: '★'; color: #5CE8FF; text-shadow: 0 0 8px #5CE8FF; }
[data-theme="neon"] body::before {
  top: auto; height: 42vh;
  background:
    linear-gradient(to top, transparent, rgba(5, 5, 7, 1) 92%),
    repeating-linear-gradient(90deg, rgba(255, 79, 216, .35) 0 1px, transparent 1px 60px),
    repeating-linear-gradient(0deg, rgba(92, 232, 255, .30) 0 1px, transparent 1px 40px);
  transform: perspective(300px) rotateX(55deg); transform-origin: bottom; opacity: .55;
  animation: vc-grid 3s linear infinite;
}
@keyframes vc-grid { to { background-position: 0 0, 0 0, 0 40px; } }
[data-theme="neon"] .hero h1 .accent { animation: vc-neon 6s infinite; }
@keyframes vc-neon { 0%, 18%, 22%, 25%, 53%, 57%, 100% { text-shadow: 0 0 6px #fff, 0 0 18px #FF4FD8, 0 0 42px #FF4FD8; opacity: 1; } 20%, 24%, 55% { text-shadow: none; opacity: .55; } }
[data-theme="neon"] .tile:hover { box-shadow: 0 0 0 1px #FF4FD8, 0 0 18px rgba(255, 79, 216, .5), 0 0 40px rgba(92, 232, 255, .25); }
[data-theme="neon"] .btn-primary { box-shadow: 0 0 14px rgba(255, 79, 216, .55); }

/* ---- Deep Sea: bubbles, and cards that bob ---- */
[data-theme="deepsea"] .brand-name::after { content: '°ₒ'; color: var(--accent); }
[data-theme="deepsea"] body::before {
  background:
    radial-gradient(circle at 20px 20px, transparent 4px, rgba(46, 230, 200, .25) 4.5px, transparent 5.5px),
    radial-gradient(circle at 110px 90px, transparent 2px, rgba(46, 230, 200, .2) 2.5px, transparent 3.5px),
    radial-gradient(circle at 70px 160px, transparent 6px, rgba(134, 207, 255, .18) 6.5px, transparent 7.5px),
    radial-gradient(70rem 30rem at 50% -10%, rgba(46, 230, 200, .08), transparent 70%);
  background-size: 180px 200px, 180px 200px, 180px 200px, 100% 100%;
  animation: vc-bubbles 18s linear infinite;
}
@keyframes vc-bubbles { to { background-position: 10px -400px, -15px -400px, 5px -400px, 0 0; } }
[data-theme="deepsea"] .tile:hover { animation: vc-bob 2.4s ease-in-out infinite; }
@keyframes vc-bob { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(-6px); } }

/* ---- Noir: a little film grain and a vignette ---- */
[data-theme="noir"] body::before {
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .55) 100%),
    repeating-radial-gradient(circle at 17% 32%, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px);
}

/* ---- Archive: an old filing cabinet, typewriter and all ---- */
[data-theme="archive"] { --f-head: 'Courier New', Courier, ui-monospace, monospace; }
[data-theme="archive"] .brand-name::after { content: '✎'; color: var(--accent); }
[data-theme="archive"] body::before {
  background:
    repeating-linear-gradient(0deg, rgba(120, 100, 60, .035) 0 1px, transparent 1px 4px),
    radial-gradient(ellipse at 50% 0%, transparent 60%, rgba(140, 115, 70, .12) 100%);
}
[data-theme="archive"] .tile { box-shadow: 0 1px 2px rgba(60, 50, 30, .12), 0 6px 14px rgba(60, 50, 30, .06); }
[data-theme="archive"] .tile:nth-child(3n+1) { transform: rotate(-.6deg); }
[data-theme="archive"] .tile:nth-child(3n+2) { transform: rotate(.45deg); }
[data-theme="archive"] .tile:hover { transform: rotate(0) translateY(-2px); }
[data-theme="archive"] .tile::before {
  content: ''; position: absolute; top: -6px; left: 50%; width: 70px; height: 18px; margin-left: -35px; z-index: 3; pointer-events: none;
  background: rgba(230, 215, 170, .75); transform: rotate(-3deg); box-shadow: 0 1px 1px rgba(0, 0, 0, .08);
}
[data-theme="archive"] .tile { overflow: visible; }
[data-theme="archive"] .tile-head { overflow: hidden; border-radius: 6px 6px 0 0; }
[data-theme="archive"] .stamp { mix-blend-mode: multiply; opacity: .85; }

/* ---- Arctic: frosted glass and icicles ---- */
[data-theme="arctic"] .brand-name::after { content: '❄'; color: var(--accent); }
[data-theme="arctic"] body::before { background: radial-gradient(60rem 30rem at 15% -5%, rgba(173, 214, 255, .55), transparent 65%), radial-gradient(50rem 30rem at 100% 100%, rgba(200, 230, 255, .5), transparent 65%); }
[data-theme="arctic"] .topbar { border-bottom: 0; }
[data-theme="arctic"] .topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -12px; height: 12px; pointer-events: none;
  background:
    linear-gradient(225deg, #D6E8FA 50%, transparent 50%) 0 0 / 18px 12px repeat-x,
    linear-gradient(135deg, #D6E8FA 50%, transparent 50%) 0 0 / 18px 12px repeat-x;
  filter: drop-shadow(0 1px 1px rgba(60, 100, 160, .35));
}
[data-theme="arctic"] .panel, [data-theme="arctic"] .tile { background: color-mix(in srgb, var(--panel) 72%, transparent); backdrop-filter: blur(10px); }

/* Calm down for anyone who's asked their device for less motion. */
@media (prefers-reduced-motion: reduce) {
  [data-theme] body::before, [data-theme] .topbar::after, [data-theme] .hero h1 .accent, [data-theme] .tile:hover { animation: none !important; }
}

/* Steel: photos come out cold and metallic until you hover. */
[data-theme="steel"] .tile-img img { filter: saturate(.4) contrast(1.08) brightness(.95); transition: filter .35s; }
[data-theme="steel"] .tile:hover .tile-img img { filter: none; }

/* =====================================================================
 * Comic Book: ink outlines, halftone dots, speech bubbles, POW!
 * ===================================================================== */
[data-theme="comic"] {
  color-scheme: light;
  --accent: #1E6BFF; --accent-ink: #FFFFFF;
  --bg: #FBF7F0; --panel: #FFFFFF; --panel-2: #FFFDF8; --sunk: #F3EEE4;
  --line: #111111; --line-2: #111111; --hover-line: #111111;
  --text: #111111; --muted: #333333; --muted-2: #4A4A4A; --warn: #B0127A;
  --auto-bg: #DDEBFF; --auto: #0B3FB0; --patch-bg: #FFE0F4; --patch: #B0127A;
  --rc-bg: #DDF7E7; --rc: #0B7A3E; --sp-bg: #EEE6FF; --sp: #5B2DB0;
  --tile-hi: #FFFFFF; --tile-lo: #ECE6DA;
  --f-head: 'Bangers', Impact, 'Arial Black', sans-serif;
}
[data-theme="comic"] .brand-name::after { content: '💥'; }
[data-theme="comic"] body::before {
  background:
    radial-gradient(rgba(30, 107, 255, .16) 1.3px, transparent 1.8px) 0 0 / 11px 11px,
    radial-gradient(rgba(255, 62, 165, .12) 1.3px, transparent 1.8px) 5px 5px / 11px 11px;
  -webkit-mask-image: linear-gradient(160deg, #000, transparent 55%, #000);
          mask-image: linear-gradient(160deg, #000, transparent 55%, #000);
}
[data-theme="comic"] h1, [data-theme="comic"] h2, [data-theme="comic"] .tile-title, [data-theme="comic"] .stat-num, [data-theme="comic"] .brand-name { letter-spacing: .04em; font-weight: 400; }
[data-theme="comic"] .hero h1 { line-height: .98; }
[data-theme="comic"] .hero h1 .accent { -webkit-text-stroke: 2px #111; text-shadow: 4px 4px 0 #FF3EA5; }
[data-theme="comic"] .topbar { background: #FFFFFF; border-bottom: 3px solid #111; }
[data-theme="comic"] .panel, [data-theme="comic"] .tile, [data-theme="comic"] .stat-grid { border: 2.5px solid #111; box-shadow: 5px 5px 0 #111; }
[data-theme="comic"] .btn, [data-theme="comic"] input, [data-theme="comic"] select, [data-theme="comic"] textarea { border: 2px solid #111; }
[data-theme="comic"] .btn { box-shadow: 3px 3px 0 #111; }
[data-theme="comic"] .btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #111; }
[data-theme="comic"] .tile-body { border-top: 3px solid #111; }
[data-theme="comic"] .badge { border: 1.5px solid #111; }
[data-theme="comic"] .hero .detail {
  position: relative; display: inline-block; margin-top: 14px; padding: .7rem 1rem; max-width: 34rem;
  background: #fff; color: #111; border: 2.5px solid #111; border-radius: 18px; box-shadow: 4px 4px 0 #111;
}
[data-theme="comic"] .hero .detail::before {
  content: ''; position: absolute; left: 28px; top: -16px; width: 22px; height: 16px;
  background: #fff; border-left: 2.5px solid #111; border-top: 2.5px solid #111; transform: skewX(-35deg); border-radius: 2px 0 0 0;
}
[data-theme="comic"] .tile:hover { transform: translate(-3px, -3px) rotate(-1deg); box-shadow: 9px 9px 0 #111; border-color: #111; }
[data-theme="comic"] .tile::after {
  content: 'POW!'; position: absolute; top: 46px; right: -10px; z-index: 4; pointer-events: none;
  font: 22px/1 'Bangers', Impact, sans-serif; letter-spacing: .05em; color: #fff; -webkit-text-stroke: 1px #111;
  padding: 18px 16px; background: #FF3EA5;
  clip-path: polygon(50% 0, 61% 26%, 92% 12%, 76% 40%, 100% 52%, 74% 62%, 86% 92%, 58% 76%, 46% 100%, 38% 74%, 8% 88%, 24% 60%, 0 44%, 26% 36%, 14% 8%, 40% 24%);
  transform: rotate(14deg) scale(0); transition: transform .18s cubic-bezier(.3, 1.6, .5, 1);
}
[data-theme="comic"] .tile:nth-child(4n+2)::after { content: 'BAM!'; background: #1E6BFF; }
[data-theme="comic"] .tile:nth-child(4n+3)::after { content: 'ZAP!'; background: #18B26B; }
[data-theme="comic"] .tile:nth-child(4n+4)::after { content: 'WHAM!'; background: #8B3DFF; }
[data-theme="comic"] .tile:hover::after { transform: rotate(14deg) scale(1); }
[data-theme="comic"] .meter { border: 2px solid #111; height: 14px; }
[data-theme="comic"] .meter > div { background: repeating-linear-gradient(-45deg, var(--accent) 0 6px, #4C8DFF 6px 12px); }

/* =====================================================================
 * Case File: a dossier pinned to the corkboard. Confidential.
 * ===================================================================== */
[data-theme="casefile"] {
  color-scheme: light;
  --accent: #1F3A5F; --accent-ink: #F4EBD8;
  --bg: #A3845C; --panel: #EFE3C8; --panel-2: #F4EAD3; --sunk: #E4D5B5;
  --line: #C9B48D; --line-2: #B8A077; --hover-line: #8C744C;
  --text: #2B2118; --muted: #574632; --muted-2: #6B5840; --warn: #8E1F22;
  --auto-bg: #DCE3EC; --auto: #1F3A5F; --patch-bg: #EAD9D9; --patch: #7A1F22;
  --rc-bg: #DCE6D3; --rc: #2F5A2A; --sp-bg: #E6D9BC; --sp: #5A4220;
  --tile-hi: #FBF8F1; --tile-lo: #E6DECB;
  --f-head: 'Special Elite', 'Courier New', Courier, monospace;
  --f-detail: 'Special Elite', 'Courier New', Courier, monospace;
}
[data-theme="casefile"] .brand-name::after { content: '🔍'; }
[data-theme="casefile"] body::before {
  background:
    radial-gradient(circle at 20% 30%, rgba(60, 40, 20, .25) 1px, transparent 1.6px) 0 0 / 7px 9px,
    radial-gradient(circle at 70% 60%, rgba(255, 240, 210, .18) 1px, transparent 1.6px) 3px 2px / 9px 7px,
    radial-gradient(ellipse at center, transparent 50%, rgba(50, 30, 10, .35) 100%);
}
/* The page itself is a manila folder on the board. */
[data-theme="casefile"] .topbar { background: #EFE3C8; border-bottom: 2px solid #8C744C; }
[data-theme="casefile"] .wrap {
  position: relative; margin-top: 34px; background: var(--panel-2); border-radius: 0 8px 8px 8px;
  box-shadow: 0 2px 0 #C9B48D, 0 14px 40px rgba(40, 25, 10, .45);
}
[data-theme="casefile"] .wrap::before {
  content: 'EXHIBIT 0612 · OPEN FILE'; position: absolute; left: 0; top: -30px; height: 30px; padding: 7px 22px 0;
  font: 13px 'Special Elite', 'Courier New', monospace; letter-spacing: .1em; color: #574632;
  background: var(--panel-2); border-radius: 8px 8px 0 0;
}
[data-theme="casefile"] .foot { color: #2B2118; }
[data-theme="casefile"] .foot-links a { color: #2B2118; }
[data-theme="casefile"] .hero-main { position: relative; }
[data-theme="casefile"] .hero-main::after {
  content: 'CONFIDENTIAL'; position: absolute; right: 4%; top: -6px; pointer-events: none;
  font: 22px 'Special Elite', 'Courier New', monospace; letter-spacing: .14em; color: #8E1F22;
  border: 3px double #8E1F22; padding: 4px 12px; transform: rotate(-9deg); opacity: .7; mix-blend-mode: multiply;
}
/* Cards are evidence photos, pinned up a little crooked. */
[data-theme="casefile"] .tile { background: #FBF8F1; border: 0; border-radius: 2px; padding: 8px 8px 0; box-shadow: 0 1px 2px rgba(40, 25, 10, .25), 0 8px 18px rgba(40, 25, 10, .18); overflow: visible; }
[data-theme="casefile"] .tile-head { border-bottom: 0; padding: 4px 4px 8px; }
[data-theme="casefile"] .tile-body { border-top: 0; padding: 12px 6px 14px; }
[data-theme="casefile"] .tile:nth-child(4n+1) { transform: rotate(-1.2deg); }
[data-theme="casefile"] .tile:nth-child(4n+2) { transform: rotate(.8deg); }
[data-theme="casefile"] .tile:nth-child(4n+3) { transform: rotate(-.4deg); }
[data-theme="casefile"] .tile:nth-child(4n+4) { transform: rotate(1.4deg); }
[data-theme="casefile"] .tile:hover { transform: rotate(0) translateY(-3px) scale(1.02); }
[data-theme="casefile"] .tile::before {
  content: ''; position: absolute; top: -7px; left: 50%; width: 16px; height: 16px; margin-left: -8px; z-index: 4; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 35% 35%, #E8686B, #8E1F22 60%, #5A1214); box-shadow: 1px 3px 3px rgba(0, 0, 0, .35);
}
[data-theme="casefile"] .stamp { color: #8E1F22; border-color: #8E1F22; mix-blend-mode: multiply; }
[data-theme="casefile"] .tile-head .is-ok { color: #8E1F22; }
[data-theme="casefile"] .panel { box-shadow: 0 1px 0 #C9B48D; background-image: repeating-linear-gradient(180deg, transparent 0 27px, rgba(31, 58, 95, .07) 27px 28px); }
@media (max-width: 860px) {
  [data-theme="casefile"] .wrap { margin-top: 30px; border-radius: 0; }
  [data-theme="casefile"] .hero-main::after { font-size: 14px; top: -2px; }
}
@media (max-width: 700px) {
  [data-theme="comic"] .hero h1 .accent { -webkit-text-stroke: 1px #111; text-shadow: 3px 3px 0 #FF3EA5; }
}
