/* Stein auf Stein – Physik & Astronomie: gemeinsames Layout aller Seiten (selbst gehostet, keine externen Quellen) */
:root {
  --ink: #17232b; --muted: #55636c; --paper: #f5f3ee; --card: #ffffff; --rule: #ddd7cc; --soft: #ece8df;
  --acc: #c8962e; --acc-ink: #6b4a0c; --night: #070b16; --ok: #2f7d4f;
  --r: 14px; --max: 1180px;
  --f-head: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16.5px/1.62 var(--f-body); }
a { color: var(--acc-ink); text-underline-offset: 2px; }
img, svg, canvas { max-width: 100%; }
h1, h2, h3 { font-family: var(--f-head); line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); font-weight: 750; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.15rem); font-weight: 700; }
h3 { font-size: 1.22rem; font-weight: 680; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.mono, .num { font-family: var(--f-mono); font-feature-settings: "tnum"; }
.eyebrow { font: 600 .8rem/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--acc-ink); margin-bottom: .8em; }
.lede { font-size: 1.16rem; color: #2a3740; max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; background: rgba(245, 243, 238, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule); }
.top .wrap { display: flex; align-items: center; gap: 18px; min-height: 56px; flex-wrap: wrap; }
.brand { font: 700 1rem/1.2 var(--f-head); color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.brand i { width: 22px; height: 14px; border-radius: 3px; background: var(--acc); display: inline-block; position: relative; }
.brand i::before, .brand i::after { content: ""; position: absolute; top: -4px; width: 6px; height: 4px; border-radius: 2px 2px 0 0; background: var(--acc); }
.brand i::before { left: 3px; } .brand i::after { right: 3px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a { font: 500 .88rem/1 var(--f-body); color: var(--ink); text-decoration: none; padding: 8px 10px; border-radius: 8px; }
.nav a:hover { background: var(--soft); }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }

/* hero */
.hero { padding: 44px 0 28px; }
.hero .grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 36px; align-items: end; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; margin: 0; }
.specs div { background: var(--card); padding: 12px 14px; }
.specs dt { font: 500 .74rem/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.specs dd { margin: 4px 0 0; font: 600 1.08rem/1.25 var(--f-body); }

/* 3D stage */
.stage { position: relative; background: radial-gradient(ellipse at 50% 30%, #fbfaf7, #e6e1d6); border-radius: 18px; overflow: hidden;
  border: 1px solid var(--rule); aspect-ratio: 16 / 9; min-height: 300px; transition: background .5s; }
.stage.night { background: radial-gradient(ellipse at 50% 35%, #111a33, #03050b); border-color: #222b40; }
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.stage .status { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: .95rem; padding: 20px; text-align: center; pointer-events: none; }
.controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 12px 0 4px; }
.controls label { font-size: .9rem; }
.controls input[type=range] { width: min(340px, 100%); accent-color: var(--acc); }
.btn { font: 600 .88rem/1 var(--f-body); border: 1px solid var(--ink); background: var(--card); color: var(--ink); padding: 9px 13px; border-radius: 999px; cursor: pointer; }
.btn:hover { background: var(--soft); }
.btn[aria-pressed="true"] { background: var(--ink); color: #fff; }
.btn.lightbtn[aria-pressed="true"] { background: #0c1326; border-color: #0c1326; color: #ffd27a; }
select.btn { padding-right: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .82rem; border: 1px solid var(--rule); background: var(--card); border-radius: 999px; padding: 5px 10px 5px 8px; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; user-select: none; }
.chip input { margin: 0; accent-color: var(--acc); }
.hint { font-size: .85rem; color: var(--muted); }
.layerout { font: 500 .85rem/1 var(--f-mono); color: var(--muted); min-width: 16ch; }
.scene-desc { font-size: .9rem; color: var(--muted); min-height: 1.4em; }

/* sections */
section.block { padding: 40px 0; border-top: 1px solid var(--rule); }
.sec-head { max-width: 70ch; margin-bottom: 22px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); padding: 20px 22px; }
.card h3 { display: flex; gap: 10px; align-items: baseline; }
.card h3 .n { font: 600 .8rem/1 var(--f-mono); color: var(--acc-ink); background: var(--soft); padding: 5px 7px; border-radius: 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
figure { margin: 0; }
figure.diagram { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px; }
figcaption { font-size: .86rem; color: var(--muted); margin-top: 8px; }
.calc { background: #fffaf0; border: 1px dashed #d9b46a; border-radius: var(--r); padding: 16px 18px; margin: 14px 0; }
.calc b { font-family: var(--f-mono); }
.calc .q { font-weight: 650; }
details.answer summary { cursor: pointer; color: var(--acc-ink); font-weight: 600; margin-top: 6px; }
.bridge { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.bridge div { background: var(--card); border-left: 4px solid var(--acc); border-radius: 8px; padding: 12px 14px; font-size: .95rem; }
.bridge b { display: block; font-family: var(--f-head); font-size: 1.05rem; margin-bottom: 2px; }
.note { background: var(--soft); border-radius: var(--r); padding: 14px 18px; font-size: .93rem; }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.gallery figure.wide { grid-column: 1 / -1; }
.gallery img { width: 100%; height: auto; border-radius: 12px; display: block; background: #ddd; }

/* parts */
table.parts { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--card); border-radius: var(--r); overflow: hidden; }
table.parts th, table.parts td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--soft); }
table.parts th { font: 600 .74rem/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #faf8f4; }
table.parts td.n { text-align: right; font-family: var(--f-mono); }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0,0,0,.25); vertical-align: -1px; margin-right: 6px; }
.bars .bar { display: grid; grid-template-columns: 150px 1fr 60px; gap: 10px; align-items: center; font-size: .88rem; margin: 3px 0; }
.bars .track { background: var(--soft); border-radius: 4px; height: 12px; overflow: hidden; }
.bars .fill { height: 100%; }
.bars .v { text-align: right; font-family: var(--f-mono); }
.files { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.file { display: block; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px 16px; text-decoration: none; color: var(--ink); }
.file:hover { border-color: var(--acc); }
.file strong { display: block; } .file span { font: .8rem/1.4 var(--f-mono); color: var(--muted); }
ol.sources { font-size: .9rem; padding-left: 1.3em; } ol.sources li { margin: .35em 0; word-break: break-word; }

/* model cards (overview) */
.models { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; }
.model { background: var(--card); border: 1px solid var(--rule); border-radius: 16px; overflow: hidden; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.model img { aspect-ratio: 16/9; object-fit: cover; width: 100%; height: auto; display: block; }
.model .b { padding: 14px 16px 16px; }
.model .k { font: 600 .74rem/1.2 var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.model:hover { border-color: var(--ink); }

footer { border-top: 1px solid var(--rule); padding: 30px 0 50px; font-size: .86rem; color: var(--muted); }
footer p { margin: .4em 0; }

@media (max-width: 860px) {
  .hero .grid, .two { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .bars .bar { grid-template-columns: 110px 1fr 50px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .stage { aspect-ratio: 4 / 3.4; }
  .nav { margin-left: 0; }
  .specs { grid-template-columns: 1fr 1fr; }
  table.parts td:nth-child(1), table.parts th:nth-child(1) { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
