/*
 * raster: zauberpilze.org
 * 1. Concept: a German/Swiss non-fiction book (Sachbuch) on a strict typographic grid. The site reads like a
 *    paperback from a 1960s/70s Swiss series: table of contents as the home page, numbered chapters, footnotes.
 * 2. Type: Hanken Grotesk (500/700) for headings, numbers, navigation and captions; Source Serif 4 (400/600, italic)
 *    for the reading text.
 * 3. Palette: paper #fbfaf7, ink #0d0d0d, grey text #57534e, hairline #d8d4cc, signal vermilion #e2401c (numbers,
 *    warnings; #c2361a for small text on paper).
 * 4. Layout signature: visible 12-column logic; big left-aligned chapter numbers ("03") in vermilion with the title
 *    beside them; the home page is an Inhaltsverzeichnis with abstracts; numbered sections (3.1, 3.2) and a section
 *    register in the right-hand columns.
 * 5. Detail: footnote-style source references (superscript vermilion numbers that jump to a "Quellen" list set as
 *    footnotes), hairline tables with grotesk column heads, products as numbered catalogue plates.
 */

@font-face{font-family:'Hanken Grotesk';font-style:normal;font-weight:500 700;font-display:swap;src:url(fonts/hanken-grotesk-500-700-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Hanken Grotesk';font-style:normal;font-weight:500 700;font-display:swap;src:url(fonts/hanken-grotesk-500-700-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Source Serif 4';font-style:normal;font-weight:400 600;font-display:swap;src:url(fonts/source-serif-4-400-600-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Source Serif 4';font-style:normal;font-weight:400 600;font-display:swap;src:url(fonts/source-serif-4-400-600-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Source Serif 4';font-style:italic;font-weight:400;font-display:swap;src:url(fonts/source-serif-4-italic-400-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Source Serif 4';font-style:italic;font-weight:400;font-display:swap;src:url(fonts/source-serif-4-italic-400-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

:root {
  --paper: #fbfaf7;
  --paper-2: #f1efe9;
  --ink: #0d0d0d;
  --grey: #57534e;
  --rule: #d8d4cc;
  --signal: #e2401c;
  --signal-text: #c2361a;
  --grotesk: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --max: 80rem;
  --gap: 1.25rem;
  --side: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--serif);
  font-optical-sizing: auto;
  font-kerning: normal;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--signal-text); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; font-family: var(--grotesk); }
.skip:focus { left: var(--side); z-index: 10; }

/* ---------- the grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gap);
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--side);
}
.grid > * { grid-column: 1 / -1; min-width: 0; }
@media (min-width: 60rem) {
  :root { --side: 2.5rem; --gap: 1.5rem; }
  .grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
}

/* ---------- header ---------- */
.head { border-top: 6px solid var(--ink); border-bottom: 1px solid var(--ink); }
.head-row { align-items: center; padding-top: .9rem; padding-bottom: .9rem; row-gap: .75rem; }
.brand {
  grid-column: 1 / 4;
  display: grid; grid-template-columns: auto 1fr; column-gap: .65rem; align-items: center;
  text-decoration: none; font-family: var(--grotesk);
}
.brand-mark { grid-row: 1 / 3; width: 34px; height: 34px; }
.brand-name { font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em; line-height: 1.1; }
.brand-sub { font-weight: 500; font-size: .78rem; color: var(--grey); line-height: 1.2; }
.toc-nav { display: none; }
.menu { grid-column: 4 / 5; justify-self: end; font-family: var(--grotesk); position: relative; }
.menu summary {
  list-style: none; cursor: pointer; font-weight: 700; font-size: .9rem; text-transform: uppercase; letter-spacing: .06em;
  padding: .45rem .7rem; border: 1px solid var(--ink);
}
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--ink); color: var(--paper); }
.menu nav { position: absolute; right: 0; top: calc(100% + .5rem); z-index: 5; width: min(20rem, calc(100vw - 2rem)); background: var(--paper); border: 1px solid var(--ink); }
.menu ol, .toc-nav ol { list-style: none; margin: 0; padding: 0; }
.menu li + li { border-top: 1px solid var(--rule); }
.menu a { display: block; padding: .75rem 1rem; text-decoration: none; font-weight: 500; }
.menu .n, .toc-nav .n { color: var(--signal-text); font-weight: 700; font-variant-numeric: tabular-nums; margin-right: .35rem; }
.menu a[aria-current] { background: var(--paper-2); }

@media (min-width: 60rem) {
  .brand { grid-column: 1 / 4; }
  .menu { display: none; }
  .toc-nav { display: block; grid-column: 5 / 13; font-family: var(--grotesk); }
  .toc-nav ol { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: var(--gap); }
  .toc-nav a {
    display: block; text-decoration: none; font-weight: 500; font-size: .86rem; line-height: 1.25;
    padding-top: .45rem; border-top: 2px solid transparent;
  }
  .toc-nav .n { display: block; font-size: .78rem; margin: 0 0 .1rem; }
  .toc-nav a:hover { color: var(--ink); border-top-color: var(--rule); }
  .toc-nav a[aria-current] { border-top-color: var(--signal); }
}

/* ---------- shared typographic pieces ---------- */
.kicker {
  font-family: var(--grotesk); font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
  margin: 0 0 1rem; color: var(--ink);
}
h1, h2, h3, h4 { font-family: var(--grotesk); font-weight: 700; letter-spacing: -.015em; hyphens: manual; -webkit-hyphens: manual; }

/* ---------- home: title sheet + Inhaltsverzeichnis ---------- */
.title-sheet { padding-top: 3rem; padding-bottom: 2.5rem; }
.title-sheet h1 { font-size: clamp(2.4rem, 8vw, 5.6rem); line-height: .98; letter-spacing: -.035em; margin: 0 0 1.5rem; max-width: 14ch; }
.title-sheet .lede { font-size: 1.25rem; line-height: 1.45; color: var(--grey); margin: 0; max-width: 34em; }
@media (min-width: 60rem) {
  .title-sheet { padding-top: 5rem; padding-bottom: 4rem; }
  .title-sheet .kicker { grid-column: 1 / 13; }
  .title-sheet h1 { grid-column: 1 / 10; }
  .title-sheet .lede { grid-column: 4 / 10; }
}

.contents { padding-bottom: 3rem; }
.contents > * { border-top: 1px solid var(--ink); padding-top: 1rem; }
.contents-title { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; margin: 0; padding-bottom: 1rem; }
.contents-list { padding-top: 0 !important; border-top: 0 !important; }
@media (min-width: 60rem) { .contents-list { border-top: 1px solid var(--ink) !important; } }
.contents-list { list-style: none; margin: 0; padding: 0; }
.contents-list li { border-bottom: 1px solid var(--rule); }
.contents-list li:last-child { border-bottom: 0; }
.contents-list a {
  display: grid; grid-template-columns: 3.5rem 1fr; column-gap: var(--gap); row-gap: .25rem;
  padding: 1.1rem 0 1.25rem; text-decoration: none;
}
.c-no { grid-row: 1 / 4; font-family: var(--grotesk); font-weight: 700; font-size: 2.2rem; line-height: 1; color: var(--signal); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.c-label { font-family: var(--grotesk); font-weight: 700; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--grey); }
.c-title { hyphens: manual; -webkit-hyphens: manual; font-family: var(--grotesk); font-weight: 700; font-size: 1.3rem; line-height: 1.2; letter-spacing: -.01em; }
.c-desc { font-size: 1rem; line-height: 1.5; color: var(--grey); }
.contents-list a:hover .c-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .15em; }
.contents-list a:hover { color: var(--ink); }
.is-appendix .c-no { color: var(--ink); }
@media (min-width: 60rem) {
  .contents-title { grid-column: 1 / 3; }
  .contents-list { grid-column: 3 / 13; }
  .contents-list a { grid-template-columns: repeat(10, minmax(0, 1fr)); align-items: baseline; padding: 1.4rem 0 1.5rem; }
  .c-no { grid-column: 1 / 2; grid-row: 1 / 3; font-size: 3rem; }
  .c-label { grid-column: 2 / 5; grid-row: 1; }
  .c-title { grid-column: 2 / 6; grid-row: 2; font-size: 1.45rem; }
  .c-desc { grid-column: 6 / 11; grid-row: 1 / 3; align-self: start; }
}

/* ---------- chapter head ---------- */
.chapter-head { border-bottom: 1px solid var(--ink); padding-top: 2.5rem; padding-bottom: 2rem; row-gap: .5rem; }
.chapter-no {
  margin: 0; font-family: var(--grotesk); font-weight: 700; color: var(--signal);
  font-size: clamp(4.5rem, 22vw, 11rem); line-height: .8; letter-spacing: -.06em; font-variant-numeric: tabular-nums;
}
.chapter-title h1 { font-size: clamp(2rem, 6vw, 3.6rem); line-height: 1.04; letter-spacing: -.03em; margin: 0 0 1.25rem; max-width: 20ch; }
.chapter-title .kicker { margin-bottom: .75rem; }
.meta { font-family: var(--grotesk); font-weight: 500; font-size: .85rem; color: var(--grey); margin: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
@media (min-width: 60rem) {
  .chapter-head { padding-top: 4rem; padding-bottom: 3rem; }
  .chapter-no { grid-column: 1 / 4; }
  .chapter-title { grid-column: 4 / 12; align-self: end; }
}

/* ---------- reading sheet ---------- */
.sheet { padding-top: 2.5rem; padding-bottom: 4rem; }
.side { margin-bottom: 2rem; font-family: var(--grotesk); border-top: 1px solid var(--ink); padding-top: .6rem; }
.side-title { font-weight: 700; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 .5rem; }
.side-toc { list-style: none; margin: 0; padding: 0; font-size: .9rem; line-height: 1.3; }
.side-toc li { border-bottom: 1px solid var(--rule); }
.side-toc a { display: grid; grid-template-columns: 2.4rem 1fr; padding: .5rem 0; text-decoration: none; font-weight: 500; }
.side-toc .n { color: var(--signal-text); font-weight: 700; font-variant-numeric: tabular-nums; }
@media (min-width: 60rem) {
  .sheet { padding-top: 3.5rem; padding-bottom: 6rem; }
  .prose { grid-column: 4 / 10; grid-row: 1; }
  .home-prose { grid-column: 4 / 10; }
  .home-label { grid-column: 1 / 3; grid-row: 1; }
  .side { grid-column: 10 / 13; grid-row: 1; align-self: start; position: sticky; top: 1.5rem; margin: 0; }
}

/* ---------- prose ---------- */
.home-label { font-family: var(--grotesk); font-weight: 700; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 1rem; border-top: 1px solid var(--ink); padding-top: .6rem; align-self: start; }
.prose { max-width: 38rem; counter-reset: sec; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.1em; }
.prose > p:first-child { font-size: 1.25rem; line-height: 1.5; }
.prose h2 {
  font-size: 1.55rem; line-height: 1.2; margin: 2.75rem 0 1rem; padding-top: .9rem; border-top: 1px solid var(--ink);
  counter-increment: sec;
}
.prose h3 { font-size: 1.12rem; line-height: 1.3; margin: 2rem 0 .6rem; }
.prose[data-chapter] h2::before {
  content: counter(chap) "." counter(sec);
  display: block; font-size: .85rem; letter-spacing: .02em; color: var(--signal-text); margin-bottom: .35rem; font-variant-numeric: tabular-nums;
}
.prose[data-chapter="1"] { counter-reset: chap 1 sec; }
.prose[data-chapter="2"] { counter-reset: chap 2 sec; }
.prose[data-chapter="3"] { counter-reset: chap 3 sec; }
.prose[data-chapter="4"] { counter-reset: chap 4 sec; }
.prose[data-chapter="5"] { counter-reset: chap 5 sec; }
.prose[data-chapter="6"] { counter-reset: chap 6 sec; }
.prose[data-chapter="7"] { counter-reset: chap 7 sec; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.2em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--grey); font-family: var(--grotesk); font-weight: 700; }
.prose strong { font-weight: 600; }
.prose em { font-style: italic; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
.prose code { font-family: var(--grotesk); font-size: .9em; }
.prose figure { margin: 2rem 0; }
.prose figure img { width: 160px; height: auto; }

/* warning / note blocks: blockquote is used for "Achtung" notes */
.prose blockquote {
  margin: 1.75rem 0; padding: .9rem 0 .2rem 1.1rem; border-left: 3px solid var(--signal);
  font-family: var(--grotesk); font-weight: 500; font-size: 1rem; line-height: 1.5;
}
.prose blockquote strong { font-weight: 700; color: var(--signal-text); text-transform: uppercase; letter-spacing: .06em; font-size: .82rem; display: block; margin-bottom: .25rem; }

/* footnote references: [1](#quellen) */
.prose a[href="#quellen"] {
  font-family: var(--grotesk); font-weight: 700; font-size: .68em; line-height: 0; vertical-align: super;
  color: var(--signal-text); text-decoration: none; padding: 0 .1em;
}
.prose a[href="#quellen"]::before { content: "["; color: var(--grey); font-weight: 500; }
.prose a[href="#quellen"]::after { content: "]"; color: var(--grey); font-weight: 500; }
/* the footnote apparatus itself */
.prose h2#quellen { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; margin-top: 3.5rem; border-top: 1px solid var(--rule); }
.prose h2#quellen::before { display: none; }
.prose h2#quellen + ol {
  font-family: var(--grotesk); font-weight: 500; font-size: .84rem; line-height: 1.45; color: var(--grey);
  padding-left: 1.6em; margin: 0;
}
.prose h2#quellen + ol li { margin-bottom: .55em; padding-left: .2em; }
.prose h2#quellen + ol li::marker { color: var(--signal-text); font-weight: 700; }
.prose h2#quellen + ol a { color: var(--ink); }

/* hairline tables */
.table { overflow-x: auto; margin: 1.75rem 0 2rem; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; line-height: 1.4; }
.prose th {
  font-family: var(--grotesk); font-weight: 700; font-size: .74rem; letter-spacing: .07em; text-transform: uppercase;
  text-align: left; vertical-align: bottom; padding: 0 .9rem .5rem 0; border-bottom: 1px solid var(--ink);
}
.prose td { vertical-align: top; padding: .65rem .9rem .65rem 0; border-bottom: 1px solid var(--rule); }
.prose td:first-child { font-family: var(--grotesk); font-weight: 700; font-size: .9rem; }
.prose tr:last-child td { border-bottom: 1px solid var(--ink); }
@media (min-width: 60rem) {
  .prose .table { margin-right: 0; }
}

/* composite report: italic label lines */
.is-report p:has(> em:only-child) { font-family: var(--grotesk); font-weight: 500; font-size: .85rem; line-height: 1.5; color: var(--grey); border-left: 3px solid var(--rule); padding-left: .9rem; }
.is-report p > em:only-child { font-style: normal; }

/* ---------- product plates ---------- */
.products, .product-feature { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem var(--gap); margin: 2rem 0 2.5rem; counter-reset: plate; }
@media (min-width: 40rem) { .products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 60rem) { .prose .products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.product-feature { grid-template-columns: minmax(0, 1fr); max-width: 22rem; }
.plate { display: flex; flex-direction: column; text-decoration: none; counter-increment: plate; border-top: 1px solid var(--ink); padding-top: .5rem; }
.plate::before {
  content: "Tafel " counter(plate);
  font-family: var(--grotesk); font-weight: 700; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--signal-text);
  margin-bottom: .5rem;
}
.plate-img { display: block; background: #fff; border: 1px solid var(--rule); aspect-ratio: 1; }
.plate-img img { width: 100%; height: 100%; object-fit: contain; }
.plate-cap { display: flex; flex-direction: column; gap: .4rem; padding-top: .6rem; font-family: var(--grotesk); }
.plate-name { font-weight: 700; font-size: .92rem; line-height: 1.25; }
.plate-row { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; border-top: 1px solid var(--rule); padding-top: .4rem; font-size: .8rem; }
.plate-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.plate-shop { color: var(--grey); font-weight: 500; text-align: right; }
.plate:hover .plate-name { text-decoration: underline; }
.plate:hover { color: var(--ink); }

/* ---------- next chapter ---------- */
.next { padding-bottom: 4rem; }
.next a { display: block; border-top: 1px solid var(--ink); padding-top: 1rem; text-decoration: none; font-family: var(--grotesk); }
.next-label { display: block; font-weight: 700; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--signal-text); margin-bottom: .35rem; }
.next-title { display: block; font-weight: 700; font-size: clamp(1.4rem, 4vw, 2.2rem); letter-spacing: -.02em; line-height: 1.1; }
.next a:hover .next-title { text-decoration: underline; text-decoration-thickness: 2px; }
.next a:hover { color: var(--ink); }
@media (min-width: 60rem) { .next a { grid-column: 4 / 13; } }

/* ---------- footer ---------- */
.foot { border-top: 6px solid var(--ink); background: var(--paper-2); font-family: var(--grotesk); font-size: .9rem; line-height: 1.5; }
.foot-row { padding-top: 2rem; padding-bottom: 2.5rem; row-gap: 1.75rem; }
.foot p { margin: 0; }
.foot-label { display: block; font-weight: 700; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .35rem; }
.foot-note p:not(.foot-label) { max-width: 34em; }
.foot-publisher { display: grid; grid-template-columns: 72px 1fr; column-gap: 1rem; align-items: center; }
.mascot { width: 72px; height: 72px; }
.foot-colophon p:not(.foot-label) { color: var(--grey); }
.foot a { font-weight: 700; }
@media (min-width: 60rem) {
  .foot-note { grid-column: 1 / 6; }
  .foot-publisher { grid-column: 6 / 10; align-self: start; }
  .foot-colophon { grid-column: 10 / 13; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  .head, .foot, .side, .next, .menu { display: none; }
  body { background: #fff; }
}

/* wide tables scroll sideways on small screens instead of crushing the columns */
@media (max-width: 59.99rem) {
  .prose table { font-size: .9rem; }
  .prose table:has(th:nth-child(3)) { min-width: 30rem; }
  .prose table:has(th:nth-child(4)) { min-width: 38rem; }
  .table { margin-right: calc(-1 * var(--side)); padding-right: var(--side); }
}
