:root {
  --theme-accent: #7d8187;
}

html.classic {
  color-scheme: light;
  --bg: #ece4d2;
  --surface: #f7f0e3;
  --surface-soft: #e5dac5;
  --text: #211c15;
  --muted: rgba(33, 28, 21, .68);
  --soft: rgba(33, 28, 21, .46);
  --line: rgba(33, 28, 21, .18);
  --line-soft: rgba(33, 28, 21, .10);
  --button: #c8362a;
  --button-text: #f7f0e3;
  --shadow: rgba(33, 28, 21, .14);
  --theme-accent: #5b4a3a;
}

html.classic ::selection {
  background: #c8362a;
  color: #f7f0e3;
}

html.classic .brand-mark,
html.classic .classic-icon,
html.classic .eyebrow-new {
  color: #c8362a;
}

html.classic .hero-accent,
html.classic .services-hero h1 span {
  color: var(--theme-accent);
}

html.classic .eyebrow-new {
  border-color: color-mix(in srgb, #c8362a 48%, transparent);
}

.theme-picker {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

html.dark .theme-toggle .sun-icon,
html.dark .theme-toggle .classic-icon,
html.light .theme-toggle .moon-icon,
html.light .theme-toggle .classic-icon,
html.classic .theme-toggle .sun-icon,
html.classic .theme-toggle .moon-icon {
  display: none;
}

html.dark .theme-toggle .moon-icon,
html.light .theme-toggle .sun-icon,
html.classic .theme-toggle .classic-icon {
  display: block;
}

.theme-toggle .classic-icon {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
}

.theme-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  width: 184px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 48px var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}

.theme-picker[data-open="true"] .theme-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.theme-option {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 24px 1fr 16px;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 9px;
  padding: 7px 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

.theme-option:hover,
.theme-option:focus-visible {
  outline: none;
  background: var(--line-soft);
  color: var(--text);
}

.theme-option[aria-checked="true"] {
  color: var(--text);
}

.theme-swatch {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
}

.theme-swatch-dark { background: #0a0a0a; color: #fff; border-color: rgba(255,255,255,.18); }
.theme-swatch-light { background: #f4f4f2; color: #0a0a0a; border-color: rgba(10,10,10,.14); }
.theme-swatch-classic { background: #ece4d2; color: #c8362a; border-color: rgba(33,28,21,.18); font-family: "Noto Sans JP", sans-serif; font-weight: 500; }
.theme-option-label { font-size: 13px; font-weight: 500; }
.theme-check { opacity: 0; font-size: 13px; }
.theme-option[aria-checked="true"] .theme-check { opacity: 1; }

.footer-theme .theme-menu {
  top: auto;
  right: auto;
  bottom: calc(100% + 10px);
  left: 0;
}

@media (max-width: 640px) {
  .nav-actions > .theme-picker { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .theme-menu { transition: none; }
}
