.palette-switcher {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  margin-left: 12px;
  padding: 3px;
  border: 1px solid color-mix(in srgb, var(--gold) 18%, transparent);
  border-radius: 999px;
  background: rgba(2, 5, 20, .28);
}

.palette-option {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}

.palette-option:hover { background: color-mix(in srgb, var(--gold) 10%, transparent); }
.palette-option:active { transform: scale(.94); }
.palette-option:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.palette-swatch {
  display: block;
  width: 21px;
  height: 21px;
  border: 1px solid rgba(0, 0, 0, .72);
  border-radius: 50%;
  box-shadow: 0 3px 9px rgba(0, 0, 0, .28);
  transition: box-shadow .18s ease, transform .18s ease;
}

.palette-swatch.is-midnight { background: conic-gradient(from 210deg, #171f44 0 34%, #74ffed 34% 68%, #fe81d1 68%); }
.palette-swatch.is-ice { background: linear-gradient(145deg, #3aaeff 0 49%, #f4fbff 51% 100%); }
.palette-swatch.is-gold { background: linear-gradient(145deg, #080a0d 0 49%, #d9b85f 51% 100%); }
.palette-swatch.is-matrix { background: linear-gradient(145deg, #010302 0 49%, #00ff66 51% 100%); }

.palette-option[aria-pressed="true"] .palette-swatch {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px rgba(4, 7, 12, .98), 0 0 0 4px var(--gold), 0 5px 13px rgba(0, 0, 0, .36);
}

.palette-option[aria-pressed="true"]::after {
  content: '';
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 6px;
  height: 6px;
  border: 2px solid #08101d;
  border-radius: 50%;
  background: var(--gold2);
}

html[data-palette="ice"] {
  --palette-midnight: #102842;
  --palette-aqua: #62cbff;
  --palette-pink: #f4fbff;
  --bg: #06111f;
  --bg2: #0a1a2c;
  --card: #102842;
  --gold: #62cbff;
  --gold2: #f4fbff;
  --neon-green: #62cbff;
  --neon-purple: #b8e9ff;
  --muted: #b8c7d6;
  --text: #f8fbff;
  --line: rgba(98, 203, 255, .2);
  --theme-deep: #06111f;
  --theme-deep-2: #0a1a2c;
  --theme-surface: #102842;
  --theme-surface-rgb: 16, 40, 66;
  --theme-accent: #62cbff;
  --theme-accent-rgb: 98, 203, 255;
  --theme-soft: #f4fbff;
  --theme-soft-rgb: 244, 251, 255;
}

html[data-palette="gold"] {
  --palette-midnight: #11151c;
  --palette-aqua: #d9b85f;
  --palette-pink: #f1d98d;
  --bg: #080a0d;
  --bg2: #0d1016;
  --card: #11151c;
  --gold: #d9b85f;
  --gold2: #f1d98d;
  --neon-green: #d9b85f;
  --neon-purple: #aa7d25;
  --muted: #9da2ab;
  --text: #eef0f3;
  --line: rgba(217, 184, 95, .18);
  --theme-deep: #080a0d;
  --theme-deep-2: #0d1016;
  --theme-surface: #11151c;
  --theme-surface-rgb: 17, 21, 28;
  --theme-accent: #d9b85f;
  --theme-accent-rgb: 217, 184, 95;
  --theme-soft: #f1d98d;
  --theme-soft-rgb: 241, 217, 141;
}

html[data-palette="ice"] body,
html[data-palette="gold"] body {
  background:
    radial-gradient(circle at 12% 8%, rgba(var(--theme-accent-rgb), .09), transparent 26rem),
    radial-gradient(circle at 88% 18%, rgba(var(--theme-soft-rgb), .055), transparent 30rem),
    linear-gradient(180deg, var(--theme-deep) 0%, var(--theme-deep-2) 52%, var(--theme-deep) 100%);
}

html[data-palette="ice"] .palette-ambient,
html[data-palette="gold"] .palette-ambient {
  background:
    radial-gradient(circle at 18% 24%, rgba(var(--theme-accent-rgb), .18), transparent 25%),
    radial-gradient(circle at 78% 18%, rgba(var(--theme-soft-rgb), .08), transparent 22%),
    radial-gradient(circle at 72% 76%, rgba(var(--theme-accent-rgb), .09), transparent 25%),
    radial-gradient(circle at 36% 82%, rgba(var(--theme-soft-rgb), .055), transparent 23%);
}

html[data-palette="ice"] ::selection,
html[data-palette="gold"] ::selection { background: var(--theme-accent); color: var(--theme-deep); }

html[data-palette="ice"] .site-nav,
html[data-palette="gold"] .site-nav {
  border-color: rgba(var(--theme-accent-rgb), .2);
  background: rgba(var(--theme-surface-rgb), .7);
  box-shadow: 0 18px 52px rgba(0, 0, 0, .36), inset 0 1px 0 rgba(var(--theme-soft-rgb), .05);
}

html[data-palette="ice"] .palette-switcher,
html[data-palette="gold"] .palette-switcher { border-color: rgba(var(--theme-accent-rgb), .15); background: rgba(0, 0, 0, .18); }

html[data-palette="ice"] .nav-cta,
html[data-palette="ice"] .command-trigger,
html[data-palette="gold"] .nav-cta,
html[data-palette="gold"] .command-trigger {
  border-color: rgba(var(--theme-accent-rgb), .35);
  background: rgba(var(--theme-accent-rgb), .075);
  color: var(--theme-soft) !important;
}

html[data-palette="ice"] .hero::before,
html[data-palette="gold"] .hero::before {
  background-image:
    linear-gradient(rgba(var(--theme-accent-rgb), .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--theme-accent-rgb), .04) 1px, transparent 1px);
}

html[data-palette="ice"] .hero::after,
html[data-palette="gold"] .hero::after { background: radial-gradient(circle, rgba(var(--theme-accent-rgb), .14), transparent 68%); }

html[data-palette="ice"] .hero-title,
html[data-palette="gold"] .hero-title { color: rgba(var(--theme-soft-rgb), .78); }
html[data-palette="ice"] .hero-copy,
html[data-palette="gold"] .hero-copy { color: var(--muted); }

html[data-palette="ice"] .pill,
html[data-palette="gold"] .pill,
html[data-palette="ice"] .btn,
html[data-palette="gold"] .btn {
  border-color: rgba(var(--theme-accent-rgb), .22);
  background: rgba(var(--theme-surface-rgb), .78);
}

html[data-palette="ice"] .btn-primary,
html[data-palette="ice"] .cv-download,
html[data-palette="gold"] .btn-primary,
html[data-palette="gold"] .cv-download {
  border-color: transparent;
  background: linear-gradient(120deg, var(--theme-accent), var(--theme-soft));
  color: var(--theme-deep);
  box-shadow: 0 14px 36px rgba(var(--theme-accent-rgb), .16);
}

html[data-palette="ice"] .terminal,
html[data-palette="gold"] .terminal {
  border-color: rgba(var(--theme-accent-rgb), .28);
  background: rgba(3, 7, 12, .9);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .48), inset 0 0 45px rgba(var(--theme-accent-rgb), .025);
}

html[data-palette="ice"] .terminal-head,
html[data-palette="gold"] .terminal-head { border-bottom-color: rgba(var(--theme-accent-rgb), .16); }
html[data-palette="ice"] .terminal-line,
html[data-palette="ice"] .terminal-body,
html[data-palette="gold"] .terminal-line,
html[data-palette="gold"] .terminal-body { color: rgba(var(--theme-soft-rgb), .73); }

html[data-palette="ice"] .profile-section,
html[data-palette="ice"] .career-section,
html[data-palette="gold"] .profile-section,
html[data-palette="gold"] .career-section {
  background: linear-gradient(180deg, rgba(var(--theme-surface-rgb), .48), rgba(3, 7, 12, .84));
  border-color: rgba(var(--theme-accent-rgb), .08);
}

html[data-palette="ice"] .profile-section::before,
html[data-palette="gold"] .profile-section::before {
  background:
    radial-gradient(circle at 10% 18%, rgba(var(--theme-accent-rgb), .09), transparent 31%),
    radial-gradient(circle at 88% 78%, rgba(var(--theme-soft-rgb), .05), transparent 34%);
}

html[data-palette="ice"] .profile-summary,
html[data-palette="ice"] .competency-card,
html[data-palette="ice"] .profile-fact,
html[data-palette="ice"] .career-section .edu-card,
html[data-palette="gold"] .profile-summary,
html[data-palette="gold"] .competency-card,
html[data-palette="gold"] .profile-fact,
html[data-palette="gold"] .career-section .edu-card {
  border-color: rgba(var(--theme-accent-rgb), .13);
  background: linear-gradient(145deg, rgba(var(--theme-surface-rgb), .9), rgba(3, 7, 12, .94));
}

html[data-palette="ice"] .competency-tags span,
html[data-palette="ice"] .skill-tags span,
html[data-palette="ice"] .project-meta span,
html[data-palette="gold"] .competency-tags span,
html[data-palette="gold"] .skill-tags span,
html[data-palette="gold"] .project-meta span {
  border-color: rgba(var(--theme-accent-rgb), .12);
  background: rgba(3, 7, 12, .58);
  color: rgba(var(--theme-soft-rgb), .72);
}

html[data-palette="ice"] .work-showcase,
html[data-palette="ice"] .work-board,
html[data-palette="gold"] .work-showcase,
html[data-palette="gold"] .work-board {
  background:
    radial-gradient(circle at 8% 8%, rgba(var(--theme-accent-rgb), .065), transparent 24rem),
    radial-gradient(circle at 92% 70%, rgba(var(--theme-soft-rgb), .04), transparent 28rem),
    var(--theme-deep);
}

html[data-palette="ice"] .work-category,
html[data-palette="gold"] .work-category {
  background: linear-gradient(155deg, rgba(var(--theme-surface-rgb), .8), rgba(3, 7, 12, .9));
  box-shadow: 0 20px 58px rgba(0, 0, 0, .26), inset 0 1px 0 rgba(var(--theme-accent-rgb), .04);
}

html[data-palette="ice"] .work-tile,
html[data-palette="ice"] .work-tile-static,
html[data-palette="gold"] .work-tile,
html[data-palette="gold"] .work-tile-static { border-color: rgba(var(--theme-accent-rgb), .13); background: var(--theme-surface); }

html[data-palette="ice"] .work-tile:hover,
html[data-palette="ice"] .work-tile:focus-visible,
html[data-palette="gold"] .work-tile:hover,
html[data-palette="gold"] .work-tile:focus-visible {
  border-color: rgba(var(--theme-accent-rgb), .62);
  box-shadow: 0 14px 34px rgba(var(--theme-accent-rgb), .1);
}

html[data-palette="ice"] .work-detail-dialog,
html[data-palette="ice"] .command-dialog,
html[data-palette="gold"] .work-detail-dialog,
html[data-palette="gold"] .command-dialog {
  border-color: rgba(var(--theme-accent-rgb), .24);
  background: var(--theme-deep-2);
  box-shadow: 0 35px 120px rgba(0, 0, 0, .76), 0 0 48px rgba(var(--theme-accent-rgb), .06);
}

html[data-palette="ice"] .work-detail-copy,
html[data-palette="ice"] .command-head,
html[data-palette="ice"] .command-body,
html[data-palette="gold"] .work-detail-copy,
html[data-palette="gold"] .command-head,
html[data-palette="gold"] .command-body { background-color: rgba(var(--theme-surface-rgb), .94); }

html[data-palette="ice"] .hobby-card,
html[data-palette="gold"] .hobby-card { --hobby-accent: var(--theme-accent); background: linear-gradient(145deg, rgba(var(--theme-surface-rgb), .92), rgba(3, 7, 12, .97)); }

html[data-palette="ice"] .alperen-chat-bubble,
html[data-palette="ice"] .alperen-chat-panel,
html[data-palette="gold"] .alperen-chat-bubble,
html[data-palette="gold"] .alperen-chat-panel {
  border-color: rgba(var(--theme-accent-rgb), .28);
  background: linear-gradient(155deg, rgba(var(--theme-surface-rgb), .985), rgba(3, 7, 12, .995));
  box-shadow: 0 28px 85px rgba(0, 0, 0, .68), 0 0 38px rgba(var(--theme-accent-rgb), .06);
}

html[data-palette="ice"] .alperen-chat-bubble::after,
html[data-palette="gold"] .alperen-chat-bubble::after { border-color: rgba(var(--theme-accent-rgb), .28); background: var(--theme-surface); }
html[data-palette="ice"] .alperen-chat-head,
html[data-palette="ice"] .alperen-chat-form,
html[data-palette="ice"] .alperen-chat-note,
html[data-palette="gold"] .alperen-chat-head,
html[data-palette="gold"] .alperen-chat-form,
html[data-palette="gold"] .alperen-chat-note { background: rgba(var(--theme-surface-rgb), .9); }
html[data-palette="ice"] .alperen-chat-message.is-user,
html[data-palette="ice"] .alperen-chat-send,
html[data-palette="gold"] .alperen-chat-message.is-user,
html[data-palette="gold"] .alperen-chat-send { background: linear-gradient(135deg, rgba(var(--theme-accent-rgb), .16), rgba(var(--theme-soft-rgb), .12)); }

html[data-palette="ice"] .scroll-progress span,
html[data-palette="gold"] .scroll-progress span {
  background: linear-gradient(90deg, var(--theme-accent), var(--theme-soft), var(--theme-accent));
  box-shadow: 0 0 14px rgba(var(--theme-accent-rgb), .45);
}

html[data-palette="ice"] a:focus-visible,
html[data-palette="ice"] button:focus-visible,
html[data-palette="gold"] a:focus-visible,
html[data-palette="gold"] button:focus-visible { outline-color: var(--theme-accent); }

@media (max-width: 1180px) and (min-width: 901px) {
  .palette-switcher { margin-left: 6px; }
  .palette-option { width: 30px; }
  .palette-swatch { width: 18px; height: 18px; }
}

@media (max-width: 620px) {
  .palette-switcher { gap: 0; margin-left: 5px; padding: 2px; }
  .palette-option { width: 29px; height: 34px; }
  .palette-swatch { width: 17px; height: 17px; }
  .palette-option[aria-pressed="true"]::after { right: 1px; bottom: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  .palette-option,
  .palette-swatch { transition: none; }
}
