/*
 * Website-owned named palette catalogue.
 * Website assigns palettes to stable project ids. Project CSS remains available
 * for imagery and genuinely project-specific treatment, not shared geometry.
 */

body.theme-adk,
body[data-project-id="adk"],
.ap-project-card[data-project-theme="adk"],
.ap-project-switcher__link[data-project-theme="adk"] {
  --palette-bg: #111a35;
  --palette-bg-elevated: #182445;
  --palette-bg-soft: #21305a;
  --palette-bg-strong: #2b3d6d;
  --palette-bg-code: #0c1228;
  --palette-bg-nav: rgba(17, 26, 53, 0.96);
  --palette-text: #e8edf7;
  --palette-text-muted: #a8b2c7;
  --palette-text-faint: #7e8aa3;
  --palette-border: #344a7a;
  --palette-border-strong: #4c65a0;
  --palette-accent: #8aa4ff;
  --palette-accent-strong: #b0bfff;
  --palette-accent-soft: rgba(138, 164, 255, 0.16);
  --palette-accent-border: rgba(138, 164, 255, 0.46);
}

body.theme-website,
body[data-project-id="website"],
.ap-project-card[data-project-theme="website"],
.ap-project-switcher__link[data-project-theme="website"] {
  --palette-bg: #111417;
  --palette-bg-elevated: #191d21;
  --palette-bg-soft: #22272c;
  --palette-bg-strong: #2d343a;
  --palette-bg-code: #0d1012;
  --palette-bg-nav: rgba(17, 20, 23, 0.94);
  --palette-text: #edf0f2;
  --palette-text-muted: #b4bdc5;
  --palette-text-faint: #89959f;
  --palette-border: #384149;
  --palette-border-strong: #4e5a64;
  --palette-accent: #aebbc6;
  --palette-accent-strong: #d5dde3;
  --palette-accent-soft: rgba(174, 187, 198, 0.15);
  --palette-accent-border: rgba(174, 187, 198, 0.44);
}

body.theme-living-world,
body[data-project-id="living-world"],
.ap-project-card[data-project-theme="living-world"],
.ap-project-switcher__link[data-project-theme="living-world"] {
  --palette-bg: #10281a;
  --palette-bg-elevated: #173823;
  --palette-bg-soft: #20492d;
  --palette-bg-strong: #295c38;
  --palette-bg-code: #0c2015;
  --palette-bg-nav: rgba(16, 40, 26, 0.96);
  --palette-text: #e7f2eb;
  --palette-text-muted: #a9bdb0;
  --palette-text-faint: #7f9988;
  --palette-border: #356b47;
  --palette-border-strong: #4c8a60;
  --palette-accent: #79c79a;
  --palette-accent-strong: #a2dfb8;
  --palette-accent-soft: rgba(121, 199, 154, 0.16);
  --palette-accent-border: rgba(121, 199, 154, 0.46);
}

body.theme-workbench,
body[data-project-id="workbench-documentation"],
.ap-project-card[data-project-theme="workbench"],
.ap-project-switcher__link[data-project-theme="workbench"] {
  --palette-bg: #2a1d0b;
  --palette-bg-elevated: #3a2910;
  --palette-bg-soft: #4a3517;
  --palette-bg-strong: #5b421e;
  --palette-bg-code: #201607;
  --palette-bg-nav: rgba(42, 29, 11, 0.96);
  --palette-text: #f3eadb;
  --palette-text-muted: #c8b99e;
  --palette-text-faint: #9d896d;
  --palette-border: #6a4d24;
  --palette-border-strong: #8a6734;
  --palette-accent: #e0a64a;
  --palette-accent-strong: #f2c873;
  --palette-accent-soft: rgba(224, 166, 74, 0.17);
  --palette-accent-border: rgba(224, 166, 74, 0.5);
}

body.theme-agnostic-knowledge,
body[data-project-id="agnostic-knowledge"],
.ap-project-card[data-project-theme="agnostic-knowledge"],
.ap-project-switcher__link[data-project-theme="agnostic-knowledge"] {
  --palette-bg: #0d292c;
  --palette-bg-elevated: #14383c;
  --palette-bg-soft: #1c494e;
  --palette-bg-strong: #255b61;
  --palette-bg-code: #091f21;
  --palette-bg-nav: rgba(13, 41, 44, 0.96);
  --palette-text: #e4f3f2;
  --palette-text-muted: #a5c4c1;
  --palette-text-faint: #789c99;
  --palette-border: #326a70;
  --palette-border-strong: #478b92;
  --palette-accent: #62c6bb;
  --palette-accent-strong: #91ded5;
  --palette-accent-soft: rgba(98, 198, 187, 0.16);
  --palette-accent-border: rgba(98, 198, 187, 0.48);
}

/* Reserved, accessible choices for future projects. Their neutral surface
   families are deliberately distinct, while project imagery may add character. */
body.theme-ember, .ap-project-card[data-project-theme="ember"] { --palette-bg: #1a0e0a; --palette-bg-elevated: #251611; --palette-bg-soft: #321d16; --palette-bg-strong: #40251b; --palette-bg-code: #120906; --palette-bg-nav: rgba(26, 14, 10, 0.94); --palette-text: #f6e9e2; --palette-text-muted: #cdb5a9; --palette-text-faint: #a18476; --palette-border: #54362a; --palette-border-strong: #704838; --palette-accent: #ef8b62; --palette-accent-strong: #ffb08f; --palette-accent-soft: rgba(239, 139, 98, 0.17); --palette-accent-border: rgba(239, 139, 98, 0.5); }
body.theme-violet, .ap-project-card[data-project-theme="violet"] { --palette-bg: #120e1b; --palette-bg-elevated: #1c1628; --palette-bg-soft: #271e36; --palette-bg-strong: #332746; --palette-bg-code: #0d0914; --palette-bg-nav: rgba(18, 14, 27, 0.94); --palette-text: #f0ebf7; --palette-text-muted: #c0b5cf; --palette-text-faint: #9383a8; --palette-border: #413452; --palette-border-strong: #5a4670; --palette-accent: #b79aff; --palette-accent-strong: #d2c1ff; --palette-accent-soft: rgba(183, 154, 255, 0.17); --palette-accent-border: rgba(183, 154, 255, 0.5); }
body.theme-ocean, .ap-project-card[data-project-theme="ocean"] { --palette-bg: #07151a; --palette-bg-elevated: #0d2028; --palette-bg-soft: #132c36; --palette-bg-strong: #193946; --palette-bg-code: #050f13; --palette-bg-nav: rgba(7, 21, 26, 0.94); --palette-text: #e5f2f7; --palette-text-muted: #a9c3ce; --palette-text-faint: #7899a7; --palette-border: #244754; --palette-border-strong: #326273; --palette-accent: #55bde8; --palette-accent-strong: #91d8f5; --palette-accent-soft: rgba(85, 189, 232, 0.17); --palette-accent-border: rgba(85, 189, 232, 0.5); }
body.theme-rose, .ap-project-card[data-project-theme="rose"] { --palette-bg: #190d13; --palette-bg-elevated: #25151d; --palette-bg-soft: #321c27; --palette-bg-strong: #402532; --palette-bg-code: #11080d; --palette-bg-nav: rgba(25, 13, 19, 0.94); --palette-text: #f7e8ee; --palette-text-muted: #ceb2bd; --palette-text-faint: #a17e8c; --palette-border: #553443; --palette-border-strong: #72465a; --palette-accent: #eb87aa; --palette-accent-strong: #f5b0c8; --palette-accent-soft: rgba(235, 135, 170, 0.17); --palette-accent-border: rgba(235, 135, 170, 0.5); }
body.theme-slate, .ap-project-card[data-project-theme="slate"] { --palette-bg: #101419; --palette-bg-elevated: #181e25; --palette-bg-soft: #202933; --palette-bg-strong: #2a3542; --palette-bg-code: #0b0f13; --palette-bg-nav: rgba(16, 20, 25, 0.94); --palette-text: #ebf0f4; --palette-text-muted: #b2bec8; --palette-text-faint: #84939f; --palette-border: #34424e; --palette-border-strong: #495b69; --palette-accent: #9eb2c7; --palette-accent-strong: #c5d2df; --palette-accent-soft: rgba(158, 178, 199, 0.17); --palette-accent-border: rgba(158, 178, 199, 0.5); }
body.theme-copper, .ap-project-card[data-project-theme="copper"] { --palette-bg: #18110d; --palette-bg-elevated: #231a14; --palette-bg-soft: #2e231b; --palette-bg-strong: #3b2d23; --palette-bg-code: #100b08; --palette-bg-nav: rgba(24, 17, 13, 0.94); --palette-text: #f3ebe6; --palette-text-muted: #c7b7ad; --palette-text-faint: #998579; --palette-border: #4d3c31; --palette-border-strong: #685043; --palette-accent: #c98b69; --palette-accent-strong: #e6b394; --palette-accent-soft: rgba(201, 139, 105, 0.17); --palette-accent-border: rgba(201, 139, 105, 0.5); }

body[class*="theme-"],
body[data-project-id] {
  /* Every composed owner is validated against Website's palette registry.
     Keep this bridge acyclic: Firefox correctly invalidates a custom property
     whose fallback references the property being defined. */
  --bg: var(--palette-bg);
  --bg-elevated: var(--palette-bg-elevated);
  --bg-soft: var(--palette-bg-soft);
  --bg-strong: var(--palette-bg-strong);
  --bg-code: var(--palette-bg-code);
  --bg-nav: var(--palette-bg-nav);
  --text: var(--palette-text);
  --text-muted: var(--palette-text-muted);
  --text-faint: var(--palette-text-faint);
  --border: var(--palette-border);
  --border-strong: var(--palette-border-strong);
  --accent: var(--palette-accent);
  --accent-strong: var(--palette-accent-strong);
  --accent-soft: var(--palette-accent-soft);
  --accent-border: var(--palette-accent-border);
}

.ap-project-card[data-project-theme] {
  --project-card-accent: var(--palette-accent, var(--accent));
  --project-card-accent-strong: var(--palette-accent-strong, var(--accent-strong));
  --project-card-soft: var(--palette-accent-soft, var(--accent-soft));
}

/* Destination rows consume the same named palette records as pages and cards.
   Reserved palettes remain available for future registry assignments. */
.ap-project-switcher__link[data-project-theme="ember"] { --palette-accent: #ef8b62; --palette-accent-strong: #ffb08f; --palette-accent-soft: rgba(239, 139, 98, 0.17); }
.ap-project-switcher__link[data-project-theme="violet"] { --palette-accent: #b79aff; --palette-accent-strong: #d2c1ff; --palette-accent-soft: rgba(183, 154, 255, 0.17); }
.ap-project-switcher__link[data-project-theme="ocean"] { --palette-accent: #55bde8; --palette-accent-strong: #91d8f5; --palette-accent-soft: rgba(85, 189, 232, 0.17); }
.ap-project-switcher__link[data-project-theme="rose"] { --palette-accent: #eb87aa; --palette-accent-strong: #f5b0c8; --palette-accent-soft: rgba(235, 135, 170, 0.17); }
.ap-project-switcher__link[data-project-theme="slate"] { --palette-accent: #9eb2c7; --palette-accent-strong: #c5d2df; --palette-accent-soft: rgba(158, 178, 199, 0.17); }
.ap-project-switcher__link[data-project-theme="copper"] { --palette-accent: #c98b69; --palette-accent-strong: #e6b394; --palette-accent-soft: rgba(201, 139, 105, 0.17); }

@media (prefers-color-scheme: light) {
  body.theme-adk, body[data-project-id="adk"], .ap-project-card[data-project-theme="adk"], .ap-project-switcher__link[data-project-theme="adk"] { --palette-bg: #f5f7fb; --palette-bg-elevated: #ffffff; --palette-bg-soft: #edf1f8; --palette-bg-strong: #e4eaf4; --palette-bg-code: #f0f3f8; --palette-bg-nav: rgba(245, 247, 251, 0.94); --palette-text: #182033; --palette-text-muted: #526078; --palette-text-faint: #71809b; --palette-border: #d7deea; --palette-border-strong: #bcc7d9; --palette-accent: #435fd0; --palette-accent-strong: #263f9e; --palette-accent-soft: rgba(67, 95, 208, 0.1); --palette-accent-border: rgba(67, 95, 208, 0.34); }
  body.theme-website, body[data-project-id="website"], .ap-project-card[data-project-theme="website"], .ap-project-switcher__link[data-project-theme="website"] { --palette-bg: #f4f5f6; --palette-bg-elevated: #ffffff; --palette-bg-soft: #e9ecef; --palette-bg-strong: #dde2e6; --palette-bg-code: #eef0f2; --palette-bg-nav: rgba(244, 245, 246, 0.95); --palette-text: #20262b; --palette-text-muted: #56616a; --palette-text-faint: #76828c; --palette-border: #d4d9de; --palette-border-strong: #b9c1c8; --palette-accent: #536675; --palette-accent-strong: #354653; --palette-accent-soft: rgba(83, 102, 117, 0.1); --palette-accent-border: rgba(83, 102, 117, 0.34); }
  body.theme-living-world, body[data-project-id="living-world"], .ap-project-card[data-project-theme="living-world"], .ap-project-switcher__link[data-project-theme="living-world"] { --palette-bg: #eaf4ec; --palette-bg-elevated: #f7fcf8; --palette-bg-soft: #dcecdf; --palette-bg-strong: #c9e0ce; --palette-bg-code: #e2efe5; --palette-bg-nav: rgba(234, 244, 236, 0.95); --palette-text: #14251a; --palette-text-muted: #3f604a; --palette-text-faint: #617a68; --palette-border: #b8d1be; --palette-border-strong: #88ad92; --palette-accent: #28744a; --palette-accent-strong: #175936; --palette-accent-soft: rgba(40, 116, 74, 0.12); --palette-accent-border: rgba(40, 116, 74, 0.4); }
  body.theme-workbench, body[data-project-id="workbench-documentation"], .ap-project-card[data-project-theme="workbench"], .ap-project-switcher__link[data-project-theme="workbench"] { --palette-bg: #fbf6ec; --palette-bg-elevated: #fffdf8; --palette-bg-soft: #f3e8d6; --palette-bg-strong: #ead9bd; --palette-bg-code: #f7efe2; --palette-bg-nav: rgba(251, 246, 236, 0.95); --palette-text: #2d2114; --palette-text-muted: #675239; --palette-text-faint: #876f50; --palette-border: #e0ceb1; --palette-border-strong: #c8aa7e; --palette-accent: #8a5a0a; --palette-accent-strong: #633e00; --palette-accent-soft: rgba(138, 90, 10, 0.1); --palette-accent-border: rgba(138, 90, 10, 0.34); }
  body.theme-agnostic-knowledge, body[data-project-id="agnostic-knowledge"], .ap-project-card[data-project-theme="agnostic-knowledge"], .ap-project-switcher__link[data-project-theme="agnostic-knowledge"] { --palette-bg: #f1f8f7; --palette-bg-elevated: #ffffff; --palette-bg-soft: #e4f1ef; --palette-bg-strong: #d4e7e4; --palette-bg-code: #eaf4f2; --palette-bg-nav: rgba(241, 248, 247, 0.95); --palette-text: #142725; --palette-text-muted: #46645f; --palette-text-faint: #6b8581; --palette-border: #cadeda; --palette-border-strong: #a9c8c3; --palette-accent: #1e746c; --palette-accent-strong: #13564f; --palette-accent-soft: rgba(30, 116, 108, 0.1); --palette-accent-border: rgba(30, 116, 108, 0.34); }
  body.theme-ember, body.theme-violet, body.theme-ocean, body.theme-rose, body.theme-slate, body.theme-copper { --palette-bg: #f7f5f3; --palette-bg-elevated: #ffffff; --palette-bg-soft: #eeebe7; --palette-bg-strong: #e3ded8; --palette-bg-code: #f1eeea; --palette-bg-nav: rgba(247, 245, 243, 0.95); --palette-text: #292522; --palette-text-muted: #625b55; --palette-text-faint: #817870; --palette-border: #ddd7d1; --palette-border-strong: #c4bbb3; }
  body.theme-ember { --palette-accent: #a84420; --palette-accent-strong: #7b2d10; --palette-accent-soft: rgba(168, 68, 32, 0.1); --palette-accent-border: rgba(168, 68, 32, 0.34); }
  body.theme-violet { --palette-accent: #6842a3; --palette-accent-strong: #4d2b7d; --palette-accent-soft: rgba(104, 66, 163, 0.1); --palette-accent-border: rgba(104, 66, 163, 0.34); }
  body.theme-ocean { --palette-accent: #17698d; --palette-accent-strong: #0e4e6c; --palette-accent-soft: rgba(23, 105, 141, 0.1); --palette-accent-border: rgba(23, 105, 141, 0.34); }
  body.theme-rose { --palette-accent: #9a3f61; --palette-accent-strong: #732845; --palette-accent-soft: rgba(154, 63, 97, 0.1); --palette-accent-border: rgba(154, 63, 97, 0.34); }
  body.theme-slate { --palette-accent: #53697d; --palette-accent-strong: #384d60; --palette-accent-soft: rgba(83, 105, 125, 0.1); --palette-accent-border: rgba(83, 105, 125, 0.34); }
  body.theme-copper { --palette-accent: #8b5135; --palette-accent-strong: #653821; --palette-accent-soft: rgba(139, 81, 53, 0.1); --palette-accent-border: rgba(139, 81, 53, 0.34); }

}
