/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }

/* ── Hidden radio inputs ──────────────────────────── */
.theme-radio { position: absolute; opacity: 0; pointer-events: none; }

/* ── Stage ─────────────────────────────────────────── */
.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.6s ease;
}

/* ── Circle Frame ──────────────────────────────────── */
.circle-frame {
  --size: min(70vmin, 400px);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: box-shadow 0.6s ease;
}

.circle-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  transition: background 0.6s ease;
}
.circle-frame canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
  will-change: contents;
  transform: translateZ(0); /* GPU compositing layer */
}

/* ── No-JS fallback image ─────────────────────────── */
.noscript-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
}

/* ── Footer ───────────────────────────────────────── */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  z-index: 10;
}
.footer-legal {
  display: flex;
  gap: 24px;
  justify-content: center;
}
.site-footer a {
  color: #777;
  text-decoration: none;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.site-footer a:hover {
  opacity: 0.9;
  text-decoration: underline;
}
.site-footer--home {
  background: transparent;
}
[data-theme="porcelain"] .site-footer { background: #e8e4de; }
[data-theme="sandstone"] .site-footer { background: repeating-conic-gradient(#d4c4a8 0% 25%, #cebfa5 25% 50%) 0 0 / 3px 3px, #d0bfa0; }
[data-theme="slate"] .site-footer     { background: #c2c0bc; }
[data-theme="sky"] .site-footer       { background: #b5cadd; }
[data-theme="sage"] .site-footer      { background: #b2c5b2; }

/* ── Burger Menu ──────────────────────────────────── */
.burger-checkbox {
  position: fixed;
  top: -1px;
  left: -1px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.burger-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 24px;
  height: 20px;
  cursor: pointer;
  z-index: 30;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.burger-line {
  display: block;
  width: 100%;
  height: 2px;
  background: #888;
  opacity: 0.45;
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}
.burger-btn:hover .burger-line { opacity: 0.85; }

/* animate to X when open */
#burger-toggle:checked ~ .burger-btn .burger-line:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
#burger-toggle:checked ~ .burger-btn .burger-line:nth-child(2) {
  opacity: 0;
}
#burger-toggle:checked ~ .burger-btn .burger-line:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* dropdown panel */
.burger-menu {
  position: fixed;
  top: 72px;
  right: 20px;
  min-width: 160px;
  padding: 12px 0;
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  z-index: 25;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
#burger-toggle:checked ~ .burger-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.burger-menu a {
  padding: 8px 20px;
  text-decoration: none;
  color: #555;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.burger-menu a:hover { opacity: 1; }

/* burger menu background per theme */
[data-theme="porcelain"] .burger-menu { background: #e8e4de; }
[data-theme="sandstone"] .burger-menu { background: #d0bfa0; }
[data-theme="slate"] .burger-menu     { background: #c2c0bc; }
[data-theme="sky"] .burger-menu       { background: #b5cadd; }
[data-theme="lilac"] .burger-menu     { background: #d0c2d4; }
[data-theme="sage"] .burger-menu      { background: #b2c5b2; }

/* ── Social Icons ─────────────────────────────────── */
.social-icons {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  z-index: 10;
}
.social-icons a {
  display: block;
  width: 22px;
  height: 22px;
  color: #888;
  opacity: 0.45;
  transition: opacity 0.2s, color 0.3s;
}
.social-icons a:hover {
  opacity: 0.85;
}
.social-icons svg {
  width: 100%;
  height: 100%;
}
.social-img-icon img {
  width: 100%;
  height: 100%;
  opacity: 0.45;
  transition: opacity 0.2s;
}
.social-img-icon:hover img {
  opacity: 0.85;
}
/* HU Siegel: SVG with transparent bg, bolder due to filigree lines */
.social-hu-icon {
  width: 26px !important;
  height: 26px !important;
}
.social-hu-icon img {
  width: 100%;
  height: 100%;
  opacity: 1;
  transition: opacity 0.2s;
}
.social-hu-icon:hover img {
  opacity: 1;
}
/* artop icon: PNG needs filter for theme blending */
.social-artop-icon {
  width: 22px !important;
  height: 22px !important;
  margin-top: -4px;
}
.social-artop-icon img {
  width: 100%;
  height: 100%;
  opacity: 0.35;
  filter: grayscale(1) brightness(1.5);
  transition: opacity 0.2s;
}
.social-artop-icon:hover img {
  opacity: 0.7;
}

/* ══════════════════════════════════════════════════════
   THEMES — dual selectors: data-theme (JS) + :has() (no-JS)
   ══════════════════════════════════════════════════════ */

/* ── Porcelain ────────────────────────────────────── */
[data-theme="porcelain"] .stage,
body:has(#theme-porcelain:checked) .stage {
  background:
    repeating-conic-gradient(#eae6e0 0% 25%, #e5e1db 25% 50%) 0 0 / 3px 3px,
    #e8e4de;
}
[data-theme="porcelain"] .circle-frame,
body:has(#theme-porcelain:checked) .circle-frame {
  box-shadow:
    0 0 0 3px #d5d0c8,
    0 0 40px rgba(0,0,0,0.08),
    inset 0 0 20px rgba(0,0,0,0.05);
}
[data-theme="porcelain"] .circle-frame::after,
body:has(#theme-porcelain:checked) .circle-frame::after {
  background: rgba(215, 210, 195, 0.12);
}

/* ── Sandstone ────────────────────────────────────── */
[data-theme="sandstone"] .stage,
body:has(#theme-sandstone:checked) .stage {
  background:
    repeating-conic-gradient(#d4c4a8 0% 25%, #cebfa5 25% 50%) 0 0 / 3px 3px,
    #d0bfa0;
}
[data-theme="sandstone"] .circle-frame,
body:has(#theme-sandstone:checked) .circle-frame {
  box-shadow:
    0 0 0 3px #c4b494,
    0 0 40px rgba(100,80,40,0.15),
    inset 0 0 20px rgba(80,60,20,0.08);
}

/* ── Slate ─────────────────────────────────────────── */
[data-theme="slate"] .stage,
body:has(#theme-slate:checked) .stage {
  background:
    repeating-conic-gradient(#c5c3c0 0% 25%, #bfbdb9 25% 50%) 0 0 / 4px 4px,
    #c2c0bc;
}
[data-theme="slate"] .circle-frame,
body:has(#theme-slate:checked) .circle-frame {
  box-shadow:
    0 0 0 3px #b0aeaa,
    0 0 40px rgba(0,0,0,0.1),
    inset 0 0 20px rgba(0,0,0,0.06);
}

/* ── Sky ──────────────────────────────────────────── */
[data-theme="sky"] .stage,
body:has(#theme-sky:checked) .stage {
  background:
    repeating-conic-gradient(#b8cde0 0% 25%, #b2c7db 25% 50%) 0 0 / 4px 4px,
    #b5cadd;
}
[data-theme="sky"] .circle-frame,
body:has(#theme-sky:checked) .circle-frame {
  box-shadow:
    0 0 0 3px #a0b8d0,
    0 0 40px rgba(40,80,140,0.12),
    inset 0 0 20px rgba(30,60,100,0.08);
}

/* ── Lilac ─────────────────────────────────────────── */
[data-theme="lilac"] .stage,
body:has(#theme-lilac:checked) .stage {
  background:
    repeating-conic-gradient(#d2c4d6 0% 25%, #ccbfd2 25% 50%) 0 0 / 4px 4px,
    #d0c2d4;
}
[data-theme="lilac"] .circle-frame,
body:has(#theme-lilac:checked) .circle-frame {
  box-shadow:
    0 0 0 3px #beb0c2,
    0 0 40px rgba(80,40,90,0.12),
    inset 0 0 20px rgba(60,30,70,0.08);
}
[data-theme="lilac"] .site-footer { background: #d0c2d4; }

/* ── Sage ──────────────────────────────────────────── */
[data-theme="sage"] .stage,
body:has(#theme-sage:checked) .stage {
  background:
    repeating-conic-gradient(#b5c8b5 0% 25%, #afc2af 25% 50%) 0 0 / 4px 4px,
    #b2c5b2;
}
[data-theme="sage"] .circle-frame,
body:has(#theme-sage:checked) .circle-frame {
  box-shadow:
    0 0 0 3px #9db59d,
    0 0 40px rgba(40,80,40,0.12),
    inset 0 0 20px rgba(30,60,30,0.08);
}

/* ── Theme Switcher ────────────────────────────────── */
.theme-switcher {
  display: flex;
  gap: 12px;
}
.theme-switcher label {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(128,128,128,0.3);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: border-color 0.3s, transform 0.2s;
}
.theme-switcher label:hover {
  transform: scale(1.15);
}
.swatch {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
}
.sw-porcelain  { background: #e8e4de; }
.sw-sandstone  { background: #d0bfa0; }
.sw-slate      { background: #c2c0bc; }
.sw-sky        { background: #b5cadd; }
.sw-lilac      { background: #d0c2d4; }
.sw-sage       { background: #b2c5b2; }

/* ── Language Switcher ─────────────────────────────── */
.lang-switcher {
  position: fixed;
  top: 48px;
  /* center under burger: right 20px + half burger width 12px = 32px center */
  right: 20px;
  width: 24px;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 10px;
  letter-spacing: 0.5px;
  z-index: 30;
}
.lang-link {
  color: #555;
  opacity: 0.4;
  text-decoration: none;
  transition: opacity 0.2s;
}
.lang-link:hover { opacity: 0.85; }
.lang-link::before { content: "["; }
.lang-link::after { content: "]"; }
.lang-disabled {
  color: #999;
  opacity: 0.25;
  cursor: default;
}
.lang-disabled::before { content: "["; }
.lang-disabled::after { content: "]"; }

/* ── Site Logo (subpages) ─────────────────────────── */
.site-logo {
  position: fixed;
  top: 20px;
  left: 20px;
  /* gleiche Abstaende wie burger-btn: top 20px, seitlich 20px */
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  opacity: 0.5;
  transition: opacity 0.2s;
  z-index: 20;
}
.site-logo:hover { opacity: 0.85; }
.site-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

/* ── Legal pages ──────────────────────────────────── */
.legal-page, .legal-page body { height: auto; overflow: auto; }
html.legal-html { height: auto; overflow: auto; }
.legal {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 56px 64px 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  font-size: 15px;
  color: #555;
  position: relative;
  z-index: 1;
}
.legal h1 { font-size: 24px; margin-bottom: 24px; color: #333; padding-right: 24px; }
.legal h2 { font-size: 18px; margin: 28px 0 8px; color: #444; }
.legal h3 { font-size: 16px; margin: 20px 0 6px; color: #444; }
.legal p, .legal ul { margin: 8px 0; }
.legal ul { padding-left: 1.4em; }
.legal a { color: inherit; }
.legal .back {
  display: inline-block;
  margin-bottom: 24px;
  opacity: 0.5;
  text-decoration: none;
  font-size: 13px;
  color: #555;
}
.legal .back:hover { opacity: 1; }
.legal-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  transition: background 0.6s ease;
}

/* ── PII & Email obfuscation (anti-scraping) ─────── */
.pii-protected {
  unicode-bidi: bidi-override;
  direction: rtl;
}
.email-reversed {
  unicode-bidi: bidi-override;
  direction: rtl;
  cursor: pointer;
}
.email-reversed:hover { text-decoration: underline; }
.email-protected noscript,
.pii-protected + noscript { font-size: inherit; }

/* ── Accessibility ────────────────────────────────── */

/* Skip-to-content link */
.skip-link {
  position: fixed;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 6px 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  text-decoration: none;
  z-index: 100;
  transition: top 0.2s;
}
.skip-link:focus,
.skip-link.skip-link--visible {
  top: 0;
}

/* Visible focus ring on all interactive elements */
:focus-visible {
  outline: 2px solid #555;
  outline-offset: 2px;
}
.burger-btn:focus-visible {
  outline: 2px solid #555;
  outline-offset: 4px;
  border-radius: 2px;
}
.theme-switcher label:focus-visible {
  outline: 2px solid #555;
  outline-offset: 2px;
}
.social-icons a:focus-visible {
  outline: 2px solid #555;
  outline-offset: 4px;
}
.site-logo:focus-visible {
  outline: 2px solid #555;
  outline-offset: 4px;
}

/* prefers-reduced-motion: disable all animations and transitions */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .circle-frame canvas {
    will-change: auto;
  }
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 800px) {
  .legal h1 { padding-left: 80px; }
}
@media (max-width: 480px) {
  .circle-frame { --size: 80vmin; }
  .theme-switcher { gap: 8px; }
  .theme-switcher label { width: 28px; height: 28px; }
  .swatch { width: 16px; height: 16px; }
  .social-icons { right: 10px; gap: 12px; }
  .social-icons a { width: 18px; height: 18px; }
  .site-logo { width: 56px; height: 56px; }
  .legal h1 { padding-left: 68px; }
  .lang-switcher { right: 10px; }
}
@media (min-width: 1200px) {
  .circle-frame { --size: min(50vmin, 450px); }
  .social-icons { right: 28px; }
}
