:root {
  --bg-0: #0a0a15;
  --bg-1: #1d1e3d;
  --bg-2: #3b3c7a;
  --bg-3: #4b5dc9;
  --bg-4: #7b6aca;

  --text: #f7f7fb;
  --muted: #a8adc8;
  --muted-2: #7d84a8;

  --accent: #ff5733;
  --accent-soft: rgba(255, 87, 51, 0.16);

  --panel: rgba(10, 14, 28, 0.72);
  --panel-strong: rgba(9, 12, 25, 0.9);
  --line: rgba(155, 175, 255, 0.18);
  --line-strong: rgba(155, 175, 255, 0.32);

  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-pill: 999px;

  --max-width: 1080px;
  --page-pad: clamp(20px, 4vw, 56px);

  --font-body: Inter, Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Montserrat", "Arial Black", Inter, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg-0);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 82% 28%, rgba(123, 106, 202, 0.78) 0, rgba(75, 93, 201, 0.55) 22%, transparent 48%),
    radial-gradient(circle at 55% 45%, rgba(59, 60, 122, 0.48) 0, transparent 42%),
    radial-gradient(circle at 8% 25%, rgba(29, 30, 61, 0.95) 0, rgba(10, 10, 21, 0.94) 42%, transparent 65%),
    linear-gradient(135deg, var(--bg-0) 0%, var(--bg-1) 42%, var(--bg-3) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -20%;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 13% 38%, rgba(0, 0, 0, 0.58) 0, rgba(0, 0, 0, 0.42) 24%, transparent 44%),
    radial-gradient(ellipse at 78% 38%, rgba(75, 93, 201, 0.34) 0, transparent 44%);
  filter: blur(8px);
  z-index: -1;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.45), transparent 72%);
  z-index: -1;
}

a {
  color: inherit;
}

.app-shell {
  width: min(var(--max-width), calc(100% - var(--page-pad) * 2));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 72px) 0 80px;
}

.back-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(13, 19, 38, 0.72);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  backdrop-filter: blur(14px);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.back-pill:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  background: rgba(18, 25, 50, 0.82);
}

.page-hero {
  margin-top: clamp(40px, 7vw, 86px);
  margin-bottom: clamp(28px, 4vw, 44px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 13px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1 {
  max-width: 980px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(56px, 8vw, 118px);
  line-height: 0.88;
  letter-spacing: -0.07em;
  text-wrap: balance;
}

.lead {
  max-width: 760px;
  margin: 22px 0 0;
  color: rgba(247, 247, 251, 0.88);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.55;
}

.content-area {
  display: grid;
  gap: 18px;
}

.panel,
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.card {
  padding: clamp(18px, 2.4vw, 28px);
}

.card:hover {
  border-color: var(--line-strong);
  background: rgba(12, 17, 34, 0.84);
}

.button,
button {
  appearance: none;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #11121d;
  min-height: 52px;
  padding: 0 28px;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 18px 42px rgba(255, 87, 51, 0.26);
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.button:hover,
button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.button.secondary,
button.secondary {
  border: 1px solid var(--line);
  background: rgba(13, 19, 38, 0.75);
  color: var(--text);
  box-shadow: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--text);
  background: rgba(10, 14, 28, 0.7);
  font-size: 12px;
  font-weight: 800;
}

.badge.accent {
  border-color: rgba(255, 87, 51, 0.6);
  color: #ffd8cf;
  background: var(--accent-soft);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(5, 8, 18, 0.78);
  color: var(--text);
  font: inherit;
  padding: 16px 18px;
  outline: none;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(255, 87, 51, 0.9);
  box-shadow: 0 0 0 4px rgba(255, 87, 51, 0.13);
}

.small-muted {
  color: var(--muted-2);
  font-size: 14px;
}

/* Startseite: App-Zentrale */

.app-home {
  min-height: 100vh;
}

.home-hero {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.home-hero h1,
.home-hero .lead {
  margin-left: auto;
  margin-right: auto;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 38px;
}

.app-tile {
  position: relative;
  min-height: 178px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(10, 14, 28, 0.68);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.app-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 86% 18%, rgba(123,106,202,.34), transparent 32%),
    linear-gradient(135deg, rgba(255,87,51,0.08), transparent 44%);
  opacity: .72;
  pointer-events: none;
}

.app-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 87, 51, 0.65);
  background:
    linear-gradient(135deg, rgba(255,87,51,0.13), transparent 42%),
    rgba(10, 14, 28, 0.82);
}

.tile-kicker,
.app-tile strong,
.app-tile small,
.tile-status {
  position: relative;
  z-index: 1;
}

.tile-kicker {
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.app-tile strong {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 42px);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.app-tile small {
  max-width: 360px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.tile-status {
  align-self: flex-start;
  margin-top: 18px;
}

.home-note {
  margin-top: 24px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(10, 14, 28, 0.58);
  color: var(--muted);
  line-height: 1.55;
  backdrop-filter: blur(16px);
}

/* Standardstatus für spätere Module */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 0 15px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgba(13, 19, 38, 0.72);
  color: var(--muted);
  font-weight: 800;
}

.status-pill::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--muted-2);
}

.status-pill.live {
  color: #fff;
  border-color: rgba(255, 87, 51, 0.7);
  background: rgba(255, 87, 51, 0.14);
}

.status-pill.live::before {
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(255, 87, 51, 0.14);
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 32px, var(--max-width));
    padding-top: 24px;
  }

  h1 {
    font-size: clamp(48px, 16vw, 74px);
    letter-spacing: -0.06em;
  }

  .lead {
    font-size: 16px;
  }

  .app-grid {
    grid-template-columns: 1fr;
  }

  .app-tile {
    min-height: 145px;
    padding: 24px;
  }
}

/* Feinschliff Startzentrale: Titelabstand und präzisere Hero-Proportionen */
.home-title {
  display: grid;
  gap: clamp(12px, 1.5vw, 22px);
  line-height: 0.82;
}

.home-title span {
  display: block;
}

.home-hero .lead {
  margin-top: clamp(30px, 4vw, 48px);
}

.home-hero {
  margin-bottom: clamp(34px, 4.8vw, 56px);
}

@media (max-width: 760px) {
  .home-title {
    gap: 10px;
    line-height: 0.86;
  }

  .home-hero .lead {
    margin-top: 26px;
  }
}

/* Finaler Feinschliff App-Zentrale */
.home-title {
  display: grid;
  gap: clamp(22px, 3vw, 42px);
  line-height: 0.78;
}

.home-title span {
  display: block;
}

.home-title span + span {
  transform: translateY(0.02em);
}

.home-hero .lead {
  max-width: 880px;
  margin-top: clamp(34px, 4.4vw, 54px);
  text-wrap: balance;
}

.home-hero {
  margin-bottom: clamp(38px, 5.2vw, 64px);
}

.home-note {
  display: grid;
  gap: 7px;
  padding: 20px 24px;
  line-height: 1.55;
}

.home-note span {
  display: block;
}

@media (max-width: 760px) {
  .home-title {
    gap: 16px;
    line-height: 0.82;
  }

  .home-hero .lead {
    margin-top: 28px;
    max-width: 34rem;
  }

  .home-note {
    gap: 8px;
    padding: 18px;
  }
}

@media (max-width: 420px) {
  .home-title {
    gap: 12px;
  }
}

/* Feinschliff App-Kacheln: Beschreibung und Badge-Abstand */
.app-tile small {
  line-height: 1.52;
}

.app-tile .tile-status {
  margin-top: 22px;
}

/* Mobile Feinschliff App-Zentrale */
@media (max-width: 760px) {
  .app-home {
    overflow-x: hidden;
  }

  .app-home .page-hero {
    margin-top: 34px;
    margin-bottom: 30px;
  }

  .app-home .eyebrow {
    font-size: 11px;
    letter-spacing: 0.18em;
  }

  .home-title {
    width: 100%;
    max-width: 100%;
    gap: 12px;
    line-height: 0.86;
  }

  .home-title span:first-child {
    font-size: clamp(39px, 11.8vw, 58px);
    letter-spacing: -0.065em;
    white-space: nowrap;
  }

  .home-title span:last-child {
    font-size: clamp(54px, 17vw, 74px);
    letter-spacing: -0.065em;
  }

  .home-hero .lead {
    max-width: 30rem;
    margin-top: 24px;
    font-size: 15px;
    line-height: 1.55;
  }

  .app-grid {
    margin-top: 28px;
    gap: 14px;
  }

  .app-tile {
    min-height: 138px;
    padding: 22px;
  }

  .app-tile strong {
    font-size: clamp(27px, 8vw, 36px);
  }

  .app-tile small {
    font-size: 14px;
    line-height: 1.48;
  }

  .home-note {
    margin-top: 16px;
    font-size: 14px;
  }
}

@media (max-width: 420px) {
  .app-shell {
    width: calc(100% - 28px);
  }

  .back-pill {
    max-width: 100%;
    min-height: 40px;
    padding: 0 14px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .home-title span:first-child {
    font-size: clamp(36px, 11.2vw, 47px);
  }

  .home-title span:last-child {
    font-size: clamp(50px, 16vw, 64px);
  }
}

/* Harte Mobile-Viewport-Korrektur: kein seitliches Verrutschen */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    background-attachment: scroll;
    background-position: center top;
    background-size: cover;
  }

  body::before,
  body::after {
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
  }

  .app-shell {
    width: calc(100vw - 28px) !important;
    max-width: calc(100vw - 28px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .app-home,
  .page-hero,
  .home-hero,
  .content-area,
  .app-grid,
  .app-tile,
  .panel,
  .card,
  .home-note {
    max-width: 100%;
    overflow-x: hidden;
  }

  .home-title {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .home-title span {
    max-width: 100%;
  }

  .home-title span:first-child {
    font-size: clamp(34px, 10.6vw, 44px);
    white-space: nowrap;
  }

  .home-title span:last-child {
    font-size: clamp(48px, 15.5vw, 62px);
  }

  .app-tile {
    width: 100%;
  }

  .app-tile strong,
  .app-tile small,
  .home-note,
  .lead {
    overflow-wrap: break-word;
  }
}

@media (max-width: 380px) {
  .app-shell {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
  }

  .home-title span:first-child {
    font-size: clamp(31px, 10vw, 38px);
  }

  .home-title span:last-child {
    font-size: clamp(44px, 14.5vw, 56px);
  }

  .app-tile {
    padding: 20px;
  }
}

/* Home legal links */
.home-legal {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 34px auto 0;
  padding: 18px 0 4px;
}

.home-legal a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
  backdrop-filter: blur(10px);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.home-legal a:hover,
.home-legal a:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 87, 51, 0.55);
  background: rgba(255, 87, 51, 0.12);
  color: #ffffff;
  outline: none;
}

@media (max-width: 520px) {
  .home-legal {
    margin-top: 26px;
    gap: 10px;
  }

  .home-legal a {
    flex: 1 1 140px;
    min-width: 0;
  }
}

/* Legal links sauber unten in der Home-Note */
.home-note {
  text-align: center;
  align-items: center;
}

.home-note .home-legal {
  width: 100%;
  display: flex !important;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px auto 0 !important;
  padding: 16px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.home-note .home-legal a {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 17px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.84) !important;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.home-note .home-legal a:hover,
.home-note .home-legal a:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 87, 51, 0.56);
  background: rgba(255, 87, 51, 0.13);
  color: #ffffff !important;
  outline: none;
}

@media (max-width: 520px) {
  .home-note .home-legal {
    gap: 10px;
    margin-top: 16px !important;
  }

  .home-note .home-legal a {
    flex: 1 1 130px;
  }
}
