/* ============================================================
 * AUFFI · SHARED MARKETING TOPBAR + FOOTER · CALM FRESH
 * ============================================================
 * Used by impressum/, datenschutz/, download/. The SPA at
 * viewer/index.html ships an identical token-set + components via
 * Vite (viewer/src/styles.css). Keep both in sync when changing
 * visual rules; HTML class names are stable across the SPA + the
 * static-page set so the same selectors apply.
 *
 * Aesthetic: emerald/mint, rounded corners, soft card shadows,
 * mono eyebrow labels kept. Fonts are self-hosted under /fonts/. */

/* ── @font-face ──────────────────────────────────────────────── */
@font-face {
  font-family: "Plex Sans";
  src: url("/fonts/IBMPlexSans-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Plex Sans";
  src: url("/fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("/fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("/fonts/IBMPlexMono-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

/* ── Design tokens ───────────────────────────────────────────── */
:root {
  --paper: #f6faf8;
  --surface: #ffffff;
  --ink: #0f1f1a;
  --muted: #5b6b64;
  --brand: #10b981;
  --brand-2: #34d399;
  --brand-strong: #047857;
  --ink-on-brand: #06231b;
  --line: #e3ece8;
  --focus: #10b981;
  --radius-card: 16px;
  --radius-input: 12px;
  --radius-pill: 999px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15,31,26,0.05), 0 2px 8px rgba(16,185,129,0.06);
  --shadow-lift: 0 4px 12px rgba(15,31,26,0.08), 0 8px 24px rgba(16,185,129,0.10);

  /* legacy bridges */
  --bg: var(--paper);
  --text: var(--ink);
  --card-bg: var(--surface);
  --accent: var(--brand-strong);
  --amber: var(--brand-strong);
  --cyan: var(--brand-strong);

  /* kept for components that reference them directly */
  --ink-soft: var(--muted);
  --edge: var(--line);
  --accent-hover: var(--brand);
  --amber-ink: var(--ink-on-brand);
  --border: var(--line);
  --text-secondary: var(--muted);
  --error: #a83b3b;

  --font-sans: "Plex Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font: var(--font-sans);
  --topbar-height: 56px;
  --footer-height: 48px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0c1714;
    --surface: #11201c;
    --ink: #e8f1ec;
    --muted: #9fb2aa;
    --brand: #34d399;
    --brand-2: #10b981;
    --brand-strong: #34d399;
    --ink-on-brand: #06231b;
    --line: #20312b;
    --focus: #34d399;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-lift: 0 6px 20px rgba(0,0,0,0.5);
  }
}

body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  margin: 0;
  padding-top: calc(var(--topbar-height) + 1.5rem);
  padding-bottom: calc(var(--footer-height) + 1rem);
  line-height: 1.55;
}

a {
  color: var(--brand-strong);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 100ms ease;
}
a:hover { border-bottom-color: var(--brand-strong); }

/* ── Topbar — frosted surface, 1px line border, pill buttons ── */
#top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  gap: 1rem;
}

.topbar-wordmark {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  background: var(--brand-strong);
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  border-bottom: none;
  transition: background 120ms ease, transform 120ms ease;
}
.topbar-wordmark:hover {
  border-bottom: none;
  background: var(--brand);
  color: var(--ink-on-brand);
  transform: translateY(-1px);
}

.topbar-tagline {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  text-align: left;
  padding-left: 0.5rem;
}
@media (max-width: 580px) {
  .topbar-tagline { display: none; }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}

/* Topbar buttons: ghost default, ALL CAPS mono tracked, pill corners.
   Three variants: default (ghost), primary (emerald-filled), coffee (emerald). */
.topbar-btn {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.4375rem 0.875rem;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
  background: transparent;
  color: var(--ink);
  -webkit-appearance: none;
  outline: none;
}
.topbar-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.topbar-btn:hover {
  background: var(--surface);
  border-color: var(--brand);
  color: var(--brand-strong);
  transform: translateY(-1px);
}

.topbar-btn-coffee {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.topbar-btn-coffee:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--ink-on-brand);
  box-shadow: var(--shadow-lift);
}

.topbar-btn-primary {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.topbar-btn-primary:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--ink-on-brand);
  box-shadow: var(--shadow-lift);
}

.topbar-btn-label { display: inline; }

@media (max-width: 380px) {
  .topbar-btn-label { display: none; }
  .topbar-btn { padding: 0.4375rem 0.5rem; }
}

@media (max-width: 720px) {
  #topbar-download .topbar-btn-label,
  #topbar-coffee .topbar-btn-label { display: none; }
}

/* ── Notch CTA — emerald pill tab hanging from topbar ── */
.topbar-notch {
  position: fixed;
  top: var(--topbar-height);
  left: 50%;
  transform: translateX(-50%);
  z-index: 501;
  height: 32px;
  padding: 0 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  background: var(--brand-strong);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  border-bottom-left-radius: var(--radius-pill);
  border-bottom-right-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 150ms ease, background 120ms ease, box-shadow 150ms ease;
  -webkit-appearance: none;
  outline: none;
}
.topbar-notch::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1em;
  margin-right: 0.25em;
  vertical-align: -0.12em;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.7);
  line-height: 1;
}
.topbar-notch:hover {
  background: var(--brand);
  transform: translateX(-50%) translateY(3px);
  box-shadow: var(--shadow-lift);
}
.topbar-notch:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
@media (max-width: 480px) {
  .topbar-notch {
    height: 30px;
    padding: 0 0.875rem;
    font-size: 0.625rem;
  }
}

/* ── Footer — slim mono band, surface bg, 1px line ── */
#site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: var(--footer-height);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 0.5rem 1.5rem;
  background: var(--surface);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
}

#site-footer .legal-links {
  white-space: nowrap;
}

#site-footer a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: color 100ms ease, border-color 100ms ease;
}
#site-footer a:hover {
  color: var(--brand-strong);
  border-bottom-color: var(--brand-strong);
}
#site-footer a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ── Accessibility utility — visually-hidden text for screen readers
     + SEO crawlers; standard a11y pattern. Used by download/index.html
     ("Pakete"-h2) among others. ── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Marketing-page content typography. Pages that import this CSS
   (impressum/, datenschutz/, download/) render long-form prose
   in plain <h1>..<h3>, <p>, <ul>, <code>. Typography conventions:
   emerald rounded-bar marker on headings, mono code,
   tabular-aligned list bullets via custom counter-style.
   ============================================================ */
main.container {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

h1, h2, h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.005em;
}
h1 { font-size: 1.875rem; margin-bottom: 0.625rem; }
h2 { font-size: 1.125rem; margin-top: 2.25rem; margin-bottom: 0.625rem; }
h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1em;
  margin-right: 0.5em;
  vertical-align: -0.12em;
  border-radius: var(--radius-pill);
  background: var(--brand);
  font-weight: 400;
}
h3 { font-size: 1rem; margin-top: 1.25rem; margin-bottom: 0.375rem; color: var(--muted); font-weight: 600; }
h3.platform-heading {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  border-top: 1px solid var(--line);
  padding-top: 0.875rem;
  margin-top: 2rem;
}

p, li { font-size: 0.9375rem; color: var(--ink); line-height: 1.6; }
p { margin: 0 0 0.875rem; }
p.lead { font-size: 1.0625rem; color: var(--ink); }
p.hint {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.875rem;
  margin: 1.25rem 0;
}

ul, ol { margin: 0 0 1.25rem 1.25rem; padding: 0; }
li { margin-bottom: 0.375rem; }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.0625rem 0.375rem;
  border-radius: var(--radius-sm);
}

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

section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
section:first-of-type { border-top: none; padding-top: 0; }

/* ============================================================
   /download/ — package list. The HTML uses the same <ul class=
   "download-list"> / <li class="download-item"> + .download-btn
   structure across Windows + Linux blocks.
   ============================================================ */
.download-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  gap: 0.875rem;
}
.download-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 150ms ease, transform 150ms ease;
}
.download-item:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}
.download-meta {
  flex: 1;
}
.download-meta h3 {
  margin: 0 0 0.375rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}
.download-meta p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
}
.download-meta .size {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}
.download-btn {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.5625rem 1.125rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--brand-strong);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  align-self: center;
  box-shadow: var(--shadow-sm);
  transition: background 120ms ease, box-shadow 150ms ease, transform 120ms ease;
}
.download-btn:hover {
  background: var(--brand);
  color: var(--ink-on-brand);
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
  border-bottom: none;
}
.download-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.download-count {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 0.375rem;
}

/* /download/ release-notes section: emerald rounded border-left */
.release-list { list-style: none; margin: 0; padding: 0; }
.release-list li {
  padding: 0.375rem 0 0.375rem 1.5rem;
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  margin-bottom: 0.625rem;
  font-size: 0.9375rem;
}

/* Numeric prefix on h3 release headings */
.release-notes h3 {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin-top: 1.5rem;
  margin-bottom: 0.625rem;
  text-transform: none;
}
.release-notes h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1em;
  margin-right: 0.5em;
  vertical-align: -0.12em;
  border-radius: var(--radius-pill);
  background: var(--brand);
}

@media (max-width: 580px) {
  .download-item { flex-direction: column; }
  .download-btn { align-self: flex-start; }
}

/* Dark-mode AA contrast: brand-background elements with white text. */
@media (prefers-color-scheme: dark) {
  .topbar-wordmark { color: var(--ink-on-brand); }
  .topbar-btn-coffee { color: var(--ink-on-brand); }
  .topbar-btn-primary { color: var(--ink-on-brand); }
  .topbar-notch { color: var(--ink-on-brand); }
  .download-btn { color: var(--ink-on-brand); }
}
