:root {
  --bg: #000000;
  --fg: #ffffff;
  /* 6.02:1 on black. #6f6f6f measured 4.18:1 and failed WCAG AA 1.4.3. */
  --muted: #8a8a8a;
  --line: #1c1c1c;
  --accent: #e3a083;

  --ring: clamp(210px, 50vmin, 440px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: "Helvetica Neue", Inter, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Home ────────────────────────────────────────────────────────────────── */

/* The interactive cell field sits behind everything */
#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Darkens the corners so the lit centre reads as depth rather than flat black */
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    circle at 50% 42%,
    rgba(255, 255, 255, 0.045) 0%,
    rgba(255, 255, 255, 0) 42%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

.home main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px 24px;
}

/* The entrance animation lives here, not on .scene. A filled animation's final
   keyframe wins over the element's own transform, which would permanently
   override the pointer tilt. Separating them lets both run. */
.stage {
  perspective: 1100px;
  perspective-origin: 50% 45%;
  animation: rise 1.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.scene {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-style: preserve-3d;
  /* JS writes --rx/--ry from the pointer; the fallback keeps the scene flat */
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Warm bloom behind the mark, furthest back in Z */
.halo {
  position: absolute;
  top: calc(var(--ring) * 0.5);
  left: 50%;
  width: calc(var(--ring) * 2.1);
  height: calc(var(--ring) * 2.1);
  margin: calc(var(--ring) * -1.05) 0 0 calc(var(--ring) * -1.05);
  border-radius: 50%;
  transform: translateZ(-160px);
  background: radial-gradient(
    circle,
    rgba(227, 160, 131, 0.17) 0%,
    rgba(227, 160, 131, 0.05) 38%,
    rgba(227, 160, 131, 0) 68%
  );
  filter: blur(14px);
  animation: breathe 9s ease-in-out infinite;
}

.ring-wrap {
  transform: translateZ(80px);
  line-height: 0;
}

.ring {
  display: block;
  width: var(--ring);
  height: auto;
  animation: spin 46s linear infinite;
  filter: drop-shadow(0 24px 60px rgba(0, 0, 0, 0.9));
}

/* The wordmark image is the page's h1; the heading itself adds no layout.
   The depth lives here rather than on the image, because the <picture>
   wrapper in between would otherwise flatten the image's own translateZ. */
.wordmark-h1 {
  margin: calc(var(--ring) * 0.15) 0 0;
  line-height: 0;
  font-size: 0;
  transform: translateZ(34px);
}

.wordmark-h1 picture,
.ring-wrap picture {
  display: block;
  line-height: 0;
}

.wordmark {
  display: block;
  width: calc(var(--ring) * 0.56);
  height: auto;
}

.soon {
  position: relative;
  z-index: 1;
  margin: calc(var(--ring) * 0.2) 0 0;
  font-size: 14px;
  color: var(--muted);
  animation: fade 1.6s 0.5s ease both;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 0 24px 34px;
  font-size: 13px;
  animation: fade 1.6s 0.8s ease both;
}

footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

footer a:hover,
footer a:focus-visible { color: var(--fg); }

/* Keyboard users get no hover, so focus needs its own visible affordance.
   --accent measures 9.62:1 on black. */
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Cursor ──────────────────────────────────────────────────────────────── */

/* Only replace the cursor where a fine pointer exists and motion is welcome.
   Gated on .js-cursor, which app.js sets once the replacement is actually
   wired up: if the script never runs, the native cursor must stay. */
@media (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .js-cursor body.home,
  .js-cursor body.home a {
    cursor: none;
  }
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  will-change: transform;
}

.cursor-dot {
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  background: var(--fg);
}

.cursor-ring {
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  transition: width 0.25s ease, height 0.25s ease, margin 0.25s ease,
    border-color 0.25s ease;
}

/* The ring opens up over anything interactive */
.cursor-ring.is-link {
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-color: rgba(227, 160, 131, 0.8);
}

/* ── Motion ──────────────────────────────────────────────────────────────── */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }


@keyframes breathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .stage, .soon, footer, .ring, .halo { animation: none; }
  .scene { transition: none; }
  #field, .cursor-dot, .cursor-ring { display: none; }
}

/* ── Legal pages ─────────────────────────────────────────────────────────── */

body.legal main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 72px 24px 48px;
}

.doc {
  width: 100%;
  max-width: 620px;
}

.doc h1 {
  font-size: 26px;
  font-weight: 500;
  margin: 0 0 6px;
}

.doc .meta {
  color: var(--muted);
  margin: 0 0 44px;
}

/* Numbered sections are h3 in privacy.html (under the Part I/II h2 dividers)
   and h2 in impressum.html, which has no such split. Same visual treatment. */
.doc h2,
.doc h3 {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
  margin: 40px 0 10px;
}

.doc p { margin: 0 0 14px; }

.doc address { font-style: normal; }

.doc a { color: var(--fg); }

.doc ul {
  margin: 0 0 14px;
  padding-left: 20px;
}

.doc li { margin-bottom: 8px; }

/* PART I / PART II dividers inside the combined legal document */
.doc .part {
  font-size: 18px;
  color: var(--fg);
  font-weight: 500;
  margin: 64px 0 4px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.doc .note {
  color: var(--muted);
  border-left: 2px solid var(--line);
  padding-left: 16px;
}

.back {
  display: inline-block;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 44px;
}

.back:hover,
.back:focus-visible { color: var(--fg); }

body.legal footer {
  border-top: 1px solid var(--line);
  padding-top: 28px;
  margin: 0 24px;
  animation: none;
}
