/* ============================================
   citizn.one – Dossier
   Gemeinsames Stylesheet
   ============================================ */

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

:root {
  --paper:      #f4f2ec;
  --sheet:      #ffffff;
  --card:       #fafbfd;
  --sheet-alt:  #f0eee7;
  --ink:        #12151c;
  --ink-soft:   #5c6070;
  --blue:       #1a4ed8;
  --blue-mid:   #4a72e0;
  --blue-pale:  #e6ecfb;
  --rule:       #ccd6ee;
  --rule-soft:  #e0e5f0;

  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-sans: 'Inter', system-ui, sans-serif;

  --rail-w: 74px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--rule-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule-soft) 1px, transparent 1px);
  background-size: 42px 42px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--blue-pale); color: var(--blue); }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* ── KOPFLEISTE ───────────────────────────── */
.topbar {
  border-bottom: 1px solid var(--rule);
  background: rgba(255,255,255,0.86);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
}

.topbar-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

/* ── REGISTERREITER ───────────────────────── */
.register {
  max-width: 1180px;
  margin: 1.75rem auto 0;
  padding: 0 2rem;
}

.register-strip {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-top: 2px;
}

.register-strip::-webkit-scrollbar { display: none; }

.tab {
  flex: 1 1 0;
  min-width: 96px;
  text-decoration: none;
  background: #ffffff;
  padding: 0.42rem 1.15rem 0.48rem;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.55rem;
  position: relative;
  transition: background 0.18s, transform 0.18s, color 0.18s;
  transform: translateY(3px);
  border: 1px solid var(--rule);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  /* Fasen ueber Perspektive, Ecken bleiben weich */
  box-shadow: inset 0 0 0 0 transparent;
}

/* angeschraegte Flanken als Pseudoelemente, damit Rundung erhalten bleibt */
.tab::before,
.tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  width: 13px;
  top: -1px;
  pointer-events: none;
}
.tab::before { left: -13px; }
.tab::after  { right: -13px; }

.tab:hover { background: #f5f8ff; border-color: #b9c9ee; transform: translateY(1px); }

.tab .tab-num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--blue);
}

.tab .tab-name {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

.tab.active {
  background: #ffffff;
  transform: translateY(0);
  padding-bottom: 0.62rem;
  z-index: 3;
  border-color: var(--blue);
  box-shadow: 0 -1px 0 0 var(--blue);
}
.tab.active .tab-name { color: var(--ink); font-weight: 500; }

.tab.active .tab-name { color: var(--ink); font-weight: 500; }

/* ── BLATT ────────────────────────────────── */
.sheet-wrap {
  max-width: 1180px;
  margin: 0 auto 4rem;
  padding: 0 2rem;
}

.sheet {
  background: var(--sheet);
  border: 1px solid var(--rule);
  position: relative;
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
}

/* ── LINKE INDEXSPALTE ────────────────────── */
.rail {
  border-right: 1px solid var(--rule);
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.rail-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--blue);
  text-transform: uppercase;
}

.rail-index {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.rail-index a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 2px 4px;
  transition: color 0.18s;
}

.rail-index a:hover { color: var(--blue); }
.rail-index a.here { color: var(--blue); font-weight: 500; border-bottom: 1px solid var(--blue); }
.rail-index .dash { color: var(--rule); font-family: var(--font-mono); font-size: 10px; }

.rail-vertical {
  margin-top: auto;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

/* ── INHALT ───────────────────────────────── */
.content { padding: 3rem 3.25rem 3.5rem; min-width: 0; }

.doc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.doc-title {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 500;
}

.doc-ref {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

/* Wortmarke, in das Papier geprägt */
.wordmark {
  font-family: var(--font-mono);
  font-size: clamp(2.4rem, 7vw, 5rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--ink);
  -webkit-text-stroke: 0;
  text-shadow: none;
  margin-bottom: 2rem;
  user-select: none;
}

.rule-short {
  width: 46px;
  height: 2px;
  background: var(--blue);
  margin-bottom: 1.75rem;
}

h1.page-h {
  font-family: var(--font-mono);
  font-size: clamp(1.35rem, 2.7vw, 2.1rem);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 660px;
  margin-bottom: 1rem;
}

.page-sub {
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 1.3vw, 1.05rem);
  color: var(--blue);
  margin-bottom: 2rem;
}

.lead {
  font-size: 1rem;
  color: var(--ink-soft);
  max-width: 620px;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.body-text {
  font-size: 0.98rem;
  color: var(--ink);
  max-width: 640px;
  line-height: 1.85;
  margin-bottom: 1.25rem;
}

.body-text strong { font-weight: 500; }

.underline-ink {
  border-bottom: 1.5px solid var(--blue);
  font-weight: 500;
}

/* ── HERO-RASTER ──────────────────────────── */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

/* Metadatenfeld */
.meta-panel { border: 1px solid var(--rule); background: var(--card); }

.meta-row { padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--rule); }
.meta-row:last-child { border-bottom: none; }

.meta-key {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 0.3rem;
}

.meta-val {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  line-height: 1.5;
}

.meta-val.dot { display: flex; align-items: center; gap: 0.55rem; }

.meta-val.dot::before {
  content: '';
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 2px solid var(--blue);
  background: var(--blue);
  box-shadow: inset 0 0 0 1.5px var(--sheet);
  flex-shrink: 0;
}

/* Registriernummer */
.jump-box {
  display: block;
  border: 1px solid var(--blue);
  padding: 0.9rem 1.1rem 1rem;
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: background 0.18s;
}

.jump-box:hover { background: var(--blue-pale); }

.jump-box .k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 0.45rem;
}

.jump-box .v {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.jump-box .v .arw { transition: transform 0.18s; }
.jump-box:hover .v .arw { transform: translateX(3px); }

/* Ecke umgeknickt */
.folded { position: relative; }

.folded::after {
  content: '';
  position: absolute;
  right: -1px; bottom: -1px;
  width: 18px; height: 18px;
  background: linear-gradient(225deg, var(--paper) 50%, transparent 50%);
  border-left: 1px solid var(--rule);
  border-top: 1px solid var(--rule);
}

/* ── ABSCHNITTE ───────────────────────────── */
.block { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--rule); }
.block:first-of-type { border-top: none; padding-top: 0; margin-top: 2.5rem; }

.block-head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.block-num {
  font-family: var(--font-mono);
  font-size: 17px;
  color: var(--blue);
  border: 1px solid var(--blue);
  padding: 0.4rem 0.65rem;
  line-height: 1;
  flex-shrink: 0;
}

.block-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 500;
}

.block-line { flex: 1; height: 1px; background: var(--rule); }

.block-ref {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  text-transform: uppercase;
  flex-shrink: 0;
}

/* Randnotiz */
.notiz {
  border-top: 1px solid var(--blue);
  border-bottom: 1px solid var(--blue);
  padding: 1rem 0;
  max-width: 260px;
}

.notiz .k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  display: block;
  margin-bottom: 0.6rem;
}

.notiz p {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.75;
  color: var(--ink-soft);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 3rem;
  align-items: start;
}

/* ── KARTEN ───────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.cards.two { grid-template-columns: repeat(2, 1fr); }

.card {
  border: 1px solid var(--rule);
  background: var(--card);
  padding: 1.5rem 1.4rem;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.card-num {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--blue);
}

.card-mark {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--blue);
  opacity: 0.65;
}

.card h3 {
  font-family: var(--font-mono);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.45;
  margin-bottom: 0.7rem;
  color: var(--ink);
}

.card p { font-size: 0.85rem; color: var(--ink-soft); line-height: 1.7; }

/* ── LISTE (Leistungen) ───────────────────── */
.entry-list { list-style: none; border-top: 1px solid var(--rule); }

.entry {
  display: grid;
  grid-template-columns: 52px 1fr 78px;
  gap: 1.5rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}

.entry .idx {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--blue);
  letter-spacing: 0.08em;
  padding-top: 0.2rem;
}

.entry h3 {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  line-height: 1.45;
}

.entry p { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.75; max-width: 580px; }

.entry .ref {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  text-align: right;
  padding-top: 0.35rem;
  text-transform: uppercase;
}

/* ── KENNZAHLEN ───────────────────────────── */
.stats {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
  padding: 1.75rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
}

.stat-num {
  font-family: var(--font-mono);
  font-size: 2.1rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
  display: block;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 0.5rem;
  display: block;
  max-width: 150px;
  line-height: 1.6;
}

/* ── TEAM ─────────────────────────────────── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.75rem;
}

.team-portrait {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 0.9rem;
  border: 1px solid var(--rule);
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.5s ease;
}

.team-name { font-family: var(--font-mono); font-size: 0.9rem; font-weight: 500; margin-bottom: 0.2rem; }

.team-role {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  display: block;
  margin-bottom: 0.8rem;
}

.team-bio { font-size: 0.82rem; color: var(--ink-soft); line-height: 1.7; }

/* ── AUSSAGE-BLOCK ────────────────────────── */
.statement {
  border: 1px solid var(--blue);
  padding: 2.25rem 2rem;
  background: var(--blue-pale);
}

.statement p {
  font-family: var(--font-mono);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.6;
  color: var(--ink);
  max-width: 680px;
}

.statement .hl { color: var(--blue); }

.statement .after {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.8;
  margin-top: 1.5rem;
  max-width: 560px;
}

/* ── LINKS / CTA ──────────────────────────── */
.ink-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid var(--blue);
  padding-bottom: 1px;
  transition: opacity 0.2s;
}

.ink-link:hover { opacity: 0.65; }

.next-nav {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.next-nav .k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 0.35rem;
}

/* ── FUSSLEISTE ───────────────────────────── */
.legend {
  border-top: 1px solid var(--rule);
  background: rgba(255,255,255,0.62);
}

.legend-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem 2rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.legend-item .k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  display: block;
  margin-bottom: 0.5rem;
}

.legend-item p {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.75;
}

footer { border-top: 1px solid var(--rule); background: rgba(255,255,255,0.72); }

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.footer-inner a { color: var(--ink-soft); text-decoration: none; }
.footer-inner a:hover { color: var(--blue); }
.footer-links { display: flex; gap: 1.75rem; flex-wrap: wrap; }

/* ── REVEAL ───────────────────────────────── */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── RESPONSIV ────────────────────────────── */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.25rem; }
  .two-col { grid-template-columns: 1fr; gap: 2rem; }
  .notiz { max-width: none; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .legend-inner { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  body { background-size: 32px 32px; }
  .topbar-inner, .register, .sheet-wrap, .legend-inner, .footer-inner { padding-left: 1.1rem; padding-right: 1.1rem; }
  .sheet { grid-template-columns: 1fr; }
  .rail { display: none; }
  .content { padding: 2rem 1.4rem 2.5rem; }
  .register { margin-top: 1.25rem; }
  .tab { min-width: 88px; flex: 0 0 auto; }
  .cards, .cards.two { grid-template-columns: 1fr; }
  .entry { grid-template-columns: 40px 1fr; gap: 1rem; }
  .entry .ref { display: none; }
  .team-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
  .stats { gap: 1.75rem; }
  .legend-inner { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .tab { transition: none; }
}

/* ── BURGER (mobil) ───────────────────────── */
.burger {
  display: none;
  width: 38px; height: 38px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.burger span {
  display: block;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1), opacity 0.2s;
  transform-origin: center;
}

.burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── NAVIGATIONS-OVERLAY (Aktenschrank) ──── */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(255,255,255,0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  overflow-y: auto;
}

.nav-overlay.open { opacity: 1; pointer-events: all; }

.nav-sheet {
  min-height: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 4.5rem 1.4rem 2.5rem;
  display: flex;
  flex-direction: column;
}

.nav-close {
  position: absolute;
  top: 1rem; right: 1.1rem;
  width: 40px; height: 40px;
  background: none;
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s;
}
.nav-close:hover { background: #fff; border-color: var(--blue); color: var(--blue); }

.nav-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.9rem;
  margin-bottom: 1.35rem;
  border-bottom: 1px solid var(--rule);
}
.nav-kicker::before { content: '\258A\258A'; letter-spacing: -2px; }

.folder-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.folder-nav a {
  --i: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.92rem 1.15rem;
  background: #ffffff;
  border: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 50%, calc(100% - 22px) 100%, 0 100%);
  transform: translateX(-30px);
  opacity: 0;
  transition: transform 0.36s cubic-bezier(0.2,0.7,0.2,1),
              opacity 0.36s ease, background 0.16s, color 0.16s;
}

.nav-overlay.open .folder-nav a {
  transform: translateX(0);
  opacity: 1;
  transition-delay: calc(var(--i) * 55ms);
}

.folder-nav a:hover { background: #f5f8ff; border-color: #b9c9ee; }
.folder-nav a:hover .fn-name { color: var(--blue); }

.folder-nav .fn-num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--blue);
  min-width: 26px;
}

.folder-nav .fn-name {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--ink);
  transition: color 0.16s;
}

.folder-nav a.here { background: var(--blue); }
.folder-nav a.here .fn-num { color: rgba(255,255,255,0.72); }
.folder-nav a.here .fn-name { color: #fff; }

/* Impressum etwas abgesetzt */
.folder-nav li.sep { margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px dashed var(--rule); }

.nav-foot {
  margin-top: auto;
  padding-top: 2rem;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ── SEITENWECHSEL-ANZEIGE ────────────────── */
.page-advance {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(14px);
  z-index: 70;
  background: #fff;
  border: 1px solid var(--blue);
  padding: 0.6rem 1rem 0.65rem;
  min-width: 230px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
  box-shadow: 0 4px 14px rgba(18,21,28,0.08);
}

.page-advance.on { opacity: 1; transform: translateX(-50%) translateY(0); }

.page-advance .pa-text {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.page-advance .pa-bar { height: 2px; background: var(--rule); position: relative; }

.page-advance .pa-bar i {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: var(--blue);
  display: block;
}

body.leaving { opacity: 0; transition: opacity 0.18s ease; }

@media (max-width: 820px) {
  .topbar-meta { display: none; }
  .burger { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-overlay, .page-advance, .burger span, body.leaving { transition: none; }
  .folder-nav a { transform: none; opacity: 1; transition: none; }
}

/* ── PARTNER (Footer) ─────────────────────── */
.partner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  border-bottom: 1px solid var(--rule);
}
.partner-k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.partner-logo {
  height: 30px;
  width: auto;
  display: block;
}
@media (max-width: 720px) {
  .partner { padding-left: 1.1rem; padding-right: 1.1rem; gap: 0.85rem; }
  .partner-logo { height: 26px; }
}

/* ══ SEITENHINTERGRÜNDE ═══════════════════════
   Jede Seite hat ihr eigenes Papier.
   Klasse sitzt am <body>: bg-index, bg-auftrag, ...
   ═════════════════════════════════════════════ */

/* 01 Index — hellblau mit weissem Karo */
body.bg-index {
  background-color: #dfe8fa;
  background-image:
    linear-gradient(rgba(255,255,255,0.95) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.95) 1px, transparent 1px);
  background-size: 42px 42px;
}

/* 02 Auftrag — warmes Papier mit blauem Millimeterraster */
body.bg-auftrag {
  background-color: #f3f1ea;
  background-image:
    linear-gradient(rgba(26,78,216,0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,78,216,0.10) 1px, transparent 1px),
    linear-gradient(rgba(26,78,216,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,78,216,0.05) 1px, transparent 1px);
  background-size: 84px 84px, 84px 84px, 21px 21px, 21px 21px;
}

/* 03 Ansatz — reines Weiss, nur Punktraster */
body.bg-ansatz {
  background-color: #ffffff;
  background-image: radial-gradient(rgba(26,78,216,0.16) 1px, transparent 1px);
  background-size: 26px 26px;
}

/* 04 Leistungen — kühles Grau, feine Linien quer */
body.bg-leistungen {
  background-color: #eef0f4;
  background-image: linear-gradient(rgba(255,255,255,0.9) 1px, transparent 1px);
  background-size: 100% 15px;
}

/* 05 Einsatz — Blaupause, dunkleres Blau mit hellem Raster */
body.bg-einsatz {
  background-color: #dbe3f5;
  background-image:
    linear-gradient(rgba(26,78,216,0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,78,216,0.16) 1px, transparent 1px);
  background-size: 34px 34px;
}

/* 06 Team — sehr helles Grün-Grau, diagonales Muster */
body.bg-team {
  background-color: #edf1ee;
  background-image:
    repeating-linear-gradient(45deg, rgba(26,78,216,0.055) 0 1px, transparent 1px 16px);
}

/* Impressum — schlicht, ganz ohne Muster */
body.bg-impressum {
  background-color: #f2f2f0;
  background-image: none;
}

/* 05 Academy — helles Sandgelb mit blauem Feinraster */
body.bg-academy {
  background-color: #f4f1e6;
  background-image:
    linear-gradient(rgba(26,78,216,0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,78,216,0.09) 1px, transparent 1px);
  background-size: 30px 30px;
}

/* ── AGENT-BREAK (Academy) ────────────────── */
.agent-break {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 1.9rem 0 2rem;
  margin: 0 0 2.25rem;
}

.ab-line {
  font-family: var(--font-mono);
  font-size: clamp(1.05rem, 2.1vw, 1.45rem);
  line-height: 1.45;
}

.ab-a { color: var(--ink-soft); }

.ab-b {
  color: var(--ink);
  font-weight: 500;
  box-shadow: inset 0 -0.5em 0 var(--blue-pale);
}

.flow { margin-top: 1.6rem; display: flex; flex-direction: column; gap: 0.7rem; }

.flow-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.flow-tag {
  min-width: 58px;
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.flow-row .fl {
  border: 1px solid var(--rule);
  background: #fff;
  padding: 0.4rem 0.7rem;
  color: var(--ink-soft);
}

.flow-row .ar { color: var(--rule); }

.flow-row.is-agent .fl { border-color: #b9c9ee; color: var(--ink); }
.flow-row.is-agent .ar { color: var(--blue); }
.flow-row.is-agent .fl:last-of-type {
  border-color: var(--blue);
  background: var(--blue-pale);
  color: var(--blue);
}

@media (max-width: 640px) {
  .flow-row { font-size: 10px; gap: 0.35rem; }
  .flow-row .fl { padding: 0.32rem 0.5rem; }
  .flow-tag { min-width: 100%; margin-bottom: 0.15rem; }
}

/* ── ACADEMY-LANDINGPAGE ──────────────────── */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}
.eyebrow::after { content: ''; flex: 1; height: 1px; background: var(--rule); max-width: 90px; }

.mega {
  font-family: var(--font-mono);
  font-size: clamp(2.4rem, 8vw, 5.2rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 0.9rem;
}

.mega-sub {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2vw, 1.35rem);
  color: var(--blue);
  margin-bottom: 1.6rem;
  box-shadow: inset 0 -0.45em 0 var(--blue-pale);
  display: inline-block;
}

.cta-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 2rem 0 0;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--blue);
  transition: background 0.18s, transform 0.18s;
}
.btn-primary:hover { background: #143fb0; transform: translateY(-1px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: var(--blue);
  text-decoration: none;
  padding: 0.85rem 1.4rem;
  border: 1px solid var(--rule);
  background: #fff;
  transition: border-color 0.18s, background 0.18s;
}
.btn-ghost:hover { border-color: var(--blue); background: var(--blue-pale); }

.card-day { border-color: #b9c9ee; }
.card-day .card-num {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* hervorgehobener Academy-Reiter */
.tab-hi .tab-num { color: var(--blue); font-weight: 500; }
.tab-hi:not(.active) { border-color: #c3d1f0; background: #f7f9ff; }
.tab-hi:not(.active) .tab-name { color: var(--blue); }

/* ── ACADEMY-PROMO auf der Startseite ─────── */
.academy-promo {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--blue);
  background: #ffffff;
  margin: 3rem 0 0;
  min-height: 300px;
  display: flex;
  align-items: center;
}

.ap-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.ap-photo {
  position: absolute;
  right: 0; top: 0;
  height: 100%;
  width: 62%;
  object-fit: cover;
  object-position: 60% 45%;
  display: block;
}

.ap-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    #ffffff 0%, #ffffff 40%,
    rgba(255,255,255,0.88) 50%,
    rgba(255,255,255,0.15) 66%,
    rgba(255,255,255,0) 78%);
}

.ap-text {
  position: relative;
  z-index: 1;
  padding: 2.2rem 1.9rem;
  max-width: 54%;
}

.ap-k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blue);
  display: block;
  margin-bottom: 1rem;
}
.ap-h {
  font-family: var(--font-mono);
  font-size: clamp(1.35rem, 2.9vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 0.85rem;
}
.ap-t {
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

@media (max-width: 760px) {
  .academy-promo { min-height: 0; display: block; }
  .ap-photo { width: 100%; opacity: 0.16; object-position: 60% 30%; }
  .ap-fade { background: rgba(255,255,255,0.88); }
  .ap-text { max-width: 100%; padding: 1.8rem 1.4rem; }
}

/* ── SCHREIBMASCHINE (Index-Hero) ──────────── */
.te-line { min-height: 1.2em; }
.te-line.te-active::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 0.95em;
  background: var(--blue);
  margin-left: 3px;
  vertical-align: -0.12em;
  animation: te-blink 0.9s steps(1) infinite;
}
@keyframes te-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .te-line.te-active::after { animation: none; }
}

/* ── AGENTENSYSTEM-DIAGRAMM (Academy) ─────── */
.sys {
  margin-top: 0.75rem;
}

.sys > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.4rem 0.1rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  user-select: none;
  flex-wrap: wrap;
}
.sys > summary::-webkit-details-marker { display: none; }
.sys > summary:hover .st-h { color: var(--blue); }

.sys-plus {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
  transition: transform 0.2s ease, color 0.16s;
}
.sys[open] .sys-plus { transform: rotate(45deg); }
.sys > summary:hover .sys-plus { color: var(--blue); }

.sys-line { flex: 1; }
.sys-line .st-h {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  transition: color 0.16s;
}

.sys-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--blue);
  white-space: nowrap;
}
.sys[open] .sys-hint .h-close { display: none; }
.sys:not([open]) .sys-hint .h-open { display: none; }

.sys-body {
  border-top: 1px solid var(--rule-soft);
  margin-top: 0.6rem;
  padding: 1.4rem 0.1rem 0.5rem;
  overflow-x: auto;
}

/* Diagramm-Raster */
.diagram { min-width: 540px; }

.dg-row { display: flex; align-items: stretch; justify-content: center; gap: 0.6rem; }
.dg-lane { display: flex; flex-direction: column; align-items: center; }

.node {
  border: 1px solid var(--rule);
  background: #fff;
  font-family: var(--font-mono);
  text-align: center;
  padding: 0.6rem 0.75rem;
  min-width: 116px;
}
.node .nlabel {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink);
  display: block;
  line-height: 1.35;
}
.node .nsub {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: block;
  margin-top: 0.25rem;
}

.node.n-in     { border-color: var(--rule); background: #f7f7f5; }
.node.n-orch   { border-color: var(--blue); background: var(--blue-pale); }
.node.n-orch .nlabel { color: var(--blue); font-weight: 500; }
.node.n-agent  { border-color: #b9c9ee; }
.node.n-tool   { min-width: 0; padding: 0.35rem 0.55rem; background: #fbfbfa; }
.node.n-tool .nlabel { font-size: 10px; color: var(--ink-soft); }
.node.n-out    { border-color: var(--blue); }
.node.n-out .nlabel { color: var(--blue); font-weight: 500; }

/* vertikale Verbinder */
.conn-v { width: 1px; height: 20px; background: var(--rule); }
.conn-v.blue { background: var(--blue); }

/* horizontale Fächerung */
.fan {
  height: 18px;
  border-top: 1px solid var(--rule);
  align-self: stretch;
}
.fan-wrap { display: flex; justify-content: center; }

.dg-cap {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
  margin: 0.15rem 0 0.55rem;
}

.tool-stack { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.4rem; }

.dg-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
}
.dg-legend span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.dg-legend i {
  width: 11px; height: 11px;
  border: 1px solid var(--rule);
  display: inline-block;
}
.dg-legend i.l-orch { border-color: var(--blue); background: var(--blue-pale); }
.dg-legend i.l-agent { border-color: #b9c9ee; }
.dg-legend i.l-tool { background: #fbfbfa; }

.dg-lane.dg-loop { justify-content: center; margin-left: 0.6rem; }
.node.n-loop {
  border-style: dashed;
  border-color: var(--ink-soft);
  background: #fafaf8;
  min-width: 150px;
}
.node.n-loop .nlabel { color: var(--ink-soft); font-size: 10px; }
.node.n-loop .nsub { color: var(--ink-soft); }


@media (max-width: 640px) {
  .sys-hint { display: none; }
  .sys-body { padding: 1.2rem 0.9rem 1.4rem; }
}

.sys-close-note {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--rule);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--blue);
  line-height: 1.6;
}

/* ── HERO-FOTO (Academy) ──────────────────── */
.hero-photo {
  margin: 2.4rem 0 0;
  border: 1px solid var(--rule);
  background: #fff;
}
.hero-photo img {
  display: block;
  width: 100%;
  height: auto;
}
.hero-photo figcaption {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  padding: 0.6rem 0.85rem;
  border-top: 1px solid var(--rule);
}

