/* Grunge / Underground Zine. Opt-in only: the Wikipedia never receives these classes. */
:root:is(.grunge-site, .grunge-admin) {
  --gr-ink: #171915;
  --gr-coal: #111310;
  --gr-paper: #e8e0cf;
  --gr-paper-light: #f3ecd9;
  --gr-bone: #e6ddc8;
  --gr-red: #ba342c;
  --gr-red-bright: #d74238;
  --gr-green: #32553b;
  --gr-moss: #60715b;
  --gr-muted: #bfb9a7;
  --gr-mono: 'Cousine', 'Liberation Mono', Consolas, monospace;
  --gr-condensed: 'Roboto Condensed', 'Arial Narrow', Impact, sans-serif;
  --gr-shadow: 6px 7px 0 #050605;
  --gr-texture: repeating-linear-gradient(96deg, #ffffff03 0 1px, transparent 1px 67px);
  --gr-paper-texture: repeating-linear-gradient(0deg, transparent 0 28px, #4d432d08 28px 29px), linear-gradient(128deg, #f0e8d8, #dfd2bd);
  --brand-coal: #272425; --brand-graphite: #2b2b2b; --brand-brown: #4b372c;
  --brand-sand: #af8e77; --brand-green: #1c5427; --brand-red: #b9322d; --brand-cream: #fcf5f1;
}
html.grunge-site {
  color-scheme: dark;
  --bg: var(--gr-coal); --bg-soft: #262923; --text: var(--gr-paper-light);
  --muted: #c5bfaf; --muted-2: #bfb9a7; --line: #f1e9d43b;
  --library-bg: var(--gr-coal); --library-surface: #20241e; --library-surface-2: #292e25;
  --library-text: var(--gr-paper-light); --library-muted: #c5bfaf;
  --library-border: #af8e7770; --library-accent: #d6b9a5; --library-shelf: #4b372c;
}
html.grunge-site body {
  color: var(--gr-paper-light);
  font-family: 'Roboto', Arial, sans-serif;
  background: radial-gradient(ellipse at 0 21%, #4f62452e, transparent 38%), radial-gradient(ellipse at 100% 64%, #91302a24, transparent 34%), var(--gr-texture), var(--gr-coal);
}
html.grunge-site :is(h1, h2, .project-title) {
  font-family: var(--gr-condensed);
  font-weight: 900;
  letter-spacing: -.035em;
}
html.grunge-site :is(.section-head h2, .publication-header h1, .library-hero h1, .discography-header h1) {
  text-transform: uppercase;
  line-height: 1.06;
  text-wrap: balance;
}
html.grunge-site :is(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px dashed var(--gr-red-bright); outline-offset: 4px;
}
html.grunge-site :is(button, input, select, textarea):disabled { opacity: .48; cursor: not-allowed; }
html.grunge-site :is(input:not([type=checkbox]):not([type=range]), select, textarea) {
  color: var(--gr-ink); background: var(--gr-paper-light); border: 2px solid #676853; border-radius: 2px;
}
html.grunge-site :is(.btn, .button, .publication-back, .library-card-action) { border-radius: 0; font-family: var(--gr-condensed); font-weight: 900; }
html.grunge-site :is(.btn, .button) { border: 2px solid var(--gr-ink); background: var(--gr-paper-light); color: var(--gr-ink); box-shadow: 4px 4px var(--gr-ink); }
html.grunge-site :is(.btn.primary, .button.primary) { color: var(--gr-paper-light); background: var(--gr-red); }
html.grunge-site :is(.btn, .button):hover { border-color: var(--gr-red); box-shadow: 2px 2px var(--gr-ink); }
html.grunge-site :is(.eyebrow, .library-kicker, .project-kicker, .publication-meta, .year-heading) { font-family: var(--gr-mono); font-weight: 800; }
html.grunge-site :is(.chip, .tag, .platform) { border-radius: 0; font-family: var(--gr-mono); border-color: #af8e7780; }
html.grunge-site :is(.footer, .footer-panel, .publication-author) { border-radius: 0; border-color: var(--gr-muted); font-family: var(--gr-mono); }
/* Paper surfaces; media cases and book geometry deliberately remain separate. */
html.grunge-site :is(.bio-article, .project-card, .library-card, .library-hero, .publication-page > article, .pe-editor-page) {
  --text: var(--gr-ink); --muted: #464b40; --muted-2: #555a4e;
  --library-text: var(--gr-ink); --library-muted: #464b40;
  color: var(--gr-ink); background: var(--gr-paper-texture);
  border: 2px solid var(--gr-ink); border-radius: 0; box-shadow: var(--gr-shadow);
}
html.grunge-site :is(.bio-article, .project-card, .library-card, .library-hero, .publication-page > article, .pe-editor-page) :is(h1,h2,h3,p,.project-desc,.project-title,.project-kicker,.publication-meta,.publication-project,.publication-author) {
  color: var(--gr-ink);
}
html.grunge-site :is(.bio-article, .project-card, .publication-page > article) a:not(.btn):not(.platform) { color: #1c5427; text-decoration-color: #1c542780; }
html.grunge-site :is(.bio-article, .project-card, .library-card, .library-hero, .publication-page > article, .pe-editor-page) :is(.platform, .tag, .chip, .channel-handle, .channel-status) {
  color: var(--gr-ink);
}
html.grunge-site :is(.bio-article, .project-card, .library-card, .library-hero, .publication-page > article, .pe-editor-page) :is(.platform, .tag, .chip, .channel-status) {
  border-color: #80725d;
}
html.grunge-site :is(.bio-article, .project-card, .library-card, .library-hero, .publication-page > article, .pe-editor-page) .platform:is(:hover, :focus-visible) {
  color: var(--gr-ink); background: #d8cbb2; border-color: #4b372c;
}
html.grunge-site .project-card { border-top: 6px solid var(--gr-green); }
html.grunge-site .project-card:nth-child(2n) { border-top-color: var(--gr-red); }
html.grunge-site :is(.project-card, .library-card):hover { box-shadow: 8px 9px 0 #050605; border-color: var(--gr-red); }
html.grunge-site .library-card { border-top: 8px solid var(--card-accent, var(--gr-green)); }
html.grunge-site .library-card h2 { color: var(--gr-ink); font-size: clamp(2.2rem, 4vw, 3.5rem); }
html.grunge-site .library-card :is(p,.library-card-meta,.library-card-action) { color: #333c30; }
html.grunge-site .library-card::after { border-color: #4b372c33; }
html.grunge-site .library-hero { border-top: 8px solid var(--gr-red); }
html.grunge-site .library-shelf-heading h2 { color: var(--gr-paper-light); font-family: var(--gr-condensed); }
html.grunge-site .library-shelf-frame { border-radius: 2px; border-color: #af8e7766; background: var(--gr-texture), linear-gradient(#26292370,#111310); }
html.grunge-site .library-shelf-frame::after { border-radius: 0; border-color: var(--brand-sand); }
html.grunge-site .library-book { border-radius: 1px; }
html.grunge-site .library-book-tooltip { border-radius: 0; border: 2px solid var(--gr-ink); background: var(--gr-paper-light); color: var(--gr-ink); box-shadow: var(--gr-shadow); }
html.grunge-site .publication-page > article { padding: clamp(20px, 5vw, 52px); }
html.grunge-site .publication-rich-text { color: var(--gr-ink); }
html.grunge-site .publication-header { border-bottom: 4px solid var(--gr-red); padding-bottom: 24px; }
html.grunge-site .publication-content { font-family: 'Roboto', Arial, sans-serif; }
html.grunge-site .publication-content blockquote { border-color: var(--gr-red); background: #4b372c0b; }
html.grunge-site .publication-author { border-top: 2px solid var(--gr-ink); }
html.grunge-site .time-item { border-radius: 0; border-left: 4px solid var(--gr-green); }
html.grunge-site .time-year { color: var(--gr-paper-light); background: var(--gr-red); font-family: var(--gr-mono); }
html.grunge-site .page-biography :is(.card-a,.card-b,.mini-note) { border-radius: 0; border: 3px solid var(--gr-ink); box-shadow: var(--gr-shadow); }
/* CD/DVD/TV: materials and external frames only. No transforms, clipping or hit areas. */
html.grunge-site :is(.jewel-case, .music-dvd-modal, .track-modal-inner, .media-detail-panel) { color: var(--gr-paper-light); background: var(--gr-texture), #20241e; border-color: #af8e77; border-radius: 2px; }
html.grunge-site :is(.case-back, .music-dvd-back, .booklet-page) { color: var(--gr-paper-light); background-color: #2b2b25; border-color: #af8e77; }
html.grunge-site .discography-page .jewel-case.is-open .case-back { background: var(--gr-texture), #292e25; border-color: #af8e77; }
html.grunge-site :is(.music-tv, .music-tv-frame, .cd-player-unit) { border-color: #af8e77; background-color: #20241e; }
html.grunge-site :is(.collection-heading, .cd-shelf, .music-dvd-row) { border-color: var(--brand-brown); }
/* Shared player skin; its fixed bar and anchored video geometry stay in persistent-player.css. */
html.grunge-site :is(.discography-page,.page-timeline) .persistent-player {
  color: var(--gr-paper-light); background: var(--gr-texture), #171e17; border-top-color: var(--gr-red);
  font-family: 'Roboto', Arial, sans-serif;
}
html.grunge-site :is(.discography-page,.page-timeline) .persistent-player-info strong { font-family: var(--gr-condensed); text-transform: uppercase; }
html.grunge-site :is(.discography-page,.page-timeline) .persistent-player-info small { color: #d4c6af; }
html.grunge-site :is(.discography-page,.page-timeline) .persistent-player button { color: var(--gr-paper-light); border-radius: 0; }
html.grunge-site :is(.discography-page,.page-timeline) .persistent-player button[aria-pressed=true] { color: var(--gr-paper-light); background: #32553b; }
html.grunge-site :is(.discography-page,.page-timeline) .persistent-player input[type=range] { accent-color: var(--gr-red-bright); }
/* Keep the progress slider usable when tablet transport controls fill the first row. */
@media (min-width:621px) and (max-width:1000px) {
  html.grunge-site :is(.discography-page,.page-timeline) .is-music .persistent-player-bar { flex-wrap: wrap; }
  html.grunge-site :is(.discography-page,.page-timeline) .is-music input[type=range]:not(.persistent-player-volume) { order: 2; flex-basis: calc(100% - 110px); }
  html.grunge-site :is(.discography-page,.page-timeline) .is-music .persistent-player-time { order: 3; }
}
html.grunge-site :is(.flow-navigation button, .library-shelf-arrow, .music-tv button, .music-dvd-back button, .booklet-navigation button) { border-radius: 1px; }
html.grunge-site :is(.search-dialog, .pwa-invite, .pwa-settings, .pwa-dialog) { border-radius: 1px; border-color: #af8e77; }
html.grunge-site .pwa-settings { color: var(--gr-ink); background: var(--gr-paper-light); }
html.grunge-site :is(.page-404, .page-offline) main { color: var(--gr-ink); background: var(--gr-paper-texture); border: 3px solid var(--gr-ink); border-radius: 0; box-shadow: var(--gr-shadow); }
html.grunge-site.grunge-utility main { color: var(--gr-ink); background: var(--gr-paper-texture); border: 3px solid var(--gr-ink); border-radius: 0; box-shadow: var(--gr-shadow); }
html.grunge-site.grunge-utility main :is(p,a) { color: #333c30; }
/* Administrative surfaces share tokens, never public canvas selectors. */
html.grunge-admin {
  --bg: var(--gr-coal); --surface: #20241e; --surface-soft: #292e25; --surface-strong: #35392e;
  --text: var(--gr-paper-light); --muted: #c5bfaf; --border: #72725c; --border-strong: #af8e77;
  --rose: #d6b9a5; --raspberry: #e2b29a; --plum: #e8e0cf; --accent-soft: #394336;
  --canvas: #151714; --shadow: 5px 6px 0 #050605;
  font-family: 'Roboto', Arial, sans-serif;
}
html.grunge-admin[data-editor-theme=light] {
  --bg: #d5cbb5; --surface: var(--gr-paper-light); --surface-soft: #e8e0cf; --surface-strong: #d8cbb2;
  --text: var(--gr-ink); --muted: #505447; --border: #8a8069; --border-strong: #4b372c;
  --rose: #4b372c; --raspberry: #8e2b24; --plum: #32553b; --accent-soft: #cbd4bc; --canvas: #a7aa95;
}
html.grunge-admin body { background: var(--gr-texture), var(--bg); }
html.grunge-admin :is(h1,h2,h3,.panel-heading,.nav-button) { font-family: var(--gr-condensed); font-weight: 900; }
html.grunge-admin :is(.eyebrow,.local-badge,.save-status,.view-kicker) { font-family: var(--gr-mono); }
html.grunge-admin .app-header { border-bottom: 4px solid var(--gr-red); background: var(--surface); backdrop-filter: none; }
html.grunge-admin :is(.panel,.feed-block,.discography-track,.dialog-card,.item-button,.menu-item,.post-card,.dvd-editor-panel) { border-radius: 2px; border-color: var(--border); box-shadow: 3px 4px 0 #05060555; }
html.grunge-admin :is(button,.file-button,.search-input,input,select,textarea,.badge,.local-badge,.rich-editor) { border-radius: 1px; }
html.grunge-admin :is(.primary-button,.nav-button.is-active,.nav-publish) { color: var(--gr-paper-light); background: var(--gr-red); border: 1px solid var(--gr-ink); box-shadow: 3px 3px 0 #050605; }
html.grunge-admin :is(.primary-button,.nav-button.is-active,.nav-publish):hover { background: #983028; }
html.grunge-admin :is(.secondary-button,.icon-button,.file-button) { border-color: var(--border-strong); }
html.grunge-admin :is(.secondary-button,.icon-button,.file-button):hover { background: var(--accent-soft); }
html.grunge-admin :is(input,select,textarea,.rich-editor) { border-color: var(--border-strong); }
html.grunge-admin :is(button,input,select,textarea,[contenteditable],.file-button):focus-visible { outline: 3px dashed var(--gr-red-bright); outline-offset: 3px; }
html.grunge-admin .rich-editor { background: var(--gr-paper-light); color: var(--gr-ink); }
html.grunge-admin .rich-editor :is(a,blockquote) { color: #1c5427; }
html.grunge-admin :is(.library-editor-section,.library-editor-card-hero,.library-admin-card,.library-publication-card,.publication-admin-tabs,.library-archived-group) { border-radius: 2px; border-color: var(--border-strong); box-shadow: 4px 5px #05060555; }
html.grunge-admin :is(.library-admin-card,.library-publication-card) { color: var(--gr-ink); background: var(--gr-paper-texture); border-top: 5px solid var(--editor-card-accent); }
html.grunge-admin :is(.library-admin-card-open,.library-publication-open) { color: var(--gr-ink); }
html.grunge-admin :is(.library-admin-card-open,.library-publication-open) strong { font-family: var(--gr-condensed); font-size: 1.8rem; }
html.grunge-admin :is(.library-admin-card-open,.library-publication-open) :is(p,small) { color: #464b40; }
html.grunge-admin :is(.library-admin-card,.library-publication-card) .library-admin-kicker { color: #32553b; font-family: var(--gr-mono); }
html.grunge-admin .library-admin-card-actions { background: var(--surface); }
html.grunge-admin .feed-rich-editor { color: var(--gr-ink); background: var(--gr-paper-light); border-color: var(--border-strong); border-radius: 1px; }
html.grunge-admin .feed-rich-editor a { color: #1c5427; }
html.grunge-admin .library-editor-card-hero h3 { font-family: var(--gr-condensed); }
html.grunge-admin fieldset { border-radius: 1px; border-color: var(--border-strong); }
html.grunge-admin legend { font-family: var(--gr-mono); }
html.grunge-admin button:disabled { opacity: .48; box-shadow: none; }
@media (max-width:600px) {
  html.grunge-site .publication-page > article { padding: 20px 16px; }
  html.grunge-site .library-card h2 { font-size: 2.4rem; }
}
@media (max-width:760px) {
  html.grunge-site.js .global-nav-links { background: var(--gr-paper-light); color: var(--gr-ink); border-radius: 0; border-color: var(--gr-ink); }
}
@media (prefers-reduced-motion:reduce) {
  html.grunge-site :is(.btn,.library-card,.project-card), html.grunge-admin :is(button,.item-button) { transition: none; }
}
