/* ========================================================= 
   site.css v2.30 – errorlevel1.ai
   Harmonisierte Abstände für index / about / essays / lab / projects
   Light & Dark Editorial Style (NOEMA / Quanta / Aeon inspiriert)
   ========================================================= */

/* =========================================================
   1. Design Tokens – Light & Dark Theme
   ========================================================= */

:root {
  /* Farben Light Theme – leicht kühler & mehr Tiefe */
  --bg: #f3f4f6;
  --surface: #ffffff;
  --text: #1c1c1c;
  --text-soft: #555555;
  --border: #dddddd;
  --accent: #3b6cf0;
  --accent-hover: #4e7cff;
  --code-bg: #f0f0ee;
  --shadow-soft: rgba(15, 23, 42, 0.06);
  --shadow-strong: rgba(15, 23, 42, 0.12);

  /* Typografie */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Layout */
  --max-width: 72rem;
}

/* Dark Theme – flacher, editorialer Look */
[data-theme="dark"] {
  --bg: #050507;
  --surface: #15151b;
  --text: #f4f4f6;
  --text-soft: #b9bac6;
  --border: #262630;
  --accent: #8ca4ff;
  --accent-hover: #a1b4ff;
  --code-bg: #1a1b22;
  --shadow-soft: rgba(0, 0, 0, 0.38);
  --shadow-strong: rgba(0, 0, 0, 0.75);
}

/* System Dark Fallback */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --bg: #050507;
    --surface: #15151b;
    --text: #f4f4f6;
    --text-soft: #b9bac6;
    --border: #262630;
    --accent: #8ca4ff;
    --accent-hover: #a1b4ff;
    --code-bg: #1a1b22;
    --shadow-soft: rgba(0, 0, 0, 0.38);
    --shadow-strong: rgba(0, 0, 0, 0.75);
  }
}


/* =========================================================
   2. Global Styles
   ========================================================= */

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Dark-Mode: etwas mehr „Print“-Schärfe */
[data-theme="dark"] body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover,
a:focus {
  color: var(--accent-hover);
}

/* horizontale Linie – editorial */
hr {
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  margin: 2rem 0;
}

[data-theme="dark"] hr {
  border-top-color: #393943;
}

/* Zentrale Breite */
.site-header__inner,
.intro__inner,
.features__inner,
.highlight__inner,
.site-footer__inner,
.essays__inner,
.lab__inner,
.projects__inner,
.about-section__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}


/* =========================================================
   3. Header – Editorial Look
   ========================================================= */

.site-header {
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-lg);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header__logo {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
}

.site-header__logo:hover {
  text-decoration: underline;
}

/* Dark: Logo etwas heller */
[data-theme="dark"] .site-header__logo {
  color: #f6f6f7;
}

.site-nav__list {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__item a {
  text-decoration: none;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.site-nav__item a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Aktive Navigation */
.site-nav__item a.is-active {
  color: var(--accent);
  text-decoration: underline;
}

/* Theme Toggle */
.theme-toggle {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

[data-theme="dark"] .theme-toggle {
  border-color: #3a3a48;
  color: #d0d0de;
}


/* =========================================================
   4. Main Layout & Page Intros
   ========================================================= */

.site-main {
  padding-bottom: var(--space-3xl);
}

/* Gemeinsames Intro für alle Seiten */
.intro {
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-2xl);
}
.intro__inner {
  /* max-width kommt aus Sammel-Selector oben */
}

.intro__line {
  margin: 0 0 var(--space-sm);
  font-size: clamp(2.1rem, 3vw, 3.3rem);
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: -0.02em;
}

/* Dark: etwas weicher, aber klar */
[data-theme="dark"] .intro__line {
  color: #f8f8fa;
  font-weight: 380;
}

/* Untertitel unter about / essays / lab / projects */
.intro__sub {
  margin-top: var(--space-sm);
  max-width: 42rem;
  color: var(--text-soft);
  font-size: 1.05rem;
  letter-spacing: 0.015em;
}

[data-theme="dark"] .intro__sub {
  color: #c5c5d2;
}


/* =========================================================
   5. Startseite – Features & Highlight
   ========================================================= */

.features {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-xl);
}

.features__inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-xl);
}

.feature-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: var(--space-xl) var(--space-lg);
  box-shadow: 0 10px 26px var(--shadow-soft);
}

[data-theme="dark"] .feature-card {
  background-color: #191922;
  border-color: #30303a;
}

/* Titel/Text */
.feature-card__title {
  margin: 0 0 var(--space-sm);
  font-size: 1.1rem;
  font-weight: 500;
}

.feature-card__text {
  margin: 0 0 var(--space-md);
  color: var(--text-soft);
  font-size: 0.95rem;
  font-weight: 420;
}

.feature-card__link {
  font-size: 0.9rem;
}

/* Highlight-Bereich (Startseite + andere) */
.highlight {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-2xl);
}

.highlight__inner {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: var(--space-2xl);
  box-shadow: 0 18px 40px var(--shadow-strong);
}

/* Dark: Panel sichtbar über dem Hintergrund, NOEMA-Style */
[data-theme="dark"] .highlight__inner {
  background-color: #1d1d25;
  border-color: #343441;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.82);
}

.highlight__label {
  margin: 0 0 var(--space-xs);
  color: var(--text-soft);
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  text-transform: uppercase;
}

[data-theme="dark"] .highlight__label {
  color: #9b9bb0;
}

.highlight__title {
  margin: 0 0 var(--space-md);
  font-size: 1.45rem;
  font-weight: 500;
}

[data-theme="dark"] .highlight__title {
  color: #f5f5f9;
}

.highlight__text {
  margin: 0 0 var(--space-md);
  color: var(--text-soft);
  font-size: 0.98rem;
  font-weight: 420;
}

[data-theme="dark"] .highlight__text {
  color: #d3d3e0;
}

/* Link im Highlight-Block */
.highlight__link {
  display: inline-block;
  margin-top: var(--space-sm);
  font-size: 0.95rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Spezieller Textbereich für About-Karten */
.highlight--about .highlight__text {
  max-width: 40rem;
  margin-left: 3rem;
}

/* Spezieller Textbereich für Startseiten-Highlight */
.highlight--home .highlight__text,
.highlight--home .highlight__link {
  max-width: 40rem;
  margin-left: 3rem;
}


/* =========================================================
   6. Footer
   ========================================================= */

.site-footer {
  border-top: 1px solid var(--border);
  padding-top: var(--space-lg);
  padding-bottom: var(--space-lg);
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-soft);
  font-size: 0.85rem;
}

.site-footer__copy {
  margin: 0;
}

.site-footer__nav a {
  margin-left: var(--space-md);
  color: var(--text-soft);
  text-decoration: none;
}

.site-footer__nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}


/* =========================================================
   7. Spezielle Typografie für Essay-Einzelseiten
   ---------------------------------------------------------
   <article class="highlight__text"> ... </article>
   ========================================================= */

.highlight__inner article.highlight__text {
  max-width: 65ch;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
}

[data-theme="dark"] .highlight__inner article.highlight__text {
  color: #e6e6f3;
}

/* Absätze */
.highlight__inner article.highlight__text p {
  margin-bottom: 1.25rem;
}

/* erster Absatz: minimal Abstand nach oben */
.highlight__inner article.highlight__text p:first-of-type {
  margin-top: 0.5rem;
}

/* H2 im Essay */
.highlight__inner article.highlight__text h2 {
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.55rem;
  line-height: 1.35;
}

/* H3 im Essay */
.highlight__inner article.highlight__text h3 {
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
  line-height: 1.35;
}

/* Zitate */
.highlight__inner article.highlight__text blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 3px solid rgba(0, 0, 0, 0.15);
  font-style: italic;
}

[data-theme="dark"] .highlight__inner article.highlight__text blockquote {
  border-left-color: rgba(255, 255, 255, 0.25);
}

/* Listen in Essays */
.highlight__inner article.highlight__text ul,
.highlight__inner article.highlight__text ol {
  margin: 1.25rem 0 1.75rem 1.5rem;
  padding-left: 0;
}

.highlight__inner article.highlight__text li {
  margin-bottom: 0.6rem;
  line-height: 1.65;
}

/* Fußnoten-Bereich in Essays */
.highlight__inner article.highlight__text .essay-footnotes {
  font-size: 0.70rem;
  line-height: 1.4;
  color: var(--text-soft);
  margin-top: 1.5rem;
}

/* einzelne Zeilen etwas kompakter */
.highlight__inner article.highlight__text .essay-footnotes p {
  margin-bottom: 0.25rem;
}


/* =========================================================
   8. Essays-Übersicht (essays.php)
   ========================================================= */

.essays {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-3xl);
}

.essays__inner {
  /* max-width + padding kommen aus Sammel-Selector */
}

.essays__grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

/* Kartenstil – wird auch für Lab & Projects benutzt */
.essay-card,
.lab-card,
.project-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: var(--space-xl) var(--space-lg);
  box-shadow: 0 12px 30px var(--shadow-soft);
}

[data-theme="dark"] .essay-card,
[data-theme="dark"] .lab-card,
[data-theme="dark"] .project-card {
  background-color: #191922;
  border-color: #32323f;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.85);
}

.essay-card__label,
.lab-card__label,
.project-card__label {
  margin: 0 0 var(--space-xs);
  color: var(--text-soft);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.essay-card__title,
.lab-card__title,
.project-card__title {
  margin: 0 0 var(--space-sm);
  font-size: 1.35rem;
  font-weight: 500;
}

.essay-card__title a,
.project-card__title a {
  color: var(--text);
  text-decoration: none;
}

.essay-card__title a:hover,
.project-card__title a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.essay-card__teaser,
.lab-card__text,
.project-card__text {
  margin: 0 0 var(--space-md);
  color: var(--text-soft);
  font-size: 0.98rem;
  line-height: 1.6;
}

/* Zeilenlänge & Einzug für Essays (Desktop/Tablet) */
.essay-card__teaser,
.essay-card__meta {
  max-width: 40rem;
  margin-left: 2rem;
}

.essay-card__meta,
.project-card__meta {
  margin: 0;
  font-size: 0.9rem;
}

.essay-card__link,
.lab-card__link,
.project-card__link {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Lab-Link-Text leicht typisiert */
.lab-card__link {
  margin-top: var(--space-sm);
  font-size: 0.9rem;
}

.lab-card__link a {
  color: var(--accent);
}

.lab-card__link a:hover {
  color: var(--accent-hover);
}

.essays__empty {
  color: var(--text-soft);
  font-size: 0.98rem;
}


/* =========================================================
   9. Lab-Übersicht (lab.php)
   ========================================================= */

.lab {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-3xl);
}

.lab__inner {
  /* max-width + padding über Sammel-Selector */
}

.lab__grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

/* Meta-Zeile: Label links, Status rechts */
.lab-card__meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2px;
}

/* Status-Badge im aktuellen Projekt */
.lab-card__status {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Visuelle Betonung des aktuellen Lab-Projekts */
.lab-card--current {
  box-shadow: 0 18px 40px var(--shadow-strong);
}

/* Zeilenlänge & Einzug für Lab-Karten (Desktop/Tablet) */
.lab-card__text,
.lab-card__link {
  max-width: 40rem;
  margin-left: 2rem;
}


/* =========================================================
   10. Projects-Seite (projects.php)
   ========================================================= */

.projects {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-3xl);
}

.projects__inner {
  /* max-width + padding via Sammel-Selector */
}

.projects__grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

/* Visuelle Betonung des aktuellen Projekts */
.project-card--current {
  box-shadow: 0 18px 40px var(--shadow-strong);
}

/* Zeilenlänge & Einzug für Projekt-Karten (Desktop/Tablet) */
.project-card__text,
.project-card__meta {
  max-width: 40rem;
  margin-left: 2rem;
}


/* =========================================================
   11. Projekt-Detail: Typografie
   ========================================================= */

.project-detail-text p,
.project-detail-text li {
  line-height: 1.48;
  margin-bottom: 0.6rem;
}


/* =========================================================
   12. About-Seite (about-section Layout – aktuell Reserve)
   ========================================================= */

.about-section {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
}

.about-section__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr);
  gap: var(--space-xl);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: var(--space-2xl);
  box-shadow: 0 18px 40px var(--shadow-strong);
}

[data-theme="dark"] .about-section__inner {
  background-color: #1a1a22;
  border-color: #333343;
}

.about-section__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.about-section__label {
  margin: 0;
  color: var(--text-soft);
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.about-section__title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 500;
}

.about-section__content {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--text-soft);
}

.about-section__content p {
  margin-top: 0;
  margin-bottom: 1.1rem;
}

.about-section__content p:last-child {
  margin-bottom: 0;
}


/* =========================================================
   13. Responsive
   ========================================================= */

@media (max-width: 960px) {
  .features__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .highlight__inner {
    padding: var(--space-xl);
  }

  .about-section__inner {
    grid-template-columns: 1fr;
  }

  /* About-Highlights: auf Tablet/Phone ohne Einzug, volle Breite */
  .highlight--about .highlight__text {
    max-width: 100%;
    margin-left: 0;
  }

  /* Startseiten-Highlight: auf Tablet/Phone ohne Einzug, volle Breite */
  .highlight--home .highlight__text,
  .highlight--home .highlight__link {
    max-width: 100%;
    margin-left: 0;
  }

  /* Lab-Karten: auf Tablet/Phone volle Breite, kein Einzug */
  .lab-card__text,
  .lab-card__link {
    max-width: 100%;
    margin-left: 0;
  }

  /* Essays-Karten: auf Tablet/Phone volle Breite, kein Einzug */
  .essay-card__teaser,
  .essay-card__meta {
    max-width: 100%;
    margin-left: 0;
  }

  /* Projects-Karten: auf Tablet/Phone volle Breite, kein Einzug */
  .project-card__text,
  .project-card__meta {
    max-width: 100%;
    margin-left: 0;
  }
}

/* Projekt-Detail: großes Hero-Bild */

.project-hero {
  margin: 24px 0 32px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 26px 70px var(--shadow-strong);
}

.project-hero img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

/* Stills-Grid auf Projekt-Detailseiten */

.project-stills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 32px;
  max-width: 600px;      /* vorher 480px */
  margin: 32px auto 32px;
}

.project-stills__item {
  text-align: center;
}

.project-stills__link {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 18px 45px var(--shadow-strong);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    filter 0.3s ease;
}

.project-stills__item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;   /* erzwingt 16:9 – perfekt für deine 1920x1080-Stills */
  object-fit: cover;
}

.project-stills__link:hover,
.project-stills__link:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 28px 65px var(--shadow-strong);
  filter: brightness(1.06);
}

.project-stills__item figcaption {
  margin-top: 4px;      /* etwas dichter ans Bild */
  font-size: 0.78rem;   /* klar als Meta-Info, nicht „zweite Headline“ */
  line-height: 1.25;    /* kompakt, bleibt aber gut lesbar */
  color: var(--text-soft);
}


/* Tablet: etwas breiter möglich, aber 3 Spalten bleiben */

@media (max-width: 960px) {
  .project-stills {
    max-width: 420px;
    gap: 12px 24px;
  }
}

/* Mobile: ein Still pro Zeile + mobile Typo-Anpassungen */

@media (max-width: 640px) {
  .project-stills {
    grid-template-columns: 1fr;
    max-width: 320px;
    gap: 16px;
  }

  /* Essay-Text auf Mobile: luftig, aber gut lesbar */
  .highlight__inner article.highlight__text {
    font-size: 1.02rem;
    line-height: 1.7;
    padding-bottom: 0.25rem;
  }

  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .about-section__inner {
    padding: var(--space-xl);
  }

  .essay-card,
  .lab-card,
  .project-card {
    padding: var(--space-lg);
  }

  .essay-card__title,
  .lab-card__title,
  .project-card__title {
    font-size: 1.2rem;
  }
}
