/* ==========================================================================
   Deskvaro - assets/style.css
   Design-Grundlage: design-plan.md ("Blaupause"-Konzept)
   ========================================================================== */

/* -- Fonts ---------------------------------------------------------------- */

@font-face {
    font-family: 'Big Shoulders';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('fonts/big-shoulders-variable.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 100 700;
    font-display: swap;
    src: url('fonts/ibm-plex-sans-variable.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/ibm-plex-mono-400.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/ibm-plex-mono-500.woff2') format('woff2');
}

/* -- Tokens ----------------------------------------------------------------- */

:root {
    /* Farbe (design-plan.md Abschnitt 1) */
    --color-grundton: #E8ECEC;
    --color-tiefton: #1B252B;
    --color-leitfarbe: #1F4C72;
    --color-leitfarbe-hell: #6FA0C2;
    --color-leitfarbe-hover: #163C58;
    --color-akzent: #C97C2A;
    --color-akzent-hover: #D8924C;
    --color-border-deko: #CDD6D6;
    --color-border-funktional: #71828A;
    --color-text-sekundaer: #5C6669;
    --color-hover-flaeche: #DCE6EA;
    --color-erfolg: #2F6E58;
    --color-warnung-text: #8A5314;
    --color-fehler: #9C3A26;
    --color-weiss: #FFFFFF;
    --color-erfolg-bg: #EAF3EF;
    --color-warnung-bg: #F7EEE0;
    --color-fehler-bg: #F7E7E3;
    --color-on-leitfarbe-muted: #D9E4EA;
    --color-footer-line: #33424A;

    /* Typografie */
    --font-display: 'Big Shoulders', 'Arial Narrow', sans-serif;
    --font-text: 'IBM Plex Sans', system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

    --step-display: clamp(2.75rem, 2rem + 3vw, 4.5rem);
    --step-h1: clamp(2.25rem, 1.9rem + 1.5vw, 3rem);
    --step-h2: 2rem;
    --step-h3: 1.5rem;
    --step-lead: 1.25rem;
    --step-body: 1rem;
    --step-small: 0.875rem;
    --step-caption: 0.75rem;

    /* Abstaende (4px-Basis) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
    --space-9: 96px;

    /* Radius - bewusst durchgaengig 0 (technische Zeichnung) */
    --radius-0: 0;

    /* Schatten - bewusst keine (Tiefe ueber Flaechenkontrast/Rahmen) */
    --shadow-none: none;

    /* Rahmenstaerken */
    --border-deko: 1px;
    --border-funktional: 2px;
    --border-focus: 3px;

    --font-scale: 1;
    --motion-duration: 300ms;
}

:root[data-contrast="high"] {
    --color-grundton: #FFFFFF;
    --color-tiefton: #000000;
    --color-leitfarbe: #113a5c;
    --color-leitfarbe-hell: #9dc3dc;
    --color-border-funktional: #000000;
    --color-text-sekundaer: #333333;
    --color-hover-flaeche: #d7e4ea;
}

@media (prefers-reduced-motion: reduce) {
    :root {
        --motion-duration: 0ms;
    }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

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

*, *::before, *::after { box-sizing: border-box; }
html { font-size: calc(16px * var(--font-scale)); -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--color-grundton);
    color: var(--color-tiefton);
    font-family: var(--font-text);
    font-size: var(--step-body);
    line-height: 1.6;
    hyphens: auto;
}
html[lang="de"] body { hyphens: auto; }
img, svg { max-width: 100%; display: block; }
a { color: var(--color-leitfarbe); }
a:hover { color: var(--color-leitfarbe-hover); }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; color: var(--color-tiefton); margin: 0 0 var(--space-4); text-wrap: balance; }
p { margin: 0 0 var(--space-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
button { font-family: inherit; }

.display { font-family: var(--font-display); font-weight: 900; font-size: var(--step-display); line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; margin: 0 0 var(--space-5); }
.h1, h1 { font-size: var(--step-h1); line-height: 1.15; letter-spacing: -0.015em; }
.h2, h2 { font-size: var(--step-h2); line-height: 1.2; letter-spacing: -0.01em; }
.h3, h3 { font-size: var(--step-h3); line-height: 1.25; letter-spacing: -0.005em; }
.lead { font-size: var(--step-lead); line-height: 1.55; font-weight: 400; color: var(--color-tiefton); max-width: 65ch; }
.body { font-size: var(--step-body); line-height: 1.6; }
.small { font-size: var(--step-small); line-height: 1.5; letter-spacing: 0.01em; }
.caption { font-size: var(--step-caption); line-height: 1.4; letter-spacing: 0.02em; color: var(--color-text-sekundaer); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.container { max-width: 72rem; margin-inline: auto; padding-inline: clamp(var(--space-4), 4vw, var(--space-8)); }
.container--narrow { max-width: 42rem; }

.skip-link {
    position: absolute; left: var(--space-3); top: -3rem;
    background: var(--color-tiefton); color: var(--color-weiss);
    padding: var(--space-3) var(--space-4); z-index: 100;
    transition: top var(--motion-duration) ease;
}
.skip-link:focus { top: var(--space-3); }

:focus-visible {
    outline: var(--border-focus) solid var(--color-leitfarbe);
    outline-offset: 2px;
}

/* -- Buttons ------------------------------------------------------------ */

.button {
    display: inline-flex; align-items: center; gap: var(--space-2);
    font-family: var(--font-text); font-weight: 600; font-size: var(--step-body);
    padding: var(--space-3) var(--space-5);
    border: var(--border-funktional) solid transparent;
    border-radius: var(--radius-0);
    cursor: pointer; text-decoration: none;
    min-height: 44px;
    transition: background-color var(--motion-duration) ease, color var(--motion-duration) ease;
}
.button--primary { background: var(--color-leitfarbe); color: var(--color-weiss); }
.button--primary:hover { background: var(--color-leitfarbe-hover); color: var(--color-weiss); }
.button--secondary { background: var(--color-akzent); color: var(--color-tiefton); }
.button--secondary:hover { background: var(--color-akzent-hover); color: var(--color-tiefton); }
.button--small { padding: var(--space-2) var(--space-4); font-size: var(--step-small); min-height: 36px; }

.icon-button {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; background: transparent; border: var(--border-funktional) solid var(--color-border-funktional);
    color: var(--color-tiefton); cursor: pointer;
}
.icon-button:hover { background: var(--color-hover-flaeche); }

.textlink { color: var(--color-leitfarbe); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

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

.site-header {
    background: var(--color-grundton);
    border-bottom: var(--border-deko) solid var(--color-border-deko);
    position: sticky; top: 0; z-index: 40;
}
.site-header__row {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-5); padding-block: var(--space-4);
}
.wordmark { display: inline-flex; align-items: center; gap: var(--space-2); text-decoration: none; }
.wordmark__text { font-family: var(--font-display); font-weight: 800; font-size: 1.375rem; color: var(--color-tiefton); letter-spacing: -0.01em; }
.main-nav ul { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.main-nav a {
    display: inline-block; padding: var(--space-2) var(--space-1);
    color: var(--color-tiefton); text-decoration: none; font-weight: 500;
    border-bottom: var(--border-funktional) solid transparent;
}
.main-nav a:hover { color: var(--color-leitfarbe); }
.main-nav a[aria-current="page"] { border-bottom-color: var(--color-akzent); color: var(--color-leitfarbe); }
.nav-cta { flex-shrink: 0; }

@media (max-width: 47.99rem) {
    .site-header__row { flex-wrap: wrap; }
    .nav-cta { order: 3; width: 100%; justify-content: center; }
}

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

.site-footer { background: var(--color-tiefton); color: var(--color-grundton); margin-top: var(--space-9); }
.site-footer a { color: var(--color-leitfarbe-hell); }
.site-footer__grid {
    display: grid; gap: var(--space-6); padding-block: var(--space-8);
    grid-template-columns: 1fr;
}
@media (min-width: 48rem) {
    .site-footer__grid { grid-template-columns: 2fr 1fr; }
}
.site-footer__brand .wordmark__text { color: var(--color-grundton); }
.site-footer__brand p { color: var(--color-grundton); max-width: 34rem; }
.site-footer__nav ul { display: flex; flex-direction: column; gap: var(--space-2); }
.site-footer__meta { border-top: var(--border-deko) solid var(--color-footer-line); padding-block: var(--space-4) var(--space-6); }
.site-footer__meta p { color: var(--color-border-deko); }

/* -- Sections / Rhythm ----------------------------------------------------- */

.section { padding-block: var(--space-8); }
.section--tight { padding-block: var(--space-6); }

.grid-paper {
    background-image:
        linear-gradient(var(--color-border-deko) 1px, transparent 1px),
        linear-gradient(90deg, var(--color-border-deko) 1px, transparent 1px);
    background-size: 32px 32px;
}

/* Hero (Muster 1) */
.hero { padding-block: var(--space-8) var(--space-9); }
.hero__row {
    display: grid; gap: var(--space-7); align-items: center;
    grid-template-columns: 1fr;
}
@media (min-width: 60rem) {
    .hero__row { grid-template-columns: minmax(220px, 340px) 1fr; }
}
.hero__diagram { width: 100%; height: auto; color: var(--color-leitfarbe); }
.hero__diagram path {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    animation: deskvaro-draw 900ms ease forwards;
}
.hero__diagram path:nth-child(2) { animation-delay: 120ms; }
.hero__diagram path:nth-child(3) { animation-delay: 260ms; }
.hero__diagram path:nth-child(4) { animation-delay: 380ms; }
.hero__diagram circle { opacity: 0; animation: deskvaro-fade 400ms ease forwards; animation-delay: 500ms; }
@keyframes deskvaro-draw { to { stroke-dashoffset: 0; } }
@keyframes deskvaro-fade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .hero__diagram path { stroke-dashoffset: 0; animation: none; }
    .hero__diagram circle { opacity: 1; animation: none; }
}
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-5); margin-top: var(--space-6); }

/* Modul-Raster versetzt (Muster 2) */
.modul-raster { display: grid; gap: var(--space-6); }
.modul-raster__item { display: grid; grid-template-columns: 3rem 1fr; gap: var(--space-4); align-items: start; padding-block: var(--space-4); border-top: var(--border-deko) solid var(--color-border-deko); }
.modul-raster__item:first-child { border-top: none; }
.modul-raster__item svg { color: var(--color-leitfarbe); }
@media (min-width: 48rem) {
    .modul-raster { grid-template-columns: 1fr 1fr; column-gap: var(--space-7); }
    .modul-raster__item:nth-child(2) { border-top: none; }
}

/* Zweispaltig asymmetrisch (Muster 3) */
.split { display: grid; gap: var(--space-6); align-items: start; }
@media (min-width: 55rem) {
    .split { grid-template-columns: 1.6fr 1fr; }
    .split--reverse { grid-template-columns: 1fr 1.6fr; }
    .split--reverse > :first-child { order: 2; }
}
.split figure { margin: 0; border: var(--border-funktional) solid var(--color-border-funktional); padding: var(--space-4); background: var(--color-weiss); }

/* Eigene Blaupause-Diagramme (Abschnitt "Zeichnungen") */
.module-diagram { width: 100%; height: auto; }

/* Tabelle (Muster 4) */
.data-table { width: 100%; border-collapse: collapse; }
.data-table caption { text-align: left; font-weight: 600; margin-bottom: var(--space-3); }
.data-table th, .data-table td { text-align: left; padding: var(--space-3) var(--space-4); border-bottom: var(--border-deko) solid var(--color-border-deko); }
.data-table th { font-family: var(--font-display); font-weight: 700; border-bottom: var(--border-funktional) solid var(--color-border-funktional); hyphens: none; }
.data-table th[scope="row"] { width: 35%; }
.data-table td.num, .data-table th.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }

/* Key-Value-Tabellen (Preis, Systemvoraussetzungen): Label links, Wert rechts */
.data-table--kv th[scope="row"] { text-align: left; }
.data-table--kv td { text-align: right; }

/* Liste mit Trennlinien (Muster 5) */
.line-list { display: flex; flex-direction: column; }
.line-list > li, .line-list__item { padding-block: var(--space-5); border-top: var(--border-deko) solid var(--color-border-deko); }
.line-list > li:first-child, .line-list__item:first-child { border-top: none; padding-top: 0; }
.line-list__meta { display: block; margin-bottom: var(--space-1); }

/* Zitat-/Detailflaeche (Muster 6) */
.note-block {
    border: var(--border-funktional) solid var(--color-border-funktional);
    border-left-width: var(--space-2);
    border-left-color: var(--color-akzent);
    padding: var(--space-6);
    background: var(--color-weiss);
}
.note-block p { font-family: var(--font-display); font-weight: 600; font-size: var(--step-h3); line-height: 1.3; }

/* Modul-Kopfstreifen: konsistente farbliche Einleitung fuer jedes der
   vier Module auf funktionen.php. Bewusst als wiederkehrendes
   Struktur-/Orientierungselement gestaltet (wie Header/Footer), nicht
   als Sektions-Inhaltsmuster - der Inhalt darunter nutzt weiterhin je
   Modul ein unterschiedliches Sektionsmuster (Abschnitt 2.3). */
.module-heading {
    position: relative; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw; width: 100vw;
    background: var(--color-tiefton);
}
.module-heading .container { display: flex; align-items: center; gap: var(--space-4); padding-block: var(--space-5); }
.module-heading svg { color: var(--color-leitfarbe-hell); width: 40px; height: 40px; flex-shrink: 0; }
.module-heading h2 { color: var(--color-weiss); margin: 0; }
.module-heading + .section { padding-top: var(--space-6); }

/* CTA-Band (Muster 9) */
.cta-band { background: var(--color-leitfarbe); color: var(--color-weiss); }
.cta-band h2 { color: var(--color-weiss); }
.cta-band p { color: var(--color-on-leitfarbe-muted); }
.cta-band__inner { display: grid; gap: var(--space-6); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 55rem) { .cta-band__inner { grid-template-columns: 1fr 1fr; } }
.cta-band__field { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.cta-band__field input {
    flex: 1 1 14rem; min-height: 44px; padding: var(--space-3);
    border: var(--border-funktional) solid var(--color-weiss); background: var(--color-weiss);
    font-family: var(--font-text); font-size: var(--step-body);
}

/* Formularflaeche (Kontaktformular) */
.form-panel { border: var(--border-funktional) solid var(--color-border-funktional); background: var(--color-weiss); padding: var(--space-7); }
.form-panel--narrow { max-width: 24rem; }
.inline-form { display: inline; }
.link-button { background: none; border: none; padding: 0; cursor: pointer; font: inherit; }
.form-field { margin-bottom: var(--space-5); }
.form-field label { display: block; font-weight: 600; margin-bottom: var(--space-2); }
.form-field input, .form-field textarea {
    width: 100%; min-height: 44px; padding: var(--space-3);
    border: var(--border-funktional) solid var(--color-border-funktional);
    background: var(--color-grundton); font-family: var(--font-text); font-size: var(--step-body);
}
.form-field textarea { min-height: 9rem; resize: vertical; }
.form-field__hint { color: var(--color-text-sekundaer); margin-top: var(--space-1); }
.form-field--error input, .form-field--error textarea { border-color: var(--color-fehler); }
.form-field__error { color: var(--color-fehler); margin-top: var(--space-1); font-weight: 600; }

.honeypot { position: absolute; left: -9999px; top: -9999px; }

/* Alerts */
.alert { border: var(--border-funktional) solid; padding: var(--space-5); margin-bottom: var(--space-6); }
.alert h1, .alert h2 { margin-bottom: var(--space-2); }
.alert--success { border-color: var(--color-erfolg); background: var(--color-erfolg-bg); color: var(--color-erfolg); }
.alert--success h1, .alert--success h2 { color: var(--color-erfolg); }
.alert--warning { border-color: var(--color-warnung-text); background: var(--color-warnung-bg); color: var(--color-warnung-text); }
.alert--warning h1, .alert--warning h2 { color: var(--color-warnung-text); }
.alert--error { border-color: var(--color-fehler); background: var(--color-fehler-bg); color: var(--color-fehler); }
.alert--error h1, .alert--error h2 { color: var(--color-fehler); }
.alert p { color: var(--color-tiefton); }

/* Badges */
.badge { display: inline-block; padding: var(--space-1) var(--space-3); background: var(--color-akzent); color: var(--color-tiefton); font-weight: 600; font-size: var(--step-small); }

/* Systemvoraussetzungen etc. - Zweispaltig, Kurzfassung */
.kv-list { display: grid; grid-template-columns: 1fr; gap: var(--space-3); }
.kv-list__row { display: flex; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-2); border-bottom: var(--border-deko) solid var(--color-border-deko); }
.kv-list__row span:last-child { text-align: right; }

/* -- A11y widget ------------------------------------------------------- */

.a11y-widget { position: fixed; right: var(--space-5); bottom: var(--space-5); z-index: 60; }
.a11y-widget__toggle {
    width: 56px; height: 56px; background: var(--color-tiefton); color: var(--color-weiss);
    border: var(--border-funktional) solid var(--color-tiefton); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.a11y-widget__toggle:hover { background: var(--color-leitfarbe-hover); }
.a11y-widget__icon { width: 26px; height: 26px; }
.a11y-widget__panel {
    position: absolute; right: 0; bottom: 68px; width: min(20rem, 84vw);
    background: var(--color-weiss); border: var(--border-funktional) solid var(--color-tiefton);
    padding: var(--space-5);
}
.a11y-widget__panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-5); }
.a11y-widget__panel-head h2 { margin: 0; }
.a11y-widget__group { margin-bottom: var(--space-5); }
.a11y-widget__group:last-child { margin-bottom: 0; }
.a11y-widget__label { display: block; font-weight: 600; margin-bottom: var(--space-2); }
.a11y-widget__buttons { display: flex; flex-direction: column; gap: var(--space-2); align-items: stretch; }
.a11y-widget__value { text-align: center; font-family: var(--font-mono); }
@media (min-width: 26rem) {
    .a11y-widget__buttons { flex-direction: row; align-items: center; }
}
[aria-pressed="true"] { outline: var(--border-focus) solid var(--color-akzent); outline-offset: -3px; }

/* -- Utility spacing on last elements -- */
.section > .container > *:last-child { margin-bottom: 0; }
