/* ============================================
   LEGAL PAGES STYLESHEET — Impressum, Datenschutz, Imprint, Privacy
   Matches the main KI verstehen brand (warm cream, Fraunces + Newsreader)
   ============================================ */

:root {
  --paper:        #F7F1E3;
  --paper-deep:   #EFE6D2;
  --paper-edge:   #E5D9BD;
  --ink-deep:     #2A1F1A;
  --ink-medium:   #5A4738;
  --ink-soft:     #6E5C49;
  --terra:        #C25E3C;
  --terra-deep:   #9C4225;
  --sage-deep:    #547349;

  --font-display: "Fraunces", Georgia, serif;
  --font-body:    "Newsreader", Georgia, serif;
}

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

/* Skip-link for keyboard accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--ink-deep);
  color: var(--paper);
  padding: 0.85rem 1.25rem;
  border-radius: 0 0 12px 12px;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1rem;
  z-index: 1001;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--ink-deep);
  background: var(--paper);
  font-variation-settings: "opsz" 16;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

/* Subtle paper grain overlay */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.65 0 0 0 0 0.55 0 0 0 0 0.4 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================
   Top nav with brand + language switcher
   ============================================ */
.legal-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  background: linear-gradient(to bottom, rgba(247, 241, 227, 0.96), rgba(247, 241, 227, 0.85));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--paper-edge);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  font-variation-settings: "opsz" 14, "SOFT" 100;
  color: var(--ink-medium);
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color 0.3s ease;
}

.brand:hover { color: var(--terra); }
.brand-mark { width: 26px; height: 26px; }

.lang-switch {
  display: inline-flex;
  background: var(--paper-deep);
  border: 1px solid var(--paper-edge);
  border-radius: 100px;
  padding: 3px;
  gap: 2px;
}

.lang-switch a {
  padding: 0.45rem 0.95rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-variation-settings: "opsz" 14, "SOFT" 80;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 100px;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.lang-switch a:hover:not(.active) { color: var(--ink-deep); }

.lang-switch a.active {
  background: var(--ink-deep);
  color: var(--paper);
  box-shadow: 0 4px 12px -4px rgba(42, 31, 26, 0.4);
}

/* ============================================
   Main content
   ============================================ */
.legal-content {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 4rem 2rem 5rem;
  flex: 1;
}

.kicker {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--terra);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.kicker::before {
  content: "";
  width: 40px;
  height: 1px;
  background: var(--terra);
}

.legal-content h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink-deep);
  margin-bottom: 1.5rem;
  word-break: break-word;
}

.legal-content .lead {
  font-family: var(--font-body);
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--ink-medium);
  margin-bottom: 3rem;
  max-width: 640px;
}

.legal-content section {
  margin-bottom: 2.5rem;
}

.legal-content h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 32, "SOFT" 80;
  font-size: 1.6rem;
  line-height: 1.2;
  color: var(--ink-deep);
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--paper-edge);
  padding-bottom: 0.6rem;
}

.legal-content p {
  margin-bottom: 1rem;
  color: var(--ink-medium);
}

.legal-content ul {
  margin: 0.75rem 0 1.25rem 1.75rem;
  color: var(--ink-medium);
}

.legal-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.legal-content a {
  color: var(--terra-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s ease;
}

.legal-content a:hover { color: var(--terra); }

.legal-content strong {
  color: var(--ink-deep);
  font-weight: 600;
}

.legal-content em { font-style: italic; }

.legal-content code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: rgba(154, 89, 51, 0.12);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: var(--terra-deep);
  word-break: break-all;
}

.meta-section {
  margin-top: 3rem;
  padding: 1.5rem 2rem;
  background: var(--paper-deep);
  border-left: 4px solid var(--sage-deep);
  border-radius: 4px;
}

.meta-section h2 {
  border-bottom: none;
  padding-bottom: 0;
  margin-top: 0;
  font-size: 1.3rem;
}

.last-updated {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--paper-edge);
  color: var(--ink-soft);
  font-size: 0.95rem;
  text-align: center;
}

/* ============================================
   Footer
   ============================================ */
.legal-footer {
  padding: 2rem;
  text-align: center;
  background: var(--paper-deep);
  border-top: 1px solid var(--paper-edge);
}

.legal-footer nav {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.legal-footer nav a {
  color: var(--terra-deep);
  text-decoration: none;
  font-weight: 500;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.3rem;
}

.legal-footer nav a:hover {
  color: var(--terra);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-footer nav span { color: var(--ink-soft); }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 600px) {
  body { font-size: 1.05rem; }

  .legal-nav {
    padding: 1rem 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .brand { font-size: 1rem; }

  .legal-content {
    padding: 2.5rem 1.25rem 3.5rem;
  }

  .legal-content h2 { font-size: 1.4rem; }
  .legal-content .lead { font-size: 1.15rem; }

  .meta-section {
    padding: 1.25rem 1.25rem;
  }
}

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

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--terra);
  outline-offset: 4px;
  border-radius: 3px;
}

/* ============================================
   Definition list for legal data
   ============================================ */
.legal-dl {
  display: grid;
  gap: 0.85rem;
  margin: 0.75rem 0;
}

.legal-dl > div {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px dashed var(--paper-edge);
}

.legal-dl > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.legal-dl dt {
  font-family: var(--font-body);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--ink-soft);
  padding-top: 0.15rem;
  line-height: 1.4;
}

.legal-dl dd {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--ink-deep);
  line-height: 1.55;
}

.legal-dl dd strong {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 18, "SOFT" 80;
  font-weight: 500;
  font-size: 1.15rem;
}

.legal-dl dd code {
  font-size: 0.95em;
  background: rgba(154, 89, 51, 0.10);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  color: var(--terra-deep);
  letter-spacing: 0.03em;
}

@media (max-width: 600px) {
  .legal-dl > div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}

/* ============================================
   Floating "Powered by" badge
   ============================================ */
.powered-by-fab {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 50;
  display: none;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.9rem 0.45rem 0.7rem;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 100px;
  box-shadow: 0 4px 14px -4px rgba(154, 89, 51, 0.20);
  text-decoration: none;
  color: var(--ink-medium);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.powered-by-fab:hover {
  border-color: var(--terra);
  color: var(--terra-deep);
  box-shadow: 0 12px 32px -6px rgba(194, 94, 60, 0.35);
  transform: translateY(-3px);
}

.fab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--terra);
  transition: transform 0.3s ease;
}

.powered-by-fab:hover .fab-icon {
  transform: rotate(-8deg) scale(1.1);
}

.fab-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: left;
}

.fab-kicker {
  font-family: var(--font-body);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  font-weight: 600;
}

.fab-brand {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 16, "SOFT" 80;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-deep);
  transition: color 0.3s ease;
  margin-top: 1px;
}

.powered-by-fab:hover .fab-brand {
  color: var(--terra-deep);
}

.fab-arrow {
  color: var(--ink-soft);
  transition: transform 0.3s ease, color 0.3s ease;
}

.powered-by-fab:hover .fab-arrow {
  transform: translateX(3px);
  color: var(--terra-deep);
}

/* Show on lg+ screens only (>= 1024px) */
@media (min-width: 1024px) {
  .powered-by-fab {
    display: inline-flex;
  }
}
