/* =========================================================================
   SunsetV — Redesign-Layer
   =========================================================================
   Diese Datei wird als LETZTES Stylesheet geladen (nach styles.css,
   styles-overrides.css und design-system.css) und enthaelt alle Aenderungen
   aus dem Design-Review. Vorteil: nichts Bestehendes wurde geloescht — wer
   eine Aenderung rueckgaengig machen will, kommentiert hier den jeweiligen
   Abschnitt aus.

   01  Tokens & Grundlagen
   02  Lesbarkeit auf Fotos (Weg-Karten)
   03  Typografie: Laufweite & Zeilenumbruch
   04  Kopfzeile: Discord-Button, Burger-Menue, aktiver Zustand
   05  Serverstatus-Leiste
   06  Hero-Hoehe
   07  Info-Hub: Hierarchie statt vier gleicher Karten
   08  Flaechen, Rahmen, Radien
   ========================================================================= */

/* ---------- 01  Tokens & Grundlagen ------------------------------------ */

:root {
  --radius-card: 16px;   /* grosse Flaechen */
  --radius-control: 10px; /* Buttons, Chips, Eingaben */
  --status-online: #2f7d4f;
  --status-offline: #a8402c;
  --status-unknown: #6b6866;
  --scrim: 6 7 9; /* RGB-Basis fuer alle Bild-Verlaeufe */
}

html[data-theme="dark"] {
  --status-online: #5ed18d;
  --status-offline: #ff7a63;
  --status-unknown: #a7a5a0;
}

/* Silbentrennung statt harter Wortbrueche. "overflow-wrap: anywhere" trennt
   mitten im Wort ohne Trennstrich — das sieht auf schmalen Screens kaputt aus. */
:is(h1, h2, h3, h4, h5, h6) {
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Der Theme-Schalter traegt ein Icon-Zeichen; solange die Icon-Schrift laedt,
   darf dessen Ligatur-Name den Knopf nicht auseinanderziehen. */
.theme-switch {
  overflow: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Icon-Schrift blockiert kurz, statt die Ligatur-Namen ("light_mode") als
   Text aufblitzen zu lassen. */
@font-face {
  font-family: "Material Symbols Outlined";
  font-display: block;
  src: url("https://fonts.gstatic.com/s/materialsymbolsoutlined/v368/kJF1BvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oDMzByHX9rA6RzaxHMPdY43zj-jCxv3fzvRNU22ZXGJpEpjC_1v-p_4MrImHCIJIZrDDxHOem.ttf") format("truetype");
}

/* ---------- 02  Lesbarkeit auf Fotos ----------------------------------- */
/* Befund 01: Weisser Text lag ungeschuetzt auf dem Bild. Der Verlauf sitzt
   jetzt direkt hinter dem Textblock: oben bleibt das Foto unberuehrt, unten
   bekommt der Text einen eigenen Grund. */

.experience-card::after {
  background: linear-gradient(
    180deg,
    rgb(var(--scrim) / 0) 0%,
    rgb(var(--scrim) / 0.08) 26%,
    rgb(var(--scrim) / 0.42) 48%,
    rgb(var(--scrim) / 0.82) 70%,
    rgb(var(--scrim) / 0.95) 100%
  );
}

.experience-overlay {
  justify-content: flex-end;
  gap: 18px;
  background: linear-gradient(
    180deg,
    rgb(var(--scrim) / 0) 42%,
    rgb(var(--scrim) / 0.45) 68%,
    rgb(var(--scrim) / 0.88) 100%
  );
}

.experience-overlay > span {
  margin-bottom: auto;
  color: #ffd7a8;
  text-shadow: 0 1px 14px rgb(var(--scrim) / 0.9);
}

.experience-card h3 {
  color: #fff;
}

.experience-card p {
  color: #ebece7;
}

/* Gleiches Prinzip fuer die uebrigen Bild-Overlays. */
.subpage-hero::before,
.rules-v2-hero::before {
  background: linear-gradient(
    180deg,
    rgb(var(--scrim) / 0.72) 0%,
    rgb(var(--scrim) / 0.55) 45%,
    rgb(var(--scrim) / 0.88) 100%
  );
}

.image-content-media span {
  text-shadow: 0 1px 12px rgb(var(--scrim) / 0.85);
}

/* ---------- 03  Typografie --------------------------------------------- */
/* Befund 02: -0.055em ist bei 44 px zu eng, die Woerter kleben aneinander.
   Enge Laufweite funktioniert erst ab wirklich grossen Graden — also
   staffeln statt einen festen Wert fuer alle Groessen. */

:is(.hero h1, .subpage-hero h1, .rules-v2-hero h1) {
  letter-spacing: -0.018em;
  line-height: 1.06;
}

@media (min-width: 900px) {
  :is(.hero h1, .subpage-hero h1, .rules-v2-hero h1) {
    letter-spacing: -0.03em;
  }
}

@media (min-width: 1400px) {
  :is(.hero h1, .subpage-hero h1, .rules-v2-hero h1) {
    letter-spacing: -0.04em;
    line-height: 1.02;
  }
}

/* Feste Zeilen statt Fliesstext: der Umbruch der Hauptzeile wandert nie mehr. */
.hero h1 .headline-line {
  display: block;
}

.hero h1 br {
  display: none;
}

:is(.section-heading h2, .community-copy h2, .info-hub-heading h2,
.content-heading h2, .image-content-copy h2, .faq-section h2, .prompt-section h2,
.subpage-cta h2, .conduct-panel h2, .notice-panel h2, .server-features-heading h2,
.rules-v2-support h2) {
  letter-spacing: -0.022em;
}

@media (min-width: 1100px) {
  :is(.section-heading h2, .community-copy h2, .info-hub-heading h2,
  .content-heading h2, .image-content-copy h2, .faq-section h2, .prompt-section h2,
  .subpage-cta h2, .conduct-panel h2, .notice-panel h2, .server-features-heading h2,
  .rules-v2-support h2) {
    letter-spacing: -0.032em;
  }
}

/* ---------- 04  Kopfzeile ---------------------------------------------- */
/* Befund 03: Auf dem Handy fehlte der Discord-Button, die fuenfteilige
   Navigation lief bis an die Bildschirmkante. Jetzt: eine Kopfzeile mit
   Logo, Discord und Burger — die Navigation liegt im Overlay. */

/* Aktiver Punkt bekommt sichtbares Gewicht, nicht nur eine andere Farbe. */
.site-header nav a[aria-current="page"] {
  font-weight: 600;
}

.site-header nav a[aria-current="page"]::after {
  right: 0;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  color: var(--foreground);
  cursor: pointer;
}

.nav-toggle i {
  display: block;
  width: 17px;
  height: 1.5px;
  background: currentColor;
  transition: transform 180ms ease, opacity 140ms ease;
}

.nav-toggle[aria-expanded="true"] i:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] i:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] i:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

@media (max-width: 1120px) {
  .nav-toggle {
    display: inline-flex;
  }

  /* Navigation als Overlay-Panel statt als gequetschte Zeile. */
  .mobile-nav {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 40;
    width: 100%;
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 10px var(--page-gutter) 18px;
    border-bottom: 1px solid var(--border);
    background: var(--background);
    box-shadow: 0 24px 48px rgb(var(--scrim) / 0.28);
    overflow: visible;
  }

  .mobile-nav:not([data-nav-open="true"]) {
    display: none;
  }

  .mobile-nav a {
    min-height: 52px;
    display: flex;
    align-items: center;
    padding-inline: 4px;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
    font-size: 1.0625rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--foreground);
  }

  .mobile-nav a:last-of-type {
    border-bottom: 0;
  }

  .mobile-nav a[aria-current="page"] {
    color: var(--red);
    font-weight: 600;
  }

  /* Der Theme-Schalter zieht ins Overlay — im Header ist der Platz fuer
     Discord da. (Das Verschieben uebernimmt redesign.js.) */
  .nav-theme-label {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-soft);
  }

  .mobile-nav .theme-control {
    margin-top: 10px;
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  /* Wichtigste Aktion bleibt sichtbar. */
  .header-discord {
    display: inline-flex;
    min-height: 40px;
    padding-inline: 16px;
    font-size: 0.8125rem;
  }

  .site-header {
    height: 72px;
  }

  .brand span {
    font-size: 1.0625rem;
  }
}

@media (max-width: 360px) {
  .brand span {
    display: none;
  }
}

/* ---------- 05  Serverstatus-Leiste ------------------------------------ */
/* Befund 04: Die erste Frage jedes FiveM-Spielers — laeuft der Server
   gerade? — blieb unbeantwortet. Die Leiste zeigt nur Werte, die wirklich
   bekannt sind (Konfiguration in redesign.js). */

/* Die Leiste ragt ein Stueck ins Hero-Bild: ein angeschnittenes Element
   zieht zuverlaessiger nach unten als ein Scroll-Pfeil. */
.server-status {
  position: relative;
  z-index: 5;
  margin-top: -34px;
}

.server-status-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 40px;
  padding: 20px clamp(20px, 2.4vw, 32px);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: 0 18px 44px rgb(var(--scrim) / 0.16);
}

.status-live {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--status-unknown);
}

.status-live[data-server-status="online"] {
  color: var(--status-online);
}

.status-live[data-server-status="offline"] {
  color: var(--status-offline);
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.status-live[data-server-status="online"] .status-dot {
  animation: status-pulse 2.4s ease-out infinite;
}

@keyframes status-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--status-online) 55%, transparent); }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.status-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 36px;
  margin: 0;
}

.status-figures > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-figures dt {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.status-figures dd {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.status-connect {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0;
}

.status-bar {
  width: min(180px, 40vw);
  height: 5px;
  margin-top: 7px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--foreground) 12%, transparent);
  overflow: hidden;
}

.status-bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--red));
  transition: width 500ms ease;
}

.server-status .status-cta {
  margin-left: auto;
}

@media (max-width: 620px) {
  .server-status {
    margin-top: 24px;
  }

  .server-status-inner {
    gap: 16px 28px;
  }

  .server-status .status-cta {
    width: 100%;
    margin-left: 0;
  }
}

/* ---------- 06  Hero-Hoehe --------------------------------------------- */
/* Befund 06: 100svh liess unten ein fast leeres Drittel stehen, das ein
   "Scroll"-Hinweis ueberbruecken musste. Jetzt ragt stattdessen die
   Statusleiste ins Bild — das zieht zuverlaessiger nach unten. */

.hero {
  min-height: min(86svh, 880px);
  padding-bottom: 46px;
}

.hero-content {
  padding-block: clamp(48px, 7vh, 96px);
}

.hero-footer [data-scroll] {
  display: none;
}

@media (max-width: 620px) {
  .hero {
    min-height: 0;
  }

  .hero-content {
    padding-block: 44px 52px;
  }
}

/* ---------- 07  Info-Hub ----------------------------------------------- */
/* Befund 05: Vier identische Karten, dazu eine Nummerierung 01-04, die eine
   Reihenfolge verspricht, die es nicht gibt (das Regelwerk ist kein vierter
   Schritt). Der Einstieg ist jetzt die Primaerkarte. */

.route-card-number {
  display: none;
}

/* Die Primaerkarte liegt als eigene Zeile ueber den drei Nachschlagewerken —
   so entsteht Hierarchie, ohne dass eine Karte ueber leeren Raum gedehnt wird. */
.route-card-grid {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 760px) {
  .route-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .route-card:first-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: clamp(24px, 4vw, 64px);
  }

  .route-card:first-child > p,
  .route-card:first-child h3,
  .route-card:first-child > span:not(.route-card-number) {
    grid-column: 1;
  }

  .route-card:first-child strong {
    grid-column: 2;
    grid-row: 1 / -1;
    margin-top: 0;
    align-self: center;
  }
}

@media (min-width: 760px) and (max-width: 1000px) {
  .route-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .route-card:nth-child(4) {
    grid-column: 1 / -1;
  }
}

.route-card {
  min-height: 0;
  padding: clamp(22px, 1.8vw, 30px);
  border-radius: var(--radius-card);
}

.route-card > p {
  margin: 0 0 10px;
}

.route-card h3 {
  margin: 0 0 10px;
  font-size: 1.375rem;
}

.route-card strong {
  padding-top: 18px;
}

/* Primaerkarte: Akzentflaeche, groesserer Grad, echter Button-Anschluss. */
.route-card:first-child {
  padding: clamp(28px, 2.4vw, 44px);
  border-color: color-mix(in srgb, var(--red) 42%, transparent);
  background:
    linear-gradient(155deg, color-mix(in srgb, var(--red) 18%, transparent), transparent 62%),
    var(--surface);
}

.route-card:first-child h3 {
  margin-bottom: 16px;
  font-size: clamp(1.75rem, 2.6vw, 2.5rem);
}

.route-card:first-child > span:not(.route-card-number) {
  font-size: 1rem;
  max-width: 46ch;
}

.route-card:first-child strong {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  margin-top: 24px;
  border-radius: var(--radius-control);
  color: #fff;
  background: #bc431d;
}

/* Die Sonderbehandlung der zweiten Karte (Foto-Hintergrund) faellt weg —
   Gewicht bekommt jetzt die Karte, die fuer Neulinge zaehlt. */
.route-card:nth-child(2) {
  color: var(--foreground);
  border-color: var(--border);
  background: var(--surface);
}

.route-card:nth-child(2) > p {
  color: var(--red);
}

.route-card:nth-child(2) > span:not(.route-card-number) {
  color: var(--ink-soft);
}

.route-card:hover,
.route-card:focus-visible {
  transform: none;
  border-color: color-mix(in srgb, var(--red) 60%, var(--border));
}

/* ---------- 08  Flaechen, Rahmen, Radien ------------------------------- */
/* Befund 07: Ein Radius, eine Flaeche, ein Rahmen fuer jeden Block — damit
   hebt sich nichts mehr ab. Gewicht wird jetzt nach Rolle vergeben. */

:is(.route-card, .step-card, .role-card, .feature-grid article,
.decision-strip, .knowledge-nav, .conduct-panel, .notice-panel,
.dashboard-card, .vehicle-dashboard-card, .finance-balance-card,
.experience-card, .image-content-media, .manifesto) {
  border-radius: var(--radius-card);
}

:is(.button, .header-discord, .login-button, .office-category-nav button,
.rules-v2-search) {
  border-radius: var(--radius-control);
}

/* Tertiaere Bloecke tragen keine eigene Karte mehr, nur noch eine Linie. */
:is(.prompt-grid article, .glossary-grid > div) {
  padding-inline: 0;
  padding-block: 22px 24px;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.glossary-grid dt {
  color: var(--red);
}

/* Chips bleiben Chips. */
.story-tags span,
.kicker,
.badge {
  border-radius: 999px;
}

@media (prefers-reduced-motion: reduce) {
  .status-live[data-server-status="online"] .status-dot {
    animation: none;
  }
}
