/*
 * TI20.io TechNews — public pages. Brand tokens from ~/code/borchert/brand (brand.css 1.0.0):
 * Borchert red is context dependent (#cd071e on light, #e0142b on dark), Space Grotesk + JetBrains Mono.
 * Rules use tokens only; dark mode follows the OS.
 */
:root {
    --rot: #cd071e;
    --rot-tief: #a80f20;
    --papier: #ffffff;
    --papier-2: #f6f2f1;
    --linie: #e4e4e4;
    --text: #1a1a1a;
    --text-leise: #6b6b6b;
    --chip-grund: #f6f2f1;
    --chip-text: #1a1a1a;
    --kopf-grund: #0e1116;
    --kopf-text: #e8ecf1;
    --kopf-leise: #9aa6b2;
    --schrift: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --radius: 10px;
    --breite: 1080px;
    --lesebreite: 72ch;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --rot: #e0142b;
        --rot-tief: #ff2f44;
        --papier: #0e1116;
        --papier-2: #161b22;
        --linie: #2a313c;
        --text: #e8ecf1;
        --text-leise: #9aa6b2;
        --chip-grund: #161b22;
        --chip-text: #e8ecf1;
        --kopf-grund: #161b22;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--papier);
    color: var(--text);
    font-family: var(--schrift);
    font-size: 1.0625rem;
    line-height: 1.6;
}

a { color: var(--rot); text-underline-offset: 0.18em; }
a:hover { color: var(--rot-tief); }
:focus-visible { outline: 3px solid var(--rot); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 16px; top: 8px; background: var(--papier); padding: 0.4rem 0.8rem; z-index: 10; }

/* ---------------------------------------------------------------- header */
.kopf {
    background: var(--kopf-grund);
    color: var(--kopf-text);
    border-top: 5px solid var(--rot);
}
.kopf-innen, .fuss-innen, .seite {
    max-width: var(--breite);
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
}
.kopf-innen {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}
.marke { display: flex; align-items: center; gap: 0.75rem; color: inherit; text-decoration: none; min-width: 0; }
.marke:hover { color: inherit; }
.marke img { flex: 0 0 auto; border-radius: 6px; }
.marke-text { display: flex; flex-direction: column; min-width: 0; }
.marke-name { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; }
.marke-unterzeile { color: var(--kopf-leise); font-size: 0.85rem; }
.kopf-nav { display: flex; gap: 1.1rem; font-size: 0.95rem; }
.kopf-nav a { color: var(--kopf-text); text-decoration: none; }
.kopf-nav a:hover { color: #ffffff; text-decoration: underline; }

/* ---------------------------------------------------------------- layout */
.seite { padding-top: 2rem; padding-bottom: 3rem; }
.spalten { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 3rem; align-items: start; }
@media (max-width: 860px) {
    .spalten { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
}

.liste-titel, .beitrag-titel {
    font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 1.5rem;
}

/* ---------------------------------------------------------------- post cards */
.karte { padding: 1.25rem 0 1.4rem; border-top: 1px solid var(--linie); }
.karte:first-of-type { border-top: 0; padding-top: 0; }
.datum { display: block; color: var(--text-leise); font-size: 0.85rem; font-family: var(--mono); }
.karte-titel { font-size: 1.3rem; line-height: 1.3; margin: 0.25rem 0 0.4rem; letter-spacing: -0.01em; }
.karte-titel a { color: var(--text); text-decoration: none; }
.karte-titel a:hover { color: var(--rot); text-decoration: underline; }
.karte-teaser { margin: 0 0 0.7rem; color: var(--text); max-width: var(--lesebreite); }
.leer { color: var(--text-leise); }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0; }
.chip {
    display: inline-block;
    padding: 0.1rem 0.6rem;
    border: 1px solid var(--linie);
    border-radius: 999px;
    background: var(--chip-grund);
    color: var(--chip-text);
    font-family: var(--mono);
    font-size: 0.78rem;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.chip:hover { border-color: var(--rot); color: var(--rot); }

.blaettern { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; }
.blaettern a[rel="next"] { margin-left: auto; }

/* ---------------------------------------------------------------- sidebar */
.seitenleiste { border-left: 1px solid var(--linie); padding-left: 1.5rem; }
@media (max-width: 860px) {
    .seitenleiste { border-left: 0; padding-left: 0; border-top: 1px solid var(--linie); padding-top: 1.5rem; }
}
.seitenleiste-titel { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-leise); margin: 0 0 0.75rem; }
.repo-liste { list-style: none; padding: 0; margin: 0; font-size: 0.92rem; }
.repo-liste li { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.25rem 0; }
.repo-liste a { color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.repo-liste a:hover { color: var(--rot); text-decoration: underline; }
.anzahl { color: var(--text-leise); font-family: var(--mono); font-size: 0.8rem; }

/* ---------------------------------------------------------------- sponsor slot */
.sponsoren { display: grid; gap: 0.6rem; margin: 0 0 2rem; }
.seitenleiste .sponsoren { margin-bottom: 1.75rem; }
.beitrag .sponsoren { margin: 2rem 0; }
.sponsor-kennzeichnung {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-leise);
}
.sponsor-link {
    display: grid;
    gap: 0.35rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    background: var(--papier-2);
    color: var(--text);
    text-decoration: none;
}
.sponsor-link:hover { border-color: var(--rot); color: var(--text); }
/* Logos come with their own (usually white) background — a light plate keeps them legible in dark mode too */
.sponsor-logo {
    max-width: 100%; max-height: 56px; width: auto; height: auto; object-fit: contain; justify-self: start;
    background: #ffffff; border-radius: 6px; padding: 4px;
}
.sponsor-name { font-weight: 700; }
.sponsor-text { color: var(--text-leise); font-size: 0.92rem; }

/* ---------------------------------------------------------------- single post */
.beitrag { max-width: var(--lesebreite); }
.beitrag-kopf { margin-bottom: 2rem; }
.beitrag-kopf .beitrag-titel { margin: 0.3rem 0 0.8rem; }
.beitrag-teaser { font-size: 1.2rem; color: var(--text-leise); margin: 0 0 1rem; }

.inhalt h2 { font-size: 1.35rem; margin: 2.2rem 0 0.6rem; letter-spacing: -0.01em; }
.inhalt h3 { font-size: 1.1rem; margin: 1.6rem 0 0.4rem; }
.inhalt p, .inhalt ul, .inhalt ol { margin: 0 0 1rem; }
.inhalt li { margin: 0.25rem 0; }
.inhalt blockquote { margin: 0 0 1rem; padding: 0.2rem 1rem; border-left: 3px solid var(--rot); color: var(--text-leise); }
.inhalt code {
    font-family: var(--mono);
    font-size: 0.88em;
    background: var(--papier-2);
    border: 1px solid var(--linie);
    border-radius: 4px;
    padding: 0.05em 0.3em;
    overflow-wrap: anywhere;
}
.inhalt pre { overflow-x: auto; background: var(--papier-2); padding: 1rem; border-radius: var(--radius); }
.inhalt pre code { border: 0; padding: 0; background: none; }
.inhalt table { border-collapse: collapse; display: block; overflow-x: auto; }
.inhalt th, .inhalt td { border: 1px solid var(--linie); padding: 0.35rem 0.6rem; text-align: left; }

.hinweis {
    border-left: 3px solid var(--rot);
    background: var(--papier-2);
    padding: 0.7rem 1rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.92rem;
    color: var(--text-leise);
}
.quellen h2 { font-size: 1rem; margin: 2rem 0 0.4rem; }
.quellen ul { padding-left: 1.2rem; font-family: var(--mono); font-size: 0.85rem; }

/* ---------------------------------------------------------------- footer */
.fuss { border-top: 1px solid var(--linie); background: var(--papier-2); color: var(--text-leise); font-size: 0.88rem; }
.fuss-innen { padding-top: 1.5rem; padding-bottom: 2rem; }
.fuss-innen p { margin: 0 0 0.6rem; max-width: var(--lesebreite); }
.fuss-links { display: flex; flex-wrap: wrap; gap: 1.2rem; }

/* ================================================================ landing page (www.ti20.io) */
.knopf {
    display: inline-block;
    padding: 0.75rem 1.3rem;
    border-radius: var(--radius);
    font-weight: 700;
    text-decoration: none;
    border: 2px solid transparent;
}
.knopf--primaer { background: var(--rot); color: #ffffff; }
.knopf--primaer:hover { background: var(--rot-tief); color: #ffffff; }
.knopf--sekundaer { border-color: var(--kopf-leise); color: var(--kopf-text); }
.knopf--sekundaer:hover { border-color: var(--kopf-text); color: #ffffff; }

.held { background: var(--kopf-grund); color: var(--kopf-text); border-bottom: 1px solid var(--linie); }
.held-innen, .abschnitt-innen { max-width: var(--breite); margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.held-innen { padding-top: clamp(3rem, 8vw, 6rem); padding-bottom: clamp(3rem, 8vw, 6rem); }
.held-vorzeile {
    margin: 0 0 1rem; color: var(--rot); font-family: var(--mono); font-size: 0.9rem;
    text-transform: uppercase; letter-spacing: 0.1em;
}
.held-titel {
    margin: 0 0 1.25rem; max-width: 20ch;
    font-size: clamp(2.2rem, 1.4rem + 3.6vw, 4rem); line-height: 1.05; letter-spacing: -0.03em;
}
.held-text { margin: 0 0 2rem; max-width: 60ch; font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem); color: var(--kopf-leise); }
.held-aktionen { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0; }

.abschnitt { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.abschnitt--hell { background: var(--papier-2); border-top: 1px solid var(--linie); border-bottom: 1px solid var(--linie); }
.abschnitt-titel { margin: 0 0 1.75rem; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); letter-spacing: -0.02em; }
.abschnitt-mehr { margin: 1.5rem 0 0; }

.produkte { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 1rem; }
.produkt {
    display: flex; flex-direction: column; gap: 0.5rem;
    padding: 1.25rem; border: 1px solid var(--linie); border-radius: var(--radius); background: var(--papier);
}
.produkt-name { margin: 0; font-size: 1.25rem; letter-spacing: -0.01em; }
.produkt-text { margin: 0; flex: 1; color: var(--text-leise); font-size: 0.95rem; }
.produkt-link { margin: 0.5rem 0 0; font-weight: 700; }
.produkt-link a { text-decoration: none; }
.produkt-status {
    align-self: flex-start; margin: 0; padding: 0.1rem 0.6rem; border-radius: 999px;
    font-family: var(--mono); font-size: 0.72rem; border: 1px solid var(--linie); color: var(--text-leise);
}
.produkt-status--taeglich, .produkt-status--demonstrator { border-color: var(--rot); color: var(--rot); }

.grundsaetze { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1.5rem 2rem; }
.grundsatz h3 { margin: 0 0 0.4rem; font-size: 1.1rem; }
.grundsatz h3::before { content: ""; display: block; width: 2rem; height: 3px; background: var(--rot); margin-bottom: 0.75rem; }
.grundsatz p { margin: 0; color: var(--text-leise); }

.news-karten { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1.25rem 2rem; }
.news-karte .karte-titel { font-size: 1.1rem; }
.news-karte .karte-teaser { font-size: 0.95rem; color: var(--text-leise); }

.abschnitt--kontakt { background: var(--kopf-grund); color: var(--kopf-text); }
.kontakt p { max-width: 60ch; color: var(--kopf-leise); }
.kontakt .held-aktionen { margin-top: 1.5rem; }
