/* =============================================================================
   Routix — Globales Stylesheet
   =============================================================================
   Strukturiert in Themen-Blöcke. Wird sowohl von Coming-Soon- als auch
   Marketing-Seite eingebunden — Selektoren ohne Match auf der jeweiligen Seite
   sind tot, kosten aber nichts an Performance, sodass eine Aufteilung in
   zwei Bundles aktuell nicht nötig ist. Falls die CSS-Datei deutlich wächst,
   einfach nach Pages splitten (`coming-soon.css`, `home.css`) und im Layout
   conditional einbinden.
   ============================================================================= */

/* ===== Global =============================================================== */
html { scroll-padding-top: 80px; }
body {
    font-feature-settings: 'cv02','cv03','cv04','cv11';
    -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(249,115,22,.25); }

/* ===== Scroll-Progress-Bar (Marketing) ====================================== */
#scroll-progress {
    position: fixed; top: 0; left: 0; height: 2px; width: 0;
    background: linear-gradient(90deg, #1d4ed8, #3b82f6, #f97316);
    z-index: 60;
    transition: width .1s linear;
}

/* ===== Section-Indicator (rechtsseitig, Desktop) ============================ */
#section-nav {
    position: fixed; right: 1.25rem; top: 50%; transform: translateY(-50%);
    z-index: 40; display: none;
}
@media (min-width: 1024px) { #section-nav { display: flex; } }
#section-nav { flex-direction: column; gap: .65rem; }
.sn-dot {
    position: relative; width: 9px; height: 9px; border-radius: 50%;
    background: rgba(100,116,139,.35);
    transition: all .35s cubic-bezier(.4,0,.2,1);
}
.sn-dot.is-active { background: #f97316; transform: scale(1.4); }
.sn-dot::after {
    content: attr(data-label); position: absolute; right: 22px; top: 50%;
    transform: translateY(-50%) translateX(8px);
    font-size: 11px; font-weight: 600; white-space: nowrap;
    background: rgba(15,23,42,.92); color: white; padding: 4px 10px;
    border-radius: 4px; opacity: 0; pointer-events: none;
    transition: opacity .25s, transform .25s;
}
.sn-dot:hover::after, .sn-dot.is-active::after { opacity: 1; transform: translateY(-50%) translateX(0); }

/* ===== Mesh-Gradient-Background ============================================= */
.mesh-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.mesh-bg::before, .mesh-bg::after {
    content: ''; position: absolute; border-radius: 50%; filter: blur(90px);
    will-change: transform;
}
.mesh-bg::before {
    width: 800px; height: 800px; left: -150px; top: -200px;
    background: radial-gradient(circle, rgba(29,78,216,.45), transparent 70%);
    animation: drift1 22s ease-in-out infinite;
}
.mesh-bg::after {
    width: 700px; height: 700px; right: -200px; top: 100px;
    background: radial-gradient(circle, rgba(249,115,22,.4), transparent 70%);
    animation: drift2 28s ease-in-out infinite;
}
.mesh-bg .mesh-third {
    position: absolute; bottom: -200px; left: 30%;
    width: 600px; height: 600px; border-radius: 50%; filter: blur(90px);
    background: radial-gradient(circle, rgba(59,130,246,.35), transparent 70%);
    animation: drift3 25s ease-in-out infinite;
}
@keyframes drift1 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(80px,40px) scale(1.1)} }
@keyframes drift2 { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(-60px,80px) scale(.9)} }
@keyframes drift3 { 0%,100%{transform:translate(0,0) scale(.9)} 50%{transform:translate(40px,-60px) scale(1.1)} }

/* Subtiles Grid-Overlay */
.bg-grid {
    background-image:
        linear-gradient(to right, rgba(148,163,184,.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(148,163,184,.08) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 30%, transparent 100%);
}

/* ===== Reveal-Animationen =================================================== */
.reveal {
    opacity: 0; transform: translateY(28px);
    transition: opacity .9s cubic-bezier(.2,.7,.2,1),
                transform .9s cubic-bezier(.34,1.3,.64,1);
    will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

.stagger > * {
    opacity: 0; transform: translateY(16px);
    transition: opacity .7s, transform .7s cubic-bezier(.34,1.3,.64,1);
}
.stagger.is-visible > * { opacity: 1; transform: none; }
.stagger.is-visible > *:nth-child(1){transition-delay:.05s}
.stagger.is-visible > *:nth-child(2){transition-delay:.12s}
.stagger.is-visible > *:nth-child(3){transition-delay:.19s}
.stagger.is-visible > *:nth-child(4){transition-delay:.26s}
.stagger.is-visible > *:nth-child(5){transition-delay:.33s}
.stagger.is-visible > *:nth-child(6){transition-delay:.40s}
.stagger.is-visible > *:nth-child(7){transition-delay:.47s}
.stagger.is-visible > *:nth-child(8){transition-delay:.54s}

/* ===== Animated Underline (Nav-Links) ======================================= */
.nav-link { position: relative; }
.nav-link::after {
    content: ''; position: absolute; left: 0; bottom: -4px;
    width: 100%; height: 2px;
    background: linear-gradient(90deg, #1d4ed8, #f97316);
    transform: scaleX(0); transform-origin: right;
    transition: transform .35s cubic-bezier(.65,.05,.36,1);
}
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }

/* ===== Word-Cycler (Hero) =================================================== */
.word-cycler {
    display: inline-block; position: relative;
    overflow: hidden; vertical-align: bottom;
    height: 1em;
}
.word-cycler-track {
    display: flex; flex-direction: column;
    transition: transform .6s cubic-bezier(.65,.05,.36,1);
}
.word-cycler-item {
    height: 1em; line-height: 1;
    background: linear-gradient(90deg, #1d4ed8, #3b82f6, #f97316);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    white-space: nowrap;
}

/* ===== Hero — Animierte SVG-Routen + fahrender Truck ======================== */
.route-line {
    stroke-dasharray: 1000; stroke-dashoffset: 1000;
    animation: draw 2.6s cubic-bezier(.65,.05,.36,1) forwards;
}
.route-line.delay-1 { animation-delay: .35s; }
.route-line.delay-2 { animation-delay: .8s;  }
@keyframes draw { to { stroke-dashoffset: 0; } }

.truck-anim {
    offset-path: path('M40 240 Q 100 180 160 200 T 280 120 T 360 60');
    offset-rotate: auto;
    animation: truckRoute 8s cubic-bezier(.4,0,.2,1) 2s infinite;
}
@keyframes truckRoute {
    0%   { offset-distance: 0%;   opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 1; }
    100% { offset-distance: 100%; opacity: 0; }
}

/* ===== 3D-Tilt + Magnetic Buttons =========================================== */
.tilt-3d {
    transform-style: preserve-3d;
    transition: transform .35s cubic-bezier(.34,1.3,.64,1);
    will-change: transform;
}
.tilt-3d > * { transform-style: preserve-3d; }

.magnetic { transition: transform .25s cubic-bezier(.34,1.3,.64,1); will-change: transform; }

/* ===== Cursor-Following Glow (Cards) ======================================== */
.glow-card { position: relative; isolation: isolate; overflow: hidden; }
.glow-card::before {
    content:''; position: absolute; inset: 0;
    background: radial-gradient(420px circle at var(--mx,50%) var(--my,50%),
                rgba(249,115,22,.18), transparent 50%);
    opacity: 0; transition: opacity .35s; pointer-events: none; z-index: 0;
}
.glow-card:hover::before { opacity: 1; }
.glow-card > * { position: relative; z-index: 1; }

/* ===== Marquee Logo-Strip =================================================== */
.marquee {
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
    display: flex; gap: 4rem; width: max-content;
    animation: marquee 30s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ===== Live-Toast-Notifications (Marketing) ================================= */
#toast-stack {
    position: fixed; bottom: 1.5rem; left: 1.5rem;
    z-index: 50; display: flex; flex-direction: column; gap: .5rem;
    pointer-events: none;
}
#toast-stack .toast {
    pointer-events: auto;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(226,232,240,1);
    box-shadow: 0 12px 40px -12px rgba(2,6,23,.25);
    border-radius: 12px;
    padding: 12px 14px 12px 12px;
    min-width: 280px; max-width: 340px;
    display: flex; gap: 10px; align-items: flex-start;
    transform: translateX(-120%); opacity: 0;
    transition: transform .55s cubic-bezier(.34,1.4,.64,1), opacity .35s;
}
.dark #toast-stack .toast { background: rgba(15,23,42,.95); border-color: rgba(30,41,59,1); color: #e2e8f0; }
#toast-stack .toast.shown   { transform: translateX(0); opacity: 1; }
#toast-stack .toast.leaving { transform: translateX(-120%); opacity: 0; }

.toast-dot {
    width: 8px; height: 8px; border-radius: 50%;
    flex: 0 0 8px; margin-top: 6px;
    animation: ping 1.6s cubic-bezier(0,0,.2,1) infinite;
}
@keyframes ping {
    0%   { box-shadow: 0 0 0 0 currentColor; }
    70%  { box-shadow: 0 0 0 10px rgba(0,0,0,0); }
    100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}

/* ===== Pricing — Animated Glow Border (Featured-Plan) ======================= */
.price-featured { position: relative; overflow: hidden; }
.price-featured::before {
    content: ''; position: absolute; inset: -2px; z-index: -1;
    border-radius: inherit;
    background: conic-gradient(from 0deg, #1d4ed8, #f97316, #3b82f6, #f97316, #1d4ed8);
    animation: spin 6s linear infinite;
    opacity: .8;
}
.price-featured::after {
    content: ''; position: absolute; inset: 2px; z-index: -1;
    border-radius: inherit;
    background: linear-gradient(180deg, #1d4ed8, #1e40af);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== FAQ-Akkordeon ======================================================== */
.faq-panel {
    max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height .4s cubic-bezier(.4,0,.2,1), opacity .35s;
}
.faq-item[data-open="true"] .faq-panel { max-height: 400px; opacity: 1; }
.faq-item[data-open="true"] .faq-chev  { transform: rotate(180deg); }

/* ===== Toggle / Carousel ==================================================== */
.toggle-knob { transition: transform .35s cubic-bezier(.34,1.4,.64,1); }
[data-billing="yearly"] .toggle-knob { transform: translateX(28px); }
.carousel-track { transition: transform .8s cubic-bezier(.65,.05,.36,1); }

/* ===== Misc ================================================================= */
.ticker { font-variant-numeric: tabular-nums; }
.chat-msg {
    opacity: 0; transform: translateY(8px);
    transition: opacity .35s, transform .35s cubic-bezier(.34,1.4,.64,1);
}
.chat-msg.shown { opacity: 1; transform: none; }

.pulse-soft { animation: pulseSoft 2.4s ease-in-out infinite; }
@keyframes pulseSoft {
    0%,100% { opacity: .55; transform: scale(1); }
    50%     { opacity: 1;   transform: scale(1.15); }
}

.float-anim { animation: floaty 6s ease-in-out infinite; }
@keyframes floaty { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }

.theme-icon { transition: transform .5s cubic-bezier(.34,1.4,.64,1); }

/* ===== Coming-Soon — 3D Cinematic Highway (Konzept A v3) ==================== */

.motion-window {
    background: #0c0a3e;
    box-shadow:
        0 30px 80px -20px rgba(2,6,23,.5),
        inset 0 0 0 1px rgba(255,255,255,.06);
}
.motion-vignette {
    position: absolute; inset: 0; z-index: 4;
    pointer-events: none;
    background: radial-gradient(ellipse 95% 85% at 50% 50%, transparent 55%, rgba(2,6,23,.5) 100%);
}

/* Spline 3D-Szene überdeckt die SVG-Fallback (z-index 2 < 4 = Vignette bleibt drüber) */
.motion-spline {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: transparent;
    /* Sanftes Einblenden sobald spline-viewer das Custom-Element registriert hat */
    opacity: 0;
    animation: motionSplineFadeIn 1s ease-out .4s forwards;
}
@keyframes motionSplineFadeIn { to { opacity: 1; } }

/* SVG-Fallback liegt darunter; bleibt einzige Anzeige solange keine spline_url gesetzt ist */
.motion-fallback { z-index: 1; }

/* Phase-1 Glass-Badge oben links */
.motion-badge {
    position: absolute;
    top: 14px; left: 14px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(15,23,42,.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.18);
    color: rgba(255,255,255,.95);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .03em;
}
.motion-badge-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #f97316;
    box-shadow: 0 0 8px rgba(249,115,22,.7);
    animation: pulseSoft 2.4s ease-in-out infinite;
}

/* Sterne — sanftes Twinkling */
.star-twinkle         { animation: starTwinkle 3.2s ease-in-out infinite; }
.star-twinkle.delay-1 { animation-delay: .8s; }
.star-twinkle.delay-2 { animation-delay: 1.6s; }
.star-twinkle.delay-3 { animation-delay: 2.4s; }
@keyframes starTwinkle {
    0%, 100% { opacity: .25; }
    50%      { opacity: 1; }
}

/* Sonne am Horizont */
.sun-pulse { animation: sunPulse 4s ease-in-out infinite; transform-origin: center; }
@keyframes sunPulse {
    0%, 100% { opacity: .75; }
    50%      { opacity: 1; }
}

/* Berg-Parallax — zwei Layer für 3D-Tiefe.
   Pfade sind doppelt im SVG (0..400 + 400..800), translate(-400px) macht den Loop nahtlos. */
.layer-mountains-far  { animation: panSlow   80s linear infinite; }
.layer-mountains-near { animation: panMedium 32s linear infinite; }
@keyframes panSlow   { to { transform: translateX(-400px); } }
@keyframes panMedium { to { transform: translateX(-400px); } }

/* Strassen-Mittelstreifen — fliegen auf Betrachter zu */
.road-dash {
    stroke-dasharray: 18 22;
    animation: roadFlow .9s linear infinite;
}
@keyframes roadFlow { to { stroke-dashoffset: -40; } }

/* Laternen — vom Horizont an die Kamera zoomen */
.lamppost           { animation: lampZoom 3.6s linear infinite; opacity: 0; }
.lamppost-1         { animation-delay: 0s; }
.lamppost-2         { animation-delay: 1.2s; }
.lamppost-3         { animation-delay: 2.4s; }
@keyframes lampZoom {
    0%   { transform: translate(225px, 215px) scale(.18); opacity: 0; }
    8%   { opacity: .85; }
    85%  { opacity: 1; }
    100% { transform: translate(440px, 360px) scale(2.2); opacity: 0; }
}
.lamp-glow { animation: lampGlow 2.2s ease-in-out infinite; transform-origin: center; }
@keyframes lampGlow {
    0%, 100% { opacity: .3;  }
    50%      { opacity: .6; }
}

/* Truck idle-bob */
.motion-truck {
    animation: truckBob 1.4s ease-in-out infinite;
    transform-origin: center;
}
@keyframes truckBob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-1.4px); }
}

/* Räder drehen — innerer <g class="wheel"> rotiert um (0,0) im lokalen Koordinatensystem */
.motion-truck .wheel {
    animation: wheelSpin .42s linear infinite;
    transform-origin: 0 0;
}
@keyframes wheelSpin { to { transform: rotate(360deg); } }

/* Scheinwerfer-Glow + Strahl */
.headlight-glow { animation: headlightPulse 2.4s ease-in-out infinite; transform-origin: center; }
.headlight-beam { animation: headlightBeam  2.4s ease-in-out infinite; transform-origin: 0 50%; }
@keyframes headlightPulse {
    0%, 100% { opacity: .5;  transform: scale(1); }
    50%      { opacity: .85; transform: scale(1.18); }
}
@keyframes headlightBeam {
    0%, 100% { opacity: .4; }
    50%      { opacity: .7; }
}

/* Feature-Roadmap-Bento unter dem Animationsfenster */
.feature-mini {
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(226,232,240,.9);
    transition: transform .25s cubic-bezier(.34,1.3,.64,1), box-shadow .25s, border-color .25s;
}
.feature-mini:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -14px rgba(29,78,216,.3);
    border-color: rgba(59,130,246,.4);
}
.dark .feature-mini { background: rgba(15,23,42,.65); border-color: rgba(51,65,85,.8); }
.dark .feature-mini:hover { border-color: rgba(96,165,250,.5); }

.feature-status {
    font-size: 9px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid;
    flex-shrink: 0;
}
.feature-status-ready    { color: #047857; background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.35); }
.feature-status-beta     { color: #1d4ed8; background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.35); }
.dark .feature-status-ready { color: #6ee7b7; }
.dark .feature-status-beta  { color: #93c5fd; }

.feature-progress {
    height: 4px;
    border-radius: 999px;
    background: rgba(148,163,184,.22);
    overflow: hidden;
}
.feature-progress-bar {
    height: 100%;
    width: var(--bar-target, 100%);
    border-radius: inherit;
    transform: scaleX(0);
    transform-origin: left center;
    animation: featureFill 1.4s cubic-bezier(.65,.05,.36,1) .6s forwards;
}
@keyframes featureFill { to { transform: scaleX(1); } }

/* Progress-Bar — Endwert kommt aus der Inline-Variable `--progress-target`. */
.progress-fill {
    width: 0;
    animation: progressFill 2.5s cubic-bezier(.65,.05,.36,1) 1s forwards;
}
@keyframes progressFill { to { width: var(--progress-target, 73%); } }

/* ===== Coming-Soon — Form-Inputs ============================================ */
.form-input {
    width: 100%; height: 44px; padding: 0 14px;
    border-radius: 8px; border: 1px solid rgb(203 213 225);
    background: rgb(255 255 255); color: rgb(15 23 42); font-size: 14px;
    outline: none; transition: border .2s, box-shadow .2s, background .2s;
}
.form-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.dark .form-input { background: rgb(15 23 42); border-color: rgb(51 65 85); color: rgb(226 232 240); }
.dark .form-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.25); }
textarea.form-input { height: auto; padding: 12px 14px; min-height: 110px; resize: vertical; }
.form-label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 500; color: rgb(71 85 105); }
.dark .form-label { color: rgb(148 163 184); }

/* ===== Coming-Soon — Single-Toast =========================================== */
.toast-coming-soon {
    position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 60;
    background: rgba(255,255,255,.97); border: 1px solid rgb(226 232 240);
    border-radius: 12px; padding: 14px 18px; min-width: 300px;
    box-shadow: 0 20px 50px -15px rgba(2,6,23,.35);
    transform: translateY(120%); opacity: 0;
    transition: transform .55s cubic-bezier(.34,1.4,.64,1), opacity .35s;
    display: flex; gap: 12px; align-items: flex-start;
}
.dark .toast-coming-soon { background: rgba(15,23,42,.97); border-color: rgb(30 41 59); color: rgb(226 232 240); }
.toast-coming-soon.shown   { transform: translateY(0); opacity: 1; }
.toast-coming-soon.error   { border-color: rgb(239 68 68); }
.toast-coming-soon.success { border-color: rgb(16 185 129); }

/* ===== Reduced Motion ======================================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal, .stagger > * { opacity: 1 !important; transform: none !important; }
    .progress-fill { width: var(--progress-target, 73%) !important; }
    .route-line    { stroke-dashoffset: 0 !important; }
    .lamppost      { opacity: 1 !important; }
    .feature-progress-bar { transform: scaleX(1) !important; }
    .marquee-track { animation: none !important; }
    /* 3D-Szene komplett ausblenden — SVG-Fallback genügt für reduced-motion User. */
    .motion-spline { display: none !important; }
}
