/* Shared theme tokens and the site-wide theme switch. */
.footer .footer-social-link {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  text-decoration: none;
}

.footer .footer-social-link svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: currentColor;
}

html {
  --theme-surface-card: rgba(23, 25, 37, .72);
  --theme-surface-soft: rgba(23, 25, 37, .6);
  --theme-surface-popover: #1b1e2e;
  --theme-control-bg: rgba(255, 255, 255, .03);
  --theme-control-hover: rgba(244, 242, 237, .07);
  --theme-hover-border: rgba(244, 242, 237, .32);
  --theme-focus: rgba(244, 242, 237, .48);
  --theme-selection: rgba(201, 243, 106, .22);
  --theme-scroll-track: rgba(244, 242, 237, .14);
  --theme-scroll-thumb: rgba(244, 242, 237, .45);
  --theme-scroll-thumb-active: rgba(244, 242, 237, .7);
  --theme-popover-shadow: rgba(0, 0, 0, .5);
  --theme-card-shadow: rgba(0, 0, 0, .2);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --text: #20232d;
  --muted: #626775;
  --line: rgba(32, 35, 45, .14);
  --lime: #46515b;
  --theme-surface-card: rgba(255, 255, 255, .88);
  --theme-surface-soft: rgba(255, 255, 255, .78);
  --theme-surface-popover: #ffffff;
  --theme-control-bg: rgba(255, 255, 255, .76);
  --theme-control-hover: rgba(32, 35, 45, .055);
  --theme-hover-border: rgba(32, 35, 45, .32);
  --theme-focus: rgba(32, 35, 45, .72);
  --theme-selection: rgba(32, 35, 45, .12);
  --theme-scroll-track: rgba(32, 35, 45, .12);
  --theme-scroll-thumb: rgba(32, 35, 45, .38);
  --theme-scroll-thumb-active: rgba(32, 35, 45, .62);
  --theme-popover-shadow: rgba(28, 37, 48, .16);
  --theme-card-shadow: rgba(28, 37, 48, .08);
}

html[data-theme="light"] body {
  background: var(--bg);
}

html[data-theme="light"] .brand-logo {
  filter: brightness(0);
}

html[data-theme="light"] .promo-card,
html[data-theme="light"] .app,
html[data-theme="light"] .next,
html[data-theme="light"] .news-placeholder,
html[data-theme="light"] .pp-card {
  background: var(--theme-surface-card);
  border-color: var(--line);
  box-shadow: 0 18px 48px var(--theme-card-shadow);
}

/* Keep product art clear without adding decorative color washes. */
html[data-theme="light"] .promo-card {
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 8px 24px var(--theme-card-shadow);
}

html[data-theme="light"] .promo-card img {
  filter: drop-shadow(0 8px 12px rgba(31, 39, 52, .12));
}

html[data-theme="light"] .appvisual {
  background: #ffffff;
}

html[data-theme="light"] .pill {
  border-color: var(--line);
}

html[data-theme="light"] .promise {
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 8px 24px var(--theme-card-shadow);
}

html[data-theme="light"] .task-visual::before {
  border-color: rgba(255, 104, 84, .16);
  box-shadow: none;
}

html[data-theme="light"] .task-window {
  border-color: var(--line);
  background: #fff;
  box-shadow: 0 8px 24px var(--theme-card-shadow);
  transform: none;
}

html[data-theme="light"] .task-row {
  border-color: var(--line);
  background: #ffffff;
}

html[data-theme="light"] .task-progress {
  background: rgba(32, 35, 45, .1);
}

html[data-theme="light"] .task-row.accent {
  border-color: var(--line);
}

html[data-theme="light"] .lang-panel {
  background: var(--theme-surface-popover);
  box-shadow: 0 18px 50px var(--theme-popover-shadow);
}

html[data-theme="light"] .lang-select-wrap {
  background: var(--theme-control-bg);
}

html[data-theme="light"] .tag-proof-tags span {
  background: var(--theme-surface-soft);
}

.theme-toggle {
  display: inline-grid;
  flex: 0 0 38px;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: var(--theme-control-bg);
  cursor: pointer;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover {
  color: var(--lime);
  border-color: var(--theme-hover-border);
  background: var(--theme-control-hover);
  transform: translateY(-1px);
}

.theme-toggle:active {
  transform: translateY(0) scale(.96);
}

.theme-toggle svg {
  display: block;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

html[data-theme="dark"] .theme-icon--moon,
html[data-theme="light"] .theme-icon--sun {
  display: none;
}

html[data-theme="light"] .theme-toggle[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--line);
  background: rgba(32, 35, 45, .06);
}

html[data-theme="light"] .theme-toggle:hover {
  color: var(--text);
  border-color: var(--theme-hover-border);
  background: rgba(32, 35, 45, .1);
}

html[data-theme="light"] .lang-select-wrap:hover,
html[data-theme="light"] .outline-link:hover,
html[data-theme="light"] .pp-links a:hover,
html[data-theme="light"] .news-cta:hover,
html[data-theme="light"] .tag-showcase-link:hover,
html[data-theme="light"] .tester-button:hover {
  border-color: var(--theme-hover-border);
}

html[data-theme="light"] .lang-list button:hover,
html[data-theme="light"] .lang-list button:focus-visible {
  background: var(--theme-control-hover);
}

html[data-theme="light"] .lang-panel:focus-within {
  border-color: rgba(32, 35, 45, .24);
}

html[data-theme="light"] .lang-list::-webkit-scrollbar-thumb {
  background: rgba(32, 35, 45, .22);
}

html[data-theme="light"] .gallery-scroll::before {
  background: var(--theme-scroll-track);
}

html[data-theme="light"] .gallery-scroll-thumb {
  background: var(--theme-scroll-thumb);
}

html[data-theme="light"] .gallery-scroll-thumb:hover,
html[data-theme="light"] .gallery-scroll:active .gallery-scroll-thumb {
  background: var(--theme-scroll-thumb-active);
}

/* Keep Gallery Plus screenshots on a light, clearly separated stage. */
html[data-theme="light"] .gallery-shell {
  background: #ffffff;
  border-color: rgba(32, 35, 45, .12);
  box-shadow: 0 18px 42px rgba(28, 37, 48, .1), inset 0 1px 0 rgba(255, 255, 255, .78);
}

html[data-theme="light"] .gallery-card-frame {
  background: #ffffff;
  border-color: rgba(32, 35, 45, .14);
  box-shadow: 0 12px 26px rgba(28, 37, 48, .12);
}

html[data-theme="light"] .gallery-card-frame:hover {
  border-color: rgba(32, 35, 45, .3);
}

html[data-theme="light"] .button:hover {
  border-color: var(--theme-hover-border);
  background-color: var(--theme-control-hover);
  box-shadow: 0 8px 18px var(--theme-card-shadow);
}

html[data-theme="light"] .news-section .notice-scrollbar {
  background: var(--theme-scroll-track);
}

html[data-theme="light"] .news-section .notice-scrollbar-thumb {
  background: var(--theme-scroll-thumb);
}

html[data-theme="light"] .news-section .notice-list:focus-visible {
  outline-color: var(--theme-focus);
}

html[data-theme="light"] a:focus-visible,
html[data-theme="light"] button:focus-visible,
html[data-theme="light"] input:focus-visible {
  outline-color: var(--theme-focus);
}

html[data-theme="light"] ::selection {
  background: var(--theme-selection);
  color: var(--text);
}

body,
.promo-card,
.app,
.next,
.news-placeholder,
.pp-card,
.promise,
.lang-select-wrap,
.lang-panel {
  transition: color .22s ease, background-color .22s ease, border-color .22s ease, box-shadow .22s ease;
}

@media (max-width: 520px) {
  .theme-toggle {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle,
  body,
  .promo-card,
  .app,
  .next,
  .news-placeholder,
  .pp-card,
  .promise,
  .lang-select-wrap,
  .lang-panel {
    transition-duration: .01ms;
  }
}
