/* Reset & base */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--fg); line-height: 1.6; }
img, svg { display: block; max-width: 100%; }
:root {
  /* Design tokens */
  --bg: #0b1530; /* kids night blue default */
  --fg: #f7f7f5;
  --muted: #b7c0d6;
  --card: #101a3f;
  --accent: #ffd85e;
  --ok: #2ecc71;
  --warn: #f39c12;
  --bad: #e74c3c;
  --shadow: 0 8px 24px rgba(0,0,0,0.30);
  --shadow-soft: 0 1px 2px rgba(0,0,0,0.18), 0 10px 20px rgba(0,0,0,0.28);
  --shadow-strong: 0 14px 36px rgba(0,0,0,0.38);
  --ring-color: color-mix(in oklab, var(--accent) 80%, white 20%);
  --radius: 14px;
  --maxw: 960px;
}

/* Audience themed palettes */
body[data-aud="kids"] {
  --bg: #0b1530;
  --fg: #f7f7f5;
  --muted: #b39ddb;
  --card: #111a3b;
  --accent: #ffd85e;
}
body[data-aud="adults"] {
  --bg: #0a1024;
  --fg: #f7f7f5;
  --muted: #94a3a8;
  --card: #0d1634;
  --accent: #94a3a8;
}

[hidden] { display: none !important; }
.skip-link { position: absolute; left: -9999px; top: -9999px; }
.skip-link:focus { left: 16px; top: 16px; background: var(--accent); color: #000; padding: 0.5rem 0.75rem; border-radius: 8px; }

.container { width: min(100% - 2rem, var(--maxw)); margin-inline: auto; }

.site-header { position: sticky; top: 0; backdrop-filter: blur(6px); background: rgba(10,16,36,0.7); background: color-mix(in oklab, var(--bg) 80%, transparent); border-bottom: 1px solid rgba(255,255,255,0.08); z-index: 50; }
.site-main, .site-footer { position: relative; z-index: 1; }
.breadcrumbs { margin: 0.5rem auto 1rem; font-size: 0.9rem; color: var(--fg); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0.25rem; list-style: none; padding: 0; margin: 0; }
.breadcrumbs li { display: flex; align-items: center; }
.breadcrumbs li::after { content: '›'; opacity: 0.6; margin: 0 0.25rem; }
.breadcrumbs li:last-child::after { content: ''; }
.breadcrumbs a { color: var(--fg); text-decoration: underline; text-underline-offset: 2px; }
.breadcrumbs a:hover { filter: brightness(1.1); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 0; }
.brand { display: inline-flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--fg); }
.wordmark { font-weight: 700; letter-spacing: 0.5px; }
.lumi-mini { width: 80px; height: 80px; filter: drop-shadow(0 2px 10px rgba(0,0,0,0.28)); }
.lumi-mini .stars .star { opacity: 0.9; animation: twinkle 3.5s ease-in-out infinite; }
.lumi-mini .stars .star:nth-child(2) { animation-delay: 1.2s; }
.lumi-mini .stars .star:nth-child(3) { animation-delay: 2s; }

.switches { display: flex; gap: 0.75rem; align-items: center; }
.segmented { display: inline-flex; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12); border-radius: 999px; padding: 4px; backdrop-filter: saturate(160%) blur(8px); box-shadow: var(--shadow); }
.seg-btn { appearance: none; background: transparent; color: var(--fg); border: 0; padding: 0.4rem 0.8rem; border-radius: 999px; cursor: pointer; font-weight: 600; transition: filter 160ms ease, transform 120ms ease; }
.seg-btn:hover { filter: brightness(1.05); }
.seg-btn[aria-pressed="true"] { 
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--accent) 92%, white 8%),
    color-mix(in oklab, var(--accent) 84%, black 16%)
  );
  color: #001; 
  box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 8px 16px rgba(0,0,0,0.25);
}
.seg-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg-link { display: inline-block; text-decoration: none; color: var(--fg); padding: 0.4rem 0.8rem; border-radius: 999px; font-weight: 600; transition: filter 160ms ease, transform 120ms ease; }
.seg-link:hover { filter: brightness(1.05); }
.seg-link[aria-pressed="true"] {
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--accent) 92%, white 8%),
    color-mix(in oklab, var(--accent) 84%, black 16%)
  );
  color: #001;
  box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 8px 16px rgba(0,0,0,0.25);
}
.seg-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.site-main { display: block; }
.hero { display: grid; gap: 0.75rem; padding: 1.25rem 0 0.5rem; }
.hero h1 { font-family: ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto; font-size: clamp(1.4rem, 4.5vw, 2rem); margin: 0; }
.benefit { color: var(--muted); margin: 0.25rem 0 0.75rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; color: var(--fg); background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18); padding: 0.6rem 1rem; border-radius: 12px; cursor: pointer; transition: transform 120ms ease, box-shadow 160ms ease, background 160ms ease, filter 160ms ease; min-height: 44px; backdrop-filter: saturate(140%) blur(8px); box-shadow: var(--shadow-soft); }
.btn.primary { color: #001; border: none; background: var(--accent); background: linear-gradient(180deg, color-mix(in oklab, var(--accent) 92%, white 8%), color-mix(in oklab, var(--accent) 84%, black 16%)); box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 0.5px 0 rgba(0,0,0,0.18), 0 10px 22px rgba(0,0,0,0.28); }
.btn:hover { filter: brightness(1.03); transform: translateY(-0.5px); }
.btn:focus-visible { outline: 2px solid var(--ring-color); outline-offset: 3px; }
.btn:active { transform: translateY(0); filter: brightness(0.98); box-shadow: 0 1px 0 rgba(0,0,0,0.25) inset, 0 8px 16px rgba(0,0,0,0.25); }

.calc { padding: 1rem 0 0.5rem; }
.calc-card { background: var(--card); border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; }
.calc-modes { display: inline-flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.tab-btn { appearance: none; background: rgba(255,255,255,0.08); color: var(--fg); border: 1px solid rgba(255,255,255,0.12); border-radius: 999px; padding: 0.4rem 0.8rem; cursor: pointer; }
.tab-btn[role="tab"] { outline-offset: 3px; }
.calc-modes[role="tablist"] { gap: 0.25rem; }
.tab-btn[aria-selected="true"] { background: var(--accent); color: #001; border-color: transparent; }
.calc-inputs { display: grid; grid-template-columns: 1fr; gap: 0.75rem; }
.field { display: grid; gap: 0.35rem; }
.field span { font-weight: 600; }
input, select { background: rgba(255,255,255,0.08); color: var(--fg); border: 1px solid rgba(255,255,255,0.18); border-radius: 10px; padding: 0.5rem 0.6rem; min-height: 44px; }
/* Improve dropdown readability: ensure strong contrast in the opened list */
select option { color: #0d1228; background: #f3f4f7; }
select optgroup { color: #0d1228; background: #f3f4f7; }
/* Active/hover option with accent background and dark text for legibility */
select option:checked,
select option:hover { background: var(--accent); color: #001; }
/* Audience-tuned option text color (slightly different darks) */
body[data-aud="adults"] select option,
body[data-aud="adults"] select optgroup { color: #0a1024; }
body[data-aud="kids"] select option,
body[data-aud="kids"] select optgroup { color: #152046; }
input[type="range"] { width: 100%; }
output { display: inline-block; margin-left: 0.5rem; color: var(--accent); font-weight: 700; }
.calc-actions { margin-top: 0.75rem; }
.results { display: grid; gap: 0.5rem; margin-top: 0.75rem; }
.result-note { font-size: 0.9rem; color: var(--muted); margin: 0.25rem 0 0.25rem; }
.result-card { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; padding: 0.5rem 0.75rem; display: grid; grid-template-columns: 8px 1fr; align-items: center; gap: 0.5rem; animation: fadeIn 240ms ease both; box-shadow: var(--shadow-soft); }
.dot { width: 4px; height: 4px; border-radius: 50%; display: inline-block; justify-self: center; }
.dot.good { background: var(--ok); }
.dot.ok { background: var(--warn); }
.dot.bad { background: var(--bad); }
.best { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

.core { padding: 1rem 0; }
.card-grid { display: grid; gap: 0.75rem; grid-template-columns: 1fr; }
.card { background: color-mix(in oklab, var(--card) 88%, rgba(255,255,255,0.06) 12%); border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius); box-shadow: var(--shadow-soft); padding: 0.75rem; }
.card { backdrop-filter: saturate(130%) blur(10px); }
.card h3 { margin-top: 0; font-size: 1.1rem; }

.accordion { display: grid; gap: 0.5rem; }
.accordion-btn { width: 100%; text-align: left; background: rgba(255,255,255,0.08); color: var(--fg); border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; padding: 0.6rem 0.75rem; cursor: pointer; font-weight: 700; }
.accordion-btn[aria-expanded="true"] { background: var(--accent); color: #001; border-color: transparent; }
.accordion-btn:hover { filter: brightness(1.05); }
.accordion-panel { border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 0.6rem 0.75rem; background: rgba(255,255,255,0.06); }
.story-card { display: grid; gap: 0.4rem; }

.faq { padding: 1rem 0 2rem; }

.site-footer { border-top: 1px solid rgba(255,255,255,0.08); margin-top: 0.5rem; }
.footer-grid { display: grid; gap: 0.75rem; grid-template-columns: 1fr; padding: 1rem 0 1.5rem; }
.footer-grid h2 { font-size: 1rem; margin: 0; }
.footer-switches { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

/* Icons sprite hidden container */
#icons { position: absolute; width: 0; height: 0; overflow: hidden; }

/* WebGL star background */
#bg-stars { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; opacity: 0.35; }

/* Animations */
@keyframes twinkle {
  0%, 100% { opacity: 0.8; transform: translateY(0); }
  50% { opacity: 0.3; transform: translateY(-2px); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(2px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Mobile header stacking: logo oben, Switches darunter (zentriert) */
@media (max-width: 479px) {
  .header-inner { flex-direction: column; justify-content: center; align-items: center; gap: 0.5rem; }
  .brand { flex-direction: column-reverse; align-items: center; position: relative; z-index: 1; }
  .switches { width: 100%; justify-content: center; flex-wrap: wrap; }
}

/* Responsive */
@media (min-width: 480px) {
  .header-inner { padding: 1rem 0; }
}
@media (min-width: 768px) {
  .hero { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .header-inner { padding: 1.25rem 0; }
  .btn { padding: 0.7rem 1.2rem; border-radius: 12px; }
}
