/* ==============================================================
   NEUE EPISTEME — Studio for Narrative Intelligence
   Stylesheet
   ============================================================== */

/* ---------- Design Tokens ---------- */
:root {
  --bg: #efe7d8;
  --ink: #18140f;
  --ink-soft: #2a241c;
  --font-serif: Georgia, 'Playfair Display', 'Times New Roman', serif;
  --stage-size: min(80vw, 75vh);
  --transition-slow: 0.6s ease;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Screen-Reader-Only / SEO-Text ---------- */
/* Visuell versteckt, aber für Screenreader & Suchmaschinen zugänglich */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Stage / Logo Container ---------- */
.stage {
  width: var(--stage-size);
  height: var(--stage-size);
  position: relative;
  flex-shrink: 0;
}

svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* ---------- Subtitle ---------- */
.subtitle {
  color: var(--ink);
  font-size: clamp(14px, 2.5vw, 24px);
  letter-spacing: 0.45em;
  text-transform: uppercase;
  margin-top: 2rem;
  text-align: center;
  padding: 0 1rem;
  opacity: 0;
  animation: fadeUp 2.5s ease-out 1.2s forwards;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 0.85;
    transform: translateY(0);
  }
}

/* ---------- Rotating SVG Groups ---------- */
.ring-outer {
  transform-origin: 500px 500px;
  animation: spinCW 90s linear infinite;
}

.text-ring {
  transform-origin: 500px 500px;
  animation: spinCCW 120s linear infinite;
}

.ring-dotted {
  transform-origin: 500px 500px;
  animation: spinCCW 60s linear infinite;
}

.ring-arcs {
  transform-origin: 500px 500px;
  animation: spinCW 140s linear infinite;
}

.ticks {
  transform-origin: 500px 500px;
  animation: spinCCW 200s linear infinite;
}

@keyframes spinCW {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes spinCCW {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}

/* ---------- Pulsing Nodes ---------- */
.node {
  animation: pulse 4.5s ease-in-out infinite;
  transform-origin: center;
}

.node.d1 { animation-delay: 0s; }
.node.d2 { animation-delay: 0.6s; }
.node.d3 { animation-delay: 1.2s; }
.node.d4 { animation-delay: 1.8s; }
.node.d5 { animation-delay: 2.4s; }

@keyframes pulse {
  0%, 100% {
    opacity: 0.85;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

/* ---------- Breathing Core ---------- */
.core {
  transform-origin: 500px 500px;
  animation: breathe 6s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.015); }
}

.monogram {
  animation: ink 6s ease-in-out infinite;
}

@keyframes ink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.92; }
}

/* ---------- Ambient Halo ---------- */
.halo {
  transform-origin: 500px 500px;
  animation: halo 6s ease-in-out infinite;
}

@keyframes halo {
  0%, 100% {
    opacity: 0;
    r: 150;
  }
  50% {
    opacity: 0.05;
    r: 175;
  }
}

/* ---------- Accessibility: Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .ring-outer,
  .text-ring,
  .ring-dotted,
  .ring-arcs,
  .ticks,
  .node,
  .core,
  .monogram,
  .halo,
  .subtitle {
    animation: none !important;
  }

  .subtitle {
    opacity: 1;
    transform: none;
  }

  html, body {
    overflow: auto;
  }
}

/* ---------- Responsive: Small Screens ---------- */
@media (max-width: 600px) {
  :root {
    --stage-size: min(88vw, 70vh);
  }

  .subtitle {
    letter-spacing: 0.3em;
    font-size: clamp(12px, 3.5vw, 16px);
    margin-top: 1.5rem;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  :root {
    --stage-size: min(70vw, 88vh);
  }

  .subtitle {
    margin-top: 1rem;
    font-size: clamp(11px, 2.2vw, 14px);
  }
}

/* ---------- Print ---------- */
@media print {
  .sr-only {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: none;
    white-space: normal;
  }

  html, body {
    overflow: visible;
    display: block;
  }

  .stage {
    width: 80mm;
    height: 80mm;
    margin: 0 auto;
  }

  .subtitle {
    opacity: 1;
    animation: none;
    margin-top: 1rem;
  }
}