/* ============================================================
   LogiBright — logibright.de · shared stylesheet · Design v2
   Static site, self-hosted, system font stack, no external assets.
   Semantic token system, light + dark theme (toggle via data-theme,
   default follows prefers-color-scheme). Palette swap = replace the
   marker-delimited token block below with a website/design/tokens-*.css
   variant. No raw color values below the END marker.
   Dark values appear twice by design (media query + explicit choice);
   website/design/contrast-check.py asserts both blocks stay identical.
   ============================================================ */

/* ==== DESIGN TOKENS v2 — BEGIN (palette: C mono) ==== */
:root {
  color-scheme: light;

  /* surfaces & text — strictly hue-free */
  --color-bg: #ffffff;
  --color-bg-muted: #f5f5f5;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #4a4a4a;
  --color-text-subtle: #5f5f5f;
  --color-border: #e4e4e4;
  --color-border-strong: #8a8a8a;

  /* brand roles — ink itself is the accent; underline carries link affordance */
  --color-accent: #1a1a1a;
  --color-accent-hover: #000000;
  --color-accent-contrast: #ffffff;
  --color-link: #1a1a1a;
  --focus: #1a1a1a;

  /* ink band — dark in BOTH themes (header, Start hero) */
  --ink-bg: #0d0d0d;
  --ink-raised: #1c1c1c;
  --ink-text: #ededed;
  --ink-text-muted: #ababab;
  --ink-border: rgba(237, 237, 237, 0.16);
  --ink-accent: #ffffff;

  /* status (muted; currently placeholder styling only) */
  --status-ok: #2e7d4f;
  --status-warn: #b45309;
  --status-warn-bg: #fff7e0;
  --status-warn-text: #6d4204;
  --status-danger: #b3261e;

  /* theme-driven icon visibility (moon shown in light = switch to dark) */
  --icon-sun: none;
  --icon-moon: block;

  /* rhythm & type scale (identical across palettes) */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-6: 3rem;
  --space-8: 4rem;
  --space-10: 5rem;
  --font-display: clamp(2.3rem, 1.5rem + 3vw, 3.6rem);
  --font-h1: clamp(2rem, 1.4rem + 2vw, 2.75rem);
  --font-h2: clamp(1.5rem, 1.3rem + 0.8vw, 1.9rem);
  --font-h3: 1.2rem;
  --radius: 8px;
  --wrap: 68rem;
  --prose: 42rem;
}

/* dark via system preference (also no-JS visitors) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --color-bg: #121212;
    --color-bg-muted: #181818;
    --color-surface: #1e1e1e;
    --color-text: #e8e8e8;
    --color-text-muted: #b4b4b4;
    --color-text-subtle: #999999;
    --color-border: #2e2e2e;
    --color-border-strong: #6f6f6f;
    --color-accent: #f2f2f2;
    --color-accent-hover: #ffffff;
    --color-accent-contrast: #111111;
    --color-link: #e8e8e8;
    --focus: #ffffff;
    --ink-bg: #0d0d0d;
    --ink-raised: #1c1c1c;
    --ink-text: #ededed;
    --ink-text-muted: #ababab;
    --ink-border: rgba(237, 237, 237, 0.16);
    --ink-accent: #ffffff;
    --status-ok: #4caf7d;
    --status-warn: #d97706;
    --status-warn-bg: #3a2c10;
    --status-warn-text: #f2cd8a;
    --status-danger: #e5736b;
    --icon-sun: block;
    --icon-moon: none;
  }
}

/* dark via explicit toggle choice (values identical to the block above) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #121212;
  --color-bg-muted: #181818;
  --color-surface: #1e1e1e;
  --color-text: #e8e8e8;
  --color-text-muted: #b4b4b4;
  --color-text-subtle: #999999;
  --color-border: #2e2e2e;
  --color-border-strong: #6f6f6f;
  --color-accent: #f2f2f2;
  --color-accent-hover: #ffffff;
  --color-accent-contrast: #111111;
  --color-link: #e8e8e8;
  --focus: #ffffff;
  --ink-bg: #0d0d0d;
  --ink-raised: #1c1c1c;
  --ink-text: #ededed;
  --ink-text-muted: #ababab;
  --ink-border: rgba(237, 237, 237, 0.16);
  --ink-accent: #ffffff;
  --status-ok: #4caf7d;
  --status-warn: #d97706;
  --status-warn-bg: #3a2c10;
  --status-warn-text: #f2cd8a;
  --status-danger: #e5736b;
  --icon-sun: block;
  --icon-moon: none;
}
/* ==== DESIGN TOKENS v2 — END ==== */

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
}

h1, h2, h3 {
  color: var(--color-text);
  line-height: 1.18;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 { font-size: var(--font-h1); font-weight: 750; }
h2 { font-size: var(--font-h2); margin-top: 2em; }
h3 { font-size: var(--font-h3); margin-top: 1.6em; line-height: 1.3; }

.page-header h1 { margin-top: 0; }
h2:first-child, .page-header + h2 { margin-top: 0; }

p { margin: 0 0 1em; }

ul, ol { margin: 0 0 1.25em; padding-left: 1.35rem; }
li { margin: 0.4em 0; }

a { color: var(--color-link); text-decoration: underline; text-underline-offset: 0.15em; }
a:hover { color: var(--color-text); }

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

h2[id] { scroll-margin-top: 1.5rem; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.wrap.prose { max-width: calc(var(--prose) + 2.5rem); }

.prose-max { max-width: var(--prose); }

.lead {
  font-size: 1.15rem;
  color: var(--color-text);
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  margin: 0 0 var(--space-2);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* inline icons (Lucide, ISC — see website/design/ICONS.md) */
.icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink-raised);
  color: var(--ink-text);
  padding: 0.7rem 1.1rem;
  border-radius: 0 0 6px 0;
  text-decoration: none;
}

.skip-link:focus { left: 0; }

/* ---------- Header & navigation (ink band, both themes) ---------- */

.site-header {
  background: var(--ink-bg);
  border-bottom: 1px solid var(--ink-border);
}

.site-header :focus-visible { outline-color: var(--ink-accent); }

.header-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 4.25rem;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.brand {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink-text);
  text-decoration: none;
  margin-right: auto;
  padding: 0.4rem 0;
}

.brand:hover { color: #ffffff; }

/* Theme toggle (revealed by JS; hidden attribute wins without JS) */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--ink-border);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-text);
  cursor: pointer;
}

.theme-toggle[hidden] { display: none; }

.theme-toggle:hover { background: var(--ink-raised); }

.theme-toggle .icon-sun { display: var(--icon-sun); }
.theme-toggle .icon-moon { display: var(--icon-moon); }

/* Mobile toggle: visually hidden but focusable checkbox (CSS-only pattern) */
.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.nav-toggle-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--ink-border);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.nav-toggle-bar {
  position: relative;
  display: block;
  width: 1.25rem;
  height: 2px;
  background: var(--ink-text);
}

.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: "";
  position: absolute;
  left: 0;
  width: 1.25rem;
  height: 2px;
  background: var(--ink-text);
  transition: transform 0.15s ease;
}

.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after { top: 6px; }

#nav-toggle:checked ~ .nav-toggle-label .nav-toggle-bar { background: transparent; }
#nav-toggle:checked ~ .nav-toggle-label .nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
#nav-toggle:checked ~ .nav-toggle-label .nav-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

#nav-toggle:focus-visible ~ .nav-toggle-label {
  outline: 3px solid var(--ink-accent);
  outline-offset: 2px;
}

/* Mobile nav (default, mobile-first) */
.site-nav {
  display: none;
  flex-basis: 100%;
  border-top: 1px solid var(--ink-border);
  margin-top: 0.5rem;
}

#nav-toggle:checked ~ .site-nav { display: block; }

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0 1rem;
}

.nav-list li { margin: 0; }

.nav-list a {
  display: block;
  padding: 0.65rem 0.25rem;
  font-weight: 600;
  color: var(--ink-text);
  text-decoration: none;
}

.nav-list a:hover { color: #ffffff; text-decoration: underline; text-underline-offset: 6px; }

.nav-list a[aria-current="page"],
.nav-list > li.is-active > a {
  color: var(--ink-text);
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--ink-accent);
}

.sub-nav {
  list-style: none;
  margin: 0 0 0.25rem;
  padding: 0 0 0.25rem 1rem;
  border-left: 2px solid var(--ink-border);
}

.sub-nav a { font-weight: 400; padding: 0.45rem 0.5rem; color: var(--ink-text-muted); }
.sub-nav a:hover { color: var(--ink-text); }

/* Desktop nav */
@media (min-width: 760px) {
  .nav-toggle, .nav-toggle-label { display: none; }

  .theme-toggle { order: 99; margin-left: 0.35rem; }

  .site-nav {
    display: block;
    flex-basis: auto;
    border-top: 0;
    margin-top: 0;
  }

  .nav-list {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
  }

  .nav-list > li { position: relative; }

  .nav-list > li > a { padding: 1.35rem 0.85rem; }

  .has-sub > a::after {
    content: "";
    display: inline-block;
    margin-left: 0.4em;
    border: 4px solid transparent;
    border-top-color: currentColor;
    transform: translateY(2px);
  }

  .sub-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 20;
    min-width: 21rem;
    margin: 0;
    padding: 0.4rem 0;
    background: var(--ink-raised);
    border: 1px solid var(--ink-border);
    border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  }

  .has-sub:hover .sub-nav,
  .has-sub:focus-within .sub-nav { display: block; }

  .sub-nav a { padding: 0.55rem 1.1rem; color: var(--ink-text); }

  .sub-nav a:hover,
  .sub-nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.08); color: #ffffff; }
}

/* ---------- Buttons & CTA ---------- */

.btn {
  display: inline-block;
  background: var(--color-accent);
  border: 1px solid var(--color-accent);
  color: var(--color-accent-contrast);
  font-weight: 650;
  text-decoration: none;
  padding: 0.85rem 1.5rem;
  border-radius: 6px;
}

.btn:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: var(--color-accent-contrast);
}

.btn-outline {
  display: inline-block;
  border: 2px solid var(--color-link);
  color: var(--color-link);
  background: transparent;
  font-weight: 600;
  text-decoration: none;
  padding: 0.8rem 1.45rem;
  border-radius: 6px;
}

.btn-outline:hover { background: var(--color-bg-muted); color: var(--color-text); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin: 1.6rem 0 0.5rem;
}

.cta-panel {
  background: var(--color-bg-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.9rem 1.9rem 1.6rem;
  margin-top: var(--space-6);
}

.cta-panel h2 { margin-top: 0; }
.cta-panel p:last-child { margin-bottom: 0; }
.cta-panel .cta-row:first-child { margin-top: 0; }

.cta-note { color: var(--color-text-muted); margin-top: 1rem; }

/* ---------- Sections (start page bands) ---------- */

.section { padding: var(--space-6) 0; }

.section-alt {
  background: var(--color-bg-muted);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.section-tint {
  background: var(--color-bg-muted);
  border-top: 1px solid var(--color-border);
}

/* ---------- Hero (ink band, contiguous with header) ---------- */

.hero {
  background: var(--ink-bg);
  color: var(--ink-text);
  padding: var(--space-8) 0 var(--space-8);
}

.hero h1 {
  color: var(--ink-text);
  font-size: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5em;
  max-width: 16ch;
}

.hero .eyebrow { color: var(--ink-text-muted); }

.hero-lead { font-size: 1.25rem; color: var(--ink-text); margin-bottom: 0.75rem; }

.hero-text { max-width: 34rem; font-size: 1.1rem; color: var(--ink-text-muted); }

.hero :focus-visible { outline-color: var(--ink-accent); }

.hero-inner { display: grid; gap: var(--space-4); }

.hero-art { display: none; }

@media (min-width: 760px) {
  .section { padding: var(--space-8) 0; }
  .hero { padding: var(--space-10) 0; }

  .hero-inner {
    grid-template-columns: minmax(0, 6.5fr) minmax(0, 5.5fr);
    align-items: center;
    gap: var(--space-6);
  }

  .hero-art {
    display: block;
    pointer-events: none;
    color: var(--ink-text);
  }

  .hero-art svg { width: 100%; height: auto; display: block; }
}

.hero-art .plexus-edges { stroke: currentColor; opacity: 0.14; }
.hero-art .plexus-nodes { fill: currentColor; opacity: 0.32; }
.hero-art .glow-edges { stroke: var(--ink-accent); opacity: 0.85; }
.hero-art .glow-nodes { fill: var(--ink-accent); opacity: 0.95; }

.duo-grid {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 760px) {
  .duo-grid { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
  .duo-grid h2 { margin-top: 0; }
}

.page-header { padding: var(--space-8) 0 0.25rem; }

.page-header h1 { font-size: var(--font-h1); }

main > .wrap.prose:last-child,
main > .wrap:last-child { padding-bottom: var(--space-8); }

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  margin-top: 1.75rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
}

.card:hover {
  border-color: var(--color-border-strong);
  box-shadow: 0 8px 24px rgba(10, 20, 26, 0.10);
}

.card-num {
  display: block;
  font-size: 0.9rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  color: var(--color-text-subtle);
  font-variant-numeric: tabular-nums;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-icon {
  width: 1.4rem;
  height: 1.4rem;
  color: var(--color-text-subtle);
}

.card h2, .card h3 { margin: 0; font-size: 1.15rem; }

.card p { margin: 0; }

.card h2 a, .card h3 a {
  color: var(--color-link);
  text-decoration: none;
}

.card h2 a:hover, .card h3 a:hover { text-decoration: underline; color: var(--color-text); }

.card .arrow-link { margin-top: auto; padding-top: 0.4rem; }

/* ---------- Misc content ---------- */

.arrow-link a { font-weight: 600; }

.contact-list {
  list-style: none;
  padding: 0;
}

.contact-list li { margin: 0.5em 0; }

.contact-list .icon {
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.18em;
  margin-right: 0.45em;
  color: var(--color-text-subtle);
}

.site-footer .icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  margin-right: 0.4em;
  color: var(--color-text-subtle);
}

.article-footer {
  border-top: 1px solid var(--color-border);
  margin-top: 2.75rem;
  padding-top: 1.25rem;
  color: var(--color-text-muted);
}

/* Internal placeholder (TBD blocks kept visible on legal drafts) */
.placeholder-internal {
  display: inline-block;
  background: var(--status-warn-bg);
  border: 2px dashed var(--status-warn);
  border-radius: 4px;
  color: var(--status-warn-text);
  padding: 0.05em 0.4em;
}

.placeholder-block {
  display: block;
  padding: 0.9rem 1.1rem;
  margin: 1rem 0 1.25rem;
}

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

.site-footer {
  background: var(--color-bg-muted);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.footer-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
  padding-top: var(--space-6);
  padding-bottom: var(--space-4);
}

.footer-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.4rem;
}

.footer-tagline { color: var(--color-text-subtle); }

.footer-heading {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-text);
  margin: 0 0 0.8rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li { margin: 0.45em 0; }

.site-footer a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.site-footer a:hover { color: var(--color-text); text-decoration: underline; }

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--color-border);
  padding-top: 1.2rem;
  padding-bottom: var(--space-4);
}

.legal-nav {
  display: flex;
  gap: 1.5rem;
}

.legal-nav li { margin: 0; }

.footer-copyright { color: var(--color-text-subtle); margin: 0; }

/* ---------- Print ---------- */

@media print {
  :root {
    --color-bg: #ffffff;
    --color-bg-muted: #ffffff;
    --color-surface: #ffffff;
    --color-text: #111111;
    --color-text-muted: #333333;
    --color-text-subtle: #444444;
    --color-border: #bbbbbb;
    --color-border-strong: #888888;
    --color-link: #111111;
    --ink-bg: #ffffff;
    --ink-raised: #ffffff;
    --ink-text: #111111;
    --ink-text-muted: #333333;
    --ink-border: #bbbbbb;
    --ink-accent: #111111;
  }

  .theme-toggle, .nav-toggle-label, .hero-art, .skip-link { display: none !important; }
  .site-header, .hero { border-bottom: 1px solid #bbbbbb; }
}

/* ---------- Reduced motion ---------- */

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