:root {
  --bg: #0a0e14;
  --bg-soft: #10161f;
  --bg-card: #131b26;
  --line: #223041;
  --line-soft: #1a2431;
  --fg: #e8eef6;
  --fg-muted: #93a3b8;
  --accent: #3ba7ff;
  --accent-dim: #1d6fb8;
  --accent-glow: rgba(59, 167, 255, 0.15);
  --maxw: 1120px;
  --radius: 12px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
  font-weight: 650;
}

h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.4rem);
}

h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1.1em;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 16px;
  top: 12px;
  z-index: 200;
  background: var(--accent);
  color: #04070c;
  padding: 8px 14px;
  border-radius: 8px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

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

.brand svg {
  flex: none;
  color: var(--accent);
}

.brand span small {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.nav-toggle {
  margin-left: auto;
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--fg);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--fg-muted);
  font-size: 0.94rem;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--fg);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  color: var(--fg-muted);
}

.lang-switch a,
.lang-switch span {
  color: var(--fg-muted);
  text-transform: uppercase;
}

.lang-switch .is-active {
  color: var(--accent);
  font-weight: 600;
}

.lang-switch a:hover {
  color: var(--fg);
  text-decoration: none;
}

/* ---------- Hero ---------- */

.hero {
  --hero-img: url("../img/earth-night.jpg");
  position: relative;
  overflow: hidden;
  padding: clamp(64px, 11vw, 128px) 0 clamp(56px, 9vw, 104px);
  border-bottom: 1px solid var(--line-soft);
  background-color: var(--bg);
  /* Scrim waagerecht (Textlesbarkeit links) + senkrecht (weicher Übergang unten) über dem Foto */
  background-image:
    linear-gradient(90deg, rgba(10, 14, 20, 0.94) 0%, rgba(10, 14, 20, 0.85) 45%, rgba(10, 14, 20, 0.54) 78%, rgba(10, 14, 20, 0.38) 100%),
    linear-gradient(180deg, rgba(10, 14, 20, 0.35) 0%, rgba(10, 14, 20, 0) 30%, rgba(10, 14, 20, 0) 62%, rgba(10, 14, 20, 0.78) 90%, var(--bg) 100%),
    var(--hero-img);
  background-size: cover;
  background-position: center, center, 50% 42%;
  background-repeat: no-repeat;
}

/* Schmalere Schirme: kleinere Bilddatei ausliefern */
@media (max-width: 900px) {
  .hero {
    --hero-img: url("../img/earth-night-960.jpg");
  }
}

/* Ab hier läuft der Text über die volle Breite – Scrim entsprechend gleichmäßiger */
@media (max-width: 760px) {
  .hero {
    background-image:
      linear-gradient(90deg, rgba(10, 14, 20, 0.92) 0%, rgba(10, 14, 20, 0.88) 60%, rgba(10, 14, 20, 0.82) 100%),
      linear-gradient(180deg, rgba(10, 14, 20, 0.4) 0%, rgba(10, 14, 20, 0.1) 30%, rgba(10, 14, 20, 0.15) 62%, rgba(10, 14, 20, 0.8) 90%, var(--bg) 100%),
      var(--hero-img);
  }
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(59, 167, 255, 0.14) 1px, transparent 0);
  background-size: 38px 38px;
  mask-image: radial-gradient(ellipse 80% 65% at 55% 25%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 65% at 55% 25%, #000 20%, transparent 75%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  top: -180px;
  right: -120px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(59, 167, 255, 0.1), transparent 62%);
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
  max-width: 860px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(59, 167, 255, 0.3);
  background: rgba(59, 167, 255, 0.07);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 22px;
}

.hero p.lead {
  font-size: clamp(1.05rem, 2.1vw, 1.25rem);
  color: var(--fg-muted);
  max-width: 62ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 0.96rem;
  font-weight: 550;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

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

.btn-primary {
  background: var(--accent);
  color: #04070c;
}

.btn-primary:hover {
  background: #63b9ff;
}

.btn-ghost {
  border-color: var(--line);
  color: var(--fg);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(56px, 8vw, 92px) 0;
}

.section + .section {
  border-top: 1px solid var(--line-soft);
}

.section-head {
  max-width: 68ch;
  margin-bottom: 42px;
}

.section-head p {
  color: var(--fg-muted);
  margin-bottom: 0;
}

.page-head {
  --head-img: url("../img/earth-night.jpg");
  position: relative;
  padding: clamp(48px, 7vw, 84px) 0 clamp(24px, 4vw, 40px);
  background-color: var(--bg);
  /* Gleiches Motiv wie der Hero, nur deutlich zurückgenommen */
  background-image:
    linear-gradient(90deg, rgba(10, 14, 20, 0.96) 0%, rgba(10, 14, 20, 0.88) 45%, rgba(10, 14, 20, 0.66) 100%),
    linear-gradient(180deg, rgba(10, 14, 20, 0.5) 0%, rgba(10, 14, 20, 0.2) 35%, rgba(10, 14, 20, 0.9) 85%, var(--bg) 100%),
    var(--head-img);
  background-size: cover;
  background-position: center, center, 50% 38%;
  background-repeat: no-repeat;
}

@media (max-width: 900px) {
  .page-head {
    --head-img: url("../img/earth-night-960.jpg");
  }
}

@media (max-width: 760px) {
  .page-head {
    background-image:
      linear-gradient(90deg, rgba(10, 14, 20, 0.94) 0%, rgba(10, 14, 20, 0.92) 100%),
      linear-gradient(180deg, rgba(10, 14, 20, 0.5) 0%, rgba(10, 14, 20, 0.2) 35%, rgba(10, 14, 20, 0.9) 85%, var(--bg) 100%),
      var(--head-img);
  }
}

.page-head .container {
  max-width: 800px;
}

.page-head p {
  color: var(--fg-muted);
  font-size: 1.08rem;
  margin-bottom: 0;
}

/* ---------- Cards ---------- */

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

.grid-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 620px) {
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1000px) {
  .grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.card:hover {
  border-color: var(--line);
  transform: translateY(-2px);
}

.card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(59, 167, 255, 0.1);
  color: var(--accent);
  margin-bottom: 16px;
}

.card h3 {
  margin-bottom: 0.45em;
}

.card p {
  color: var(--fg-muted);
  font-size: 0.96rem;
  margin-bottom: 0;
}

.card ul {
  color: var(--fg-muted);
  font-size: 0.95rem;
  margin: 12px 0 0;
  padding-left: 20px;
}

.card li {
  margin-bottom: 4px;
}

/* ---------- Projects ---------- */

.project {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 36px;
  align-items: center;
  padding: 40px 0;
  border-top: 1px solid var(--line-soft);
}

.project:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.project-media {
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 12px;
}

.project-media img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}

/* Full-width variant for explanatory diagrams that need the room */
.project-full {
  grid-template-columns: minmax(0, 1fr);
  gap: 26px;
}

.project-full .project-body {
  order: 1;
  max-width: 72ch;
}

.project-full .project-media {
  order: 2;
  padding: 0;
  min-height: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  display: block;
  overflow-x: auto;
}

.project-full .project-media img {
  border-radius: 14px;
}

@media (max-width: 820px) {
  .project-full .project-media img {
    min-width: 700px;
  }
}

.project-body h3 {
  font-size: 1.4rem;
}

.project-body p {
  color: var(--fg-muted);
}

.project-body p:last-child {
  margin-bottom: 0;
}

.tag {
  display: inline-block;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
}

.stats li {
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 14px 16px;
}

.stats strong {
  display: block;
  font-size: 1.35rem;
  color: var(--fg);
  letter-spacing: -0.02em;
}

.stats span {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

/* ---------- Contact ---------- */

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.contact-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 22px;
}

.contact-list .icon {
  color: var(--accent);
  flex: none;
  margin-top: 2px;
}

.contact-list h3 {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.contact-list a,
.contact-list p {
  font-size: 1.02rem;
  margin: 0;
}

/* ---------- CTA band ---------- */

.cta {
  background: linear-gradient(180deg, var(--bg-soft), var(--bg));
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: clamp(32px, 5vw, 52px);
  text-align: center;
}

.cta h2 {
  margin-bottom: 0.4em;
}

.cta p {
  color: var(--fg-muted);
  max-width: 56ch;
  margin: 0 auto 26px;
}

/* ---------- Legal pages ---------- */

.prose {
  max-width: 72ch;
}

.prose h2 {
  margin-top: 1.8em;
}

.prose p,
.prose li {
  color: var(--fg-muted);
}

.prose strong {
  color: var(--fg);
  font-weight: 600;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 44px 0 34px;
  margin-top: 20px;
  font-size: 0.92rem;
  color: var(--fg-muted);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 48px;
  justify-content: space-between;
  align-items: flex-start;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.site-footer a {
  color: var(--fg-muted);
}

.site-footer a:hover {
  color: var(--accent);
}

.footer-bottom {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.85rem;
}

/* ---------- Reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .project {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}

@media (max-width: 760px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
    padding: 10px 24px 20px;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-nav li {
    border-bottom: 1px solid var(--line-soft);
  }

  .site-nav a {
    display: block;
    padding: 13px 0;
    font-size: 1rem;
    border-bottom: 0;
  }

  .site-nav a[aria-current="page"] {
    color: var(--accent);
  }

  .lang-switch {
    align-self: flex-start;
    margin-top: 16px;
  }
}
