/* Fehistro Studio brand assets and light/dark appearance. */
:root {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --studio-bg: #0d0d0f;
  --studio-surface: rgba(28, 28, 30, 0.72);
  --studio-surface-strong: rgba(36, 36, 38, 0.88);
  --studio-text: #f5f5f7;
  --studio-muted: #a1a1a6;
  --studio-line: rgba(255, 255, 255, 0.10);
  --studio-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.theme-toggle {
  position: relative;
  width: 48px;
  height: 28px;
  flex: 0 0 48px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.10);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #6e6e73;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  transition: background 180ms ease, border-color 180ms ease;
}

.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 1;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1d1d1f;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
  transition: transform 180ms ease, background 180ms ease;
}

.theme-toggle svg {
  position: absolute;
  top: 7px;
  z-index: 2;
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.theme-toggle .theme-icon-sun {
  left: 7px;
  color: #ffffff;
}

.theme-toggle .theme-icon-moon {
  right: 7px;
  color: #77777c;
}

.theme-toggle:hover {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.16);
}

.theme-toggle:focus-visible {
  outline: 2px solid #0071e3;
  outline-offset: 3px;
}

html[data-theme="dark"] body.studio-site,
html[data-theme="dark"] body {
  background: var(--studio-bg);
  color: var(--studio-text);
}

html[data-theme="dark"] .site-header {
  background: rgba(13, 13, 15, 0.78);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .nav-links a {
  color: #c7c7cc;
}

html[data-theme="dark"] .nav-links a:hover,
html[data-theme="dark"] .nav-links a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

html[data-theme="dark"] .theme-toggle {
  background: rgba(35, 35, 38, 0.90);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .theme-toggle:hover {
  background: rgba(45, 45, 48, 0.98);
  border-color: rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(20px);
  background: #f5f5f7;
}

html[data-theme="dark"] .theme-toggle .theme-icon-sun {
  color: #8e8e93;
}

html[data-theme="dark"] .theme-toggle .theme-icon-moon {
  color: #111113;
}

html[data-theme="dark"] .button.primary {
  background: #f5f5f7;
  border-color: #f5f5f7;
  color: #111113;
}

html[data-theme="dark"] .button.primary:hover {
  background: #ffffff;
}

html[data-theme="dark"] .button.secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
}

html[data-theme="dark"] .button.secondary:hover {
  background: rgba(255, 255, 255, 0.13);
}

html[data-theme="dark"] .glance-panel,
html[data-theme="dark"] .copy-panel,
html[data-theme="dark"] .legal-panel {
  border-color: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .glance-row > span,
html[data-theme="dark"] .copy-panel > p,
html[data-theme="dark"] .legal-copy p {
  color: #c7c7cc;
}

html[data-theme="dark"] .glance-row small,
html[data-theme="dark"] .minimal-footer > p {
  color: #8e8e93;
}

html[data-theme="dark"] .final-note a,
html[data-theme="dark"] .footer-links a {
  color: #a1a1a6;
}

html[data-theme="dark"] .final-note a:hover,
html[data-theme="dark"] .footer-links a:hover {
  color: #f5f5f7;
}

html[data-theme="dark"] .legal-copy a {
  text-decoration-color: rgba(255, 255, 255, 0.30);
}

html[data-theme="dark"] .nav-toggle {
  color: #c7c7cc;
}

@media (max-width: 760px) {
  .nav-actions {
    gap: 6px;
  }

  .theme-toggle {
    width: 46px;
    flex-basis: 46px;
  }

  html[data-theme="dark"] .nav-links {
    background: rgba(28, 28, 30, 0.96);
    border-color: rgba(255, 255, 255, 0.10);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
  }
}

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