/* intflow - shared editorial styles (complement to Tailwind) */

:root {
  --bg: #0b0b0d;
  --bg-soft: #141416;
  --hairline: #27272a;
  --text: #fafafa;
  --muted: #a1a1aa;
  --brand: #2d5bff;
  --brand-hover: #1e47e6;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.font-heading {
  font-family: "Space Grotesk", system-ui, sans-serif;
}

/* Oversized editorial display type */
.display {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.98;
}

.display-xl {
  font-size: clamp(2.75rem, 9vw, 7.5rem);
}

/* Hero-Lichtfaden: nur billige Properties animieren (dashoffset / opacity),
   die schweren Blur-Lagen bleiben statisch -> kein Ruckeln */
.streak-glint {
  stroke-dasharray: 120 2600;
  stroke-dashoffset: 0;
  animation: streakFlow 7.5s linear infinite;
}
@keyframes streakFlow {
  to { stroke-dashoffset: -2720; }
}
@media (prefers-reduced-motion: reduce) {
  .streak-glint { animation: none; }
}

/* Hero headline: vertical brushed-steel / chrome gradient, light from above */
.text-metallic {
  background: linear-gradient(
    180deg,
    #efefef 0%,
    #e0e0e0 18%,
    #c8c8c8 42%,
    #909090 70%,
    #606060 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  /* soft lift off the near-black background: subtle glow + grounding shadow */
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 16px rgba(220, 230, 255, 0.07));
}

/* Hairline grid backdrop, very subtle, no glow */
.grid-lines {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
}

/* Section number label */
.section-index {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* Logo-Wall: standardmaessig einheitliche helle Graustufe (Silhouette),
   beim Hover die Originalfarbe des Logos */
.logo-img {
  filter: grayscale(1) brightness(0) invert(0.62);
  opacity: 0.7;
  transition: filter 0.3s ease, opacity 0.3s ease;
}
.logo-img:hover {
  filter: none;
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .logo-img { transition: none; }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Down-arrow scroll cue */
@keyframes nudge {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(8px); opacity: 1; }
}
.scroll-cue { animation: nudge 1.8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .scroll-cue { animation: none; }
}

/* CTA: dezenter Licht-Sweep (links nach rechts, langsamer Loop) */
.cta-shine::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 55%;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.38) 50%, transparent 100%);
  transform: translateX(-160%) skewX(-18deg);
  animation: ctaShine 5s ease-in-out infinite;
}
@keyframes ctaShine {
  0% { transform: translateX(-160%) skewX(-18deg); }
  16% { transform: translateX(260%) skewX(-18deg); }
  100% { transform: translateX(260%) skewX(-18deg); }
}
@media (prefers-reduced-motion: reduce) {
  .cta-shine::after { animation: none; display: none; }
}

/* n8n-artiger Workflow-Canvas (Punktraster) */
.flow-canvas {
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 16px 16px;
}

/* Workflow-Graph (SVG + foreignObject-Knoten) */
.wf-svg { display: block; width: 100%; height: auto; overflow: visible; }
.wf-wire { stroke: rgba(125, 145, 185, 0.22); stroke-width: 2; fill: none; }
.wf-flow {
  stroke: rgba(111, 140, 255, 0.45);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
}
.wf-label {
  fill: #64748b;
  font-family: "DM Sans", sans-serif;
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
}

.wf-node {
  display: flex; align-items: center; gap: 9px;
  width: 100%; height: 100%; box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(11, 16, 32, 0.85);
  position: relative;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, opacity 0.4s ease, transform 0.25s ease;
}
/* dezenter Hover-Lift (nur bei Maus, sonst statisch) */
.wf-svg foreignObject { overflow: visible; }
.wf-node:hover {
  transform: translateY(-2px);
  border-color: rgba(45, 91, 255, 0.55);
  box-shadow: 0 8px 20px -10px rgba(45, 91, 255, 0.6);
}
/* inaktive Verzweigung (in diesem Durchlauf nicht gespielt) */
.wf-node.wf-idle { opacity: 0.38; }
/* Datenpunkt der inaktiven Verzweigung ausblenden (Basislinie bleibt) */
.wf-flow.wf-flow--off { opacity: 0.1; }
.wf-ico {
  flex: 0 0 32px; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}
.wf-ico svg { width: 17px; height: 17px; }
.wf-text { display: flex; flex-direction: column; min-width: 0; }
.wf-title {
  font-family: "Space Grotesk", sans-serif; font-weight: 600;
  font-size: 13px; line-height: 1.15; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wf-sub {
  font-family: "DM Sans", sans-serif; font-size: 11px; line-height: 1.2;
  color: #94a3b8; margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wf-check {
  position: absolute; top: 4px; right: 4px;
  width: 16px; height: 16px; border-radius: 9999px;
  background: #22c55e; color: #04210f;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(0.5);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.wf-check svg { width: 10px; height: 10px; }

.wf-node.is-agent { border-color: rgba(45, 91, 255, 0.5); background: rgba(45, 91, 255, 0.12); }
.wf-node.is-agent .wf-ico { background: #2d5bff; color: #fff; }

.wf-node.is-active {
  border-color: #2d5bff;
  box-shadow: 0 0 0 1px rgba(45, 91, 255, 0.35), 0 0 20px -2px rgba(45, 91, 255, 0.55);
}
.wf-node.is-done .wf-check { opacity: 1; transform: scale(1); }

@media (prefers-reduced-motion: reduce) {
  .wf-flow { animation: none; opacity: 0.55; }
}

/* ===== Vertikale Scroll-Timeline ("So gehen wir vor") ===== */
.timeline { position: relative; }

/* Zentrale Linie (Track) */
.timeline-line {
  position: absolute;
  top: 0; bottom: 0;
  left: 20px;
  width: 2px;
  background: #1f2430;
  border-radius: 2px;
}
/* gefuellter, leuchtender Teil bis zur Scrollposition */
.timeline-progress {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 0;
  background: linear-gradient(180deg, rgba(45, 91, 255, 0) 0%, #2d5bff 100%);
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(45, 91, 255, 0.45);
}
/* wandernder Leuchtpunkt */
.timeline-dot {
  position: absolute;
  left: 50%; top: 0;
  width: 14px; height: 14px;
  margin-left: -7px; margin-top: -7px;
  border-radius: 9999px;
  background: #2d5bff;
  box-shadow: 0 0 8px 2px rgba(45, 91, 255, 0.9), 0 0 26px 9px rgba(45, 91, 255, 0.45);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.timeline.is-tracking .timeline-dot { opacity: 1; }

/* Schritte */
.timeline-step { position: relative; padding-left: 56px; }
.timeline-step + .timeline-step { margin-top: 2.5rem; }

/* Knoten auf der Linie */
.timeline-node {
  position: absolute;
  left: 20px; top: 2.25rem;
  width: 14px; height: 14px;
  margin-left: -6px;
  border-radius: 9999px;
  background: #0b0b0d;
  border: 2px solid #2a3142;
  z-index: 1;
  transition: border-color 0.35s ease, background-color 0.35s ease, box-shadow 0.35s ease;
}
.timeline-node.is-active {
  border-color: #2d5bff;
  background: #2d5bff;
  box-shadow: 0 0 10px 2px rgba(45, 91, 255, 0.7);
}

/* Karte */
.timeline-card {
  position: relative;
  border: 1px solid #27272a;
  background: #0b0b0d;
  border-radius: 12px;
  padding: 1.75rem;
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}
.timeline-card.is-active {
  border-color: rgba(45, 91, 255, 0.6);
  box-shadow: 0 0 0 1px rgba(45, 91, 255, 0.25), 0 10px 34px -12px rgba(45, 91, 255, 0.4);
}

/* Horizontaler Verbinder Karte <-> Linie */
.timeline-card::before {
  content: "";
  position: absolute;
  top: 2.25rem; left: -36px;
  width: 36px; height: 2px;
  background: #2a3142;
  transition: background-color 0.35s ease;
}
.timeline-step.is-active .timeline-card::before { background: #2d5bff; }

@media (min-width: 768px) {
  .timeline-line { left: 50%; transform: translateX(-1px); }
  .timeline-step {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 4.5rem;
    align-items: center;
    padding-left: 0;
  }
  .timeline-step + .timeline-step { margin-top: 3.5rem; }
  .timeline-node { left: 50%; top: 50%; margin-left: -7px; margin-top: -7px; }
  .timeline-step--left .timeline-card { grid-column: 1; text-align: right; }
  .timeline-step--right .timeline-card { grid-column: 2; }
  .timeline-card::before { top: 50%; }
  .timeline-step--left .timeline-card::before { left: auto; right: -4.5rem; width: 4.5rem; }
  .timeline-step--right .timeline-card::before { left: -4.5rem; width: 4.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .timeline-dot { display: none; }
}

/* Marquee for logo carousels */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 32s linear infinite;
}
.marquee-track:hover { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

/* Dropdown (desktop hover + JS focus) */
.nav-dropdown:hover .nav-panel,
.nav-dropdown:focus-within .nav-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-panel {
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0b0b0d; }
::-webkit-scrollbar-thumb {
  background: #2a2a2e;
  border-radius: 9999px;
  border: 2px solid #0b0b0d;
}
::-webkit-scrollbar-thumb:hover { background: #3a3a40; }

/* Focus ring consistency */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
