/* SolidWorks Makroprogrammierung. Farben kommen aus tokens.css (Blueprint, hell und dunkel). */

@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-wght-italic.woff2") format("woff2"); font-weight: 100 800; font-style: italic; font-display: swap; }

:root {
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  --font-sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-body: var(--font-sans);
  --font-head: var(--font-mono);
  --card: var(--surface);
  --radius: 12px;
  --focus: var(--accentfill);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); letter-spacing: -.02em; }
.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; z-index: 100; background: var(--surface); padding: .5rem 1rem; border: 2px solid var(--focus); font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mono { font-family: var(--font-mono); }

/* ---------- Logo ---------- */
.logo-mark { display: block; width: 38px; height: 38px; flex: none; overflow: visible; }
.logo-mark .lg-top { fill: var(--accentfill); }
.logo-mark .lg-l { fill: #ffffff; } .logo-mark .lg-r { fill: #cfd9e8; }
.logo-mark .lg-edge { stroke: var(--brand); } .logo-mark .lg-chev { stroke: var(--brand); }
.logo-mark.on-light .lg-l { fill: var(--brand2); } .logo-mark.on-light .lg-r { fill: var(--brand); }
.logo-mark.on-light .lg-chev { stroke: #ffffff; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: inherit; white-space: nowrap; }
.brand-name { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name b { font-family: var(--font-mono); font-weight: 800; font-size: 1.02rem; letter-spacing: -.02em; }
.brand-name small { font-family: var(--font-mono); font-weight: 500; font-size: .66rem; letter-spacing: .02em; color: var(--brandmuted); margin-top: .2rem; }
.lockup-light .brand-name small { color: var(--muted); }

/* ---------- Kopfzeile ---------- */
.top { background: var(--brand); color: var(--brandfg); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(255,255,255,.08); }
.top-in { display: flex; justify-content: space-between; align-items: center; height: 66px; gap: 1rem; }
.top-nav { display: flex; align-items: center; gap: .2rem; font-family: var(--font-mono); font-size: .84rem; font-weight: 500; }
.top-nav a { text-decoration: none; padding: .5rem .8rem; color: var(--brandmuted); border-bottom: 2px solid transparent; }
.top-nav a:hover { color: var(--brandfg); }
.top-nav a.on { color: var(--brandfg); border-bottom-color: var(--accentfill); font-weight: 700; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; margin-left: .5rem; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: transparent; color: var(--brandfg); cursor: pointer; }
.icon-btn:hover { border-color: var(--accentfill); color: var(--accentfill); }

/* ---------- Buttons, Tags ---------- */
.btn { display: inline-block; padding: .7rem 1.15rem; border-radius: 8px; background: var(--accentfill); color: var(--onaccent); text-decoration: none; border: 2px solid var(--accentfill); font-family: var(--font-mono); font-weight: 700; font-size: .9rem; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: inherit; border-color: currentColor; }
.eyebrow { font-family: var(--font-mono); color: var(--accentfill); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: .74rem; margin: 0 0 .9rem; }
.kind { font-family: var(--font-mono); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.lvl { font-family: var(--font-mono); font-size: .68rem; font-weight: 700; padding: .12rem .55rem; border-radius: 5px; letter-spacing: .02em; }
.l1 { background: var(--lvl1-bg); color: var(--lvl1-fg); } .l2 { background: var(--lvl2-bg); color: var(--lvl2-fg); } .l3 { background: var(--lvl3-bg); color: var(--lvl3-fg); }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 42rem; margin: 0 0 1.5rem; }

/* ---------- Start ---------- */
.hero { position: relative; overflow: hidden; background: var(--hero-pattern); color: var(--brandfg); padding: 4rem 0 4.4rem; }
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(1.9rem, 4.4vw, 3.15rem); line-height: 1.1; font-weight: 800; letter-spacing: -.035em; margin: 0 0 1.1rem; max-width: 40rem; }
.cursor { color: var(--accentfill); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero .lead { color: var(--brandmuted); }
.hero-cube { position: absolute; z-index: 0; right: max(1rem, calc((100vw - 1120px) / 2 - 3rem)); top: 2.5rem; width: min(440px, 40vw); color: rgba(255,255,255,.2); pointer-events: none; }
.hero-cube .fill { fill: var(--accentfill); fill-opacity: .16; stroke: none; }
.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-top: 2.2rem; }
.door { display: flex; flex-direction: column; gap: .6rem; padding: 1.6rem; border-radius: 16px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(2px); }
.door-a { background: var(--surface); color: var(--fg); border: 1px solid var(--line); box-shadow: inset 0 5px 0 var(--accentfill); padding-top: 1.9rem; }
.door-tag { font-family: var(--font-mono); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.door h2 { margin: 0; font-size: 1.55rem; font-weight: 800; }
.door p { margin: 0; opacity: .9; }
.door .btn { align-self: flex-start; margin-top: .5rem; }
.door-a .btn { background: var(--brand); border-color: var(--brand); color: var(--brandfg); }
.door-a .btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.sf { display: flex; gap: .5rem; margin-top: .4rem; }
.sf input { flex: 1; min-width: 0; height: 48px; padding: 0 1rem; border-radius: 8px; border: 2px solid transparent; background: var(--surface); color: var(--fg); font-family: var(--font-mono); font-size: .88rem; }
.sf input::placeholder { color: var(--muted); }
.sf input:focus { border-color: var(--accentfill); outline: 0; }
.sf .btn { margin: 0; align-self: auto; }
.tchips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .3rem; }
.tchip { text-decoration: none; font-family: var(--font-mono); font-size: .74rem; padding: .25rem .65rem; border-radius: 6px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.2); } .tchip:hover { background: rgba(255,255,255,.2); }
.tchip span { opacity: .65; margin-left: .35rem; font-size: .68rem; }
.bar { height: 8px; border-radius: 99px; background: color-mix(in srgb, currentColor 18%, transparent); overflow: hidden; } .bar i { display: block; height: 100%; background: var(--accentfill); border-radius: 99px; transition: width .25s; }
.bar-l { font-family: var(--font-mono); font-size: .78rem; margin: .1rem 0 0 !important; }

.block { padding-block: 2.8rem 0; }
.block-h { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.block-h h2, .sec-title { margin: 0; font-size: 1.4rem; font-weight: 800; }
.block-h h2::before, .sec-title::before { content: "// "; color: var(--accent); font-weight: 500; }
.block-h a { font-family: var(--font-mono); color: var(--accent); text-decoration: none; font-weight: 700; font-size: .85rem; } .block-h a:hover { text-decoration: underline; }
.cards3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.1rem; }
.card, .item, .chap-mini a, .related a { transition: transform .12s, box-shadow .12s, border-color .12s; }
.card:hover, .item:hover, .chap-mini a:hover, .related a:hover { border-color: var(--accent); transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--accentfill); }
.card { display: block; padding: 1.25rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.card h3 { margin: .35rem 0 .45rem; font-size: 1.05rem; font-weight: 700; } .card p { margin: 0; color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.chap-mini { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: .9rem; }
.chap-mini a { display: flex; gap: 1rem; align-items: center; padding: 1rem 1.1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.chap-mini b { flex: none; display: grid; place-items: center; width: 2.7rem; height: 2.7rem; border-radius: 8px; background: var(--brand); color: var(--accentfill); font-family: var(--font-mono); font-size: 1.2rem; font-weight: 800; }
.chap-mini span { font-family: var(--font-mono); font-weight: 700; font-size: .95rem; } .chap-mini small { display: block; font-family: var(--font-body); font-weight: 400; color: var(--muted); font-size: .84rem; margin-top: .15rem; }
.discord { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.6rem 1.9rem; border-radius: 16px; background: var(--brand); color: var(--brandfg); }
.discord h2 { margin: 0 0 .2rem; font-size: 1.25rem; } .discord p { margin: 0; color: var(--brandmuted); }
.foot { margin-top: 3.5rem; border-top: 1px solid var(--line); padding: 1.6rem 0 2.5rem; color: var(--muted); font-size: .85rem; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; } .foot a { color: var(--muted); } .foot a:hover { color: var(--accent); }

/* ---------- Lernpfad ---------- */
.lp { padding-block: 2rem 1rem; }
.lp-head { display: grid; grid-template-columns: 1fr 330px; gap: 2rem; align-items: end; margin-bottom: 2rem; }
.lp-head h1, .sol-head h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; margin: 0 0 .5rem; letter-spacing: -.035em; }
.lp-card { padding: 1.2rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: grid; gap: .6rem; } .lp-card .all { margin: 0; font-weight: 700; color: var(--ok); font-family: var(--font-mono); }
.chap { margin-bottom: 1.6rem; scroll-margin-top: 84px; }
.chap-h { display: flex; gap: 1rem; align-items: center; padding: .95rem 1.15rem; background: var(--brand); color: var(--brandfg); border-radius: var(--radius) var(--radius) 0 0; }
.chap-h h2 { margin: 0; font-size: 1.1rem; font-weight: 800; } .chap-h p { margin: 0; color: var(--brandmuted); font-size: .86rem; }
.chap-n { flex: none; display: grid; place-items: center; width: 2.7rem; height: 2.7rem; border-radius: 8px; background: var(--accentfill); color: var(--onaccent); font-family: var(--font-mono); font-weight: 800; font-size: 1.25rem; }
.chap-c { margin-left: auto; font-family: var(--font-mono); font-size: .82rem; color: var(--brandmuted); font-variant-numeric: tabular-nums; }
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.row { display: flex; align-items: center; gap: .8rem; padding: 0 1rem; } .row + .row { border-top: 1px solid var(--line); }
.row a { flex: 1; display: grid; grid-template-columns: 5.6rem 1fr auto; gap: .8rem; align-items: baseline; padding: .8rem 0; text-decoration: none; min-width: 0; }
.row a:hover .rt { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.rn { font-family: var(--font-mono); font-size: .76rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; } .rt { font-weight: 600; } .rm { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); }
.row.done .rt { color: var(--muted); }
.check { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--line); background: var(--bg); color: transparent; cursor: pointer; padding: 0; }
.check:hover { border-color: var(--accent); }
.check[aria-checked="true"] { background: var(--ok); border-color: var(--ok); color: var(--surface); }

/* ---------- Lösungen ---------- */
.sol { padding-block: 2rem 1rem; }
.bigsearch { display: flex; align-items: center; gap: .8rem; height: 56px; padding: 0 1.1rem; border-radius: 12px; background: var(--surface); border: 2px solid var(--line); color: var(--muted); margin-top: 1rem; } .bigsearch:focus-within { border-color: var(--accent); }
.bigsearch input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-family: var(--font-mono); font-size: 1rem; color: var(--fg); }
.sol-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 2rem; margin-top: 1.6rem; align-items: start; }
.filt { position: sticky; top: 86px; }
.filt > summary { display: none; }
.fg h2 { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 1.1rem 0 .4rem; font-weight: 700; } .fg:first-child h2 { margin-top: 0; }
.fg ul { list-style: none; margin: 0; padding: 0; }
.fb { display: flex; justify-content: space-between; width: 100%; font-family: var(--font-mono); font-size: .8rem; text-align: left; padding: .42rem .7rem; border-radius: 6px; border: 0; background: transparent; color: var(--fg); cursor: pointer; }
.fb:hover:not(:disabled) { background: var(--surface); } .fb span { color: var(--muted); font-variant-numeric: tabular-nums; }
.fb.on { background: var(--brand); color: var(--brandfg); font-weight: 700; } .fb.on span { color: var(--accentfill); } .fb:disabled { opacity: .35; cursor: default; }
.reset { margin-top: 1rem; font-family: var(--font-mono); font-size: .78rem; border: 0; background: none; color: var(--accent); cursor: pointer; text-decoration: underline; } .reset[hidden] { display: none; }
.count { margin: 0 0 .8rem; color: var(--muted); font-family: var(--font-mono); font-size: .85rem; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.item { display: block; padding: 1.05rem 1.2rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.item-top { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; } .th { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); margin-left: auto; }
.item h3 { margin: .4rem 0 .25rem; font-size: 1.05rem; font-weight: 700; } .item p { margin: 0; color: var(--muted); font-size: .92rem; }
.item-meta { display: flex; align-items: center; gap: .4rem; margin-top: .65rem; font-family: var(--font-mono); font-size: .72rem; color: var(--muted); } .item-meta svg { margin-left: .4rem; }
.hit { margin-left: auto; color: var(--onaccent); background: var(--accentfill); font-size: .68rem; font-weight: 700; padding: .05rem .5rem; border-radius: 5px; }
.none { padding: 2rem 0; color: var(--muted); } .none a { color: var(--accent); }

/* ---------- Beitrag ---------- */
.art { max-width: 860px; padding-block: 1.3rem 1rem; }
.pathbar { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; padding: .75rem 1rem; border-radius: 10px; background: var(--brand); color: var(--brandmuted); font-family: var(--font-mono); font-size: .8rem; }
.pathbar a { color: var(--brandfg); font-weight: 700; text-decoration: none; } .pathbar a:hover { text-decoration: underline; } .pathbar span { margin-left: auto; }
.pathbar .bar { flex-basis: 100%; height: 5px; }
.art h1 { font-size: clamp(1.7rem, 3.8vw, 2.3rem); line-height: 1.15; font-weight: 800; margin: 1.7rem 0 .6rem; letter-spacing: -.03em; }
.sub { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; color: var(--muted); margin: 0 0 1.6rem; font-family: var(--font-mono); font-size: .8rem; }
.done-row { margin-top: 2rem; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.2rem; }
.pager a { padding: .9rem 1.1rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-family: var(--font-mono); font-size: .86rem; font-weight: 700; } .pager a:hover { border-color: var(--accent); }
.pager small { display: block; font-weight: 400; color: var(--muted); font-size: .72rem; margin-bottom: .15rem; } .pager .next { text-align: right; grid-column: 2; }
.related { margin-top: 2.5rem; } .related h2 { font-size: 1.1rem; } .related ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.related a { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-weight: 600; } .related small { color: var(--muted); font-weight: 400; font-family: var(--font-mono); font-size: .72rem; }

/* Beitragsinhalt und Code im neuen Design */
.prose h2, .prose h3 { font-family: var(--font-head); font-weight: 700; }
.prose a { color: var(--accent); }
.codeblock { color-scheme: dark; --radius: 10px; background: var(--code-bg); border-color: var(--code-line); }
.codehead { background: var(--code-head); border-bottom-color: var(--code-line); font-family: var(--font-mono); }
.codetitle { color: var(--code-fg); font-weight: 700; }
.codemeta { color: color-mix(in srgb, var(--code-fg) 62%, transparent); }
.copybtn { font-family: var(--font-mono); background: transparent; color: var(--code-fg); border-color: color-mix(in srgb, var(--code-fg) 30%, transparent); }
.copybtn:hover { border-color: var(--accentfill); color: var(--accentfill); }
.copybtn.done { border-color: var(--ok); color: var(--ok); }
.codeblock code { font-family: var(--font-mono); font-size: .84rem; font-feature-settings: "calt" 1; }
.tok-kw { font-weight: 700; }
.video { background: var(--brand); }
.video-btn { background: var(--hero-pattern); font-family: var(--font-mono); }
.video-btn .play { background: var(--accentfill); }
.video-btn .play::after { border-left-color: var(--onaccent); }

@media (max-width: 1000px) { .hero-cube { opacity: .55; right: -6rem; } }
@media (max-width: 860px) {
  .doors { grid-template-columns: 1fr; } .hero-cube { display: none; }
  .lp-head { grid-template-columns: 1fr; }
  .sol-grid { grid-template-columns: 1fr; }
  .filt { position: static; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 0 1rem; }
  .filt > summary { display: block; cursor: pointer; padding: .8rem 0; font-family: var(--font-mono); font-weight: 700; }
  .filt[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: .8rem; } .filt #fbody { padding-bottom: 1rem; }
}
@media (max-width: 640px) {
  .brand-name small { display: none; } .top-nav a { padding: .5rem .5rem; } .top-nav a.on { border-bottom-width: 2px; }
  .row a { grid-template-columns: 4.6rem 1fr; } .rm { display: none; }
  .pager { grid-template-columns: 1fr; } .pager .next { grid-column: 1; text-align: left; }
  .sf { flex-direction: column; } .sf input, .sf .btn { width: 100%; }
  
}
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } .card, .item, .chap-mini a, .related a { transition: none; } .card:hover, .item:hover, .chap-mini a:hover, .related a:hover { transform: none; } html { scroll-behavior: auto; } }

/* Hinweisbox und Inline-Code in Textseiten */
.notice { padding: .9rem 1.1rem; border-radius: 10px; border: 1px solid var(--accent); background: var(--surface); }
.prose :not(pre) > code { font-family: var(--font-mono); font-size: .9em; padding: .1em .4em; border-radius: 5px; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.prose h2 { font-size: 1.15rem; }
.ask { margin: 2.5rem 0 0; padding: .9rem 1.1rem; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: .92rem; }
.ask a { color: var(--accent); }

/* Code-Bloecke zum Vergroessern (nur wenn der Code laenger oder breiter ist als der sichtbare Bereich).
   Kleiner als die Ausgangsgroesse geht nicht: Hoehe per Mindesthoehe (gesetzt von site.js), Breite per min-width.
   Nach rechts darf der Block ueber die Textspalte (860 px) hinaus bis kurz vor den Bildschirmrand wachsen. */
.codeblock.resizable { display: flex; flex-direction: column; resize: both; overflow: hidden; padding-bottom: 14px; min-width: 100%; max-width: min(calc(50vw + 430px - 2rem), calc(100vw - 2rem)); max-height: none; }
.codeblock.resizable .codehead { flex: none; }
.codeblock.resizable pre { flex: 1 1 0; min-height: 0; max-height: none; }
.codeblock.resizable::-webkit-resizer { background: linear-gradient(135deg, transparent 52%, var(--accentfill) 52%, var(--accentfill) 60%, transparent 60%, transparent 72%, var(--accentfill) 72%, var(--accentfill) 80%, transparent 80%); }
.codehint { opacity: .8; }
@media (hover: none), (max-width: 700px) { .codehint { display: none; } }
.codeblock.resizable { scroll-margin-top: 80px; }
.codehead { flex-wrap: wrap; row-gap: .35rem; }
.expandbtn { min-width: 8.6rem; text-align: center; }   /* feste Breite: der Text wechselt zwischen "Ganz anzeigen" und "Zurücksetzen", die Kopfzeile darf dabei nicht umbrechen */
