/* ============================================================
   managed-cluster.net Stylesheet
   Gestaltung: technisches Zeichnungspapier, Anthrazit, Signal-Orange
   ============================================================ */

/* Dunkles Thema (Standard) */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;

  --paper:      #14181C;   /* dunkles Zeichenpapier */
  --paper-alt:  #1A1F25;
  --ink:        #E9EBE7;   /* Zeichenfarbe: helles Grau */
  --steel:      #9AA3AC;
  --line:       #2C333A;
  --line-soft:  #232930;
  --signal:     #F0561A;   /* Signal-Orange, für dunklen Grund aufgehellt */
  --signal-dark:#FF7A44;   /* hellere Variante für Links/Hover */
  --ok:         #4DAE7E;

  --grid-line-1: rgba(233, 235, 231, 0.055);
  --grid-line-2: rgba(233, 235, 231, 0.025);
  --header-bg:  rgba(20, 24, 28, 0.92);
  --btn-primary-text: #14181C;
  --footer-bg:  #0D1013;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;

  --wrap: 1120px;
}

/* Helles Thema */
:root[data-theme="light"] {
  color-scheme: light;

  --paper:      #F2F2ED;
  --paper-alt:  #EAEAE3;
  --ink:        #1D2329;
  --steel:      #59636D;
  --line:       #DCDED8;
  --line-soft:  #E8E9E4;
  --signal:     #D64500;
  --signal-dark:#B23A00;
  --ok:         #2E7D52;

  --grid-line-1: rgba(29, 35, 41, 0.045);
  --grid-line-2: rgba(29, 35, 41, 0.022);
  --header-bg:  rgba(242, 242, 237, 0.92);
  --btn-primary-text: #FFFFFF;
  --footer-bg:  #1D2329;
}

/* Dunkel ist immer Standard; hell nur nach aktiver Wahl (data-theme="light") */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  /* Zeichnungspapier: feines Raster mit Haupt- und Nebenlinien */
  background-image:
    linear-gradient(var(--grid-line-1) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-1) 1px, transparent 1px),
    linear-gradient(var(--grid-line-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-2) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}

a { color: var(--signal-dark); }
a:hover { color: var(--signal); }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

/* ---------- Typo-Bausteine ---------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal-dark);
  margin-bottom: 14px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--ink); }

.brand-tld { color: var(--steel); font-weight: 500; }

.brand-mark {
  display: grid;
  grid-template-columns: 7px 7px;
  gap: 2px;
  margin-right: 10px;
}
.brand-mark span {
  width: 7px;
  height: 7px;
  background: var(--ink);
}
.brand-mark .mark-accent { background: var(--signal); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-nav a {
  font-size: 0.9375rem;
  color: var(--steel);
  text-decoration: none;
}
.site-nav a:hover { color: var(--ink); }

.site-nav .nav-cta {
  color: var(--signal-dark);
  font-weight: 600;
  border: 1px solid currentColor;
  padding: 7px 14px;
}
.site-nav .nav-cta:hover { color: var(--signal); }

/* ---------- Header-Werkzeuge: Sprache + Farbschema ---------- */

.nav-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 4px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.lang-switch {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--steel);
  text-decoration: none;
}
.lang-switch:hover { color: var(--ink); }

.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  color: var(--steel);
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--steel); }
.theme-toggle svg { display: block; }

/* Icon zeigt das Ziel-Schema: dunkel aktiv -> Sonne, hell aktiv -> Mond */
.theme-toggle .icon-sun  { display: block; }
.theme-toggle .icon-moon { display: none; }

:root[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }


/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  padding: 13px 26px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--signal);
  color: var(--btn-primary-text);
}
.btn-primary:hover {
  background: var(--signal-dark);
  color: var(--btn-primary-text);
}

.btn-ghost {
  color: var(--ink);
  border-color: var(--ink);
  background: transparent;
}
.btn-ghost:hover { color: var(--signal-dark); border-color: var(--signal-dark); }

.btn-block { width: 100%; }

.btn[disabled] { opacity: 0.6; cursor: default; }

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

.hero {
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 56px;
  align-items: center;
  padding-top: 88px;
  padding-bottom: 88px;
}

.hero-copy h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.3rem);
  margin-bottom: 20px;
}

.lede {
  font-size: 1.15rem;
  color: var(--steel);
  max-width: 34em;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 40px;
}

.hero-facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 32px;
  font-size: 0.875rem;
  color: var(--steel);
}

.hero-facts strong {
  font-family: var(--font-mono);
  color: var(--ink);
  margin-right: 8px;
  font-size: 0.8125rem;
}

/* ---------- Hero: Failover-Schema ---------- */

.hero-figure {
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 20px 16px 14px;
  min-width: 0; /* SVG-viewBox darf das Grid nicht aufspannen */
}

.cluster-svg { display: block; width: 100%; height: auto; }

.hero-figure figcaption {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1.5;
  color: var(--steel);
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 6px;
}

.cluster-svg .box {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.5;
}

.cluster-svg .label {
  font-family: var(--font-mono);
  font-size: 12px;
  fill: var(--ink);
  text-anchor: middle;
  letter-spacing: 0.08em;
}

.cluster-svg .label-left { text-anchor: start; }

.cluster-svg .status {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-anchor: start;
}
.cluster-svg .status-on  { fill: var(--ok); }
.cluster-svg .status-off { fill: var(--signal); opacity: 0; }

.cluster-svg .dot { fill: var(--ok); }

.cluster-svg .link {
  stroke: var(--ink);
  stroke-width: 1.5;
  fill: none;
  stroke-dasharray: 6 6;
  animation: link-flow 1.2s linear infinite;
}

.cluster-svg .replication {
  stroke: var(--steel);
  stroke-width: 1;
  fill: none;
  stroke-dasharray: 2 5;
}

.cluster-svg .caption-label {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--steel);
  text-anchor: middle;
  letter-spacing: 0.1em;
}

@keyframes link-flow {
  to { stroke-dashoffset: -12; }
}

/* Failover-Zyklus (14 s): Node B fällt aus und kommt zurück */
.cluster-svg .node-b .box    { animation: nodeb-box 14s ease infinite; }
.cluster-svg .node-b .dot    { animation: nodeb-dot 14s ease infinite; }
.cluster-svg .node-b .status-on  { animation: nodeb-on 14s ease infinite; }
.cluster-svg .node-b .status-off { animation: nodeb-off 14s ease infinite; }
.cluster-svg .link-b         { animation: link-flow 1.2s linear infinite, nodeb-link 14s ease infinite; }

@keyframes nodeb-box {
  0%, 38%, 78%, 100% { stroke: var(--ink); stroke-dasharray: none; }
  42%, 74% { stroke: var(--steel); stroke-dasharray: 4 4; }
}
@keyframes nodeb-dot {
  0%, 38%, 78%, 100% { fill: var(--ok); }
  42%, 74% { fill: var(--signal); }
}
@keyframes nodeb-on {
  0%, 38%, 78%, 100% { opacity: 1; }
  42%, 74% { opacity: 0; }
}
@keyframes nodeb-off {
  0%, 38%, 78%, 100% { opacity: 0; }
  42%, 74% { opacity: 1; }
}
@keyframes nodeb-link {
  0%, 38%, 78%, 100% { opacity: 1; }
  42%, 74% { opacity: 0.15; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cluster-svg .link,
  .cluster-svg .link-b,
  .cluster-svg .node-b .box,
  .cluster-svg .node-b .dot,
  .cluster-svg .node-b .status-on,
  .cluster-svg .node-b .status-off {
    animation: none;
  }
  /* Statisches Bild erzählt dieselbe Geschichte: B offline, Rest übernimmt */
  .cluster-svg .node-b .box { stroke: var(--steel); stroke-dasharray: 4 4; }
  .cluster-svg .node-b .dot { fill: var(--signal); }
  .cluster-svg .node-b .status-on { opacity: 0; }
  .cluster-svg .node-b .status-off { opacity: 1; }
  .cluster-svg .link-b { opacity: 0.15; }
}

/* ---------- Sektionen ---------- */

.section {
  padding: 88px 0;
  border-bottom: 1px solid var(--line);
}

.section-alt { background: var(--paper-alt); }

.section-head {
  max-width: 40em;
  margin-bottom: 48px;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

/* ---------- Leistungen ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 2px solid var(--ink);
  padding: 28px;
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}

.card p {
  color: var(--steel);
  font-size: 0.975rem;
}

/* ---------- Ablauf ---------- */

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  counter-reset: step;
}

.step {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 28px;
  position: relative;
}

.step-no {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--signal-dark);
  border: 1px solid var(--signal-dark);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.step h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.step p {
  color: var(--steel);
  font-size: 0.9375rem;
}

/* ---------- Vertrauen ---------- */

.trust-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px 48px;
}

.trust-item {
  border-left: 2px solid var(--ink);
  padding-left: 20px;
}

.trust-item h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.trust-item p {
  color: var(--steel);
  font-size: 0.9375rem;
}

/* ---------- Kontakt ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 56px;
  align-items: start;
}

.contact-copy h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 16px;
}

.contact-copy p { color: var(--steel); max-width: 30em; }

.contact-alt {
  margin-top: 28px;
  font-size: 0.9375rem;
}

.contact-form {
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 32px;
}

.field { margin-bottom: 18px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 11px 12px;
  border-radius: 0;
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--signal);
  outline-offset: -1px;
  border-color: var(--signal);
}

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

/* Honeypot: aus dem Sichtbereich, nicht display:none (Bots füllen es trotzdem) */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-privacy {
  font-size: 0.8125rem;
  color: var(--steel);
  margin-bottom: 18px;
}

.form-status {
  font-size: 0.9375rem;
  margin-top: 14px;
  min-height: 1.4em;
}
.form-status.ok  { color: var(--ok); }
.form-status.err { color: var(--signal-dark); }

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

.site-footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--line);
  color: #B9C0C7;
  font-size: 0.9375rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  padding-top: 56px;
  padding-bottom: 40px;
}

.footer-name {
  color: #fff;
  font-weight: 700;
  margin-bottom: 10px;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-nav a {
  color: #B9C0C7;
  text-decoration: none;
}
.footer-nav a:hover { color: #fff; }

.footer-legal {
  border-top: 1px solid #3A424A;
  padding-top: 20px;
  padding-bottom: 28px;
  font-size: 0.8125rem;
  color: #7C8791;
}

/* ---------- Einwilligungs-Banner ---------- */

.consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: var(--paper);
  border-top: 2px solid var(--ink);
  padding: 18px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 28px;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
}

.consent-banner p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--steel);
  max-width: 46em;
}

.consent-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.consent-actions .btn {
  padding: 10px 20px;
  font-size: 0.9375rem;
}

/* ---------- Rechtstext-Seiten ---------- */

.legal-main {
  padding: 72px 0 96px;
}

.legal-main .wrap { max-width: 780px; }

.legal-main h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin-bottom: 12px;
}

.legal-main h2 {
  font-size: 1.35rem;
  margin: 44px 0 14px;
}

.legal-main h3 {
  font-size: 1.05rem;
  margin: 28px 0 10px;
}

.legal-main p, .legal-main ul { margin-bottom: 14px; color: var(--ink); }

.legal-main ul { padding-left: 22px; }

.legal-updated {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--steel);
  margin-bottom: 40px;
}

.legal-main address { font-style: normal; }

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

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; padding-top: 56px; padding-bottom: 64px; }
  .hero-figure { max-width: 520px; }
  .card-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .section { padding: 64px 0; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .header-inner { gap: 12px; }
  .site-nav { gap: 12px; }
  .site-nav a:not(.nav-cta):not(.lang-switch) { display: none; }
  .nav-tools { gap: 10px; padding-left: 12px; margin-left: 0; }
  .brand { font-size: 0.95rem; }
  .site-nav .nav-cta { padding: 6px 10px; font-size: 0.875rem; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .contact-form { padding: 22px; }
}
