/* =====================================================================
   main.css  –  mylab.earth
   Ladereihenfolge: main.css → header.css
   ===================================================================== */


/* ===================================================================
   1. DESIGN TOKENS  (Light + Dark)
   =================================================================== */
:root {
  --bg:              219, 222, 223;
  --card:            #dbdedf;
  --text:            #0b1220;
  --muted:           #51607a;
  --accent:          #b46f57;
  --accent-hover:    rgba(180, 111, 87, 0.3);
  --glass:           rgba(219, 222, 223, 0.4);
  --mobile-glass:    rgba(237, 237, 237, 0.5);
  --shadow:          0 6px 20px rgba(11, 18, 32, 0.06);
  --radius:          10px;
  --panel-meta:      rgba(77, 78, 78, 0.7);
  --footer-text:     #333;
  --footer-popup-bg: rgba(219, 222, 223, 0.6);
  --dust-shadow-color: rgba(255, 255, 255, 0.1);
  --dust-fill-color:   rgba(255, 255, 255, 0.1);

  --blob-one-bg:   radial-gradient(circle at 30% 30%, rgba(38,38,91,.95) 0%, rgba(38,38,91,.8) 35%, transparent 65%);
  --blob-two-bg:   radial-gradient(circle at 70% 60%, rgba(66,70,100,.95) 0%, rgba(66,70,100,.7) 30%, transparent 65%);
  --blob-three-bg: radial-gradient(circle at 50% 40%, rgba(180,111,87,.9) 0%, rgba(180,111,87,.35) 40%, transparent 70%);
  --blob-four-bg:  radial-gradient(circle at 60% 40%, rgba(38,38,91,.95) 0%, rgba(38,38,91,.2) 35%, transparent 70%);
  --pattern-bg:    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="800"><circle cx="50" cy="100" r="2" fill="rgba(255,255,255,0.05)"/><circle cx="200" cy="300" r="1.5" fill="rgba(255,255,255,0.05)"/><circle cx="400" cy="600" r="3" fill="rgba(255,255,255,0.08)"/><circle cx="800" cy="150" r="1" fill="rgba(255,255,255,0.04)"/><circle cx="1000" cy="700" r="2" fill="rgba(255,255,255,0.06)"/></svg>');
  --pattern-opacity: 0.8;

  color-scheme: light;
}

:root.dark {
  --bg:              11, 11, 16;
  --card:            rgba(98, 99, 100, 0.7);
  --text:            #e6eef8;
  --muted:           #98a6c2;
  --accent:          #b46f57;
  --accent-hover:    rgba(180, 111, 87, 0.3);
  --glass:           rgba(11, 11, 16, 0.5);
  --mobile-glass:    rgba(11, 11, 16, 0.5);
  --shadow:          0 10px 30px rgba(2, 6, 23, 0.6);
  --panel-meta:      rgba(219, 222, 223, 0.8);
  --footer-text:     #eee;
  --footer-popup-bg: rgba(11, 11, 16, 0.6);

  --blob-one-bg:   radial-gradient(circle at 30% 30%, rgba(38,38,91,.95) 0%, rgba(38,38,91,.45) 35%, transparent 65%);
  --blob-two-bg:   radial-gradient(circle at 70% 60%, rgba(66,70,100,.95) 0%, rgba(66,70,100,.35) 30%, transparent 65%);
  --blob-three-bg: radial-gradient(circle at 50% 40%, rgba(180,111,87,.9) 0%, rgba(180,111,87,.18) 40%, transparent 70%);
  --blob-four-bg:  radial-gradient(circle at 60% 40%, rgba(38,38,91,.95) 0%, rgba(38,38,91,.45) 35%, transparent 70%);
}


/* ===================================================================
   2. RESET
   =================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}


/* ===================================================================
   3. GLOBAL TRANSITIONS
   Nur Farb- / Schatten-Übergänge — KEIN transform/layout!
   transform ist hier absichtlich ausgeschlossen (verhindert Layout-Jank
   beim Resize und bei position:sticky im Header).
   =================================================================== */
*, *::before, *::after {
  transition:
    background-color 0.4s ease,
    color            0.4s ease,
    border-color     0.4s ease,
    box-shadow       0.4s ease;
}


/* ===================================================================
   4. BASE
   =================================================================== */
html, body {
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  font-family: Inter, system-ui, sans-serif;
  background: rgb(var(--bg));
  color: var(--text);
}

/* body als Column-Flex – KEIN align-items:center, da sonst Block-Kinder
   auf content-width schrumpfen und z.B. .content nicht mehr full-width ist */
body {
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}


/* ===================================================================
   5. PAGE STRUCTURE
   =================================================================== */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  margin-top: 10px;
}

/* Haupt-Inhaltsbereich mit seitenweitem max-width und Padding */
.content {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1500px;
  margin: 40px auto;
  padding-left: 32px;
  padding-right: 32px;
}


/* ===================================================================
   6. JS-DISABLED WARNING
   =================================================================== */
.no-js-warning {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.jsw-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}
.jsw-box {
  background: white;
  color: black;
  padding: 20px;
  width: 90%;
  max-width: 400px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
  text-align: center;
}
.jsw-btn {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 15px;
  background: #444;
  color: white;
  border-radius: 8px;
  cursor: pointer;
}
.jsw-close-checkbox { display: none; }
.jsw-close-checkbox:checked ~ .jsw-overlay,
.jsw-close-checkbox:checked ~ .jsw-box { display: none; }
.js-enabled .no-js-warning { display: none !important; }


/* ===================================================================
   7. NAVIGATION  (inline, .nav)
   =================================================================== */
.nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
.nav a:hover {
  background: var(--accent-hover);
  color: var(--text);
}

/* Globale Icon-Helper */
.icon {
  width: 24px;
  height: 24px;
  color: var(--text);
  border-radius: 50%;
  padding: 5px;
  box-sizing: content-box;
}
.icon path, .icon circle { fill: none; stroke: currentColor; }

/* Light/Dark Icon Toggle */
.icon.light { display: none  !important; }
.icon.dark  { display: inline-block !important; }
html.dark .icon.light { display: inline-block !important; }
html.dark .icon.dark  { display: none !important; }

/* Burger (wird von header.css übernommen, hier nur Fallback) */
.burger { display: none; }


/* ===================================================================
   8. BUTTONS  (.btn)
   Hinweis: header.css definiert .action-btn für den Header.
   .btn hier ist für Content-Bereiche (Hero, Cards, etc.)
   =================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}
.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-secondary {
  background: var(--glass);
  color: var(--text);
  backdrop-filter: blur(6px);
}


/* ===================================================================
   9. HERO  –  Template-Klassen
   ─────────────────────────────────────────────────────────────────────
   WICHTIG: .hero-container ist LEGACY (originale 2-Spalten-Struktur).
   Das PHP-Template templates/hero.php verwendet .tpl-hero, um diesen
   Konflikt zu vermeiden. Beide Klassen sind hier definiert.
   =================================================================== */

/* Legacy – wird nur noch direkt im HTML (index.html, about.html) benutzt */
/* .hero-container: Legacy-Klasse für statische HTML-Seiten (index.html, about.html)
   Das PHP-Template verwendet .tpl-hero stattdessen. */
.hero-container {
  position: relative;
  z-index: 2;
  width: 100%;
}

/* Template-Klasse – von templates/hero.php ausgegeben */
.tpl-hero {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-text-group {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
}

.eyebrow {
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
}

.hero-text-group h1 {
  font-size: clamp(1.4rem, 4vw + 0.5rem, 3rem);
  line-height: 1.15;
}

.hero-description {
  opacity: 0.85;
  line-height: 1.6;
  font-size: 1rem;
  overflow-wrap: break-word;
  hyphens: auto;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Hero-interne Nav-Links */
.hero-nav { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-nav a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(6px);
  transition: transform 0.18s ease, background 0.18s ease;
}
.hero-nav a:hover { transform: translateY(-2px); background: var(--accent-hover); }


/* ===================================================================
   10. PANEL  (Specs-Box mit Tag + Bullets)
   =================================================================== */
.tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
  background: rgba(180, 111, 87, 0.15);
  color: #b46f57;
  font-size: 12px;
}
.tag:hover { background: var(--accent-hover); }

.panel {
  background: var(--glass);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  backdrop-filter: blur(6px);
  width: 100%;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.panel-meta {
  text-align: right;
  font-size: 13px;
  color: var(--panel-meta);
  align-self: flex-start;
  padding: 6px 0;
}

.panel-title {
  font-weight: 700;
  line-height: 1.5;
}

ul.panel-bullets {
  list-style: none;
  padding-left: 1em;
}
ul.panel-bullets li::before {
  content: "▸";
  color: #b46f57;
  display: inline-block;
  width: 1em;
  margin-left: -1em;
}


/* ===================================================================
   11. QUOTE BOX
   =================================================================== */
.quote-box {
  background: var(--glass);
  backdrop-filter: blur(12px);
  border-radius: 18px;
  padding: 1rem 1.25rem;
  text-align: center;
  line-height: 1.6;
}
.quote-author {
  margin-top: 0.5rem;
  font-weight: bold;
  opacity: 0.85;
}


/* ===================================================================
   12. COLUMNS-WRAPPER  (von templates/columns.php)
   Die eigentliche Grid-Logik sitzt als Inline-Style.
   Hier nur das, was CSS-seitig sauber definiert werden kann.
   =================================================================== */
.cols-wrapper {
  /* max-width, grid-template-columns, gap → Inline-Style aus PHP */
}
.col-item {
  min-width: 0;          /* verhindert Overflow bei langen Inhalten */
  display: flex;
  flex-direction: column;
}


/* ===================================================================
   13. LOGO
   =================================================================== */
.logo-light { display: block; }
.logo-dark  { display: none;  }
html.dark .logo-light { display: none;  }
html.dark .logo-dark  { display: block; }


/* ===================================================================
   14. CARDS GRID
   =================================================================== */
/* .cards-grid: grid-template-columns, gap, grid-auto-rows werden
   vom PHP-Template als Inline-Style gesetzt (cards-grid.php).
   Hier nur die visuell-neutralen Defaults. */
.cards-grid {
  width: 100%;
  margin: 2rem auto;
}

/* ── Card ── */
.card {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--glass);
  border: 1px solid rgba(var(--bg), 0.1);
  border-radius: 14px;
  backdrop-filter: blur(12px) saturate(160%);
  overflow: hidden;
  cursor: pointer;
  /* will-change: transform pre-promotet auf GPU-Ebene → kein Re-Rasterize beim Hover */
  will-change: transform;
  /* translateZ(0) erzwingt Compositing-Layer auch vor dem ersten Hover */
  transform: translateZ(0);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}
.card:hover {
  /* scale3d statt scale → explizit 3D-Compositing, bleibt scharf */
  transform: scale3d(1.03, 1.03, 1);
  box-shadow: 0 15px 35px var(--accent-hover);
}

/* Card-Bild — object-fit und object-position per inline style überschreibbar */
.card img, .card picture img {
  object-fit: cover;
  object-position: center;
  width: 100%;
  height: 100%;
  display: block;
}
/* contain-Variante: schwarzen Rand durch Hintergrundfarbe füllen */
.card img[style*="contain"], .card picture img[style*="contain"] {
  background: var(--glass);
}

.card svg {
  width: 100%;
  height: 100%;
  display: block;
  padding: 1rem;
}

/* Card-Text (normal + hover) */
.card-content {
  position: relative;
  z-index: 2;
  padding: 1rem;
  text-align: center;
  transition: opacity 0.25s, transform 0.25s;
}

.card-hover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-radius: inherit;
  background: rgba(var(--bg), 0.7);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s;
  z-index: 3;
  text-align: justify;
  hyphens: auto;
  overflow-wrap: break-word;
}

.card:hover .card-content {
  opacity: 0;
  transform: translateY(-10px);
}
.card:hover .card-hover {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}


/* ===================================================================
   15. FOOTER
   =================================================================== */
/* Footer */
footer {
  width: 100%;
  position: relative;
  z-index: 2;
  background-color: rgba(var(--bg), 0.55);
  color: var(--footer-text);
  font-size: 0.82rem;
  display: flex;
  justify-content: center;
  padding: 2rem 0 1.5rem;
  box-shadow: 0 -4px 10px rgba(var(--bg), 0.7);
}
.footer-inner {
  max-width: 1400px;
  width: 100%;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Drei-Spalten-Grid */
.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  gap: 16px;
}
.footer-col { display: flex; flex-direction: column; gap: 4px; }
.footer-col--left  { align-items: flex-start; }
.footer-col--center { align-items: center; justify-self: center; text-align: center; }
.footer-col--right { align-items: flex-end; justify-self: end; }

.footer-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .45;
  font-weight: 600;
}
.footer-credit-link {
  color: var(--footer-text);
  text-decoration: none;
  opacity: .7;
  transition: opacity .18s;
  font-weight: 500;
}
.footer-credit-link:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }

.footer-copy {
  font-weight: 600;
  opacity: .85;
}
.footer-tagline {
  font-size: .72rem;
  opacity: .4;
}

.footer-nav {
  display: flex;
  gap: 16px;
}
.footer-nav a {
  color: var(--footer-text);
  text-decoration: none;
  opacity: .6;
  transition: opacity .18s;
}
.footer-nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }

/* Tech-Credits */
.footer-tech {
  font-size: .68rem;
  opacity: .3;
  text-align: center;
}
.footer-tech a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-tech a:hover { opacity: .6; }

/* Mobile */
@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-col--left,
  .footer-col--right { align-items: center; justify-self: center; }
  .footer-nav { justify-content: center; }
}


/* ===================================================================
   16. BACKGROUND LAYERS  (Blobs, Pattern, Dust)
   =================================================================== */
.bg-layer,
#dustCanvas,
#dust {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.bg-layer {
  backdrop-filter: blur(16px);
  background: rgba(0, 0, 0, 0.15);
}

.blob {
  position: absolute;
  width: 80vmax;
  height: 80vmax;
  border-radius: 50%;
  filter: blur(120px) saturate(120%);
  transform-origin: center;
  opacity: 0.95;
  mix-blend-mode: screen;
  animation: float 25s ease-in-out infinite;
}
.blob.one   { background: var(--blob-one-bg);   left: -20%; top: -25%;   animation-duration: 28s; }
.blob.two   { background: var(--blob-two-bg);   right: -15%; top: 5%;    animation-duration: 32s; }
.blob.three { background: var(--blob-three-bg); left: 15%; bottom: -20%; animation-duration: 30s; }
.blob.four  { background: var(--blob-four-bg);  right: 20%; bottom: -15%; animation-duration: 25s; }

@keyframes float {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
  50%  { transform: translate3d(10vw, -6vw, 0) rotate(15deg); }
  100% { transform: translate3d(0, 0, 0) rotate(0deg); }
}

.pattern {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: var(--pattern-opacity);
  mix-blend-mode: overlay;
  background-image: var(--pattern-bg);
  background-repeat: repeat;
  background-size: 600px 400px;
  animation: patternShift 36s linear infinite;
}
@keyframes patternShift {
  from { background-position: 0 0; }
  to   { background-position: 600px 400px; }
}


/* ===================================================================
   17. MISC UTILITIES
   =================================================================== */
.wrap {
  width: 100%;
  max-width: 900px;
  background: var(--card);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px) saturate(120%);
  border: 1px solid var(--glass);
  display: flex;
  flex-direction: column;
}

.title { white-space: pre-line; }


/* ===================================================================
   18. RESPONSIVE
   =================================================================== */
@media (max-width: 768px) {

  /* Layout */
  .content {
    padding-left: 16px;
    padding-right: 16px;
    margin: 20px auto;
  }

  /* Hero */
  .hero-container,
  .tpl-hero {
    width: 100%;
    margin: 0;
  }

  /* Quote */
  .quote-box {
    max-width: 100%;
    margin-top: 0;
  }

  /* Cards */
  /* Mobile: cards-grid wird einzeilig, aber Inline-Style des Templates hat Vorrang.
     Nur wenn kein Inline-Style → als Fallback 1 Spalte. */
  .cards-grid { grid-template-columns: 1fr !important; grid-auto-rows: 150px; }
  .card { grid-column: span 1 !important; }

  /* Columns-Template → untereinander */
  .cols-wrapper {
    grid-template-columns: 1fr !important;
  }
  .col-item {
    justify-content: flex-start !important;
    align-items: stretch !important;
  }

}
/* ── EN-AU: Down Under ──────────────────────────────────────────────────── */
html.lang-au { transform:rotate(180deg); transform-origin:50% 50%; min-height:100vh; }
