/* HamBird – Stylesheet für de/ und en/  (v2, Oktober 2026)
   Gestaltungsidee: Die Seite ist Papier wie das E-Ink des Empfängers.
   Ein blauer Umschlag (Logo-Blau) vorn, danach ruhige, technische Seiten
   mit Inhaltsverzeichnis am Rand – wie ein gut gesetztes Gerätehandbuch.
   Schriften selbst gehostet (Barlow, SIL OFL), keine externen Dienste.   */

@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/Barlow-400.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-style: italic; font-weight: 400; font-display: swap; src: url(/fonts/Barlow-400i.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/Barlow-500.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/Barlow-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/Barlow-700.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/BarlowSemiCondensed-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/BarlowSemiCondensed-700.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 800; font-display: swap; src: url(/fonts/BarlowSemiCondensed-800.woff2) format("woff2"); }

:root {
    --paper:      #e7e8e3;   /* E-Paper-Grau */
    --paper-2:    #dcdeda;
    --panel:      #f5f6f2;
    --ink:        #1e2227;
    --ink-2:      #454e57;
    --muted:      #6b747d;
    --rule:       #c4c8c2;
    --blue:       #1d4f99;   /* Logo-Blau */
    --blue-deep:  #16396f;
    --blue-soft:  #d6dfee;
    --orange:     #e8821e;   /* Logo-Orange */
    --orange-deep:#b3620a;
    --red:        #c8102e;   /* nur E-Ink */
    --yellow:     #e0b000;   /* nur E-Ink */
    --grey-mark:  #8a949d;
    --sans: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --cond: "Barlow Semi Condensed", "Barlow", system-ui, Arial Narrow, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;
    color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--orange-deep); }
img { max-width: 100%; height: auto; display: block; }
strong, b { font-weight: 600; }
code { font-family: var(--mono); font-size: .88em; background: var(--paper-2); padding: .05em .35em; border-radius: 3px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* Entwurfs-Wasserzeichen */
body::after {
    content: ""; position: fixed; inset: 0; z-index: 50; pointer-events: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="440" height="320"><text x="220" y="160" font-family="Arial, sans-serif" font-size="60" font-weight="700" letter-spacing="8" fill="%236b747d" fill-opacity="0.075" text-anchor="middle" transform="rotate(-28 220 160)">ENTWURF</text></svg>');
    background-size: 440px 320px;
}
html[lang="en"] body::after {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="440" height="320"><text x="220" y="160" font-family="Arial, sans-serif" font-size="60" font-weight="700" letter-spacing="8" fill="%236b747d" fill-opacity="0.075" text-anchor="middle" transform="rotate(-28 220 160)">DRAFT</text></svg>');
}

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Kopfleiste ---------- */
.bar {
    position: sticky; top: 0; z-index: 60;
    background: var(--paper); border-bottom: 1px solid var(--rule);
}
.bar-inner { display: flex; align-items: center; gap: 1rem; height: 3.4rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); }
.brand img { width: 34px; height: 31px; }
.brand span { font-family: var(--cond); font-weight: 800; font-size: 1.3rem; letter-spacing: .005em; }
.bar .draft { margin-left: auto; font-family: var(--cond); font-weight: 600; font-size: .95rem; color: var(--blue-deep); }
.bar .lang {
    display: inline-flex; align-items: center; gap: .45rem; text-decoration: none;
    font-weight: 500; font-size: .92rem; color: var(--ink-2);
}
.bar .lang svg { display: block; border-radius: 2px; box-shadow: 0 0 0 1px rgba(30,34,39,.2); }
.bar .lang:hover { color: var(--orange-deep); }
.toc-btn {
    display: none; align-items: center; gap: .5rem;
    background: none; border: 1px solid var(--rule); border-radius: 4px;
    padding: .35rem .7rem; font: 500 .92rem var(--sans); color: var(--ink); cursor: pointer;
}
.toc-btn svg { display: block; }
.toc-btn[aria-expanded="true"] { background: var(--panel); }

/* ---------- Umschlag (Hero) ---------- */
.cover {
    background: radial-gradient(120% 90% at 85% 10%, #255fb3 0%, var(--blue) 38%, var(--blue-deep) 100%);
    color: #fff; padding: 3.8rem 0 4.2rem;
}
.cover-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
.cover h1 {
    font-family: var(--cond); font-weight: 800;
    font-size: clamp(2.5rem, 5.6vw, 4.3rem); line-height: .98; letter-spacing: -.005em;
    text-wrap: balance;
}
.cover .lede { margin-top: 1.4rem; font-size: 1.2rem; line-height: 1.5; color: #d9e2f2; max-width: 34em; }
.facts {
    margin-top: 2.2rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.3);
    display: grid; grid-template-columns: repeat(3, auto); gap: .8rem 2.2rem; justify-content: start;
}
.facts div { display: flex; flex-direction: column; gap: .1rem; }
.facts dt { font-size: .85rem; color: #a9bddf; }
.facts dd { font-family: var(--cond); font-weight: 700; font-size: 1.2rem; color: #fff; }

/* ---------- Empfänger-Mockup mit E-Ink ---------- */
.device {
    width: min(100%, 290px); margin-left: auto; position: relative;
    background: linear-gradient(160deg, #24272c, #16181b 70%);
    border-radius: 16px; padding: 50px 20px 28px;
    box-shadow: 0 30px 60px rgba(8, 20, 45, .45), inset 0 1px 0 rgba(255,255,255,.1);
}
.device .contact {
    position: absolute; top: 16px; left: 22px;
    background: var(--red); color: #fff; font: 600 .76rem/1.6 var(--sans);
    padding: 0 .75rem; clip-path: polygon(14% 0, 100% 0, 86% 100%, 0 100%);
}
.device .strap { position: absolute; top: 0; right: 36px; width: 26px; height: 34px; background: #0d0e10; border-radius: 0 0 4px 4px; }
.device .led { position: absolute; top: 24px; right: 24px; width: 5px; height: 5px; border-radius: 50%; background: #2b86ff; box-shadow: 0 0 6px #2b86ff; opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
    .device .led { animation: blink 10s linear 1.5s infinite; }
    @keyframes blink { 0%, 1.2% { opacity: 1; } 1.3%, 100% { opacity: 0; } }
}
.epd {
    position: relative; aspect-ratio: 1 / 1; overflow: hidden;
    background: #d4d6d1; border: 3px solid #0b0c0e; border-radius: 3px;
    box-shadow: inset 0 0 0 1px #3a3d42;
    color: #121212; font-family: var(--sans);
}
.epd .screen { position: absolute; inset: 0; padding: 9% 8%; display: flex; flex-direction: column; }
.epd .idle { align-items: center; justify-content: center; gap: .3rem; }
.epd .idle img { width: 46%; filter: contrast(1.05) saturate(.75); }
.epd .idle b { font-family: var(--cond); font-weight: 800; font-size: 1.7rem; color: #1a1a1a; letter-spacing: .01em; }
.epd .call { justify-content: space-between; }
.epd .call .row { display: flex; justify-content: space-between; align-items: center; font-size: .86rem; font-weight: 500; }
.epd .call .tag { background: var(--red); color: #fff; font-weight: 700; font-size: .7rem; letter-spacing: .04em; padding: .05rem .45rem; }
.epd .call .who { font-family: var(--cond); font-weight: 800; font-size: 2.3rem; line-height: 1; letter-spacing: .02em; }
.epd .call .ybar { height: 5px; background: var(--yellow); }
.epd .call .heard { font-size: .78rem; line-height: 1.35; }
.epd .call .heard small { display: block; font-size: .72rem; color: #333; margin-bottom: .1rem; }
.epd .call .heard span { display: inline-block; width: 50%; font-weight: 500; }
.epd .flash { position: absolute; inset: 0; background: #111; opacity: 0; pointer-events: none; }
/* Ein einziger Moment: das E-Ink „blättert um“ – Invertierungsblitze wie beim echten Refresh */
@media (prefers-reduced-motion: no-preference) {
    .epd.animate .idle  { animation: epd-hide 0s linear 3.1s forwards; }
    .epd.animate .call  { opacity: 0; animation: epd-show 0s linear 3.1s forwards; }
    .epd.animate .flash { animation: epd-flash 1.4s steps(1, end) 1.8s forwards; }
    @keyframes epd-hide  { to { opacity: 0; visibility: hidden; } }
    @keyframes epd-show  { to { opacity: 1; } }
    @keyframes epd-flash {
        0%   { opacity: 1; background: #111; }
        18%  { opacity: 1; background: #f2f2ee; }
        36%  { opacity: 1; background: #111; }
        54%  { opacity: 1; background: #f2f2ee; }
        72%  { opacity: 1; background: #111; }
        92%  { opacity: 1; background: #f2f2ee; }
        100% { opacity: 0; }
    }
}
@media (prefers-reduced-motion: reduce) {
    .epd.animate .idle { display: none; }
}
.epd.static .idle { display: none; }
.device-cap { margin-top: 1rem; font-size: .9rem; color: #b7c6e2; max-width: 290px; margin-left: auto; }

/* ---------- Seitenaufbau mit Randspalte ---------- */
.page { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 3.5rem; align-items: start; }
.toc { position: sticky; top: 4.6rem; padding-top: 3.6rem; font-size: .92rem; }
.toc h2 { font-family: var(--cond); font-weight: 700; font-size: 1rem; color: var(--blue-deep); margin-bottom: .6rem; }
.toc ol { list-style: none; }
.toc a {
    display: block; padding: .32rem 0 .32rem .85rem; border-left: 2px solid var(--rule);
    color: var(--ink-2); text-decoration: none; line-height: 1.3;
}
.toc a:hover { color: var(--blue); }
.toc a.active { border-left-color: var(--orange); color: var(--blue-deep); font-weight: 600; }
.toc .note { margin-top: 1.4rem; font-size: .82rem; color: var(--muted); line-height: 1.4; }

main section { padding: 3.6rem 0 3.2rem; border-top: 1px solid var(--rule); }
main section:first-child { border-top: none; }
h2 {
    font-family: var(--cond); font-weight: 700; color: var(--blue-deep);
    font-size: clamp(1.75rem, 3vw, 2.25rem); line-height: 1.1; letter-spacing: -.005em;
    margin-bottom: 1.1rem; text-wrap: balance;
}
h3 { font-family: var(--cond); font-weight: 700; font-size: 1.35rem; line-height: 1.2; color: var(--ink); margin: 2.4rem 0 .7rem; }
h4 { font-family: var(--cond); font-weight: 700; font-size: 1.08rem; color: var(--ink); }
main p { max-width: 66ch; }
main p + p { margin-top: .9rem; }
.intro { font-size: 1.15rem; line-height: 1.5; color: var(--ink-2); max-width: 60ch; }
.small { font-size: .92rem; color: var(--ink-2); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 2.4rem; align-items: start; margin-top: 1.6rem; }
.two.center { align-items: center; }

figure img { border: 1px solid var(--rule); border-radius: 3px; background: var(--panel); }
figure.shot img { background: #fff; }
figcaption { margin-top: .55rem; font-size: .88rem; color: var(--muted); line-height: 1.4; }

/* Begriffe: Begriff links, Erklärung rechts */
.terms { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.6rem; margin-top: 1.6rem; max-width: 66ch; }
.terms dt { font-family: var(--cond); font-weight: 700; font-size: 1.05rem; color: var(--blue); padding-top: .05rem; }
.terms dd { color: var(--ink-2); }

/* Tabellen wie im Datenblatt */
.sheet { margin-top: 1.2rem; overflow-x: auto; }
.sheet table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.sheet th {
    font-family: var(--cond); font-weight: 700; font-size: 1rem; color: var(--blue-deep);
    text-align: left; padding: .4rem .9rem .4rem 0; border-bottom: 2px solid var(--blue-deep);
}
.sheet td { padding: .48rem .9rem .48rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.sheet th:last-child, .sheet td:last-child { padding-right: 0; }
.sheet .num, .sheet th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.sheet tr.sum td { border-top: 2px solid var(--ink); border-bottom: none; font-weight: 600; }
.sheet caption { text-align: left; font-family: var(--cond); font-weight: 700; font-size: 1.08rem; padding-bottom: .5rem; }

/* Chirp als Figur */
.chirp svg { width: 100%; height: 56px; display: block; }
.chirp path { fill: none; stroke: var(--orange); stroke-width: 2.4; stroke-linecap: round; }
.chirp .axis { stroke: var(--rule); stroke-width: 1; }

/* Blockschaltbild: Signalweg */
.flow { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0 1.2rem; margin-top: 2rem; }
.step { position: relative; border-top: 2px solid var(--blue); padding: 1rem 0 .4rem; }
.step::before { content: ""; position: absolute; top: -6px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.step:last-child::before { background: var(--orange); }
.step:last-child { border-top-color: var(--orange); }
.step .n { font-family: var(--cond); font-weight: 800; font-size: 1.5rem; line-height: 1; color: var(--blue); }
.step:last-child .n { color: var(--orange-deep); }
.step h4 { margin: .3rem 0 .3rem; }
.step p { font-size: .9rem; color: var(--ink-2); line-height: 1.4; }
.step .air { margin-top: .5rem; }
.step .air svg { width: 100%; height: 26px; display: block; }
.step .air path { fill: none; stroke: var(--orange); stroke-width: 1.8; stroke-linecap: round; }

/* Minutenraster */
.minutes { margin-top: 1.8rem; }
.minutes .track { display: grid; grid-template-columns: repeat(5, 1fr); height: 92px; border-bottom: 2px solid var(--ink); }
.minutes .min { position: relative; border-left: 1px solid var(--rule); }
.minutes .min:first-child { border-left-color: var(--ink); }
.minutes .lbl { position: absolute; top: 0; left: .45rem; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.minutes .mk { position: absolute; bottom: 0; width: 7px; border-radius: 2px 2px 0 0; }
.minutes .beacon { left: 3px; height: 42px; background: var(--blue); }
.minutes .call  { left: 38%; height: 64px; background: var(--orange); }
.minutes .bcast { left: 56%; height: 64px; background: var(--grey-mark); }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; margin-top: .8rem; font-size: .88rem; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .45rem; vertical-align: -1px; }

/* Frame-Diagramme */
.frame { margin-top: 1.8rem; }
.frame h4 { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .8rem; margin-bottom: .5rem; }
.frame h4 small { font-family: var(--sans); font-weight: 400; font-size: .92rem; color: var(--muted); }
.frame .scroll { overflow-x: auto; }
.fields { display: flex; align-items: stretch; gap: 3px; min-width: 640px; }
.f { border: 1px solid var(--rule); border-top: 4px solid var(--grey-mark); background: var(--panel); border-radius: 2px; padding: .45rem .55rem .4rem; min-width: 0; }
.f b { display: block; font-weight: 600; font-size: .82rem; line-height: 1.2; hyphens: auto; overflow-wrap: anywhere; }
.f span { display: block; font-size: .74rem; color: var(--muted); margin-top: .15rem; }
.f.phy { border-top-color: #b4bbc1; }
.f.hdr { border-top-color: var(--ink); }
.f.beacon { border-top-color: var(--blue); }
.f.call { border-top-color: var(--orange); }
.f.bcast { border-top-color: #5f6a74; }
.f.new { background: #fff6ea; }
.frame-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin-top: .9rem; font-size: .85rem; color: var(--muted); }
.frame-legend i { display: inline-block; width: 14px; height: 4px; margin-right: .4rem; vertical-align: 2px; background: var(--grey-mark); }

/* Erklärungen zu Protokolldetails */
.notes { columns: 2; column-gap: 2.6rem; margin-top: 2.2rem; }
.notes > div { break-inside: avoid; margin-bottom: 1.6rem; }
.notes h4 { margin-bottom: .35rem; color: var(--blue-deep); }
.notes p { font-size: .95rem; color: var(--ink-2); }

/* Empfänger-Daten */
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 2.4rem; margin-top: 1.8rem; }
.specs div { border-top: 1px solid var(--rule); padding-top: .55rem; }
.specs dt { font-size: .85rem; color: var(--muted); }
.specs dd b { display: block; font-family: var(--cond); font-weight: 700; font-size: 1.15rem; color: var(--ink); margin-bottom: .1rem; }
.specs dd { font-size: .92rem; color: var(--ink-2); }

/* Teileliste Sender */
.parts { list-style: none; margin-top: 1.4rem; max-width: 66ch; }
.parts li { padding: .55rem 0; border-bottom: 1px solid var(--rule); color: var(--ink-2); }
.parts li b { color: var(--ink); font-weight: 600; }

/* Fahrplan */
.plan { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem 2.6rem; margin-top: 1.4rem; }
.plan h3 { margin-top: .6rem; }
.todo { list-style: none; }
.todo li { position: relative; padding: .5rem 0 .5rem 1.8rem; border-bottom: 1px solid var(--rule); font-size: .97rem; color: var(--ink-2); }
.todo li::before { content: ""; position: absolute; left: 0; top: .85rem; width: 14px; height: 14px; border: 2px solid var(--grey-mark); border-radius: 3px; }
.todo li.important { color: var(--ink); }
.todo li.important::before { border-color: var(--orange); }
.todo b { color: var(--ink); }

/* Fuß */
footer { margin-top: 2rem; background: var(--paper-2); border-top: 1px solid var(--rule); padding: 3rem 0 3.5rem; font-size: .95rem; color: var(--ink-2); }
.foot { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 3.5rem; align-items: start; }
.foot img { width: 170px; }
.foot p { max-width: 66ch; }
.foot p + p { margin-top: .8rem; }
.foot .sig { margin-top: 1.6rem; font-family: var(--cond); font-weight: 700; color: var(--blue-deep); font-size: 1.05rem; }

/* ---------- Responsiv ---------- */
@media (max-width: 960px) {
    .page, .foot { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .toc {
        display: none; position: fixed; top: 3.4rem; left: 0; right: 0; z-index: 55;
        padding: 1rem 1.25rem 1.2rem; background: var(--paper); border-bottom: 1px solid var(--rule);
        box-shadow: 0 14px 28px rgba(30,34,39,.14); max-height: calc(100vh - 3.4rem); overflow: auto;
    }
    .toc.open { display: block; }
    .toc a { padding: .55rem 0 .55rem .85rem; font-size: 1rem; }
    .toc .note { display: none; }
    .toc-btn { display: inline-flex; }
    .bar .draft { display: none; }
    .flow { grid-template-columns: 1fr; gap: 0; }
    .step { border-top: none; border-left: 2px solid var(--blue); padding: 0 0 1.4rem 1.2rem; }
    .step::before { top: .3rem; left: -6px; }
    .step:last-child { border-left-color: var(--orange); padding-bottom: .2rem; }
    .step .air { max-width: 240px; }
}
@media (max-width: 820px) {
    .cover { padding: 2.8rem 0 3.2rem; }
    .cover-grid { grid-template-columns: 1fr; gap: 2.4rem; }
    .device, .device-cap { margin-left: 0; }
    .two, .specs, .plan { grid-template-columns: 1fr; }
    .notes { columns: 1; }
    .facts { grid-template-columns: 1fr 1fr; }
    main section { padding: 2.8rem 0 2.4rem; }
    .foot img { width: 140px; margin-bottom: 1.4rem; }
}
@media (max-width: 480px) {
    body { font-size: 1rem; }
    .terms { grid-template-columns: 1fr; gap: .15rem; }
    .terms dd { margin-bottom: .6rem; }
}
