/* jakobstettner.de: Stil
   VOICE   ruhig, genau, ein bisschen trocken, wie ein gutes Laborheft
   IDEA    ein technisches Zeichenblatt auf echtem Millimeterpapier (orange gedruckt)
   PICTURE das Furuta-Pendel als lebende Zeichnung mit Schriftfeld und Messwerten
   COLOUR  weißes Papier, orange Rasterlinien, schwarze Tinte, Kugelschreiber-Blau
   TYPE    Newsreader für alles Gesetzte, Plex Mono nur für Messwerte
*/

@font-face { font-family: "Newsreader"; src: url("fonts/newsreader.woff2") format("woff2-variations"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader-italic.woff2") format("woff2-variations"); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --papier: #fdfdfb;
  --flaeche: #ffffff;
  --tinte: #141414;
  --grau: #6b6b6b;
  --linie: #d9d9d4;
  --raster: rgba(236, 120, 54, .08);       /* 1-mm-Linien */
  --raster-grob: rgba(236, 120, 54, .3);   /* 10-mm-Linien */
  --stift: #1d3fa6;                         /* Kugelschreiber-Blau */
  /* Farben des Pendels: weiße und schwarze Teile wie beim echten Gerät */
  --teil-hell: #ffffff; --teil-dunkel: #161616; --kontur: #161616; --kontur-dunkel: #161616; --stange: #161616;

  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: "Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --rand: clamp(1rem, 4vw, 3.5rem);
  --luecke: clamp(1rem, 2.2vw, 2rem);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    color-scheme: dark;
    --papier: #0f1114; --flaeche: #15181c; --tinte: #ebebe6; --grau: #9a9a96; --linie: #2e3237;
    --raster: rgba(236, 120, 54, .05); --raster-grob: rgba(236, 120, 54, .2); --stift: #8aa6ff;
    --teil-hell: #d8d6cf; --teil-dunkel: #0a0a0a; --kontur: #08090a; --kontur-dunkel: #6c727b; --stange: #a3a9b2;
  }
}
:root[data-theme=dark] {
  color-scheme: dark;
  --papier: #0f1114; --flaeche: #15181c; --tinte: #ebebe6; --grau: #9a9a96; --linie: #2e3237;
  --raster: rgba(236, 120, 54, .05); --raster-grob: rgba(236, 120, 54, .2); --stift: #8aa6ff;
    --teil-hell: #d8d6cf; --teil-dunkel: #0a0a0a; --kontur: #08090a; --kontur-dunkel: #6c727b; --stange: #a3a9b2;
}

*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html { background: var(--papier); color: var(--tinte); font-family: var(--serif); -webkit-text-size-adjust: 100%; scroll-padding-top: 2rem; }
body { margin: 0; font-size: clamp(1.0625rem, .98rem + .3vw, 1.2rem); line-height: 1.55; font-variant-numeric: oldstyle-nums; font-optical-sizing: auto; overflow-x: clip; }
p, figcaption { text-wrap: pretty; }
h1, h2 { text-wrap: balance; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--stift); }
:focus-visible { outline: 2px solid var(--stift); outline-offset: 3px; }
::selection { background: var(--stift); color: var(--flaeche); }

.seite { max-width: 80rem; margin: 0 auto; padding: 0 var(--rand); }
.raster12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--luecke); }

/* Kopf */
.kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; padding: 1.3rem 0 1rem; }
.kopf .marke { font-weight: 560; text-decoration: none; }
.kopf nav { display: flex; gap: clamp(1rem, 3vw, 2.2rem); }
.kopf nav a { text-decoration: none; color: var(--grau); }
.kopf nav a:hover { color: var(--stift); }

/* Auftakt: Name und ein Satz */
.auftakt { align-items: end; padding: clamp(1.5rem, 5vw, 4rem) 0 clamp(1.25rem, 3vw, 2.25rem); }
.auftakt h1 { grid-column: 1 / span 8; margin: 0; font-weight: 340; font-size: clamp(3rem, 9.2vw, 8.6rem); line-height: .9; letter-spacing: -.035em; font-variation-settings: "opsz" 72; }
.auftakt h1 i { font-weight: 300; }
.auftakt .vorspann { grid-column: 9 / span 4; margin: 0 0 .5rem; font-size: clamp(1.15rem, 1rem + .45vw, 1.4rem); line-height: 1.35; }

/* Abb. 1: das Zeichenblatt */
.blatt { margin: 0 0 clamp(3.5rem, 8vw, 6.5rem); }
.buehne {
  position: relative; aspect-ratio: 16 / 9; max-height: 78vh; width: 100%; min-height: 340px;
  background-color: var(--flaeche);
  background-image:
    linear-gradient(var(--raster-grob) 1px, transparent 1px),
    linear-gradient(90deg, var(--raster-grob) 1px, transparent 1px),
    linear-gradient(var(--raster) 1px, transparent 1px),
    linear-gradient(90deg, var(--raster) 1px, transparent 1px);
  background-size: 50px 50px, 50px 50px, 5px 5px, 5px 5px;
  background-position: -1px -1px;
  border: 1px solid var(--tinte);
  cursor: crosshair; touch-action: pan-y;   /* waagerecht schnippen, senkrecht weiter scrollen */
}
.buehne canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.schrieb { position: relative; height: 9rem; border: 1px solid var(--tinte); border-top: 0; background: var(--flaeche); padding: .5rem .8rem .3rem; }
.schrieb canvas { width: 100%; height: 100%; display: block; }

.blatt figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 2rem; margin-top: .7rem; color: var(--grau); font-size: .95rem; }
.blatt .werte { display: flex; flex-wrap: wrap; gap: .2rem 1.4rem; }
.blatt .wert { font-family: var(--mono); font-size: .82rem; color: var(--tinte); font-variant-numeric: tabular-nums; margin-left: .35em; }
.blatt .zustand { color: var(--stift); font-family: var(--mono); font-size: .82rem; min-width: 22ch; }
.knopf { font: inherit; font-size: .9rem; color: var(--tinte); background: none; border: 1px solid var(--tinte); border-radius: 0; padding: 0 .6em; cursor: pointer; line-height: 1.6; }
.knopf:hover { color: var(--stift); border-color: var(--stift); }
.knopf:active { transform: translateY(1px); }
.zwilling { flex-basis: 100%; margin-top: .3rem; }
.zwilling summary { cursor: pointer; color: var(--tinte); width: fit-content; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.zwilling summary:hover { color: var(--stift); }
.zwilling .spalten { columns: 3 17rem; column-gap: var(--luecke); margin-top: .6rem; }
.zwilling p { margin: 0 0 .8rem; break-inside: avoid; line-height: 1.5; }
.zwilling .code { font-family: var(--mono); font-size: .82em; color: var(--tinte); }
.blatt figcaption b { color: var(--tinte); font-weight: 560; }

/* Abschnitte */
section { padding-bottom: clamp(3.5rem, 8vw, 6.5rem); }
.rubrik { grid-column: 1 / -1; margin: 0; padding-top: .8rem; border-top: 2px solid var(--tinte); font-weight: 340; font-style: italic; font-size: clamp(1.9rem, 1.4rem + 1.8vw, 3rem); line-height: 1.05; letter-spacing: -.015em; }

/* Projekte als Inhaltsverzeichnis */
.inhalt { grid-column: 1 / span 8; list-style: none; margin: clamp(1.25rem, 3vw, 2.25rem) 0 0; padding: 0; }
.inhalt li + li { border-top: 1px solid var(--linie); }
.inhalt a { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1rem; padding: 1rem 0 1.1rem; text-decoration: none; }
.inhalt .titel { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem); line-height: 1.05; letter-spacing: -.015em; font-weight: 380; transition: color .15s ease; }
.inhalt .dach { grid-column: 1; font-style: italic; color: var(--grau); margin-top: .25rem; }
.inhalt .jahr { grid-column: 2; grid-row: 1; align-self: baseline; color: var(--grau); white-space: nowrap; }
.inhalt a:hover .titel { color: var(--stift); }

.rand { grid-column: 10 / span 3; margin: clamp(1.25rem, 3vw, 2.25rem) 0 0; }
.rand svg { width: 100%; height: auto; display: block; overflow: visible; }
.rand figcaption { margin-top: .6rem; font-size: .92rem; line-height: 1.45; color: var(--grau); }
.rand figcaption b { color: var(--tinte); font-weight: 560; }

.s-tinte { stroke: var(--tinte); fill: none; }
.s-fein { stroke: var(--linie); fill: none; }
.s-stift { stroke: var(--stift); fill: none; }
.f-tinte { fill: var(--tinte); }
.f-hohl { fill: var(--flaeche); stroke: var(--tinte); }
.svg-text { font-family: var(--serif); font-style: italic; font-size: 12px; fill: var(--grau); }

/* Abseits der Werkbank */
.eintraege { grid-column: 1 / -1; list-style: none; margin: clamp(1.25rem, 3vw, 2.25rem) 0 0; padding: 0; }
.eintraege li { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--luecke); padding: 1.2rem 0; }
.eintraege li + li { border-top: 1px solid var(--linie); }
.eintraege .wann { grid-column: 1 / span 2; color: var(--grau); }
.eintraege .was { grid-column: 3 / span 6; margin: 0; }
.eintraege .was b { font-weight: 560; }
.eintraege .notiz { grid-column: 10 / span 3; font-size: .9rem; line-height: 1.45; color: var(--grau); font-style: italic; }
.massstab { width: 100%; max-width: 14rem; height: auto; display: block; margin-top: .4rem; overflow: visible; }

/* Kontakt */
.kontakt { grid-column: 1 / span 9; margin: clamp(1.25rem, 3vw, 2.25rem) 0 0; font-size: clamp(2rem, 1.2rem + 3.2vw, 4.2rem); line-height: 1.05; letter-spacing: -.02em; font-weight: 340; }
.kontakt a { text-decoration-color: var(--stift); text-decoration-thickness: 2px; }
.kontakt-klein { grid-column: 1 / span 7; margin: 1rem 0 0; color: var(--grau); }

/* Kolophon */
.kolophon { padding: 1rem 0 3rem; border-top: 1px solid var(--tinte); font-size: .9rem; line-height: 1.5; color: var(--grau); }
.kolophon p { grid-column: 1 / span 7; margin: 0; }
.kolophon p i { color: var(--tinte); }
.kolophon nav { grid-column: 9 / span 4; display: flex; gap: 1.4rem; justify-content: flex-end; }
.kolophon nav a { color: var(--grau); }

/* Schmal */
@media (max-width: 52rem) {
  .auftakt h1, .auftakt .vorspann { grid-column: 1 / -1; }
  .auftakt .vorspann { margin-top: 1.2rem; }
  .inhalt, .eintraege .was, .kontakt, .kontakt-klein, .kolophon p, .kolophon nav { grid-column: 1 / -1; }
  .rand { grid-column: 1 / -1; max-width: 17rem; margin-top: 2.5rem; }
  .eintraege .wann { grid-column: 1 / -1; }
  .eintraege .notiz { grid-column: 1 / -1; margin-top: .5rem; }
  .kolophon nav { justify-content: flex-start; margin-top: 1rem; }
}
@media (max-width: 37.5rem) {
  .buehne { aspect-ratio: auto; height: 22rem; }
  .schrieb { height: 8rem; padding: .4rem .5rem .2rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
