/* ============================================================
   Das interaktive Paper — michaeldoell / mitarano
   Tokens: siehe design-system/tokens.css (Quelle des Konzepts)
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Grund & Flächen */
    --paper: #F3F6F5;
    --panel: #FBFCFC;
    --panel-deep: #EAEFED;

    /* Text */
    --ink: #12171B;
    --ink-soft: #3C464E;
    --grey: #5B6672;
    --grey-faint: #8A949E;

    /* Linien */
    --line: #D7DEDE;
    --line-strong: #B9C3C3;

    /* Akzent */
    --trace: #1E4FE0;
    --trace-soft: rgba(30, 79, 224, 0.08);
    --trace-line: rgba(30, 79, 224, 0.35);
    --amber: #B26B00;
    --amber-soft: rgba(178, 107, 0, 0.10);

    --shadow: 0 1px 2px rgba(18, 23, 27, 0.04), 0 8px 24px -12px rgba(18, 23, 27, 0.10);

    /* Typo-Rollen */
    --font-display: 'IBM Plex Sans Condensed', 'IBM Plex Sans', sans-serif;
    --font-body: 'IBM Plex Sans', 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

    --radius: 6px;
    --radius-sm: 4px;
}

[data-theme="dark"] {
    --paper: #0D1216;
    --panel: #131A20;
    --panel-deep: #0A0E12;
    --ink: #E9EDF0;
    --ink-soft: #C2CAD1;
    --grey: #8B96A1;
    --grey-faint: #647079;
    --line: #232D35;
    --line-strong: #35424C;
    --trace: #7C99FF;
    --trace-soft: rgba(124, 153, 255, 0.10);
    --trace-line: rgba(124, 153, 255, 0.40);
    --amber: #E0A44E;
    --amber-soft: rgba(224, 164, 78, 0.12);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.5);
}

/* ---------- Basis ---------- */

body {
    font-family: var(--font-body);
    font-size: 1.02rem;
    line-height: 1.7;
    color: var(--ink-soft);
    background-color: var(--paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

h1,
h2 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.015em;
    line-height: 1.02;
    text-wrap: balance;
}

h3 {
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--ink);
    font-size: 1.08rem;
    margin-bottom: 0.35em;
}

p {
    max-width: 68ch;
}

strong {
    color: var(--ink);
    font-weight: 600;
}

a {
    color: var(--trace);
    text-decoration: none;
}

.mono {
    font-family: var(--font-mono);
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--grey);
}

.eyebrow .no {
    color: var(--trace);
}

/* ---------- Navigation ---------- */

.navbar {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0.9rem 24px;
}

.nav-title {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--ink);
}

.nav-title::before {
    content: '●';
    color: var(--trace);
    font-size: 0.6rem;
    vertical-align: 2px;
    /* Optisch gleicher Abstand wie das Mono-Leerzeichen im Namen; der
       Punkt-Glyph bringt in seiner Zelle bereits Leerraum rechts mit */
    margin-right: 0.45rem;
}

.nav-menu {
    display: flex;
    gap: 1.8rem;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 1.8rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--grey);
    font-size: 0.92rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--ink);
}

.nav-controls {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

/* Einheitliche feste Größe für alle Nav-Buttons, damit weder Inhalt
   (DE-Text, Icons) noch Icon-Wechsel (Hamburger ↔ X) die Maße ändern */
.language-toggle,
.theme-toggle,
.nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    height: 1.8rem;
    padding: 0;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    background: none;
    border: 1px solid var(--line-strong);
    color: var(--grey);
    border-radius: 3px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.language-toggle:hover,
.theme-toggle:hover,
.nav-toggle:hover {
    color: var(--ink);
    border-color: var(--ink);
}

.nav-toggle {
    display: none;
    font-size: 0.85rem;
}

/* ---------- Sektionen ---------- */

.section {
    padding: clamp(3.5rem, 8vw, 5.5rem) 0;
}

.section+.section {
    border-top: 1px solid var(--line);
}

.section-head {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-bottom: 2rem;
}

.section-head h2 {
    font-size: clamp(1.7rem, 3.4vw, 2.4rem);
}

.section-head .section-description {
    color: var(--ink-soft);
    max-width: 62ch;
}

/* ---------- Hero ---------- */

.hero {
    border-bottom: 1px solid var(--line);
}

.hero-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: clamp(3rem, 7vw, 5.5rem) 24px clamp(3rem, 7vw, 5rem);
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(240px, 1fr);
    gap: 2rem;
    align-items: center;
}

.hero h1 {
    font-size: clamp(2.6rem, 6.5vw, 4.6rem);
}

.token-word {
    white-space: nowrap;
}

.token-seg {
    display: inline-block;
    border: 1px solid var(--trace-line);
    background: var(--trace-soft);
    border-radius: 5px;
    padding: 0 0.06em;
    margin: 0 0.03em;
    color: var(--trace);
}

.hero-sub {
    margin: 1.4rem 0 1.8rem;
    font-size: 1.05rem;
    color: var(--ink-soft);
    max-width: 46ch;
}

.cta-row {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-block;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    background: var(--ink);
    color: var(--paper);
    border: none;
    border-radius: 5px;
    padding: 0.68rem 1.3rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-primary:hover {
    background: var(--trace);
    color: #fff;
}

.btn-quiet {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ink);
    border-bottom: 1px solid var(--line-strong);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.btn-quiet:hover {
    color: var(--trace);
    border-color: var(--trace);
}

.scope-wrap {
    position: relative;
    max-width: 420px;
    justify-self: end;
    width: 100%;
}

.scope-wrap canvas {
    width: 100%;
    aspect-ratio: 14 / 13;
    height: auto;
    display: block;
}

/* ---------- Lab ---------- */

.lab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.2rem;
}

.lab-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    padding: 1.2rem 1.3rem 1.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: border-color 0.2s ease;
}

.lab-card:hover {
    border-color: var(--trace-line);
}

.lab-card .eyebrow {
    font-size: 0.66rem;
}

.lab-card p {
    font-size: 0.94rem;
    margin: 0;
}

.lab-visual {
    margin: 0.4rem 0 0.2rem;
    padding: 0.8rem 0.9rem;
    background: var(--panel-deep);
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.lab-visual canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.chip-token {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    padding: 0.14rem 0.42rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--trace-line);
    background: var(--trace-soft);
    color: var(--trace);
}

.chip-token.alt {
    border-color: var(--amber);
    background: var(--amber-soft);
    color: var(--amber);
}

.lab-links {
    display: flex;
    gap: 1.1rem;
    margin-top: auto;
    padding-top: 0.6rem;
    font-size: 0.9rem;
    align-items: center;
}

.lab-links .go {
    color: var(--ink);
    font-weight: 600;
    border-bottom: 1px solid var(--line-strong);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.lab-links .go:hover {
    color: var(--trace);
    border-color: var(--trace);
}

.lab-links .gh {
    color: var(--grey);
    transition: color 0.2s ease;
}

.lab-links .gh:hover {
    color: var(--ink);
}

/* ---------- Publikationen ---------- */

/* Publikationen als typografische Referenzliste — Hairlines statt Karten */
.publication-list {
    list-style: none;
}

.pub {
    border-top: 1px solid var(--line);
    padding: 1.9rem 0 2.1rem;
}

.pub:last-child {
    padding-bottom: 0.5rem;
}

.pub-year {
    font-family: var(--font-mono);
    font-style: normal;
    font-size: 0.78rem;
    color: var(--grey);
    white-space: nowrap;
}

/* Trenner samt Abständen im CSS — dadurch links und rechts vom Punkt
   exakt gleich breit, unabhängig von Schriftart des umgebenden Texts */
.pub-year::before {
    content: '·';
    margin: 0 0.55em;
}

.pub h3 {
    font-size: 1.22rem;
    margin-bottom: 0.25em;
}

.pub .authors {
    font-size: 0.88rem;
    color: var(--grey);
    margin-bottom: 0.15em;
    max-width: none;
}


.pub .venue {
    font-size: 0.88rem;
    color: var(--grey);
    font-style: italic;
    margin-bottom: 0.7em;
    max-width: none;
}

.pub .plain {
    font-size: 0.96rem;
    color: var(--ink-soft);
    margin: 0.9em 0 1em;
    max-width: none;
}

.pub .links {
    display: flex;
    gap: 1.2rem;
    font-size: 0.84rem;
    font-family: var(--font-mono);
    flex-wrap: wrap;
}

.pub .links a {
    color: var(--trace);
    border-bottom: 1px solid var(--trace-line);
    transition: color 0.2s ease;
}

.pub .links a:hover {
    color: var(--ink);
    border-color: var(--ink);
}

/* ---------- Über mich ---------- */

.pillars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.pillar {
    background: var(--panel);
    padding: 1.4rem 1.5rem 1.6rem;
}

.pillar .eyebrow {
    font-size: 0.66rem;
    display: block;
    margin-bottom: 0.7rem;
}

.pillar p {
    font-size: 0.94rem;
    margin: 0;
}

.about-now {
    margin-top: 1.8rem;
    font-size: 0.98rem;
    color: var(--ink-soft);
    max-width: 66ch;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* ---------- Footer ---------- */

footer {
    border-top: 1px solid var(--line-strong);
    padding: 2.5rem 0;
    text-align: center;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 1.4rem;
    margin-bottom: 1rem;
}

.footer-social-link {
    color: var(--grey);
    font-size: 1.25rem;
    transition: color 0.2s ease;
}

.footer-social-link:hover {
    color: var(--trace);
}

footer p {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--grey-faint);
    margin: 0 auto 0.8rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-links a {
    font-size: 0.82rem;
    color: var(--grey);
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--ink);
}

/* ---------- Impressum / Datenschutz ---------- */

.info-main {
    min-height: 60vh;
}

.info-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    padding: clamp(1.5rem, 4vw, 2.5rem);
    max-width: 720px;
    margin: 0 auto;
}

/* Einheitliche rechte Kante: Die Karte begrenzt die Zeilenlänge,
   nicht das globale p-Maß, sonst brechen Absätze und Listen verschieden um */
.info-card p {
    max-width: none;
}

.info-card h1 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    margin-bottom: 1.2rem;
}

.info-section {
    margin-top: 1.6rem;
}

.info-section h2 {
    font-size: 1.3rem;
    font-family: var(--font-body);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Deutlich unter der h2-Stufe, damit die Hierarchie erkennbar bleibt */
.info-subheading {
    font-size: 1rem;
    margin-top: 1rem;
}

.info-section p {
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
}

.info-summary p {
    margin-bottom: 0;
    line-height: 1.5;
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 2.2rem;
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }

    /* Mobil: die Kennlinie steht frei wie im Desktop — gleiche Optik,
       nur kompakter und an der Textspalte ausgerichtet (max. 400px) */
    .scope-wrap {
        width: 100%;
        max-width: 400px;
        justify-self: start;
    }

    .scope-wrap canvas {
        aspect-ratio: auto;
        height: 210px;
    }
}

@media (max-width: 720px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--paper);
        border-bottom: 1px solid var(--line);
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 24px 1.2rem;
        gap: 1rem;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-toggle {
        display: inline-flex;
    }
}

/* ---------- Reduced Motion ---------- */

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}