/* ===========================
   COLOR THEMES
=========================== */

/* Default (System Light) */
:root {
  /* leicht getöntes Seiten-BG statt reinweiß */
  --bg: #f4f6fb; /* zartes Off-White/Blue-Gray */
  --panel: #ffffff; /* Karten/Header bleiben weiß für klaren Kontrast */
  --text: #0d1b2a;
  --muted: #4b5a6b;
  --accent: #2d6cf6;
  --radius: 16px;
}

/* Default (System Dark preference) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1624;
    --panel: #1a2437;
    --text: #e8eef8;
    --muted: #b8c4d9;
    --accent: #3f8cff;
  }
}

/* User override: force Light */
:root[data-theme="light"] {
  --bg: #f7f9fc;
  --panel: #ffffff;
  --text: #0d1b2a;
  --muted: #4b5a6b;
  --accent: #2d6cf6;
}

/* User override: force Dark */
:root[data-theme="dark"] {
  --bg: #0e1624;
  --panel: #1a2437;
  --text: #e8eef8;
  --muted: #b8c4d9;
  --accent: #3f8cff;
}

/* ===========================
   BASE STRUCTURE
=========================== */

body {
  margin: 0;
  font:
    16px/1.6 system-ui,
    sans-serif;
  background: var(--bg);
  color: var(--text);
}

.nav {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--panel);
}

.nav .brand {
  font-weight: 700;
  margin-right: auto;
}

.tabs a {
  color: var(--text);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
}

.tabs a.active {
  background: var(--accent);
}

.container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

footer {
  text-align: center;
  margin: 3rem 0 2rem;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.card img {
  max-width: 96%;
  max-height: 75vh;
  height: auto;
  display: block;
  margin: 12px auto;
  border-radius: 12px;
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;

  display: none;
  align-items: center;
  justify-content: center;

  z-index: 2000;
  padding: 20px;

  /* Blur + dezente Abdunklung */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); /* Safari */

  background: rgba(0, 0, 0, 0.35); /* leicht abdunkeln */
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 95vw;
  max-height: 90vh;
  border-radius: 12px;
}

.pdf-actions {
  display: flex;
  gap: 0.6rem;
  margin: 0.6rem 0 1rem;
}

.btn {
  display: inline-block;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  background: var(--panel);
}

.btn:hover {
  text-decoration: none;
}

.pdf-viewer {
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
}

/* Höhe: passt die Zahl an deine Header/Footer an */
.pdf-frame {
  width: 100%;
  height: 80vh;
  border: 0;
}

/* ===========================
   LINK STYLE
=========================== */

a {
  color: color-mix(in srgb, var(--text) 85%, var(--accent) 15%);
  text-decoration: none;
  transition:
    color 0.2s ease,
    text-decoration 0.2s ease;
}

a:visited {
  color: color-mix(in srgb, var(--text) 85%, var(--accent) 15%);
}

a:hover,
a:focus {
  text-decoration: underline;
  color: color-mix(in srgb, var(--text) 70%, var(--accent) 30%);
}

/* ===========================
   THEME TOGGLE BUTTON
=========================== */

.icon-btn {
  margin-left: 0.5rem;
  padding: 0.35rem 0.6rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--text) 15%, transparent);
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  color: var(--text);
  cursor: pointer;
}

.icon-btn:hover {
  filter: brightness(1.02);
}

/* Header visuell vom Body trennen */
header {
  position: sticky; /* optional: am Seitenanfang kleben */
  top: 0;
  z-index: 50;
  background: var(--panel); /* weißer Header über leicht getöntem Body */
  border-bottom: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); /* ganz dezente Tiefe */
}

/* vorhandene .nav bleibt – hier nur minimal veredeln */
.nav {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: transparent; /* Panel-Farbe kommt jetzt vom header */
}

.card {
  background: var(--panel);
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  box-shadow: 0 6px 20px rgba(10, 31, 68, 0.06); /* sehr dezent */
}

/* Sanfte Theme-Transitions (nur wenn Klasse .theme-anim aktiv ist) */
@media (prefers-reduced-motion: no-preference) {
  :root.theme-anim body,
  :root.theme-anim header,
  :root.theme-anim .nav,
  :root.theme-anim .tabs a,
  :root.theme-anim .card,
  :root.theme-anim footer,
  :root.theme-anim .btn,
  :root.theme-anim .pdf-viewer,
  :root.theme-anim .grid,
  :root.theme-anim .container {
    transition:
      background-color 0.25s ease,
      color 0.25s ease,
      border-color 0.25s ease,
      box-shadow 0.25s ease,
      outline-color 0.25s ease;
  }
}

/* iFrames & PDF nicht animieren (vermeidet „flash“) */
.pdf-frame {
  transition: none !important;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  display: grid;
  gap: 1rem;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--panel);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
}

.contact-list a {
  font-weight: 500;
  color: color-mix(in srgb, var(--text) 85%, var(--accent) 15%);
}

.contact-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  opacity: 0.9;
}

/* Kacheln vollständig klickbar & zugänglich */
.project-card {
  display: block;
  color: inherit; /* Textfarbe wie normaler Text */
  text-decoration: none; /* keine Unterstreichung */
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  transition:
    transform 0.12s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}
.project-card:not([data-status]):hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.project-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* In Karten die Abstände sauber halten */
.project-card h3 {
  margin: 0 0 0.4rem;
}
.project-card p {
  margin: 0;
}
/* ===========================
   PROJECT STATUS COLOR CODING
=========================== */

/* kleine Status-"Pille" oben rechts */
.project-card {
  position: relative;
}

.project-card::after {
  content: attr(data-status);
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
  background: color-mix(in srgb, var(--panel) 85%, transparent);
  opacity: 0.95;
}

/* Farblogik über ein Accent pro Status */
.project-card[data-status="active"] {
  border-color: color-mix(in srgb, #22c55e 35%, transparent);
}
.project-card[data-status="active"]::after {
  color: #22c55e;
  border-color: color-mix(in srgb, #22c55e 35%, transparent);
}

.project-card[data-status="wip"] {
  border-color: color-mix(in srgb, #3b82f6 35%, transparent);
}
.project-card[data-status="wip"]::after {
  color: #3b82f6;
  border-color: color-mix(in srgb, #3b82f6 35%, transparent);
}

.project-card[data-status="paused"] {
  border-color: color-mix(in srgb, #f59e0b 35%, transparent);
}
.project-card[data-status="paused"]::after {
  color: #f59e0b;
  border-color: color-mix(in srgb, #f59e0b 35%, transparent);
}

.project-card[data-status="idea"] {
  border-color: color-mix(in srgb, #a855f7 35%, transparent);
}
.project-card[data-status="idea"]::after {
  color: #a855f7;
  border-color: color-mix(in srgb, #a855f7 35%, transparent);
}

.project-card[data-status="done"] {
  border-color: color-mix(in srgb, #14b8a6 35%, transparent);
}
.project-card[data-status="done"]::after {
  color: #14b8a6;
  border-color: color-mix(in srgb, #14b8a6 35%, transparent);
}

.project-card[data-status="archived"] {
  opacity: 0.75;
}
.project-card[data-status="archived"]::after {
  color: color-mix(in srgb, var(--text) 55%, transparent);
}
/* ===========================
   MOBILE NAV (Burger)
=========================== */
.icon-btn.burger {
  display: none;
}

@media (max-width: 800px) {
  header .nav {
    position: relative;
  }

  /* Burger sichtbar machen */
  .icon-btn.burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    background: var(--panel);
    border: 1px solid var(--border, #e5e7eb);
    cursor: pointer;
  }

  /* Tabs werden zum Dropdown */
  .tabs {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 1rem;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    background: var(--panel);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    min-width: 12rem;
    z-index: 50;
  }

  /* Wenn Header-Navigation geöffnet ist, zeige Dropdown */
  header .nav.open .tabs {
    display: flex;
  }

  /* Klickfreundliche Items */
  .tabs a {
    display: block;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
  }
}
