/* ============================================================
   ThinForge — Dokumentation
   Gemeinsames Stylesheet für Hub + Themen-Unterseiten.
   Design-Tokens, Navigation und Footer sind aus index.html
   übernommen (Doku-Nav bewusst ohne den Architektur-Punkt);
   darunter folgt das Doku-spezifische Layout
   (Seitenleiste + Inhalt).
   ============================================================ */

:root {
  /* Surfaces */
  --bg-0: #0a0f17;
  --bg-1: #10171f;
  --bg-2: #161e29;
  --bg-card: #1a232f;

  /* Brand — exakt aus thinforge-logo.svg übernommen */
  --brand-blue:        #0a69a4;
  --brand-blue-light:  #1a85c8;
  --brand-blue-deep:   #074d7a;
  --brand-blue-glow:   rgba(10, 105, 164, 0.20);

  --brand-green:       #68a046;
  --brand-green-light: #84bf61;
  --brand-green-deep:  #4c7d31;
  --brand-green-glow:  rgba(104, 160, 70, 0.22);

  /* Alias-Tokens ("forge" = Akzent-Grün, "steel" = Brand-Blau) */
  --forge:        var(--brand-green);
  --forge-bright: var(--brand-green-light);
  --forge-deep:   var(--brand-green-deep);
  --forge-glow:   var(--brand-green-glow);
  --steel:        var(--brand-blue);
  --steel-light:  var(--brand-blue-light);
  --steel-glow:   var(--brand-blue-glow);

  /* Text */
  --t-primary: #eef0f5;
  --t-body: #b8bfcc;
  --t-secondary: #8089a0;
  --t-muted: #545d72;

  /* Lines */
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --line-forge: rgba(104, 160, 70, 0.36);
  --line-steel: rgba(10, 105, 164, 0.34);

  /* Type */
  --f-display: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --f-body:    -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --f-mono:    ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --f-serif:   ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, serif;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--f-body);
  background: var(--bg-0);
  color: var(--t-body);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* subtle ambient glow */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    radial-gradient(ellipse 900px 600px at 85% -10%, rgba(104, 160, 70, 0.08), transparent 60%),
    radial-gradient(ellipse 700px 500px at -10% 35%, rgba(10, 105, 164, 0.10), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

main, header, footer { position: relative; z-index: 2; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 720px) { .container { padding: 0 20px; } }

a { color: inherit; }

/* ========================= Navigation ========================= */
.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(11, 14, 21, 0.78);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand { display: flex; align-items: center; text-decoration: none; height: 100%; }
.brand-logo { display: block; height: 38px; width: auto; }
@media (max-width: 720px) { .brand-logo { height: 32px; } }

.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-link {
  color: var(--t-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color .18s;
}
.nav-link:hover { color: var(--t-primary); }
.nav-link.is-current { color: var(--forge-bright); }
.nav-cta {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--t-primary);
  padding: 10px 18px;
  border-radius: var(--r-sm);
  font-family: var(--f-mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all .18s;
  white-space: nowrap;
}
.nav-cta:hover {
  border-color: var(--forge);
  color: var(--forge-bright);
  background: rgba(104, 160, 70, 0.08);
}
.nav-lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 14px;
}
.nav-lang a, .nav-lang span {
  text-decoration: none;
  color: var(--t-muted);
  padding: 4px 6px;
  border-radius: 3px;
  transition: color .18s, background .18s;
}
.nav-lang a:hover { color: var(--t-primary); }
.nav-lang .nav-lang-active {
  color: var(--forge-bright);
  background: rgba(104, 160, 70, 0.10);
}
.nav-lang-sep { color: var(--line-strong); padding: 0; }
/* Mobile-Navigation (Hamburger) */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--t-primary);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  margin-left: 4px;
  cursor: pointer;
}
.nav-toggle svg { display: block; }
@media (max-width: 860px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: rgba(11, 14, 21, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    padding: 8px 32px 16px;
  }
  .nav-links.is-open { display: flex; }
  .nav-links .nav-link { padding: 12px 0; width: 100%; font-size: 15px; }
  .nav-toggle { display: inline-flex; align-items: center; }
  .nav-cta { display: none; }
}

/* ========================= Buttons ========================= */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px;
  border-radius: var(--r-sm);
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 14.5px;
  text-decoration: none;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: all .18s;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--forge);
  color: #0a1a02;
  border-color: var(--forge);
  box-shadow: 0 6px 22px rgba(104, 160, 70, 0.28);
}
.btn-primary:hover {
  background: var(--forge-bright);
  border-color: var(--forge-bright);
  transform: translateY(-1px);
  box-shadow: 0 0 0 6px var(--forge-glow), 0 10px 26px rgba(104, 160, 70, 0.35);
}
.btn-ghost {
  background: transparent;
  color: var(--t-primary);
  border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--forge); color: var(--forge-bright); }
.btn svg { transition: transform .18s; }
.btn:hover svg { transform: translateX(3px); }

/* ========================= Eyebrow / titles ========================= */
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--forge);
  font-weight: 600;
  margin-bottom: 22px;
}
.eyebrow::before { content: ''; width: 26px; height: 1px; background: var(--forge); }

/* ============================================================
   DOKU-HUB (dokumentation.html)
   ============================================================ */
.doc-hero { padding: 84px 0 24px; position: relative; }
.doc-hero h1 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--t-primary);
  margin-bottom: 20px;
  max-width: 18ch;
}
.doc-hero h1 .accent {
  background: linear-gradient(180deg, var(--forge-bright) 0%, var(--forge) 70%, var(--forge-deep) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.doc-hero-lead {
  font-size: 18px;
  color: var(--t-body);
  max-width: 640px;
  line-height: 1.55;
}

.doc-groups { padding: 28px 0 88px; display: flex; flex-direction: column; gap: 46px; }
.doc-group-title {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--t-secondary);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.doc-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 900px) { .doc-tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .doc-tiles { grid-template-columns: 1fr; } }

.doc-tile {
  display: block;
  text-decoration: none;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 22px 22px 20px;
  transition: border-color .18s, transform .18s, background .18s;
  position: relative;
}
.doc-tile:hover {
  border-color: var(--line-forge);
  transform: translateY(-2px);
  background: #1d2733;
}
.doc-tile-head {
  display: flex; align-items: center; gap: 11px;
  margin-bottom: 10px;
}
.doc-tile-num {
  font-family: var(--f-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--forge);
  border: 1px solid var(--line-forge);
  border-radius: 5px;
  padding: 3px 7px;
  letter-spacing: 0.02em;
}
.doc-tile h3 {
  font-family: var(--f-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--t-primary);
  letter-spacing: -0.01em;
}
.doc-tile p { font-size: 14.5px; color: var(--t-secondary); line-height: 1.5; }
.doc-tile-arrow { color: var(--forge); margin-top: 14px; font-family: var(--f-mono); font-size: 13px; }

/* ============================================================
   DOKU-UNTERSEITE (Seitenleiste + Inhalt)
   ============================================================ */
.doc-layout {
  display: grid;
  grid-template-columns: 244px 1fr;
  gap: 52px;
  align-items: start;
  padding: 40px 0 80px;
}
@media (max-width: 920px) { .doc-layout { grid-template-columns: 1fr; gap: 28px; } }

/* Sidebar */
.doc-sidebar { position: sticky; top: 92px; align-self: start; }
@media (max-width: 920px) { .doc-sidebar { position: static; top: auto; } }
.doc-sidebar-title {
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--t-muted);
  margin: 0 0 14px 12px;
}
.doc-nav-group { margin-bottom: 18px; }
.doc-nav-group > span {
  display: block;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--t-muted);
  margin: 0 0 6px 12px;
}
.doc-nav a {
  display: block;
  text-decoration: none;
  color: var(--t-secondary);
  font-size: 14px;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  border-left: 2px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.doc-nav a:hover { color: var(--t-primary); background: rgba(255,255,255,0.03); }
.doc-nav a.is-active {
  color: var(--forge-bright);
  background: rgba(104, 160, 70, 0.08);
  border-left-color: var(--forge);
  font-weight: 600;
}
@media (max-width: 920px) {
  .doc-nav-wrap {
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 14px 8px;
  }
}

/* Content column */
.doc-main { min-width: 0; max-width: 780px; }
.breadcrumb {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--t-muted);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--t-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--forge-bright); }
.breadcrumb .sep { padding: 0 8px; color: var(--line-strong); }

.doc-content h1 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--t-primary);
  margin-bottom: 14px;
}
.doc-lead {
  font-size: 18px;
  color: var(--t-body);
  line-height: 1.55;
  margin-bottom: 12px;
}
.doc-content h2 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 23px;
  letter-spacing: -0.015em;
  color: var(--t-primary);
  margin: 44px 0 14px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.doc-content h3 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 16.5px;
  color: var(--t-primary);
  margin: 26px 0 8px;
}
.doc-content p { color: var(--t-body); margin-bottom: 14px; line-height: 1.62; }
.doc-content strong { color: var(--t-primary); font-weight: 600; }
.doc-content a { color: var(--forge-bright); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .15s; }
.doc-content a:hover { border-bottom-color: var(--forge); }

.doc-content ul, .doc-content ol { margin: 0 0 16px; padding-left: 22px; }
.doc-content li { color: var(--t-body); margin-bottom: 7px; line-height: 1.55; }
.doc-content li::marker { color: var(--forge); }

.doc-content code {
  font-family: var(--f-mono);
  font-size: 0.86em;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.5px 6px;
  color: var(--steel-light);
}
.doc-content pre {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 18px;
}
.doc-content pre code {
  background: none; border: none; padding: 0;
  color: var(--t-body);
  font-size: 13px;
  line-height: 1.55;
}

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--r-md); }
.doc-content table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 420px; }
.doc-content th, .doc-content td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc-content thead th {
  background: var(--bg-2);
  color: var(--t-primary);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.02em;
}
.doc-content tbody tr:last-child td { border-bottom: none; }
.doc-content td code { white-space: nowrap; }

/* Callout / note */
.note {
  border-left: 3px solid var(--forge);
  background: rgba(104, 160, 70, 0.07);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 14px 18px;
  margin: 0 0 18px;
  color: var(--t-body);
  font-size: 14.5px;
}
.note strong { color: var(--forge-bright); }
.note.note-steel { border-left-color: var(--steel); background: rgba(10, 105, 164, 0.10); }
.note.note-steel strong { color: var(--steel-light); }

/* Screenshot figure */
.doc-figure {
  margin: 6px 0 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-1);
}
.doc-figure a {
  display: block;
  line-height: 0;
  border-bottom: none;
  cursor: zoom-in;
}
.doc-figure a:hover { border-bottom: none; }
.doc-figure img {
  display: block;
  width: 100%;
  height: auto;
}
.doc-figure figcaption {
  padding: 10px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--t-secondary);
  background: var(--bg-2);
  border-top: 1px solid var(--line);
}

/* Pager (prev / next) */
.doc-pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.doc-pager a {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 18px;
  min-width: 200px;
  transition: border-color .18s, background .18s;
}
.doc-pager a:hover { border-color: var(--line-forge); background: rgba(104,160,70,0.05); }
.doc-pager a.next { text-align: right; margin-left: auto; }
.doc-pager .pager-dir { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--t-muted); }
.doc-pager .pager-label { color: var(--t-primary); font-weight: 600; font-size: 15px; }

/* ========================= Footer ========================= */
.footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 32px;
  margin-top: 64px;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--t-muted);
  font-family: var(--f-mono);
  letter-spacing: 0.04em;
  flex-wrap: wrap;
  gap: 14px;
}
.footer-links { display: flex; gap: 24px; margin-bottom: 18px; flex-wrap: wrap; }
.footer-links a {
  font-family: var(--f-mono);
  font-size: 12.5px;
  color: var(--t-secondary);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color .18s;
}
.footer-links a:hover { color: var(--forge-bright); }
.footer-tagline { font-family: var(--f-serif); font-style: italic; color: var(--forge); font-size: 14px; letter-spacing: 0.005em; }

/* Skip-link for accessibility */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--forge); color: #0a1a02;
  padding: 10px 16px; border-radius: var(--r-sm);
  font-weight: 700; z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; }

/* Sichtbarer Tastatur-Fokus auf dem dunklen Theme */
:focus-visible { outline: 2px solid var(--forge-bright); outline-offset: 2px; border-radius: 2px; }
main:focus { outline: none; }   /* Skip-Link-Ziel (tabindex=-1) ohne Rahmen */

/* Bewegung reduzieren, wenn vom System gewünscht */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
