/* geometrie.org – Stilvorlagen: gemeinsame Basis
 * Reines CSS ohne Framework: Kaskaden-Ebenen, Custom Properties, Verschachtelung, Container Queries.
 * Jede Stilvorlage legt ihre Regeln in @layer stil und überschreibt nur Tokens und Motive. */
@layer reset, basis, stil;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
  body { margin: 0; min-height: 100vh; line-height: 1.55; text-rendering: optimizeLegibility; }
  img, video, svg, canvas { display: block; max-width: 100%; height: auto; }
  button, input, select, textarea { font: inherit; color: inherit; }
  h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
  ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
  a { color: inherit; }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  }
}

@layer basis {
  :root {
    --gutter: clamp(16px, 4vw, 48px);
    --wrap: 1180px;
    --focus: #1a5fd0;
  }
  body { overflow-x: clip; }
  .wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
  .skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: .5em 1em; background: #fff; color: #000; }
  .skip:focus { left: 8px; }
  :focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
  .visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  /* Lebendes Logo */
  .g-logo { position: relative; display: block; flex: none; border-radius: 50%; }
  .g-logo img { width: 100%; height: auto; transition: opacity .25s; }
  .g-logo__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: 50%; opacity: 0; transition: opacity .25s; pointer-events: none; }
  .g-logo.is-alive .g-logo__video { opacity: 1; }
  .g-logo.is-alive img { opacity: 0; }

  /* Videoloop */
  .g-loop { position: relative; overflow: hidden; aspect-ratio: 16 / 10; background: #e9e1d3; }
  .g-loop video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .9s ease; }
  .g-loop video.is-on { opacity: 1; }
  .g-loop__toggle {
    position: absolute; right: 12px; bottom: 12px; z-index: 2;
    min-width: 44px; min-height: 44px; padding: 0 14px;
    border: 0; border-radius: 999px; cursor: pointer;
    background: rgb(0 0 0 / .55); color: #fff; font-size: .85rem; letter-spacing: .02em;
    backdrop-filter: blur(4px);
  }
  .g-loop__toggle:hover { background: rgb(0 0 0 / .75); }

  /* Linien zeichnen: pathLength="1" an Pfaden setzen */
  [data-draw] .draw { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s cubic-bezier(.6,.05,.3,1); }
  [data-draw].is-drawn .draw { stroke-dashoffset: 0; }
  [data-draw] .draw.d2 { transition-delay: .5s; }
  [data-draw] .draw.d3 { transition-delay: 1s; }
  [data-draw] .draw.d4 { transition-delay: 1.5s; }
  [data-draw] .draw.d5 { transition-delay: 2s; }

  /* Ziehpunkte */
  .handle { cursor: grab; }
  .handle:focus-visible { outline: none; stroke: var(--focus); stroke-width: 4; }
}

/* Hinweisleiste der Vorlage (zurück zur Übersicht) – bewusst AUSSERHALB der Ebenen,
   damit Stil-Regeln wie „a { color: … }“ sie nicht überschreiben */
  .vorlage-bar {
    position: fixed; left: 12px; bottom: 12px; z-index: 50;
    display: flex; gap: 8px; align-items: center;
    padding: 6px 8px 6px 14px; border-radius: 999px;
    background: #111; color: #fff; font: 600 13px/1.2 system-ui, sans-serif;
    box-shadow: 0 6px 20px rgb(0 0 0 / .25);
  }
  .vorlage-bar a { color: #fff; text-decoration: none; padding: 6px 10px; border-radius: 999px; background: rgb(255 255 255 / .12); }
  .vorlage-bar a:hover { background: rgb(255 255 255 / .25); }
  .vorlage-bar a:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
