/*
 * Mature non-Swiss palettes.
 * Every rule is scoped to the two replacement themes so the approved
 * Swiss light and Swiss dark treatments remain untouched.
 */

html[data-theme="institutional-light"] {
  color-scheme: dark;
  --paper: #4a0d0d;
  --raised: #641416;
  --ink: #f4ecdd;
  --muted: #d8c9a8;
  --line: #b78a2e;
  --red: #d8b25a;
  --red-dark: #7d1818;
  --accent-ink: #3b080a;
  --band: #2a0608;
  --band-ink: #f4ecdd;
  --accent-text: #e8d39a;
  --focus: #ffd979;
  --button-ink: #3b080a;
  --header-bg: rgb(42 6 8 / 94%);
  --surface-raised: linear-gradient(145deg, #741819 0%, #561011 100%);
  --surface-soft: #561011;
  --shadow-card:
    inset 0 1px 0 rgb(255 240 196 / 14%),
    0 0 0 1px rgb(216 178 90 / 26%),
    0 18px 42px rgb(31 2 4 / 38%);
  --shadow-card-hover:
    inset 0 1px 0 rgb(255 240 196 / 24%),
    0 0 0 1px rgb(232 211 154 / 58%),
    0 26px 58px rgb(31 2 4 / 52%);
  --shadow-panel:
    inset 0 1px 0 rgb(255 240 196 / 20%),
    0 0 0 1px rgb(232 211 154 / 46%),
    0 30px 76px rgb(31 2 4 / 58%);
  --shadow-header: 0 14px 38px rgb(31 2 4 / 48%);
}

html[data-theme="institutional-dark"] {
  color-scheme: dark;
  --paper: #071f1c;
  --raised: #0e342f;
  --ink: #f3ead6;
  --muted: #bfd0c5;
  --line: #65998d;
  --red: #d8b45a;
  --red-dark: #0a5a52;
  --accent-ink: #0b2421;
  --band: #041412;
  --band-ink: #f3ead6;
  --accent-text: #e9d08b;
  --focus: #f0d58e;
  --button-ink: #0b2421;
  --teal: #68bdae;
  --header-bg: rgb(4 20 18 / 94%);
  --surface-raised: linear-gradient(145deg, #15463f 0%, #0e342f 54%, #092824 100%);
  --surface-soft: #0a2b27;
  --shadow-card:
    inset 0 1px 0 rgb(243 234 214 / 10%),
    0 0 0 1px rgb(101 153 141 / 28%),
    0 18px 42px rgb(0 10 9 / 44%);
  --shadow-card-hover:
    inset 0 1px 0 rgb(233 208 139 / 20%),
    0 0 0 1px rgb(216 180 90 / 58%),
    0 26px 60px rgb(0 10 9 / 60%),
    0 0 34px rgb(104 189 174 / 10%);
  --shadow-panel:
    inset 0 1px 0 rgb(233 208 139 / 18%),
    0 0 0 1px rgb(216 180 90 / 46%),
    0 32px 80px rgb(0 10 9 / 66%);
  --shadow-header: 0 14px 40px rgb(0 10 9 / 58%);
}

html[data-theme="institutional-light"] body {
  background:
    radial-gradient(120% 100% at 12% -8%, #7d1818 0%, #641416 44%, #4a0d0d 76%, #3b080a 100%);
}

html[data-theme="institutional-dark"] body {
  background:
    radial-gradient(90% 80% at 18% -8%, #19524a 0%, #0e3933 38%, #071f1c 72%, #041412 100%);
}

html[data-theme="institutional-light"] body::before {
  opacity: 0.055;
  mix-blend-mode: soft-light;
}

html[data-theme="institutional-dark"] body::before {
  opacity: 0.05;
  mix-blend-mode: screen;
}

html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .site-header {
  border-bottom-color: var(--line);
  box-shadow: inset 0 -1px 0 rgb(255 240 196 / 7%);
}

html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) :is(.brand-link, .nav-link[aria-current="page"]) {
  color: var(--accent-text);
}

html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) :is(.header-action, .hero-action, .closing__action, .button-link) {
  border-color: #d8b45a;
  background: linear-gradient(135deg, #e8d39a 0%, #d8b45a 52%, #bd8d31 100%);
  color: var(--button-ink);
  box-shadow:
    inset 0 1px 0 rgb(255 250 226 / 58%),
    0 8px 22px rgb(0 0 0 / 22%);
}

html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) :is(.hero-action, .closing__action)::after {
  background: var(--accent-ink);
}

html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .theme-switcher {
  border-color: var(--line);
  background: var(--header-bg);
  box-shadow: var(--shadow-card), inset 0 0 0 1px rgb(255 240 196 / 6%);
}

html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .theme-option {
  border-right-color: var(--line);
}

html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .theme-option[data-theme-option="institutional-light"] {
  --swatch: radial-gradient(circle at 32% 28%, #e8d39a 0 18%, #6d1414 21% 100%);
}

html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .theme-option[data-theme-option="institutional-dark"] {
  --swatch: radial-gradient(circle at 32% 28%, #d8b45a 0 18%, #0e4b43 21% 100%);
}

html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .theme-swatch {
  border-color: rgb(244 236 221 / 42%);
}

html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .paper-grid {
  opacity: 0.36;
}

html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .masthead__word {
  color: #e8d39a;
  background: linear-gradient(100deg, #d8b25a, #fff0c4 48%, #e8d39a 66%, #d8b25a);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 5px 18px rgb(0 0 0 / 24%));
}

html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) :is(.raven-fill, .footer-raven) {
  fill: #d8b45a;
}

html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .raven-outline {
  stroke: #e8d39a;
  filter: drop-shadow(0 8px 16px rgb(0 0 0 / 30%));
}

html[data-theme="institutional-light"] .raven-beak {
  fill: #7d1818;
}

html[data-theme="institutional-light"] :is(.raven-eye, .raven-ink-eye) {
  fill: #2a0608;
}

html[data-theme="institutional-dark"] .raven-beak {
  fill: #68bdae;
}

html[data-theme="institutional-dark"] :is(.raven-eye, .raven-ink-eye) {
  fill: #041412;
}

html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .site-field::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
}

html[data-theme="institutional-light"] .site-field::before {
  opacity: 0.24;
  background:
    radial-gradient(circle at 84% 8%, transparent 0 88px, rgb(232 211 154 / 36%) 89px 90px, transparent 91px 126px, rgb(183 138 46 / 26%) 127px 128px, transparent 129px),
    linear-gradient(115deg, transparent 0 61%, rgb(216 178 90 / 8%) 61.1% 61.25%, transparent 61.35% 100%);
}

html[data-theme="institutional-dark"] .site-field::before {
  opacity: 0.34;
  background:
    radial-gradient(circle at 84% 9%, transparent 0 72px, rgb(104 189 174 / 34%) 73px 74px, transparent 75px 108px, rgb(216 180 90 / 28%) 109px 110px, transparent 111px 148px, rgb(101 153 141 / 22%) 149px 150px, transparent 151px),
    radial-gradient(circle at 9% 44%, transparent 0 46px, rgb(101 153 141 / 18%) 47px 48px, transparent 49px 84px, rgb(101 153 141 / 14%) 85px 86px, transparent 87px);
}

html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) :is(.facility-panel__media, .page-hero__art, .coverage-field) {
  border-color: var(--line);
  box-shadow: var(--shadow-panel);
}

html[data-theme="institutional-light"] :is(.facility-panel__media, .page-hero__art) {
  background:
    radial-gradient(circle at 50% 44%, rgb(125 24 24 / 48%) 0 12%, transparent 13% 23%, rgb(216 178 90 / 15%) 23.3% 23.7%, transparent 24%),
    linear-gradient(145deg, #741819, #4a0d0d 72%);
}

html[data-theme="institutional-dark"] :is(.facility-panel__media, .page-hero__art) {
  background:
    radial-gradient(circle at 52% 46%, transparent 0 17%, rgb(104 189 174 / 24%) 17.3% 17.7%, transparent 18% 28%, rgb(216 180 90 / 18%) 28.3% 28.7%, transparent 29% 40%, rgb(101 153 141 / 18%) 40.3% 40.7%, transparent 41%),
    linear-gradient(145deg, #15463f, #092824 72%);
}

html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .facility-panel__media::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 8px;
  border: 1px solid rgb(232 211 154 / 52%);
  box-shadow: inset 0 0 0 4px rgb(0 0 0 / 10%);
  pointer-events: none;
}

html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .facility-panel::before {
  border-color: #d8b45a;
  opacity: 0.54;
}

html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .facility-panel::after {
  content: "";
  position: absolute;
  z-index: 3;
  top: -7px;
  left: 22px;
  width: 72px;
  height: 14px;
  border-block: 1px solid #d8b45a;
  background:
    linear-gradient(135deg, transparent 0 35%, #d8b45a 36% 43%, transparent 44% 100%) 0 0 / 18px 14px repeat-x;
  pointer-events: none;
}

html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .page-hero__art::before,
html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .coverage-field::before {
  border-color: var(--line);
}

html[data-theme="institutional-light"] .page-hero__art::before {
  background-image:
    linear-gradient(rgb(216 178 90 / 22%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(216 178 90 / 22%) 1px, transparent 1px);
}

html[data-theme="institutional-dark"] .page-hero__art::before {
  background-image:
    radial-gradient(circle at center, transparent 0 23%, rgb(104 189 174 / 28%) 23.4% 23.8%, transparent 24% 39%, rgb(216 180 90 / 24%) 39.4% 39.8%, transparent 40%),
    linear-gradient(rgb(101 153 141 / 18%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(101 153 141 / 18%) 1px, transparent 1px);
  background-size: 100% 100%, 25% 25%, 25% 25%;
}

html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) :is(.diagram-zones, .diagram-signals) {
  filter: drop-shadow(0 7px 12px rgb(0 0 0 / 22%));
}

html[data-theme="institutional-light"] :is(.proof, .services, .topic-teasers, .editorial-section) {
  --ink: #2a211a;
  --muted: #5c5347;
  --line: #97815c;
  --red: #7c5713;
  --red-dark: #6d1414;
  --accent-ink: #f4ecdd;
  --accent-text: #6d1414;
  --focus: #6d1414;
  --raised: #faf4e8;
  --band: #4a0d0d;
  --band-ink: #f4ecdd;
  --surface-raised: linear-gradient(145deg, #fff9ec 0%, #f1e5d0 100%);
  --surface-soft: #eee0c7;
  --shadow-card:
    inset 0 1px 0 rgb(255 255 255 / 72%),
    0 0 0 1px rgb(156 107 34 / 20%),
    0 16px 34px rgb(74 13 13 / 12%);
  --shadow-card-hover:
    inset 0 1px 0 rgb(255 255 255 / 86%),
    0 0 0 1px rgb(156 107 34 / 48%),
    0 24px 48px rgb(74 13 13 / 19%);
  background:
    linear-gradient(rgb(244 236 221 / 97%), rgb(244 236 221 / 98%)),
    radial-gradient(circle at 88% 12%, rgb(183 138 46 / 18%), transparent 32%);
  color: #2a211a;
}

html[data-theme="institutional-light"] :is(.proof, .services, .topic-teasers, .editorial-section) :is(h2, h3, .proof strong, .metrics-grid strong) {
  color: #6d1414;
}

html[data-theme="institutional-light"] :is(.topic-card, .info-card, .detail-panel, .metrics-grid li, .contact-card, .work-card) {
  border-color: var(--line);
}

html[data-theme="institutional-light"] .cta-panel {
  --focus: #ffd979;
  border-color: #b78a2e;
  background:
    radial-gradient(circle at 88% 0%, rgb(216 178 90 / 18%), transparent 34%),
    linear-gradient(135deg, #641416, #3b080a);
  box-shadow: var(--shadow-panel);
}

html[data-theme="institutional-light"] .editorial-section .cta-panel :is(h2, p) {
  color: #f4ecdd;
}

html[data-theme="institutional-dark"] :is(.proof, .services, .topic-teasers, .editorial-section) {
  background:
    linear-gradient(rgb(7 31 28 / 94%), rgb(4 20 18 / 97%)),
    radial-gradient(circle at 82% 5%, rgb(104 189 174 / 16%), transparent 34%);
}

html[data-theme="institutional-dark"] :is(.topic-card, .info-card, .detail-panel, .metrics-grid li, .coverage-point, .contact-card, .work-card, .service-row, .proof li) {
  border-color: #65998d;
}

html[data-theme="institutional-dark"] .coverage-field {
  background:
    radial-gradient(circle at 48% 46%, transparent 0 17%, rgb(104 189 174 / 18%) 17.3% 17.7%, transparent 18% 30%, rgb(216 180 90 / 18%) 30.3% 30.7%, transparent 31% 44%, rgb(101 153 141 / 17%) 44.3% 44.7%, transparent 45%),
    linear-gradient(145deg, #0e342f, #041412);
}

html[data-theme="institutional-dark"] .coverage-field::before {
  opacity: 0.68;
}

html[data-theme="institutional-dark"] .cta-panel {
  border-color: #d8b45a;
  background:
    radial-gradient(circle at 90% 0%, rgb(104 189 174 / 17%), transparent 36%),
    linear-gradient(135deg, #0e342f, #041412);
  box-shadow: var(--shadow-panel);
}

html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .site-footer {
  position: relative;
  overflow: hidden;
  border-top-color: #b78a2e;
}

html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 14px;
  border-block: 1px solid rgb(216 180 90 / 42%);
  background:
    linear-gradient(135deg, transparent 0 35%, rgb(216 180 90 / 62%) 36% 43%, transparent 44% 100%) 0 0 / 24px 14px repeat-x;
  pointer-events: none;
}

@media (hover: hover) {
  html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) :is(.topic-card, .info-card, .detail-panel, .metrics-grid li, .coverage-point, .work-card, .contact-card, .service-row, .page-hero__art):hover {
    border-color: #d8b45a;
  }

  html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) :is(.header-action, .hero-action, .closing__action, .button-link):hover {
    background: linear-gradient(135deg, #fff0c4 0%, #e8d39a 50%, #d8b45a 100%);
  }
}

@media (max-width: 520px) {
  html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .site-field::before {
    background-size: 78% auto;
    background-repeat: no-repeat;
  }

  html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .facility-panel::after {
    left: 15px;
    width: 54px;
  }
}

@media (forced-colors: active) {
  html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .masthead__word {
    color: CanvasText;
    background: none;
    -webkit-text-fill-color: currentColor;
    filter: none;
  }

  html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .site-field::before,
  html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .site-footer::before,
  html:is([data-theme="institutional-light"], [data-theme="institutional-dark"]) .facility-panel::after {
    display: none;
  }
}
