/* MINT-Module "Stein auf Stein" – gemeinsames Layout (hell, klar, selbst gehostete Schriften) */
@import url("fonts.css");

:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #eef0f1;
  --ink: #1d1f22;
  --ink-2: #4e545b;
  --ink-3: #7a8087;
  --line: #dcdfe2;
  --accent: #c8102e;          /* je Seite überschrieben */
  --accent-soft: #fbe9ec;
  --series-1: #257de0;
  --ok: #0a7a2f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 24, 28, .06), 0 6px 22px rgba(20, 24, 28, .06);
  --font-head: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "DejaVu Sans Mono", monospace;
}
body.bio { --accent: #1f7a3f; --accent-soft: #e6f3ea; }
body.chem { --accent: #c8102e; --accent-soft: #fbe9ec; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16.5px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.3rem); font-weight: 750; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); font-weight: 700; margin-top: .2em; }
h3 { font-size: 1.2rem; font-weight: 650; margin-top: 1.4em; }
p, ul, ol { margin: 0 0 1em; }
li { margin: .25em 0; }
sub, sup { font-size: .72em; line-height: 0; }
code, .mono { font-family: var(--font-mono); font-size: .9em; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.top { position: sticky; top: 0; z-index: 20; background: rgba(247, 246, 242, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 18px; min-height: 54px; }
.brand { font-family: var(--font-head); font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand span { color: var(--accent); }
.top nav { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; font-size: .92rem; }
.top nav a { color: var(--ink-2); text-decoration: none; white-space: nowrap; padding: 4px 0; }
.top nav a:hover { color: var(--accent); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
section { padding: 46px 0 22px; }
section + section { border-top: 1px solid var(--line); }
.kicker { font: 600 .8rem/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 10px; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 64ch; }
.prose { max-width: 72ch; }

.hero { padding: 36px 0 10px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 28px; align-items: center; }
.hero figure { margin: 0; }
.hero img { border-radius: var(--radius); background: #eceef0; box-shadow: var(--shadow); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 18px 0 4px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.fact b { display: block; font: 700 1.25rem/1.2 var(--font-head); }
.fact span { font-size: .82rem; color: var(--ink-3); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow); }
.card h3 { margin-top: 0; }
.note { background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 8px; padding: 12px 16px;
  margin: 1em 0; }
.teacher { background: #f1f3f6; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; }
figure { margin: 0 0 1em; }
figcaption { font-size: .86rem; color: var(--ink-3); margin-top: 6px; }
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.figs img { border-radius: 10px; background: #eceef0; }

table { border-collapse: collapse; width: 100%; font-size: .95rem; background: var(--surface); }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 650; color: var(--ink-2); background: var(--surface-2); }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 6px;
  border: 1px solid rgba(0, 0, 0, .25); }

/* 3D view */
.viewer { position: relative; height: min(62vh, 560px); min-height: 340px; border-radius: var(--radius); overflow: hidden;
  background: #eceef0; border: 1px solid var(--line); }
.viewer canvas { display: block; touch-action: none; }
.viewer .hint { position: absolute; left: 12px; bottom: 10px; font-size: .78rem; color: var(--ink-3);
  background: rgba(255, 255, 255, .8); padding: 3px 8px; border-radius: 6px; pointer-events: none; }
.viewer .fallback { position: absolute; inset: 0; display: none; }
.viewer.no-webgl .fallback { display: block; }
.viewer.no-webgl .fallback img { width: 100%; height: 100%; object-fit: contain; }
.controls { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 12px 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; font: 500 .88rem var(--font-body); padding: 7px 13px; cursor: pointer;
  color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.seg button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent);
  outline-offset: 2px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 7px 14px; font: 500 .9rem var(--font-body); color: var(--ink); cursor: pointer;
  text-decoration: none; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
label.inline { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-2); }
input[type=range] { accent-color: var(--accent); width: 180px; }
select, input[type=number] { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); }
input[type=number] { width: 86px; }
.out { font-family: var(--font-mono); background: var(--surface-2); border-radius: 8px; padding: 2px 8px; }

/* charts (inline SVG) */
.chart { width: 100%; height: auto; display: block; }
.chart .grid line { stroke: #e6e8ea; }
.chart .axis text, .chart text.lab { fill: var(--ink-3); font: 12px var(--font-body); }
.chart .axis line, .chart .axis path { stroke: #c3c7cc; }
.chart .series { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .marker { fill: var(--series-1); stroke: #fff; stroke-width: 2; }
.chart .ref { stroke: var(--ink-3); stroke-dasharray: 4 4; stroke-width: 1; }
.tip { position: absolute; pointer-events: none; background: #1d1f22; color: #fff; font-size: .8rem; padding: 6px 9px;
  border-radius: 6px; white-space: nowrap; transform: translate(-50%, -120%); opacity: 0; transition: opacity .1s; }
.chart-box { position: relative; }

.downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.dl { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  text-decoration: none; color: var(--ink); }
.dl:hover { border-color: var(--accent); }
.dl b { display: block; }
.dl span { font-size: .84rem; color: var(--ink-3); }

details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 10px 0; }
details summary { cursor: pointer; font-weight: 600; }
.small { font-size: .86rem; color: var(--ink-3); }
footer { padding: 30px 0 50px; color: var(--ink-3); font-size: .85rem; border-top: 1px solid var(--line); margin-top: 30px; }

@media (max-width: 860px) {
  .hero-grid, .grid2, .grid3 { grid-template-columns: 1fr; }
  .top nav { display: none; }
  input[type=range] { width: 140px; }
}
@media print {
  .top, .viewer, .controls { display: none; }
  section { break-inside: avoid-page; }
}

/* narrow screens: nothing may push the page wider than the viewport */
.grid2 > *, .grid3 > *, .hero-grid > *, .facts > * { min-width: 0; }
.seg { flex-wrap: wrap; max-width: 100%; }
.mono, .note { overflow-wrap: anywhere; }
body { overflow-x: hidden; }
