/* ==========================================================================
   forensik.io — Designsystem
   Dunkles, technisches, gerichtsfestes Erscheinungsbild.
   Fonts lokal (Fraunces, Hanken Grotesk, JetBrains Mono) — kein CDN.
   ========================================================================== */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/Fraunces.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/HankenGrotesk.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Farben — Graphit-Dunkel, warmes "Papier"-Weiß, Messing-Akzent */
  --bg: #0b0e11;
  --bg-elevated: #12161b;
  --bg-elevated-2: #181d23;
  --border: rgba(233, 228, 214, 0.1);
  --border-strong: rgba(233, 228, 214, 0.2);
  --text: #eae5d8;
  --text-muted: #9c9a8e;
  --text-dim: #6a6960;
  --accent: #c99a4e;
  --accent-bright: #e3b768;
  --accent-ink: #1a1206;
  --focus: #e3b768;

  /* Typografie */
  --font-display: "Fraunces", "Iowan Old Style", serif;
  --font-body: "Hanken Grotesk", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Layout */
  --content-width: 74rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 3px;
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

ul,
ol {
  padding: 0;
  margin: 0;
  list-style: none;
}

h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
}

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

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

/* -------------------------------------------------------------------- */
/* Typografie-Bausteine                                                   */
/* -------------------------------------------------------------------- */
.display {
  font-family: var(--font-display);
  font-weight: 480;
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 96;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.lede {
  font-size: clamp(1.05rem, 1.3vw, 1.25rem);
  color: var(--text-muted);
  max-width: 42rem;
}

/* -------------------------------------------------------------------- */
/* Layout-Hilfen                                                         */
/* -------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section {
  padding-block: clamp(3.5rem, 8vw, 7rem);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.section-head h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
}

/* -------------------------------------------------------------------- */
/* Skip-Link                                                             */
/* -------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  z-index: 100;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* -------------------------------------------------------------------- */
/* Header / Navigation                                                    */
/* -------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 14, 17, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.1rem;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}

.logo__mark {
  color: var(--accent);
}

.logo__dot {
  color: var(--text-dim);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  width: 2.6rem;
  height: 2.6rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  content: "";
  display: block;
  width: 1.3rem;
  height: 2px;
  background: var(--text);
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle__bar::before {
  position: absolute;
  top: -6px;
}

.nav-toggle__bar::after {
  position: absolute;
  top: 6px;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 1.9rem);
}

.primary-nav a {
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--text-muted);
  position: relative;
  padding-block: 0.3rem;
  transition: color 0.15s ease;
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
  color: var(--text);
}

.primary-nav a.is-soon {
  color: var(--text-dim);
}

.primary-nav a.is-current {
  color: var(--accent-bright);
}

.tag-soon {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  padding: 0.05rem 0.32rem;
  margin-left: 0.35rem;
  vertical-align: middle;
  text-transform: uppercase;
}

.nav-cta {
  border: 1px solid var(--accent);
  color: var(--accent-bright) !important;
  border-radius: var(--radius);
  padding: 0.5rem 1rem !important;
}

.nav-cta:hover {
  background: var(--accent);
  color: var(--accent-ink) !important;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }

  .primary-nav {
    position: fixed;
    inset: 4.4rem 0 0 0;
    /* .site-header hat backdrop-filter, das einen eigenen Containing Block
       für position:fixed-Nachfahren erzeugt — bottom:0 würde sich sonst auf
       die kleine Header-Box statt das Viewport beziehen. Explizite Höhe
       erzwingt die korrekte, viewport-relative Größe (siehe CSS-Spec zu
       überbestimmten absoluten Positionierungen: height gewinnt gegen bottom). */
    height: calc(100dvh - 4.4rem);
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem var(--gutter);
    gap: 1.4rem;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
  }

  .primary-nav.is-open {
    transform: translateX(0);
  }

  .primary-nav a {
    font-size: 1.1rem;
  }
}

/* -------------------------------------------------------------------- */
/* Buttons                                                                */
/* -------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
}

.btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
}

/* -------------------------------------------------------------------- */
/* Hash-Chip — dezentes forensisches Detail                               */
/* -------------------------------------------------------------------- */
.hash-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.25rem 0.55rem;
}

.hash-chip__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* -------------------------------------------------------------------- */
/* Footer                                                                 */
/* -------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 3rem;
  margin-top: clamp(3rem, 8vw, 6rem);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  align-items: flex-start;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 1.6rem;
}

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

.site-footer a:hover {
  color: var(--accent-bright);
}

.site-footer small {
  display: block;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  margin-top: 1.6rem;
}

/* -------------------------------------------------------------------- */
/* Utility                                                                */
/* -------------------------------------------------------------------- */
.center {
  text-align: center;
  margin-inline: auto;
}

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

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin-block: 0;
}

/* -------------------------------------------------------------------- */
/* Scroll-Reveal                                                          */
/* -------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

.reveal-group.is-in > * {
  opacity: 1;
  transform: translateY(0);
}

.reveal-group > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-group.is-in > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-group.is-in > *:nth-child(2) { transition-delay: 0.14s; }
.reveal-group.is-in > *:nth-child(3) { transition-delay: 0.23s; }

.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;
}

/* -------------------------------------------------------------------- */
/* Karten-Raster (Startseite: Drei Säulen, Werkzeuge: Tool-Karten)        */
/* -------------------------------------------------------------------- */
.saeulen-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 860px) {
  .saeulen-grid {
    grid-template-columns: 1fr;
  }
}

.saeule {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.7rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.saeule:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 16px 36px -18px rgba(201, 154, 78, 0.4);
}

.saeule__index {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  transition: transform 0.25s ease;
}

.saeule:hover .saeule__index {
  transform: translateX(3px);
}

.saeule h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 480;
}

.saeule p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.saeule .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* -------------------------------------------------------------------- */
/* Rechtshinweis unter Sektionen                                          */
/* -------------------------------------------------------------------- */
.legal-note {
  padding-block: 1.4rem 0;
  color: var(--text-dim);
  font-size: 0.82rem;
  max-width: 42rem;
}

.legal-note a {
  color: var(--text-muted);
}

/* -------------------------------------------------------------------- */
/* Zweispaltiger Teaser (Startseite, Verzeichnis)                        */
/* -------------------------------------------------------------------- */
.teaser {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

@media (max-width: 860px) {
  .teaser {
    grid-template-columns: 1fr;
  }
}

.teaser h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  margin-bottom: 1rem;
}

.teaser p {
  margin-bottom: 1.4rem;
}

/* -------------------------------------------------------------------- */
/* Formulare (Verzeichnis, ggf. weitere)                                  */
/* -------------------------------------------------------------------- */
.form-card {
  max-width: 34rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 4vw, 2.4rem);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 560px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

.field input,
.field select,
.field textarea {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 1.1rem) center, calc(100% - 0.85rem) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.field textarea {
  resize: vertical;
  min-height: 6rem;
  font-family: var(--font-body);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  border-color: var(--accent);
}

.field small {
  color: var(--text-dim);
  font-size: 0.76rem;
}

.check-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-left: 1.2rem;
  list-style: disc;
  color: var(--text-muted);
  margin-top: 1rem;
}

.check-list li::marker {
  color: var(--accent);
}

.form-status {
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  min-height: 1.2em;
}

/* -------------------------------------------------------------------- */
/* Rechtstexte (Impressum, Datenschutz)                                   */
/* -------------------------------------------------------------------- */
.legal-content {
  max-width: 42rem;
  padding-block: clamp(2rem, 5vw, 3.5rem);
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
}

.legal-content h2 {
  font-size: 1.3rem;
  margin-bottom: 0.7rem;
}

.legal-content p,
.legal-content li {
  color: var(--text-muted);
}

.legal-content li {
  margin-bottom: 0.4rem;
}

.legal-content ul {
  padding-left: 1.2rem;
  list-style: disc;
}

.legal-content li::marker {
  color: var(--accent);
}

.legal-content address {
  font-style: normal;
  color: var(--text-muted);
  line-height: 1.7;
}

.legal-content dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 1rem;
  margin-top: 0.8rem;
}

.legal-content dt {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.legal-content dd {
  margin: 0;
  color: var(--text-muted);
}

/* -------------------------------------------------------------------- */
/* Werkzeuge: Vorlagen-Downloads + eingebettete Tools                     */
/* -------------------------------------------------------------------- */
.download-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.download-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.3rem;
  background: var(--bg-elevated);
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.download-list a.download-item:hover {
  background: var(--bg-elevated-2);
}

.download-item:last-child {
  border-bottom: none;
}

.download-item__name {
  font-size: 0.95rem;
}

.download-item__meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  flex-shrink: 0;
  text-decoration: none;
  white-space: nowrap;
}

a.download-item__meta:hover {
  color: var(--accent-bright);
  text-decoration: underline;
}

.download-item__name small {
  font-size: 0.76rem;
  font-weight: 400;
}

.download-item__name small a {
  color: var(--accent-bright);
}

.tool-embed {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
}

.tool-embed iframe {
  display: block;
  width: 100%;
  height: 78rem;
  border: none;
}

.tool-embed__note {
  padding: 0.8rem 1.2rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-dim);
}

/* -------------------------------------------------------------------- */
/* Platzhalter-Seiten (Lagebild, Werkzeuge, Recht, Urteile)               */
/* -------------------------------------------------------------------- */
.stub {
  min-height: calc(100vh - 8rem);
  display: flex;
  align-items: center;
}

.stub__inner {
  max-width: 34rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.stub h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
}

.stub__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.6rem;
}

.badge-bald {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  padding: 0.2rem 0.5rem;
}
