/* Die Seite ist das Dach über dreizehn Projekten, nicht eines davon.
   Deshalb trägt sie nicht das Gelb von Brickfolio, sondern das Blau, das
   elf der dreizehn gemeinsam haben: das von Home Assistant. Die Formen
   bleiben die der Brickfolio-Seite – runde Ecken, der harte Schatten ohne
   Weichzeichner, Nunito. Wer zwischen den Seiten wechselt, soll dieselbe
   Hand erkennen. */
:root {
  --accent:      #1F6FBF;   /* Links und Knöpfe: dunkel genug für Text auf Weiß */
  --accent-soft: #41BDF5;   /* das HA-Blau selbst – nur für Flächen, nie für Text */
  --accent-wash: #E8F4FD;
  --claim-ink:   #0B2740;   /* Schrift auf --accent-soft */
  --brick:       #FFCF00;   /* das Gelb bleibt Brickfolio vorbehalten */
  --ink:         #10161F;
  --ink-soft:    #333B47;
  --plate:       #EEF1F5;
  --card:        #FFFFFF;
  --line:        #D5DAE1;
  --muted:       #5C6470;
  --radius: 14px;
  --shadow: 0 3px 0 rgba(16, 22, 31, .16);
  --font: "Nunito", -apple-system, "SF Pro Rounded", system-ui, sans-serif;
}

/* Abends am Tablet und morgens am Rechner ist dieselbe Seite – sie richtet
   sich nach dem, was das Gerät sagt. Der harte Schatten wird im Dunkeln zur
   Linie: Schwarz auf Dunkelgrau sieht man nicht. */
@media (prefers-color-scheme: dark) {
  :root {
    --accent:      #6FC2F5;
    --accent-soft: #2B5F86;
    --accent-wash: #16222E;
    --claim-ink:   #EAF4FB;
    --ink:         #ECEFF3;
    --ink-soft:    #C3CAD3;
    --plate:       #0E1319;
    --card:        #171E26;
    --line:        #2C3641;
    --muted:       #94A0AE;
    --shadow: 0 3px 0 rgba(0, 0, 0, .45);
  }
}

/* Lokal ausgeliefert, nicht von Google: Die Seite stellt Programme vor, die
   ohne fremde Dienste auskommen – dann soll sie selbst auch keinen anrufen.
   Ganz nebenbei erspart das den Hinweis im Datenschutztext. */
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 600;
  font-display: swap; src: url("nunito-latin-600.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 800;
  font-display: swap; src: url("nunito-latin-800.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 900;
  font-display: swap; src: url("nunito-latin-900.woff2") format("woff2"); }

/* Das `hidden` der Sprachumschaltung muss sich gegen jede eigene
   display-Regel durchsetzen – sonst steht der englische Satz unter dem
   deutschen, und niemand sieht den Fehler im Quelltext. */
[hidden] { display: none !important; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0; font-family: var(--font); color: var(--ink);
  background: var(--plate); line-height: 1.6; font-weight: 600;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-weight: 900; font-size: clamp(2.1rem, 5vw, 3.3rem); letter-spacing: -.02em; }
h2 { font-weight: 900; font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
h3 { font-weight: 800; font-size: 1.18rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
img { max-width: 100%; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ── Kopf ──────────────────────────────────────────────────────────── */
.beam { display: flex; height: 6px; }
.beam i { flex: 1; }
.beam i:nth-child(1) { background: var(--accent-soft); }
.beam i:nth-child(2) { background: #5AC8A8; }
.beam i:nth-child(3) { background: var(--brick); }
.beam i:nth-child(4) { background: #E5674E; }

header { background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; }
.bar { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.bar .mark {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: var(--accent); color: #fff; font-weight: 900; font-size: .95rem;
  display: flex; align-items: center; justify-content: center; letter-spacing: -.03em;
}
.bar strong { font-weight: 900; font-size: 1.22rem; }
.bar nav { margin-left: auto; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.bar nav a { color: var(--muted); text-decoration: none; }
.bar nav a:hover { color: var(--ink); }

/* Der Umschalter sitzt rechts oben, wo man ihn sucht. Zwei Knöpfe statt
   einer Klappliste: bei genau zwei Sprachen ist das ein Klick weniger. */
.lang { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.lang button {
  font: inherit; font-weight: 800; font-size: .84rem; padding: 5px 11px;
  border: 0; background: var(--card); color: var(--muted); cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* ── Aufmacher ─────────────────────────────────────────────────────── */
.hero { padding: 56px 0 30px; }
.hero .lead { font-size: 1.24rem; max-width: 52ch; color: var(--ink-soft); }
.hero .claim { display: inline-block; background: var(--accent-soft);
  color: var(--claim-ink); padding: 2px 10px; border-radius: 8px; font-weight: 900; }

.facts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.fact {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 16px; box-shadow: var(--shadow);
}
.fact b { display: block; font-weight: 900; font-size: 1.5rem; line-height: 1.1; }
.fact span { color: var(--muted); font-size: .88rem; }

section { padding: 40px 0; }
section.alt { background: var(--card); border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line); }
.sec-head { max-width: 62ch; margin-bottom: 26px; }
.sec-head p { color: var(--ink-soft); margin: 0; }

/* ── Projektkarten ─────────────────────────────────────────────────────
   Zwei Spalten, nicht drei: Diese Programme haben Oberflächen, und ein
   Bildschirmfoto in einem Drittel einer Spalte zeigt nichts mehr. */
.projects { display: grid; gap: 20px; grid-template-columns: repeat(2, 1fr); }
.project {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
section.alt .project { background: var(--plate); }

/* Das Bild sitzt in einem Rahmen fester Höhe, damit die Karten in einer
   Reihe gleich hoch beginnen. `contain` statt `cover`, weil ein
   beschnittenes Bildschirmfoto niemandem hilft. */
.project .shot {
  background: var(--accent-wash); border-bottom: 1px solid var(--line);
  height: 210px; display: flex; align-items: center; justify-content: center;
  padding: 14px; overflow: hidden;
}
.project .shot img { max-height: 100%; max-width: 100%; object-fit: contain;
  border-radius: 8px; display: block; }
/* Wo es kein Bildschirmfoto gibt, steht das Symbol des Programms – klein
   und mittig, damit es nicht wie ein schlecht skalierter Screenshot wirkt. */
.project .shot.logo-only img { max-height: 110px; border-radius: 16px; }

.project .body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.project h3 { margin-bottom: .35em; }
.project .desc { color: var(--ink-soft); margin: 0 0 14px; }
.project .tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px;
  list-style: none; padding: 0; }
.tag {
  font-size: .76rem; font-weight: 800; letter-spacing: .02em;
  padding: 3px 9px; border-radius: 999px;
  background: var(--accent-wash); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.tag.app { background: color-mix(in srgb, var(--brick) 22%, transparent);
  color: color-mix(in srgb, var(--ink) 82%, var(--brick));
  border-color: color-mix(in srgb, var(--brick) 55%, transparent); }

.project .btns { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 10px 17px; border-radius: 11px;
  font-weight: 800; font-size: .94rem; text-decoration: none;
  box-shadow: var(--shadow); border: 1px solid transparent;
}
.btn-main { background: var(--accent); color: #fff; }
.btn-main:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
section.alt .btn-ghost { background: var(--card); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ── Handschrift: drei Grundsätze ──────────────────────────────────── */
.principles { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.principle {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
section.alt .principle { background: var(--plate); }
.principle .sym { font-size: 1.6rem; line-height: 1; display: block; margin-bottom: 10px; }
.principle p { margin: 0; color: var(--ink-soft); font-size: .97rem; }

/* ── Fuß ───────────────────────────────────────────────────────────── */
footer { background: var(--ink); color: #BFC7D2; padding: 34px 0; font-size: .93rem; }
footer a { color: #8ED2FA; }
footer .cols { display: grid; gap: 20px; grid-template-columns: 2fr 1fr 1fr; }
footer h4 { color: #fff; font-weight: 800; margin: 0 0 .6em; font-size: 1rem; }
footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin-bottom: 6px; }
footer .fine { margin: 24px 0 0; padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.12); color: #8A93A0; font-size: .87rem; }
@media (prefers-color-scheme: dark) {
  footer { background: #080C11; border-top: 1px solid var(--line); }
}

/* ── Die beiden Rechtsseiten: reiner Text, ruhig gesetzt ───────────── */
.text { max-width: 68ch; }
.text h1 { margin-bottom: .6em; }
.text h2 { font-size: 1.24rem; margin-top: 1.7em; }
.text p, .text li { color: var(--ink-soft); }
.hinweis {
  display: block; background: color-mix(in srgb, var(--brick) 22%, var(--card));
  border-left: 4px solid var(--brick); padding: 12px 14px;
  border-radius: 0 10px 10px 0; color: var(--ink); font-size: .95rem;
}
.offen { background: color-mix(in srgb, var(--brick) 45%, transparent);
  padding: 1px 6px; border-radius: 5px; }

@media (max-width: 900px) {
  .projects, .principles, footer .cols { grid-template-columns: 1fr; }
  .bar nav { gap: 14px; }
  .hero { padding: 40px 0 24px; }
}
@media (max-width: 560px) {
  .bar { flex-wrap: wrap; }
  .bar nav { width: 100%; margin: 4px 0 0; }
  .project .shot { height: 170px; }
}
