/* ASA Astroclub Solaris – Design „Sternenhimmel“ (echte Sternbilder, drehen sich beim Scrollen)
   Layout: fixes 3D-Sternfeld (Canvas) hinter einem schwebenden Glas-Panel pro Kapitel (Onepager), eine Spalte, max. 880px.
   Dunkel ist der Standard; Hell = gleiche Bewegung, heller Himmel, dunkle Sternpunkte. */

:root {
  color-scheme: dark;
  --bg: #020308;
  --text: #f2f4fa;
  --body: #c6cbda;
  --muted: #8189a0;
  --accent: #7df9ff;
  --accent-ink: #020308;
  --line: rgba(125, 249, 255, .18);
  --panel-a: rgba(10, 14, 30, .58);
  --panel-b: rgba(4, 6, 14, .62);
  --overlay: rgba(2, 3, 8, .96);
  --photo-filter: saturate(.8) brightness(.88) contrast(1.05);
  --photo-fade: rgba(2, 3, 8, .55);
  /* Canvas liest diese Werte */
  --star-rgb: 215, 238, 255;
  --sky-rgb: 2, 3, 8;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  /* Sternform: vier lange, geschwungene Strahlen plus vier kurze Diagonalstrahlen */
  --star-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath id='s' d='M12 0C12.7 7.6 16.4 11.3 24 12C16.4 12.7 12.7 16.4 12 24C11.3 16.4 7.6 12.7 0 12C7.6 11.3 11.3 7.6 12 0Z'/%3E%3Cuse href='%23s' transform='rotate(45 12 12) translate(12 12) scale(.42) translate(-12 -12)'/%3E%3C/svg%3E");
  --radius: 20px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #eef1f7;
    --text: #0b1020;
    --body: #2d3550;
    --muted: #5b6380;
    --accent: #006d84;
    --accent-ink: #ffffff;
    --line: rgba(0, 80, 110, .2);
    --panel-a: rgba(255, 255, 255, .58);
    --panel-b: rgba(244, 247, 252, .62);
    --overlay: rgba(238, 241, 247, .97);
    --photo-filter: saturate(.9) contrast(1.02);
    --photo-fade: rgba(238, 241, 247, 0);
    --star-rgb: 14, 24, 52;
    --sky-rgb: 238, 241, 247;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef1f7;
  --text: #0b1020;
  --body: #2d3550;
  --muted: #5b6380;
  --accent: #006d84;
  --accent-ink: #ffffff;
  --line: rgba(0, 80, 110, .2);
  --panel-a: rgba(255, 255, 255, .58);
  --panel-b: rgba(244, 247, 252, .62);
  --overlay: rgba(238, 241, 247, .97);
  --photo-filter: saturate(.9) contrast(1.02);
  --photo-fade: rgba(238, 241, 247, 0);
  --star-rgb: 14, 24, 52;
  --sky-rgb: 238, 241, 247;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.7 var(--font); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 999px; }
.skip:focus { left: 16px; }

#space { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
/* Uhrzeit des gezeigten Himmels (läuft beim Scrollen von der aktuellen Uhrzeit an 24 Stunden weiter) */
.skyhud { position: fixed; z-index: 15; right: var(--gutter); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: baseline; gap: 10px;
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--overlay); color: var(--muted); font-size: 12px; letter-spacing: .06em; pointer-events: none; }
.skyhud b { font-family: var(--mono); font-size: 14px; color: var(--accent); font-variant-numeric: tabular-nums; }
.skyhud b::after { content: " Uhr"; font-family: var(--font); font-size: 12px; font-weight: 400; }
@media (max-width: 600px) { .skyhud span { display: none; } }

/* ---------- Kopfzeile ---------- */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) var(--gutter) 28px;
  background: linear-gradient(180deg, var(--bg) 40%, transparent); }
.logo { display: flex; align-items: baseline; gap: 10px; color: var(--text); text-decoration: none; margin-right: auto; min-width: 0; }
.logo b { font-size: 18px; font-weight: 800; letter-spacing: .4em; }
.logo span { color: var(--muted); font-size: 14px; letter-spacing: .08em; white-space: nowrap; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; padding: 6px 12px; border: 1px solid transparent; border-radius: 999px; }
.nav a:hover { border-color: var(--line); color: var(--text); }
.nav a { position: relative; }
/* Aktives Kapitel (per Scroll-Position gesetzt): Umrandung in Akzentfarbe + funkelnder Stern auf dem Rand.
   --p (0..1, aus site.js) = Lesefortschritt im Kapitel: der Stern wandert von links oben nach rechts oben. */
.nav a[aria-current] { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); }
.nav a[aria-current]::after { content: ""; position: absolute; top: -.72em; left: calc(.7em + var(--p, 0) * (100% - 2.8em)); width: 1.4em; height: 1.4em; pointer-events: none;
  background: radial-gradient(circle, var(--text) 0 12%, var(--accent) 46%);
  -webkit-mask: var(--star-shape) center / contain no-repeat; mask: var(--star-shape) center / contain no-repeat;
  filter: drop-shadow(0 0 3px var(--accent)) drop-shadow(0 0 9px color-mix(in srgb, var(--accent) 60%, transparent));
  animation: star-in .5s cubic-bezier(.2, 1.6, .4, 1) both, star-twinkle 3.6s ease-in-out .5s infinite; }
@keyframes star-in { from { opacity: 0; transform: scale(0) rotate(-90deg); } }
@keyframes star-twinkle { 0%, 100% { transform: scale(1) rotate(0); opacity: 1; } 50% { transform: scale(.78) rotate(18deg); opacity: .8; } }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--text); cursor: pointer; padding: 0; flex: none; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-btn .sun { display: none; }
:root[data-theme="light"] .theme-btn .sun { display: block; }
:root[data-theme="light"] .theme-btn .moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-btn .sun { display: block; }
  :root:not([data-theme="dark"]) .theme-btn .moon { display: none; }
}
.menu-btn { display: none; }

@media (max-width: 1040px) {
  .nav { display: none; }
  .menu-btn { display: inline-grid; }
  .nav.open { display: flex; position: fixed; inset: 0; z-index: -1; flex-direction: column; justify-content: center; align-items: center; gap: 6px;
    background: var(--overlay); padding: 80px 16px 40px; }
  .nav.open a { font-size: 22px; padding: 10px 22px; }
}
@media (max-width: 420px) { .logo span { display: none; } }

/* ---------- Hero ---------- */
main { position: relative; z-index: 1; perspective: 800px; padding-inline: 16px; }
.hero { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; text-align: center; padding-block: 120px 60px; }
.hero--sub { min-height: 62vh; min-height: 62svh; }
.hero h1 { font-size: clamp(44px, 10vw, 140px); line-height: .95; margin: 0; font-weight: 800; letter-spacing: -.04em; text-wrap: balance; }
.hero--sub h1 { font-size: clamp(40px, 8vw, 104px); }
.hero h1 span { color: transparent; -webkit-text-stroke: 1px var(--text); }
.hero p { color: var(--muted); max-width: 560px; margin: 22px auto 0; font-size: 17px; }
.hint { margin-top: 40px; font-size: 12px; letter-spacing: .3em; color: var(--accent); text-transform: uppercase; }
/* Kapitelkopf (Onepager): Titel eines Themas, steht frei über dem zugehörigen Panel */
.chapter { min-height: 0; padding-block: 0 clamp(32px, 6vh, 56px); scroll-margin-top: 96px; }
.chapter h2 { font-size: clamp(40px, 8vw, 104px); line-height: .95; margin: 0; font-weight: 800; letter-spacing: -.04em; text-wrap: balance; }
.eyebrow { color: var(--accent); font-size: 12px; letter-spacing: .25em; text-transform: uppercase; margin-bottom: 14px; }

/* ---------- Panels ---------- */
/* Ein Panel pro Kapitel; die Inhaltsabschnitte (.sec) liegen darin, getrennt durch eine Linie. */
.panel { width: min(880px, 100%); margin: 0 auto 14vh; padding: clamp(22px, 4vw, 48px); border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b)); -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px); }
.js .panel.warp { opacity: 0; transform: translateZ(-300px) scale(.9); transition: transform 1.1s cubic-bezier(.15,.8,.2,1), opacity 1.1s; }
.js .panel.warp.in { opacity: 1; transform: none; }
@media (max-width: 700px) { .panel { margin-bottom: 12vh; } }
.sec { scroll-margin-top: 90px; }
.sec + .sec { margin-top: clamp(36px, 6vw, 64px); padding-top: clamp(36px, 6vw, 64px); border-top: 1px solid var(--line); }
.sec > :last-child { margin-bottom: 0; }
.k { color: var(--accent); font-size: 12px; letter-spacing: .25em; text-transform: uppercase; }
.panel h2 { font-size: clamp(28px, 4.5vw, 50px); line-height: 1.08; margin: 10px 0 18px; letter-spacing: -.03em; text-wrap: balance; }
.panel h3 { font-size: 19px; margin: 30px 0 8px; letter-spacing: -.01em; }
.panel p, .panel li { color: var(--body); }
.panel p { max-width: 66ch; }
.panel ul { padding-left: 1.2em; }
.lead { font-size: 18px; }

.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 20px; margin-top: 24px; }
.cols--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols > div { border-top: 1px solid var(--line); padding-top: 12px; min-width: 0; }
.cols b { display: block; color: var(--text); }
.cols span, .cols p { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
@media (max-width: 700px) { .cols, .cols--2 { grid-template-columns: 1fr; } }

/* Einstiegskarten (Startseite) */
.doors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 26px; }
.door { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); text-decoration: none; min-width: 0; transition: border-color .2s, transform .2s; }
.door:hover { border-color: var(--accent); transform: translateY(-2px); }
.door small { color: var(--accent); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; }
.door b { font-size: 18px; }
.door span { color: var(--muted); font-size: 14px; }
.door i { font-style: normal; color: var(--accent); margin-top: auto; padding-top: 6px; font-size: 14px; }
@media (max-width: 760px) { .doors { grid-template-columns: 1fr; } }

/* Terminliste / Kursprogramm */
.ev { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 4px 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.ev:last-of-type { border-bottom: 1px solid var(--line); }
.ev b { color: var(--accent); font-weight: 500; font-variant-numeric: tabular-nums; }
.ev span { color: var(--body); }
.ev small { display: block; color: var(--muted); font-size: 13px; }
@media (max-width: 480px) { .ev { grid-template-columns: 1fr; } }
.ev--num { grid-template-columns: 44px minmax(0, 1fr) !important; padding: 10px 0; }
.ev--num span small { display: inline; margin-left: 8px; }
@media (max-width: 480px) { .ev--num span small { display: block; margin-left: 0; } }

/* Kennzahlen (Label/Wert) */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 22px; margin: 22px 0 0; }
.facts dt { color: var(--muted); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; padding-top: 2px; }
.facts dd { margin: 0; color: var(--text); }
.facts .num { font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 10px; } }

/* Preise */
.prices { width: 100%; border-collapse: collapse; margin-top: 18px; font-variant-numeric: tabular-nums; }
.prices th, .prices td { text-align: left; padding: 12px 0; border-top: 1px solid var(--line); vertical-align: top; }
.prices th { font-weight: 400; color: var(--body); padding-right: 16px; }
.prices td { text-align: right; color: var(--text); white-space: nowrap; font-weight: 600; }
.prices tr:last-child th, .prices tr:last-child td { border-bottom: 1px solid var(--line); }

/* Hinweis / Badge */
.note { margin-top: 22px; padding: 14px 18px; border: 1px dashed var(--line); border-radius: 12px; color: var(--body); font-size: 15px; }
.note b { color: var(--text); }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding: 0; list-style: none; }
.badges li { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--text); }
/* Offene Punkte (vor dem Livegang klären) */
.offen { color: var(--muted); border-bottom: 1px dashed var(--accent); cursor: help; }
.offen::after { content: " ⟨offen⟩"; color: var(--accent); font-size: 11px; letter-spacing: .05em; }

/* Aufklapper (Besucherinfos, FAQ) */
.acc { margin-top: 18px; border-top: 1px solid var(--line); }
.acc details { border-bottom: 1px solid var(--line); }
.acc summary { cursor: pointer; list-style: none; padding: 14px 32px 14px 0; position: relative; color: var(--text); font-weight: 600; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-size: 22px; font-weight: 300; color: var(--accent); transition: transform .25s; }
.acc details[open] summary::after { transform: rotate(45deg); }
.acc details > div { padding: 0 0 16px; }
.acc details > div p:first-child { margin-top: 0; }

/* Fotos: Bilder der alten Website werden über Filter + Verlauf ins Farbschema gezogen */
.foto { position: relative; margin: 26px 0 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--panel-b); }
.foto img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; filter: var(--photo-filter); }
.foto::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, var(--photo-fade)), radial-gradient(120% 90% at 50% 40%, transparent 60%, var(--photo-fade)); }
.foto figcaption { position: absolute; left: 14px; bottom: 10px; right: 14px; z-index: 1; font-size: 12px; letter-spacing: .08em; color: #f2f4fa; text-shadow: 0 1px 6px rgba(0,0,0,.7); }
.foto.leer { aspect-ratio: 16 / 9; display: grid; place-items: center; border-style: dashed;
  background: radial-gradient(circle at 30% 30%, var(--line) 0 1px, transparent 2px) 0 0 / 38px 38px, linear-gradient(180deg, var(--panel-a), var(--panel-b)); }
.foto.leer img { display: none; }
.foto.leer::after { display: none; }
.foto.leer figcaption { position: static; color: var(--muted); text-shadow: none; text-align: center; padding: 0 16px; }
.foto.leer figcaption::before { content: "Foto folgt · "; color: var(--accent); }
.foto-paar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 600px) { .foto-paar { grid-template-columns: 1fr; } }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn { display: inline-block; padding: 12px 24px; border-radius: 999px; border: 1px solid var(--accent); color: var(--accent); text-decoration: none; background: transparent; font: inherit; cursor: pointer; }
.btn:hover, .btn--solid { background: var(--accent); color: var(--accent-ink); }
.btn--solid:hover { filter: brightness(1.1); }
.copy { font-family: var(--mono); font-size: 14px; color: var(--text); background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; cursor: copy; }
.copy:hover { border-color: var(--accent); }
.copy[data-done]::after { content: " ✓ kopiert"; color: var(--accent); font-family: var(--font); }

/* Fusszeile */
footer.site { position: relative; z-index: 1; padding: 0 var(--gutter) calc(64px + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: 14px; }
footer.site .wrap { width: min(880px, 100%); margin: 0 auto; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 24px; border-top: 1px solid var(--line); padding-top: 28px; }
footer.site b { color: var(--text); display: block; margin-bottom: 6px; letter-spacing: .06em; }
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--accent); }
footer.site p { margin: 0; }
footer.site .legal { width: min(880px, 100%); margin: 0 auto; border-top: 1px solid var(--line); padding-top: 22px; font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
@media (max-width: 700px) { footer.site .wrap { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .panel.warp { opacity: 1; transform: none; transition: none; }
  .nav a[aria-current]::after { animation: none; }
}
