/* ARCHON-Projektseite — Terminal-Palette, abgestimmt auf ui/theme.py (App v0.9.x).
   Grün als dominante Farbe, Bernstein als Akzent, Rot exklusiv für Warn-/Gefahrenhinweise. */
:root {
  --green: #00ff66;
  --green-dim: #004411;
  --amber: #ffb000;
  --warn: #ff3b3b;
  --threat: #ff003c;
  --threat-dim: #440011;
  --bg: #0a0f0d;
  --panel: #0d1310;
  --border: #0a2a14;
  --dim: #4d6b57;
}
* { box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--green);
  font-family: "Consolas", "Courier New", monospace;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--green); }
.glow { text-shadow: 0 0 8px currentColor; }
.icon { display: inline-block; vertical-align: -3px; width: 1.1em; height: 1.1em; }
.icon svg { width: 100%; height: 100%; display: block; }

/* ---------- CRT-Scanline-Overlay ---------- */
/* Rein dekorativ, pointer-events:none -- blockiert keine Klicks/Selektion
   darunter. Sehr feine Linien (1px Dunkel/1px transparent), damit Lesbarkeit
   bei Fließtext nicht leidet. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 9999;
}

/* Blinkender Cursor hinter Terminal-artigen Überschriften -- Klasse statt
   global auf h1/h2, damit sie gezielt nur dort erscheint, wo ein "Terminal
   tippt gerade"-Effekt beabsichtigt ist (Hero-Headline), nicht überall. */
.cursor-blink::after {
  content: "_";
  animation: cursor-blink 1s step-end infinite;
}
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ---------- Header (mirrors ui/main_window.py _build_header) ---------- */
.site-header {
  position: relative;
  padding: 46px 20px 22px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
/* Sprachumschalter, oben rechts im Header -- siehe inc/i18n.php. Position
   absolute statt Teil des zentrierten Headerflusses, damit er DE/EN-Auswahl
   nicht mit Marke/Stat-Pillen/Nav um die horizontale Mitte konkurrieren lässt. */
.lang-switch {
  position: absolute;
  top: 16px;
  right: 20px;
  display: flex;
  gap: 4px;
}
.lang-switch a {
  color: var(--dim);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 0.72em;
  letter-spacing: 0.05em;
}
.lang-switch a:hover {
  border-color: var(--green);
  color: var(--green);
}
.lang-switch a.active {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-dim);
  font-weight: bold;
}
.site-header .brand-icon {
  width: 92px;
  height: 92px;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 18px rgba(0, 255, 102, 0.35));
}
.site-header h1 {
  font-size: 2.6em;
  letter-spacing: 0.3em;
  color: var(--green);
  margin: 0 0 8px;
}
.site-header p.tagline {
  color: var(--dim);
  letter-spacing: 0.12em;
  font-size: 0.85em;
  text-transform: uppercase;
  margin: 0 0 20px;
}
.stat-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.stat-pill {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 16px;
  text-align: left;
  min-width: 96px;
}
.stat-pill .stat-label {
  display: block;
  color: var(--dim);
  font-size: 0.68em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.stat-pill .stat-value {
  display: block;
  color: var(--green);
  font-weight: bold;
  font-size: 0.95em;
  letter-spacing: 0.03em;
}
.stat-pill.amber .stat-value { color: var(--amber); }
.stat-pill.threat { border-color: var(--threat); cursor: pointer; }
.stat-pill.threat .stat-value { color: var(--threat); }
.stat-pill.threat:hover { background: var(--threat-dim); }
.nav-pills {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.nav-pills a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.82em;
  letter-spacing: 0.05em;
  transition: all 0.15s ease;
}
.nav-pills a:hover,
.nav-pills a.active {
  border-color: var(--green);
  background: var(--green-dim);
}

/* ---------- Layout ---------- */
main {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 20px 70px;
}
main.main-narrow { max-width: 680px; }
section { margin-bottom: 44px; }
h2.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  letter-spacing: 0.15em;
  font-size: 1.05em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
h3 { color: var(--amber); letter-spacing: 0.05em; font-size: 1em; }

/* ---------- Hero (zweispaltig: Text + Core-Visual) ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: center;
  margin-bottom: 44px;
}
.hero-text .hero-lead {
  font-size: 1.1em;
  line-height: 1.7;
  margin: 0 0 24px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* Core-Visual: gefiltertes Portrait in einem "Hologramm-Tank" -- der Filter
   (Graustufen -> Sepia -> Grünstich) macht aus einem gewöhnlichen Foto eine
   monochrome Terminal-Grafik, passend zur restlichen grünen Phosphor-Palette,
   statt eines deplatzierten Farbfotos. */
.core-visual {
  background: var(--panel);
  border: 1px solid var(--green);
  border-radius: 8px;
  padding: 10px;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.8), 0 0 24px rgba(0, 255, 102, 0.08);
}
.core-visual img {
  display: block;
  width: 100%;
  border-radius: 4px;
  filter: grayscale(100%) sepia(100%) hue-rotate(70deg) contrast(150%) brightness(0.9);
  mix-blend-mode: screen;
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .core-visual { max-width: 360px; margin: 0 auto; }
}

/* ---------- Feature-Box-Grid (Karten statt Liste, für Hero-Bereich) ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.feature-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.feature-box:hover {
  border-color: var(--green);
  box-shadow: 0 0 18px rgba(0, 255, 102, 0.12);
}
.feature-box .icon { color: var(--green); margin-bottom: 10px; width: 1.6em; height: 1.6em; }
.feature-box h4 {
  margin: 0 0 8px;
  color: var(--green);
  letter-spacing: 0.05em;
  font-size: 0.95em;
}
.feature-box p { margin: 0; color: var(--dim); font-size: 0.85em; }

/* ---------- Panel-Box (mirrors QWidget#panelBox) ---------- */
.panel-box {
  background: var(--panel);
  border: 1px solid var(--green);
  border-radius: 8px;
  padding: 24px;
}
.panel-box.subtle { border-color: var(--border); }
.panel-box.danger { border: 2px solid var(--threat); color: var(--threat); }
.panel-box .panel-title {
  color: var(--green);
  font-weight: bold;
  letter-spacing: 0.15em;
  font-size: 0.85em;
  margin: 0 0 4px;
}
.panel-box .panel-subtitle {
  color: var(--dim);
  font-size: 0.78em;
  letter-spacing: 0.03em;
  margin: 0 0 14px;
}

/* Badge-Pill (mirrors QLabel#badgePill) */
.badge-pill {
  display: inline-block;
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 10px;
  padding: 3px 12px;
  font-size: 0.75em;
  font-weight: bold;
  letter-spacing: 0.05em;
}
.badge-pill.amber { background: #3a2900; color: var(--amber); border-color: var(--amber); }
.badge-pill.threat { background: var(--threat-dim); color: var(--threat); border-color: var(--threat); }
.badge-pill.dim { background: transparent; color: var(--dim); border-color: var(--border); }

/* ---------- Buttons (mirrors QPushButton) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 4px;
  padding: 13px 28px;
  text-decoration: none;
  font-weight: bold;
  letter-spacing: 0.08em;
  font-family: inherit;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.12s ease;
}
.btn:hover:not(:disabled) { background: var(--green); color: #000; }
.btn:disabled { color: var(--dim); border-color: var(--dim); cursor: not-allowed; }
.btn.amber { color: var(--amber); border-color: var(--amber); }
.btn.amber:hover:not(:disabled) { background: var(--amber); color: #000; }
.btn.ghost { border-color: var(--border); color: var(--dim); }
.btn.ghost:hover { border-color: var(--green); color: var(--green); background: transparent; }
.btn img.btn-logo { width: 18px; height: 18px; }

/* ---------- Teaser-Screenshots (index.php #teaser) ---------- */
/* Quell-Screenshots haben stark unterschiedliche Seitenverhältnisse (volle
   Fensteransicht vs. schmaler Sidebar-Ausschnitt) -- ohne feste aspect-ratio/
   object-fit ergab das in einem gleichmäßigen Grid unruhige, wild
   unterschiedlich hohe Kacheln. Hero (volle Breite) + einheitlich
   zugeschnittene 2er-Reihe darunter wirkt aufgeräumt; Detailansicht per Klick
   über die Lightbox unten macht den Zuschnitt unkritisch. */
.teaser-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 4px;
}
.teaser-shot { margin: 0; cursor: zoom-in; }
.teaser-shot.teaser-hero { grid-column: 1 / -1; }
.teaser-shot img {
  width: 100%;
  display: block;
  object-fit: cover;
  object-position: top;
  aspect-ratio: 16 / 9;
  transition: opacity 0.12s ease;
}
.teaser-shot.teaser-hero img { aspect-ratio: 21 / 9; }
.teaser-shot:hover img { opacity: 0.85; }
.teaser-shot figcaption { margin-top: 10px; }
@media (max-width: 640px) {
  .teaser-grid { grid-template-columns: 1fr; }
}

/* Lightbox-Vergrößerung für Teaser-Screenshots */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 6, 0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 50px 24px;
  cursor: zoom-out;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img {
  max-width: 92vw;
  max-height: 86vh;
  border: 1px solid var(--green);
  border-radius: 8px;
  box-shadow: 0 0 48px rgba(0, 255, 102, 0.25);
}
.lightbox-close {
  position: absolute;
  top: 22px;
  right: 28px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  font-size: 1.5em;
  line-height: 1;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--panel);
  cursor: pointer;
}

/* ---------- Feature list ---------- */
ul.features { list-style: none; padding: 0; margin: 0; }
ul.features li {
  display: flex;
  /* flex-wrap: wrap ist hier kein Stil-Detail, sondern behebt einen echten
     Overflow-Bug: <li>-Einträge, die neben dem Icon mehrere Inline-Elemente
     (<strong>, <code>, <a>) UND Fließtext direkt als Kind enthalten (siehe
     docs.php), werden von Flexbox als mehrere separate Flex-Items behandelt,
     nicht als ein zusammenhängender Textblock -- ohne wrap reihen sich diese
     Items ohne Umbruch in einer einzigen, beliebig breiten Zeile aneinander
     und sprengen auf schmalen Bildschirmen die Seitenbreite. */
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 4px 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
ul.features li:last-child { border-bottom: none; }
/* Icon bleibt als erstes Flex-Item stets links, mit fester Breite, statt bei
   wenig Platz selbst umzubrechen. Der restliche (Text-)Inhalt darf beliebig
   viele Flex-Items umfassen und diese sich über mehrere Zeilen verteilen. */
ul.features li > .icon:first-child { flex: 0 0 auto; }
ul.features li .icon { color: var(--green); margin-top: 2px; flex-shrink: 0; }

/* ---------- Archive table ---------- */
.archive-table { width: 100%; border-collapse: collapse; font-size: 0.88em; margin-top: 16px; }
.archive-table th, .archive-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.archive-table th {
  color: var(--dim);
  font-weight: normal;
  text-transform: uppercase;
  font-size: 0.8em;
  letter-spacing: 0.05em;
}
.archive-table a { text-decoration: none; }
.archive-table a:hover { text-decoration: underline; }

/* ---------- Code ---------- */
code {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--amber);
}
pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  color: var(--amber);
}

/* ---------- Misc ---------- */
figure { margin: 24px 0; text-align: center; }
figure img {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 0 24px rgba(0, 255, 102, 0.08);
}
figcaption { color: var(--dim); font-size: 0.85em; margin-top: 10px; }
.meta { color: var(--dim); font-size: 0.85em; }
.warn { color: var(--threat); }

/* ---------- Footer + Telemetry-Ticker (mirrors ui/widgets/telemetry_ticker.py) ---------- */
footer { border-top: 1px solid var(--border); }
.ticker-box {
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  background: var(--panel);
}
.ticker-box .ticker-track {
  display: inline-block;
  padding-left: 100%;
  animation: ticker-scroll 32s linear infinite;
  color: var(--dim);
  font-size: 0.78em;
  letter-spacing: 0.05em;
}
.ticker-box .ticker-track span { margin-right: 60px; }
.ticker-box .ticker-track span::before { content: "▸ "; color: var(--green); }
@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
footer .footer-links {
  text-align: center;
  color: #223026;
  padding: 24px 20px;
  font-size: 0.85em;
}
footer .footer-links a { color: var(--dim); margin: 0 8px; text-decoration: none; }
footer .footer-links a:hover { color: var(--green); }
footer .footer-clock {
  text-align: center;
  color: #223026;
  font-size: 0.75em;
  letter-spacing: 0.05em;
  padding: 0 20px 24px;
}

@media (max-width: 600px) {
  .site-header h1 { font-size: 1.8em; letter-spacing: 0.15em; }
  .stat-row { gap: 8px; }
}
