/* =====================================================================
   Petersen Digital Solutions — Premium "Cinematic Night-Ops"
   Palette: Night Navy / Ice White / Azure (aus dem Logo)
   Type: Space Grotesk (display) · Manrope (body) · JetBrains Mono (utility)
   ===================================================================== */

:root {
  /* Night */
  --night: #04070f;
  --night-2: #060c1a;
  --night-3: #0a1226;
  --panel: #0a1122;
  --panel-2: #0d1730;

  /* Brand */
  --blue: #1e9bf0;
  --blue-2: #5bc0ff;
  --blue-deep: #0e63c8;
  --blue-glow: rgba(30, 155, 240, .55);

  /* Ice / text on dark */
  --ice: #eaf2fc;
  --muted: #8fa2c2;
  --line-d: rgba(120, 165, 235, .14);
  --line-d-strong: rgba(120, 165, 235, .28);

  /* Light sections */
  --paper: #f5f8fd;
  --paper-2: #ebf0f8;
  --ink: #081120;
  --slate: #51607a;
  --line-l: #dce4f0;

  --maxw: 1240px;
  --radius: 20px;
  --radius-lg: 30px;

  --shadow-blue: 0 16px 50px rgba(30, 155, 240, .35);
  --shadow-card: 0 30px 80px rgba(2, 6, 16, .55);
  --shadow-light: 0 14px 40px rgba(8, 17, 32, .10);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* --------------------------------------------------------------- Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--night);
  color: var(--ice);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

::selection { background: var(--blue); color: #fff; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Subtle global grid texture on dark body */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(rgba(90, 140, 220, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 140, 220, .035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 0%, transparent 75%);
}

main { position: relative; z-index: 1; }

/* ------------------------------------------------------------- Layout */
.wrap { width: min(100% - 44px, var(--maxw)); margin-inline: auto; position: relative; }

section { position: relative; }

.section-pad { padding: clamp(72px, 10vw, 150px) 0; }
.section-pad-sm { padding: clamp(52px, 7vw, 96px) 0; }

/* Subtle dark contrast section — used to give visual rhythm without white */
.light {
  background: var(--night-2);
  color: var(--ice);
}
.light::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(90, 140, 220, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 140, 220, .05) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 80%);
}
.light > .wrap { z-index: 1; }

/* Section seams — angled light edge */
.seam-top { border-top: 1px solid var(--line-d); }

/* --------------------------------------------------- Typography utils */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -.025em;
  text-wrap: balance;
}

.display {
  font-size: clamp(2.7rem, 7vw, 6rem);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: .98;
}
.h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); letter-spacing: -.035em; }
.h3 { font-size: clamp(1.25rem, 2vw, 1.55rem); letter-spacing: -.015em; }

.lead {
  font-size: clamp(1.05rem, 1.55vw, 1.28rem);
  color: var(--muted);
  line-height: 1.6;
  max-width: 62ch;
  text-wrap: pretty;
}
.light .lead { color: var(--muted); }

/* Eyebrow / mono label */
.eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--blue-2);
  display: inline-flex;
  align-items: center;
  gap: .7em;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: linear-gradient(90deg, var(--blue), transparent);
}
.light .eyebrow { color: var(--blue-2); }
.light .eyebrow::before { background: linear-gradient(90deg, var(--blue), transparent); }

.idx {
  font-family: var(--font-mono);
  font-size: .76rem;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: .06em;
}

.accent { color: var(--blue-2); }
.light .accent { color: var(--blue-2); }

/* Line-reveal headline: JS wraps lines in .ln > .ln-i */
.lines .ln { display: block; overflow: hidden; }
.lines .ln-i { display: block; transform: translateY(115%); }
.lines.in .ln-i { animation: lineUp 1s var(--ease-out) forwards; }
.lines.in .ln:nth-child(2) .ln-i { animation-delay: .09s; }
.lines.in .ln:nth-child(3) .ln-i { animation-delay: .18s; }
.lines.in .ln:nth-child(4) .ln-i { animation-delay: .27s; }
@keyframes lineUp { to { transform: translateY(0); } }

/* Typewriter rotator */
.rotator { color: var(--blue-2); }
.cursor {
  color: var(--blue);
  animation: blink 1.05s steps(1) infinite;
  font-weight: 400;
}
@keyframes blink { 50% { opacity: 0; } }

/* ----------------------------------------------------------- Buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .6em;
  padding: 1em 1.7em;
  border-radius: 100px;
  font-weight: 700;
  font-size: .98rem;
  letter-spacing: -.01em;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s, border-color .3s;
  white-space: nowrap;
  will-change: transform;
}
.btn svg { width: 17px; height: 17px; }

.btn-primary {
  background: linear-gradient(135deg, var(--blue-2), var(--blue) 45%, var(--blue-deep));
  color: #fff;
  box-shadow: 0 0 0 1px rgba(120, 200, 255, .35) inset, var(--shadow-blue);
}
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(160, 215, 255, .55) inset, 0 22px 60px rgba(30, 155, 240, .5); }

.btn-ghost {
  background: rgba(140, 185, 245, .05);
  color: var(--ice);
  border: 1px solid var(--line-d-strong);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover { border-color: var(--blue); background: rgba(30, 155, 240, .1); }
.light .btn-ghost { background: rgba(140, 185, 245, .05); color: var(--ice); border-color: var(--line-d-strong); }
.light .btn-ghost:hover { border-color: var(--blue); background: rgba(30, 155, 240, .1); }

.btn-arrow svg { transition: transform .3s var(--ease); }
.btn:hover .btn-arrow svg { transform: translateX(4px); }

/* ----------------------------------------------------------- Header */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--blue-deep), var(--blue-2));
  z-index: 300;
  box-shadow: 0 0 12px var(--blue-glow);
}

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  transition: background .4s, border-color .4s, backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(4, 8, 17, .72);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-color: var(--line-d);
}

.nav { display: flex; align-items: center; justify-content: space-between; height: 80px; }

.brand { display: flex; align-items: center; gap: 13px; }
.brand img {
  width: 44px; height: 44px;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 14px rgba(30, 155, 240, .4));
}
.brand-name { line-height: 1.05; }
.brand-name b {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: .04em;
  display: block;
  text-transform: uppercase;
}
.brand-name span {
  font-family: var(--font-mono);
  font-size: .56rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--blue-2);
}

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: .55em 1em;
  border-radius: 100px;
  font-size: .94rem;
  font-weight: 600;
  color: var(--muted);
  transition: color .25s, background .25s;
}
.nav-links a:hover { color: var(--ice); background: rgba(140, 185, 245, .07); }
.nav-links a.active { color: var(--blue-2); }
.nav-links a.nav-cta {
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  color: #fff;
  margin-left: 10px;
  box-shadow: 0 8px 26px rgba(30, 155, 240, .35);
}
.nav-links a.nav-cta:hover { box-shadow: 0 10px 34px rgba(30, 155, 240, .55); color: #fff; }

.nav-toggle { display: none; width: 46px; height: 46px; border-radius: 14px; align-items: center; justify-content: center; }
.nav-toggle span { position: relative; width: 22px; height: 2px; background: var(--ice); transition: .3s; display: block; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; width: 22px; height: 2px; background: var(--ice); transition: .3s; }
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }
.nav-toggle.open span { background: transparent; }
.nav-toggle.open span::before { top: 0; transform: rotate(45deg); }
.nav-toggle.open span::after { top: 0; transform: rotate(-45deg); }

/* ------------------------------------------------------------ Reveal */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; }

.stagger > * {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity .85s var(--ease-out), transform .85s var(--ease-out);
}
.stagger.in > * { opacity: 1; transform: none; }

/* ------------------------------------------------------------ Marquee */
.marquee {
  overflow: hidden;
  padding: 26px 0;
  border-top: 1px solid var(--line-d);
  border-bottom: 1px solid var(--line-d);
  background: var(--night-2);
  position: relative;
  z-index: 1;
}
.marquee-track {
  display: flex;
  gap: 0;
  width: max-content;
  animation: marquee 38s linear infinite;
}
.marquee span {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.6vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -.02em;
  white-space: nowrap;
  padding: 0 28px;
  color: transparent;
  -webkit-text-stroke: 1px rgba(140, 185, 245, .4);
  transition: color .3s;
}
.marquee span::after {
  content: "✦";
  -webkit-text-stroke: 0;
  color: var(--blue);
  margin-left: 56px;
  font-size: .7em;
  vertical-align: middle;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------------------------------------------------------- Cursor FX */
.glow-cursor {
  position: fixed;
  width: 560px; height: 560px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  left: 0; top: 0;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(30, 155, 240, .12) 0%, rgba(30, 155, 240, .04) 38%, transparent 68%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity .6s;
}
.glow-cursor.on { opacity: 1; }

/* ----------------------------------------------------------- Footer */
.site-footer {
  background: var(--night);
  border-top: 1px solid var(--line-d);
  padding: clamp(56px, 7vw, 90px) 0 36px;
  position: relative;
  z-index: 1;
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute;
  left: 50%; bottom: -340px;
  width: 900px; height: 520px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(30, 155, 240, .14), transparent 70%);
  pointer-events: none;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 44px;
  padding-bottom: 48px;
}
.footer-brand p { color: var(--muted); font-size: .95rem; max-width: 34ch; margin-top: 18px; }
.footer-col { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--blue-2);
  font-weight: 600;
  margin-bottom: 6px;
}
.footer-col a { color: var(--muted); font-size: .96rem; transition: color .25s; }
.footer-col a:hover { color: var(--ice); }
.footer-bottom {
  border-top: 1px solid var(--line-d);
  padding-top: 26px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .88rem;
}
.footer-logo { width: 150px; margin-bottom: -6px; mix-blend-mode: screen; filter: drop-shadow(0 0 22px rgba(30,155,240,.35)); }

/* --------------------------------------------------------- Responsive */
@media (max-width: 960px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    inset: 80px 16px auto;
    max-height: calc(100vh - 96px);
    max-height: calc(100dvh - 96px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    flex-direction: column;
    align-items: stretch;
    background: rgba(7, 12, 25, .96);
    backdrop-filter: blur(20px);
    border: 1px solid var(--line-d);
    border-radius: 22px;
    padding: 14px;
    gap: 4px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: .35s var(--ease);
    box-shadow: var(--shadow-card);
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: .9em 1.1em; }
  .nav-links a.nav-cta { margin-left: 0; text-align: center; justify-content: center; display: flex; }
}

@media (max-width: 600px) {
  .footer-top { grid-template-columns: 1fr; gap: 30px; }
}

/* --------------------------------------------- Frozen-animation fallback
   JS adds .no-anim to <html> when CSS animations are detected as not
   running (some embedded previews). Content shows immediately. */
.no-anim .reveal, .no-anim .stagger > * { opacity: 1 !important; transform: none !important; transition: none !important; }
.no-anim .lines .ln-i { transform: none !important; animation: none !important; }

/* ------------------------------------------------------ Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .reveal, .stagger > * { opacity: 1; transform: none; transition: none; }
  .lines .ln-i { transform: none; animation: none; }
  .glow-cursor { display: none; }
  html { scroll-behavior: auto; }
}

/* ============================================== Mega-Navigation (v2) */
.nav-item { position: relative; display: flex; align-items: center; }
.nav-mega-trigger {
  display: inline-flex; align-items: center; gap: .4em;
  padding: .55em 1em; border-radius: 100px;
  font-size: .94rem; font-weight: 600; color: var(--muted);
  transition: color .25s, background .25s;
}
.nav-mega-trigger .chev { width: 14px; height: 14px; transition: transform .3s var(--ease); }
.nav-mega-trigger:hover { color: var(--ice); background: rgba(140,185,245,.07); }
.nav-mega-trigger.active { color: var(--blue-2); }
.nav-item:hover .nav-mega-trigger .chev, .nav-item.open .nav-mega-trigger .chev { transform: rotate(180deg); }

.mega {
  position: absolute; top: calc(100% + 16px); left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: min(780px, 92vw);
  background: rgba(8, 13, 26, .9);
  backdrop-filter: saturate(170%) blur(22px);
  -webkit-backdrop-filter: saturate(170%) blur(22px);
  border: 1px solid var(--line-d-strong);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  z-index: 250;
}
.mega::before { content: ""; position: absolute; top: -18px; left: 0; right: 0; height: 18px; }
.nav-item:hover .mega, .nav-item.open .mega {
  opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0);
}
.mega-grid { display: grid; grid-template-columns: 1fr 1fr .92fr; gap: 12px; }
.mega-col { display: flex; flex-direction: column; gap: 2px; }
.mega-h {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--blue-2); margin: 4px 10px 8px; font-weight: 600;
}
.mega-link { display: flex; gap: 12px; align-items: flex-start; padding: 9px 10px; border-radius: 14px; transition: background .2s; }
.mega-link:hover { background: rgba(140, 185, 245, .08); }
.mega-link .mi {
  flex: none; width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  background: rgba(30, 155, 240, .1); border: 1px solid rgba(30, 155, 240, .28); color: var(--blue-2);
}
.mega-link .mi svg { width: 18px; height: 18px; }
.mega-link .mt { display: flex; flex-direction: column; gap: 1px; }
.mega-link b { font-size: .9rem; font-weight: 700; letter-spacing: -.01em; color: var(--ice); }
.mega-link .md { font-size: .76rem; color: var(--muted); line-height: 1.35; }
.mega-feature {
  background: linear-gradient(165deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-d); border-radius: 18px; padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.mega-feature p { font-size: .82rem; color: var(--muted); line-height: 1.5; }
.mega-feature .btn { margin-top: 4px; width: 100%; justify-content: center; font-size: .85rem; padding: .7em 1em; }
.mega-mini { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line-d); }
.mega-mini a { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: 9px; transition: color .2s; }
.mega-mini a::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--blue); flex: none; }
.mega-mini a:hover { color: var(--blue-2); }

@media (max-width: 820px) {
  .nav-item { flex-direction: column; align-items: stretch; }
  .nav-mega-trigger { justify-content: space-between; width: 100%; padding: .9em 1.1em; }
  .mega {
    position: static; transform: none !important; width: 100%;
    opacity: 1 !important; pointer-events: auto !important;
    background: transparent; border: 0; box-shadow: none; padding: 2px 0 6px;
    max-height: 0; overflow: hidden;
    transition: max-height .4s var(--ease);
  }
  .nav-item.open .mega { max-height: 1600px; }
  .mega::before { display: none; }
  .mega-grid { grid-template-columns: 1fr; gap: 2px; }
  .mega-h { margin: 12px 10px 4px; }
  .mega-feature { margin-top: 8px; }
}

/* ============================================== Breadcrumb (Subpages) */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em; color: var(--muted); margin-bottom: 22px; }
.crumbs a { color: var(--blue-2); transition: color .2s; }
.crumbs a:hover { color: var(--ice); }
.crumbs span.sep { opacity: .5; }
