:root {
  --bg: #070e1c;
  --tile: rgba(20, 34, 60, 0.72);
  --tile-hover: rgba(28, 48, 84, 0.9);
  --border: rgba(140, 180, 255, 0.10);
  --text: #f1f5fc;
  --muted: #8c9cb8;
  --accent: #40c3ff;
  --font: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
}

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

html, body { margin: 0; }

html { background: var(--bg); }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  /* ohne background-color, sonst dunkelt background-blend-mode: overlay das Bild ab */
  background-image: linear-gradient(150deg, rgba(42, 74, 122, 0.35) 0%, rgba(31, 50, 81, 0.4) 85%), url('background.jpg');
  background-size: cover;
  background-attachment: fixed;
  background-blend-mode: overlay;
  background-position: center top;
  background-repeat: no-repeat;
}

/* ---------- KOPF ---------- */

.hero {
  padding: 28px clamp(16px, 4vw, 48px) clamp(32px, 6vh, 56px);
  text-align: center;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  max-width: 1280px;
  margin: 0 auto;
}

.brand { display: inline-block; margin-top: clamp(24px, 6vh, 56px); }
.brand img { display: block; width: clamp(200px, 22vw, 300px); height: auto; }

/* ---------- SPRACHAUSWAHL ---------- */

.lang { position: relative; z-index: 20; }

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(7, 14, 28, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text);
  font: 600 15px var(--font);
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}

.lang-btn:hover,
.lang-btn[aria-expanded="true"] {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(7, 14, 28, 0.65);
}

.lang-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.globe {
  width: 19px;
  height: 19px;
  flex: none;
  color: var(--muted);
  margin-inline-end: 2px;
  transition: color .2s;
}

.lang-btn:hover .globe,
.lang-btn[aria-expanded="true"] .globe { color: var(--text); }

.flag {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.caret {
  width: 14px;
  height: 14px;
  color: var(--muted);
  transition: transform .2s;
}

.lang-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }

.lang-panel {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  width: 280px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(12, 22, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  text-align: start;
}

.lang-panel[hidden] { display: none; }

.lang-search {
  width: 100%;
  height: 38px;
  margin-bottom: 6px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: 15px var(--font);
}

.lang-search::placeholder { color: var(--muted); }
.lang-search:focus { outline: none; border-color: rgba(64, 195, 255, 0.6); }

.lang-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.lang-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  color: #c9d4e6;
  cursor: pointer;
}

.lang-list .flag { width: 22px; height: 22px; }

.lang-list li.active { background: rgba(64, 195, 255, 0.14); color: #fff; }

.lang-list li[aria-selected="true"] { color: var(--accent); font-weight: 700; }

.lang-list li[aria-selected="true"]::after {
  content: "";
  width: 5px;
  height: 10px;
  margin-inline-start: auto;
  margin-inline-end: 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.lang-empty { padding: 10px; font-size: 14px; color: var(--muted); }

/* ---------- KACHELN ---------- */

main {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px) 72px;
}

/* Ein gemeinsames Raster für beide Spalten: 1fr-Zeilen werden so hoch wie
   die höchste Kachel, dadurch sind alle Kacheln gleich hoch und auf einer Linie */
.columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 10px 28px;
}

.columns ul { display: contents; }

.columns li { display: flex; list-style: none; }
/* --row setzt das Script, damit beide Spalten oben in Zeile 1 beginnen */
#leftColumn li { grid-column: 1; grid-row: var(--row); }
#rightColumn li { grid-column: 2; grid-row: var(--row); }

.tile {
  flex: 1;
  display: grid;
  grid-template-columns: 44px 1fr 20px;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  padding: 14px 20px 14px 16px;
  border-radius: 16px;
  background: var(--tile);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  transition: background-color .2s, border-color .2s, transform .2s, box-shadow .2s;
}

.tile:hover,
.tile:focus-visible {
  background: var(--tile-hover);
  border-color: rgba(64, 195, 255, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
  outline: none;
}

.tile:focus-visible { box-shadow: 0 0 0 3px rgba(64, 195, 255, 0.5); }

.glyph {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  transition: color .2s, background-color .2s;
}

.glyph svg { width: 20px; height: 20px; }

.tile:hover .glyph { color: var(--accent); background: rgba(64, 195, 255, 0.12); }

.arrow {
  width: 20px;
  height: 20px;
  color: var(--muted);
  opacity: .6;
  transition: transform .2s, color .2s, opacity .2s;
}

.tile:hover .arrow { color: var(--text); opacity: 1; transform: translateX(3px); }
.tile:hover .arrow.ext { transform: translate(2px, -2px); }

[dir="rtl"] .arrow:not(.ext) { transform: scaleX(-1); }
[dir="rtl"] .tile:hover .arrow:not(.ext) { transform: scaleX(-1) translateX(3px); }

/* ---------- MOBIL ---------- */

@media (max-width: 860px) {
  /* Logo links, Sprache rechts in einer Zeile – spart Höhe */
  .hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 20px;
  }
  .topbar { order: 2; margin: 0; }
  .brand { margin-top: 0; }
  .brand img { width: 140px; }

  main { padding-bottom: 40px; }
  /* einspaltig: Zeilen wieder nach Inhalt, sonst wird jede Kachel 4 Zeilen hoch */
  .columns { grid-template-columns: 1fr; grid-auto-rows: auto; }
  #leftColumn li, #rightColumn li { grid-column: 1; grid-row: auto; }
  /* sichtbare Trennung zwischen den beiden Gruppen */
  #rightColumn li:first-child { margin-top: 18px; }
  .tile { min-height: 64px; grid-template-columns: 38px 1fr 18px; gap: 12px; padding: 12px 14px 12px 12px; font-size: 15px; }
  .glyph { width: 38px; height: 38px; border-radius: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .tile, .arrow, .caret { transition: none; }
  .tile:hover { transform: none; }
}
