/* Coordinated palettes: the mode switch remains independent of the palette. */
:root[data-palette="midnight"] {
  --bg: #0d1522;
  --surface: #141f30;
  --surface-raised: #1c2b40;
  --text: #eef4ff;
  --muted: #a6b5c9;
  --accent: #a6c8ff;
  --green: #9ccab3;
  --line: #b9d2f51c;
}
:root[data-palette="midnight"][data-theme="light"] {
  --bg: #ffffff;
  --surface: #f2f5fa;
  --surface-raised: #ffffff;
  --text: #172338;
  --muted: #5c687b;
  --accent: #315ed3;
  --green: #426b5b;
  --line: #203a6221;
}
:root[data-palette="copper"] {
  --bg: #141210;
  --surface: #1e1a17;
  --surface-raised: #2b2420;
  --text: #f6efe8;
  --muted: #bcaba0;
  --accent: #dfb292;
  --green: #afbd9d;
  --line: #f1cfb91c;
}
:root[data-palette="copper"][data-theme="light"] {
  --bg: #fffdf9;
  --surface: #f3eee8;
  --surface-raised: #ffffff;
  --text: #282322;
  --muted: #70645c;
  --accent: #975836;
  --green: #536b4b;
  --line: #55342024;
}
:root[data-palette="forest"] {
  --bg: #101b16;
  --surface: #17271f;
  --surface-raised: #22362b;
  --text: #eef5ed;
  --muted: #acc1b1;
  --accent: #a8ce9f;
  --green: #b9ceaa;
  --line: #c2e2cb1f;
}
:root[data-palette="forest"][data-theme="light"] {
  --bg: #fcfdfb;
  --surface: #edf3ee;
  --surface-raised: #ffffff;
  --text: #20372d;
  --muted: #5d7265;
  --accent: #2e6a50;
  --green: #436a46;
  --line: #1c4a3221;
}
:root {
  --button-ink: var(--bg);
}
::selection {
  color: var(--bg);
  background: var(--accent);
}
.button-primary {
  color: var(--button-ink);
  background: var(--accent);
}
.button-primary:hover {
  background: color-mix(in srgb, var(--accent) 86%, var(--text));
}
.portrait-corner {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}
.degree-visual {
  background: linear-gradient(
    140deg,
    color-mix(in srgb, var(--accent) 12%, var(--surface)),
    var(--surface)
  );
}
.brand-mark {
  color: var(--text);
  background: var(--surface-raised);
  border-color: var(--line);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 4%, transparent);
}
.brand-mark .brand-symbol {
  width: 81%;
  height: auto;
  overflow: visible;
}
.hero-art.hero-brand-art {
  background:
    radial-gradient(
      ellipse at 50% 43%,
      color-mix(in srgb, var(--accent) 8%, transparent),
      transparent 64%
    ),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
}
.hero-brand-art::before {
  z-index: 0;
  opacity: 0.4;
}
.hero-brand-art .art-orbit {
  width: 84%;
  z-index: 0;
  border-color: color-mix(in srgb, var(--accent) 24%, transparent);
  opacity: 0.8;
}
.hero-emblem {
  position: relative;
  display: grid;
  place-items: center;
  width: 76%;
  aspect-ratio: 1.5;
  margin-top: -24px;
  color: var(--text);
  isolation: isolate;
}
.hero-emblem .brand-symbol {
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(
    0 14px 18px color-mix(in srgb, var(--text) 12%, transparent)
  );
  animation: emblem-float 8s ease-in-out infinite;
}
.emblem-halo {
  position: absolute;
  inset: -30% -6%;
  background: radial-gradient(
    ellipse,
    color-mix(in srgb, var(--accent) 8%, transparent),
    transparent 65%
  );
  z-index: -1;
}
.hero-brand-art .art-topline,
.hero-brand-art .art-caption,
.hero-brand-art .art-coordinate,
:root[data-theme="light"] .hero-brand-art .art-topline,
:root[data-theme="light"] .hero-brand-art .art-caption,
:root[data-theme="light"] .hero-brand-art .art-coordinate {
  color: var(--muted);
  z-index: 2;
}
:root[data-theme="light"] .hero-brand-art .art-cross {
  color: var(--accent);
}
.hero-brand-art .specialist-card,
:root[data-theme="light"] .hero-brand-art .specialist-card {
  background: color-mix(in srgb, var(--surface-raised) 95%, transparent);
  color: var(--text);
  border-color: var(--line);
  z-index: 2;
}
:root[data-theme="light"] .hero-brand-art .specialist-card div > span {
  color: var(--muted);
}
:root[data-theme="light"] .hero-brand-art .specialist-icon {
  color: var(--accent);
  border-color: var(--line);
}
@keyframes emblem-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}
.nav-actions {
  gap: 12px;
}
.theme-toggle::after {
  left: auto;
  right: 0;
  transform: translateY(-4px);
}
@media (hover: hover) {
  .theme-toggle:is(:hover, :focus-visible)::after {
    transform: translateY(0);
  }
}
.palette-control {
  position: relative;
  flex-shrink: 0;
}
.palette-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  transition:
    background 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}
.palette-toggle:hover,
.palette-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 7%, transparent);
}
.palette-toggle .icon {
  width: 19px;
  height: 19px;
}
.palette-toggle::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 13px);
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 11px;
  color: var(--text);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 10px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
@media (hover: hover) {
  .palette-toggle[aria-expanded="false"]:is(:hover, :focus-visible)::after {
    opacity: 1;
    visibility: visible;
  }
}
.palette-panel {
  position: absolute;
  top: calc(100% + 18px);
  right: 0;
  width: 324px;
  max-height: calc(100dvh - 130px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-raised);
  box-shadow: 0 18px 70px -18px #08162d40;
  z-index: 125;
  animation: palette-arrive 180ms ease-out;
}
.palette-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}
.palette-heading .eyebrow {
  font-size: 8px;
  margin-bottom: 7px;
}
.palette-heading h2 {
  font-size: 24px;
  font-weight: 500;
}
#paletteClose {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
}
#paletteClose:hover {
  color: var(--text);
  background: var(--surface);
}
.palette-options {
  display: grid;
  gap: 9px;
}
.palette-option {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px;
  width: 100%;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.palette-option:hover {
  background: var(--surface);
}
.palette-option[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-raised));
  border-color: var(--accent);
}
.palette-option:focus-visible {
  outline-offset: 2px;
}
.palette-option strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
}
.palette-option small {
  display: block;
  font-size: 9px;
  color: var(--muted);
  margin-top: 3px;
}
.palette-swatch {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid #17233822;
  box-shadow: inset 0 0 0 3px #ffffff40;
}
.palette-swatch-midnight {
  background: linear-gradient(
    135deg,
    #ffffff 0 45%,
    #1d2b45 45% 70%,
    #8fbafa 70%
  );
}
.palette-swatch-copper {
  background: linear-gradient(
    135deg,
    #fff5e8 0 45%,
    #282322 45% 70%,
    #d9aa8b 70%
  );
}
.palette-swatch-forest {
  background: linear-gradient(
    135deg,
    #f4f8ec 0 45%,
    #20372d 45% 70%,
    #a8ce9f 70%
  );
}
.palette-check {
  margin-left: auto;
  width: 16px;
  height: 16px;
  color: var(--accent);
  opacity: 0;
}
[aria-pressed="true"] > .palette-check {
  opacity: 1;
}
.palette-hint {
  margin-top: 18px;
  font-size: 10px;
  line-height: 1.7;
  color: var(--muted);
}
@keyframes palette-arrive {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
:root[data-motion="paused"] .palette-panel {
  animation: none;
}
@media (max-width: 1100px) and (min-width: 1001px) {
  .nav-contact {
    display: none;
  }
}
@media (max-width: 700px) {
  .nav-actions {
    gap: 5px;
  }
  .palette-control {
    position: static;
  }
  .palette-panel {
    left: 16px;
    right: 16px;
    top: calc(100% + 8px);
    width: auto;
    max-height: calc(100dvh - 102px);
  }
  .hero-emblem {
    width: 70%;
    margin-top: -18px;
  }
  .hero-art.hero-brand-art {
    border-radius: 15px;
  }
}
@media (max-width: 380px) {
  .site-header .brand-name {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-emblem .brand-symbol,
  .palette-panel {
    animation: none;
  }
}
