/* ==========================================================================
   Focus Mode One — Legal Pages
   Shared stylesheet for Impressum & Datenschutzerklärung
   ========================================================================== */

/* Design tokens ------------------------------------------------------------ */
:root {
  /* Surfaces */
  --surface-page: #0E0E10;
  --surface-section: #18181C;
  --surface-card: #222228;
  --surface-card-hover: #2A2A32;

  /* Typography */
  --text-heading: #F0EFE8;
  --text-heading-soft: rgba(240, 239, 232, 0.88);
  --text-body: #8E8E9E;
  --text-meta: #5A5A6E;
  --text-bright: #F0EFE8;

  /* Accents — the three deities */
  --eos: #FF8C42;           /* Today / Day — warm dawn */
  --hermes: #2575F0;        /* Week — messenger blue */
  --athena: #8840FF;        /* Quarter — strategic violet */
  --athena-hover: #A066FF;

  /* Borders & dividers */
  --border-subtle: rgba(240, 239, 232, 0.06);
  --border-medium: rgba(240, 239, 232, 0.12);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  /* Shadows & glows */
  --glow-athena: 0 0 0 1px rgba(136, 64, 255, 0.3), 0 8px 32px -8px rgba(136, 64, 255, 0.4);
  --glow-eos: 0 0 24px -8px rgba(255, 140, 66, 0.5);

  /* Layout */
  --content-max: 720px;
  --page-max: 1200px;
  --sidebar-width: 260px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* Base --------------------------------------------------------------------- */
body {
  font-family: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-body);
  background: var(--surface-page);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv01", "cv02";
}

/* Atmospheric background blobs — subtle, matches app aesthetic */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 600px 400px at 15% -10%, rgba(136, 64, 255, 0.08), transparent 60%),
    radial-gradient(ellipse 500px 300px at 85% 110%, rgba(37, 117, 240, 0.06), transparent 60%),
    radial-gradient(ellipse 400px 200px at 50% 50%, rgba(255, 140, 66, 0.03), transparent 70%);
}

/* Header ------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  background: rgba(14, 14, 16, 0.72);
  border-bottom: 1px solid var(--border-subtle);
}

.site-header__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-heading);
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 28px;
  height: 28px;
  position: relative;
  display: grid;
  place-items: center;
}

.brand-mark::before,
.brand-mark::after,
.brand-mark > span {
  content: '';
  position: absolute;
  border-radius: 50%;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-mark::before {
  width: 10px;
  height: 10px;
  background: var(--eos);
  top: 3px;
  left: 3px;
}

.brand-mark > span {
  width: 10px;
  height: 10px;
  background: var(--hermes);
  top: 3px;
  right: 3px;
}

.brand-mark::after {
  width: 10px;
  height: 10px;
  background: var(--athena);
  bottom: 3px;
  left: 9px;
}

.site-header__brand:hover .brand-mark::before { transform: translate(-1px, -1px); }
.site-header__brand:hover .brand-mark > span { transform: translate(1px, -1px); }
.site-header__brand:hover .brand-mark::after { transform: translate(0, 1px); }

.site-header__nav {
  display: flex;
  gap: 4px;
  font-size: 14px;
}

.site-header__nav a {
  color: var(--text-body);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  font-weight: 450;
}

.site-header__nav a:hover {
  color: var(--text-heading);
  background: var(--surface-card);
}

.site-header__nav a.is-active {
  color: var(--text-heading);
  background: var(--surface-card);
}

/* Hero --------------------------------------------------------------------- */
.page-hero {
  position: relative;
  z-index: 1;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 96px 32px 48px;
}

.page-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 100px;
  background: rgba(255, 140, 66, 0.12);
  border: 1px solid rgba(255, 140, 66, 0.22);
  color: var(--eos);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.page-hero__eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--eos);
  box-shadow: var(--glow-eos);
}

.page-hero__title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text-heading);
  margin-bottom: 20px;
  font-variation-settings: "opsz" 144, "SOFT" 50;
}

.page-hero__title em {
  font-style: italic;
  font-weight: 300;
  color: var(--athena);
  font-variation-settings: "opsz" 144, "SOFT" 100;
}

.page-hero__lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-body);
  max-width: 620px;
}

.page-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-meta);
}

.page-hero__meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.page-hero__meta-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: var(--text-meta);
}

.page-hero__meta-value {
  color: var(--text-heading-soft);
  font-size: 14px;
}

/* Main layout with sticky sidebar ------------------------------------------ */
.page-layout {
  position: relative;
  z-index: 1;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 32px 32px 120px;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 64px;
  align-items: start;
}

/* TOC Sidebar -------------------------------------------------------------- */
.toc {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 12px;
  font-size: 13px;
}

.toc::-webkit-scrollbar { width: 4px; }
.toc::-webkit-scrollbar-track { background: transparent; }
.toc::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 2px; }

.toc__label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-meta);
  margin-bottom: 16px;
  font-weight: 500;
}

.toc__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc__list a {
  display: block;
  padding: 7px 14px;
  color: var(--text-body);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -16px;
  padding-left: 14px;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.toc__list a:hover {
  color: var(--text-heading);
  border-left-color: var(--border-medium);
}

.toc__list a.is-active {
  color: var(--athena);
  border-left-color: var(--athena);
  background: linear-gradient(90deg, rgba(136, 64, 255, 0.08), transparent);
}

/* Content ------------------------------------------------------------------ */
.content {
  max-width: var(--content-max);
  min-width: 0;
}

.content h1 {
  display: none; /* Hero handles H1 */
}

.content h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text-heading);
  margin-top: 72px;
  margin-bottom: 20px;
  padding-top: 16px;
  scroll-margin-top: 100px;
  position: relative;
}

.content h2:first-of-type {
  margin-top: 16px;
}

.content h2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 2px;
  background: linear-gradient(90deg, var(--athena), transparent);
  border-radius: 2px;
}

.content h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text-heading);
  margin-top: 40px;
  margin-bottom: 12px;
}

.content h4 {
  font-family: 'Geist', -apple-system, sans-serif;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text-heading-soft);
  margin-top: 28px;
  margin-bottom: 10px;
  letter-spacing: 0.005em;
}

.content p {
  margin-bottom: 18px;
  color: var(--text-body);
  line-height: 1.75;
}

.content p strong {
  color: var(--text-heading-soft);
  font-weight: 600;
}

.content p em {
  color: var(--text-heading-soft);
  font-style: italic;
}

.content a {
  color: var(--hermes);
  text-decoration: none;
  border-bottom: 1px solid rgba(37, 117, 240, 0.3);
  transition: all 0.2s ease;
  padding-bottom: 1px;
}

.content a:hover {
  color: #5C9AFF;
  border-bottom-color: currentColor;
}

.content ul {
  margin: 0 0 18px 0;
  padding-left: 4px;
  list-style: none;
}

.content ul li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  color: var(--text-body);
  line-height: 1.7;
}

.content ul li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 12px;
  width: 6px;
  height: 1px;
  background: var(--text-meta);
}

/* Capitalized legal text (Widerspruchsrecht paragraphs) -------------------- */
.content p.uppercase-notice,
.content p:has(> :only-child) {
  /* fallback for all-caps DSGVO paragraphs */
}

.content > p:is([data-uppercase]) {
  font-size: 13px;
  letter-spacing: 0.02em;
  line-height: 1.7;
  color: var(--text-body);
  background: var(--surface-section);
  padding: 20px 24px;
  border-radius: var(--radius-md);
  border-left: 2px solid var(--hermes);
  margin-bottom: 16px;
}

/* Section callout — used for contact block ---------------------------------*/
.callout {
  background: var(--surface-section);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin: 24px 0;
}

.callout--primary {
  background: linear-gradient(135deg, rgba(136, 64, 255, 0.08), rgba(37, 117, 240, 0.04));
  border: 1px solid rgba(136, 64, 255, 0.2);
}

/* Footer ------------------------------------------------------------------- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-subtle);
  margin-top: 80px;
  padding: 48px 32px;
  background: rgba(14, 14, 16, 0.4);
}

.site-footer__inner {
  max-width: var(--page-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  font-size: 13px;
  color: var(--text-meta);
}

.site-footer__links {
  display: flex;
  gap: 24px;
}

.site-footer__links a {
  color: var(--text-body);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-footer__links a:hover {
  color: var(--text-heading);
}

.site-footer__tagline {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  color: var(--text-meta);
}

/* Responsive --------------------------------------------------------------- */
@media (max-width: 960px) {
  .page-layout {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 24px 24px 80px;
  }

  .toc {
    position: static;
    max-height: none;
    padding: 20px 24px;
    background: var(--surface-section);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
  }

  .toc details summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-heading-soft);
    font-weight: 500;
  }

  .toc details summary::-webkit-details-marker { display: none; }

  .toc details summary::after {
    content: '↓';
    color: var(--text-meta);
    transition: transform 0.2s ease;
  }

  .toc details[open] summary::after { transform: rotate(180deg); }

  .toc__list {
    margin-top: 16px;
  }

  .page-hero {
    padding: 56px 24px 32px;
  }

  .page-hero__title {
    font-size: clamp(36px, 8vw, 56px);
  }
}

@media (max-width: 640px) {
  .site-header__inner {
    padding: 14px 20px;
  }

  .site-header__nav {
    font-size: 13px;
  }

  .site-header__nav a {
    padding: 6px 10px;
  }

  .page-hero {
    padding: 48px 20px 24px;
  }

  .page-layout {
    padding: 16px 20px 64px;
  }

  .content h2 {
    font-size: 26px;
    margin-top: 56px;
  }

  .content h3 {
    font-size: 19px;
  }
}

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

  html { scroll-behavior: auto; }
}

/* Selection ---------------------------------------------------------------- */
::selection {
  background: rgba(136, 64, 255, 0.35);
  color: var(--text-bright);
}
