/* =========================================================================
   One-Pager-Vorlage "Spedition". Markenfarben und Schrift kommen als
   CSS-Variablen aus der config.toml (siehe partials/head.html) - hier steht
   bewusst nichts Kundenspezifisches, damit die Datei wiederverwendbar bleibt.
   Kein JavaScript: Reveal-Effekte laufen ueber animation-timeline.
   ========================================================================= */

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 300 800;
  src: url('/fonts/montserrat.woff2') format('woff2');
  font-display: swap;
}

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

:root {
  --bg: #ffffff;
  --tint: #f5f8f4;
  --dark: #1d2226;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(29, 34, 38, 0.08);
  --shadow-lift: 0 18px 44px rgba(29, 34, 38, 0.14);
}

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

.container { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }

h1, h2, h3 { line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); }
h3 { font-size: 1.15rem; }

/* === Entwurfs-Banner === */
.draft-bar {
  background: var(--muted);
  color: #fff;
  text-align: center;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  padding: 0.55rem 1rem;
}

/* === Header === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid #eceeea;
}
@supports not (backdrop-filter: blur(1px)) {
  .site-header { background: #fff; }
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.4rem;
}

.logo { display: flex; align-items: center; gap: 0.65rem; }
.logo img { height: 2.5rem; width: auto; }

.logo-text { display: grid; line-height: 1.05; }
.logo-name {
  font-size: 1.32rem;
  font-weight: 600;      /* Montserrat SemiBold, wie im Logo */
  color: var(--brand);
  letter-spacing: -0.01em;
}
.logo-sub {
  font-size: 0.6rem;
  font-weight: 500;      /* Montserrat Medium, wie im Logo */
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.main-nav { display: flex; align-items: center; gap: 0.35rem; }

.main-nav a {
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
.main-nav a:hover { color: var(--brand); background: var(--tint); }

.nav-cta {
  background: var(--brand);
  color: #fff !important;
  padding-inline: 1.2rem;
}
.nav-cta:hover { background: var(--ink); color: #fff !important; }

@media (max-width: 720px) {
  .main-nav a:not(.nav-cta) { display: none; }
  .logo img { height: 2.1rem; }
  .logo-name { font-size: 1.12rem; }
  .logo-sub { font-size: 0.52rem; }
}

/* === Hero === */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(4rem, 11vw, 8.5rem) 0 clamp(5rem, 12vw, 9rem);
  background:
    radial-gradient(120% 90% at 50% 120%, #ffffff 0%, #fdf6ec 45%, #f3f8f1 100%);
  isolation: isolate;
}

/* Die aufgehende Sonne aus der Bildmarke, als grosszuegiges Hintergrundmotiv */
.hero-sun {
  position: absolute;
  left: 50%;
  bottom: -46vw;
  translate: -50% 0;
  width: min(120vw, 1100px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
              color-mix(in srgb, var(--accent) 42%, transparent) 0%,
              color-mix(in srgb, var(--accent) 16%, transparent) 45%,
              transparent 68%);
  z-index: -2;
  animation: sunrise 1.8s cubic-bezier(0.22, 1, 0.36, 1) both,
             sun-glow 7s ease-in-out 1.8s infinite;
}

@keyframes sunrise {
  from { translate: -50% 18%; opacity: 0; scale: 0.94; }
  to   { translate: -50% 0;   opacity: 1; scale: 1; }
}

@keyframes sun-glow {
  0%, 100% { opacity: 1;    scale: 1; }
  50%      { opacity: 0.86; scale: 1.035; }
}

/* Buehne am unteren Hero-Rand: Fahrbahn + einfahrender LKW */
.hero-stage {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: clamp(90px, 13vw, 150px);
  z-index: -1;
  pointer-events: none;
}

.road {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--brand) 45%, transparent) 12%, color-mix(in srgb, var(--brand) 45%, transparent) 88%, transparent);
  overflow: hidden;
}

/* laufende Mittelstreifen - suggeriert Fahrt, ohne abzulenken */
.road-line {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg,
    color-mix(in srgb, var(--accent) 85%, transparent) 0 26px,
    transparent 26px 70px);
  animation: road-run 1.1s linear infinite;
  opacity: 0.75;
}

@keyframes road-run { to { transform: translateX(-70px); } }

.truck {
  position: absolute;
  bottom: -6px;
  left: 0;
  width: clamp(92px, 12vw, 150px);
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(29,34,38,0.18));
  animation:
    truck-drive 2.1s cubic-bezier(0.16, 0.9, 0.3, 1) 0.15s both,
    truck-idle 2.4s ease-in-out 2.4s infinite;
}

/* faehrt von links herein und bleibt gut rechts der Mitte stehen */
@keyframes truck-drive {
  from { left: -22%; }
  to   { left: min(64%, calc(100% - 210px)); }
}

/* leichtes Wippen im Stand, wie ein laufender Motor */
@keyframes truck-idle {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

.hero-inner { position: relative; text-align: center; }

.eyebrow, .section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 0.9rem;
}
.section-eyebrow.light { color: var(--accent); }

.hero h1 { max-width: 16ch; margin-inline: auto; }

.hero h1::after {
  content: '';
  display: block;
  width: 4.5rem;
  height: 4px;
  margin: 1.3rem auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.hero-sub {
  max-width: 56ch;
  margin: 1.4rem auto 0;
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  color: var(--muted);
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  margin-top: 2.2rem;
}

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 0.9rem 2rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.98rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 32%, transparent);
}
.btn-primary:hover { box-shadow: 0 14px 30px color-mix(in srgb, var(--brand) 42%, transparent); }

.btn-ghost { border-color: color-mix(in srgb, var(--ink) 18%, transparent); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.btn-block { width: 100%; }

/* === Zahlenband === */
.band {
  background: var(--ink);
  color: #fff;
  padding: 2.2rem 0;
}
.band-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  text-align: center;
}
.band-num {
  display: block;
  font-size: clamp(1.5rem, 3vw, 2.05rem);
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.band-label { display: block; font-size: 0.86rem; opacity: 0.78; }

/* === Sections === */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section-tint { background: var(--tint); }

.section h2 { max-width: 22ch; }
.section-sub { max-width: 62ch; margin-top: 0.9rem; color: var(--muted); }

/* === Karten === */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.4rem;
  margin-top: 2.6rem;
}

.card {
  background: #fff;
  border: 1px solid #ecefe9;
  border-radius: var(--radius);
  padding: 1.9rem 1.6rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--brand) 35%, transparent);
}

.card-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 1.1rem;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
}
.card-icon svg { width: 1.6rem; height: 1.6rem; }

.card h3 { margin-bottom: 0.5rem; }
.card p { color: var(--muted); font-size: 0.96rem; }

/* === Ablauf === */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.6rem;
  margin-top: 2.6rem;
  counter-reset: step;
}
.steps li { position: relative; padding-top: 3.6rem; }

.step-num {
  position: absolute;
  top: 0;
  left: 0;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--accent) 70%, var(--brand)));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 30%, transparent);
}
.steps h3 { margin-bottom: 0.45rem; }
.steps p { color: var(--muted); font-size: 0.96rem; }

/* === Split === */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 900px) {
  .split { grid-template-columns: 1.15fr 0.85fr; gap: 4rem; }
}

.split-text p { color: var(--muted); margin-top: 0.9rem; }

.check-list { list-style: none; margin-top: 1.5rem; display: grid; gap: 0.75rem; }
.check-list li {
  position: relative;
  padding-left: 2rem;
  color: var(--ink);
  font-size: 0.98rem;
}
.check-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.36em;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 15%, transparent);
}
.check-list li::after {
  content: '';
  position: absolute;
  left: 0.35rem;
  top: 0.62em;
  width: 0.42rem;
  height: 0.22rem;
  border-left: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  rotate: -45deg;
}

.split-visual {
  display: grid;
  place-items: center;
  padding: 2.5rem;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 65%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 62%),
    var(--tint);
}
.split-visual img { width: min(320px, 80%); }

/* === Kontakt === */
.section-dark { background: var(--dark); color: #fff; }
.section-dark h2 { color: #fff; }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}
@media (min-width: 900px) {
  .contact-grid { grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
}

.contact-lead { margin-top: 1rem; opacity: 0.82; max-width: 46ch; }
.contact-line { margin-top: 0.5rem; opacity: 0.72; font-size: 0.96rem; }

.lead-form {
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius);
  padding: 1.9rem 1.7rem;
  box-shadow: var(--shadow-lift);
  display: grid;
  gap: 0.9rem;
}

.form-title { font-weight: 800; font-size: 1.15rem; }

.lead-form label {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
}

.lead-form input {
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  /* width/min-width sind Pflicht: <input> bringt eine Eigenbreite von ~20
     Zeichen mit. Im Raster unten wuerde die sonst die Spalte aufblasen und
     die ganze Seite breiter als das Handy machen. */
  width: 100%;
  min-width: 0;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid #e2e6df;
  border-radius: 9px;
  background: #fcfdfb;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.lead-form input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.form-row > label { min-width: 0; }

/* Auf schmalen Handys lieber untereinander als gequetscht */
@media (max-width: 430px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-hint { font-size: 0.8rem; color: var(--muted); text-align: center; }

/* === Footer === */
.site-footer { background: var(--ink); color: #fff; padding: 3.2rem 0 1.8rem; }

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 2rem;
  align-items: start;
}
.footer-logo { height: 7rem; width: auto; }
@media (max-width: 720px) { .footer-logo { height: 5.5rem; } }
.site-footer h3 { font-size: 0.92rem; margin-bottom: 0.7rem; color: var(--accent); }
.site-footer p { font-size: 0.9rem; opacity: 0.75; }
.site-footer a:hover { color: var(--accent); }
.footer-hint { font-size: 0.78rem !important; opacity: 0.45 !important; margin-top: 0.5rem; }

.footer-bottom {
  margin-top: 2.4rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
  opacity: 0.6;
}

/* =========================================================================
   Bewegung
   -------------------------------------------------------------------------
   Zwei Wege, weil `animation-timeline: view()` (scroll-gekoppelt) bis heute
   nur Chrome/Safari koennen - Firefox 153 kann es NICHT. Ohne Fallback laege
   die Seite dort voellig still.
     1. .anim  = laeuft beim Laden, mit gestaffelter Verzoegerung (--d).
                 Funktioniert ueberall. Traegt den Hero.
     2. .reveal = scroll-gekoppelt, wo unterstuetzt; sonst faellt es auf
                 dieselbe Lade-Animation zurueck.
   ========================================================================= */

@media (prefers-reduced-motion: no-preference) {

  .anim {
    animation: rise-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--d, 0s);
  }

  @keyframes rise-in {
    from { opacity: 0; transform: translateY(26px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Zahlenband: Ziffern kommen einzeln und mit einem Tick Ueberschwung */
  .band-grid > div {
    animation: pop-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  }
  .band-grid > div:nth-child(1) { animation-delay: 0.75s; }
  .band-grid > div:nth-child(2) { animation-delay: 0.87s; }
  .band-grid > div:nth-child(3) { animation-delay: 0.99s; }
  .band-grid > div:nth-child(4) { animation-delay: 1.11s; }

  @keyframes pop-in {
    from { opacity: 0; transform: translateY(14px) scale(0.94); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }

  /* Scroll-gekoppelt, wo es geht */
  @supports (animation-timeline: view()) {
    .reveal {
      animation: rise-in linear both;
      animation-timeline: view();
      animation-range: entry 6% cover 28%;
      animation-delay: 0s;
    }
    .cards .reveal:nth-child(2) { animation-range: entry 2% cover 26%; }
    .cards .reveal:nth-child(3) { animation-range: entry -2% cover 24%; }
    .cards .reveal:nth-child(4) { animation-range: entry -6% cover 22%; }
  }

  /* Fallback fuer Firefox & Co: gestaffelt beim Laden */
  @supports not (animation-timeline: view()) {
    .reveal {
      animation: rise-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
    .cards .reveal:nth-child(1), .steps .reveal:nth-child(1) { animation-delay: 0.20s; }
    .cards .reveal:nth-child(2), .steps .reveal:nth-child(2) { animation-delay: 0.32s; }
    .cards .reveal:nth-child(3), .steps .reveal:nth-child(3) { animation-delay: 0.44s; }
    .cards .reveal:nth-child(4) { animation-delay: 0.56s; }
  }

  /* Schritt-Nummern springen kurz an */
  .step-num { animation: num-pop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
  .steps li:nth-child(1) .step-num { animation-delay: 0.30s; }
  .steps li:nth-child(2) .step-num { animation-delay: 0.45s; }
  .steps li:nth-child(3) .step-num { animation-delay: 0.60s; }

  @keyframes num-pop {
    from { opacity: 0; transform: scale(0.4) rotate(-14deg); }
    to   { opacity: 1; transform: scale(1) rotate(0); }
  }
}

/* Unterstrich unter H2 wischt beim Hover der Section ein - kleiner Akzent */
.section h2 { position: relative; display: inline-block; }
.section h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.section:hover h2::after { transform: scaleX(1); }

/* Glanz-Sweep ueber den Hauptbutton beim Hover */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: skewX(-18deg);
  transition: left 0.6s ease;
}
.btn-primary:hover::after { left: 120%; }

/* Karten-Icon dreht sich beim Hover leicht mit */
.card-icon { transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s; }
.card:hover .card-icon {
  transform: rotate(-7deg) scale(1.08);
  background: color-mix(in srgb, var(--brand) 20%, transparent);
}

/* Formularkarte hebt sich beim Fokussieren leicht an */
.lead-form { transition: transform 0.35s, box-shadow 0.35s; }
.lead-form:focus-within { transform: translateY(-4px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-sun, .truck, .road-line { animation: none !important; }
  .truck { left: min(64%, calc(100% - 210px)); }
  .btn:hover, .card:hover { transform: none; }
  .section h2::after { transition: none; }
}

/* =========================================================================
   Fortschritts-Fahrbahn am unteren Rand
   -------------------------------------------------------------------------
   Der LKW faehrt beim Scrollen mit und zeigt nebenbei den Lesefortschritt.
   Zwei Wege, damit es ueberall laeuft:
     · Chrome/Safari: `animation-timeline: scroll()` - reines CSS, kein JS.
     · Firefox: kann das (Stand 153) nicht. Dort setzt ein winziges Skript in
       baseof.html die Variable --scroll (0…1), die hier ausgewertet wird.
   ========================================================================= */

.scroll-road {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  height: 3px;
  z-index: 60;
  pointer-events: none;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
}

.scroll-road-line {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  width: calc(var(--scroll, 0) * 100%);
}

.scroll-truck {
  position: absolute;
  bottom: 1px;
  width: clamp(46px, 6vw, 68px);
  height: auto;
  left: calc(var(--scroll, 0) * (100% - clamp(46px, 6vw, 68px)));
  filter: drop-shadow(0 6px 10px rgba(29, 34, 38, 0.22));
}

/* Chrome/Safari: Fahrt und Balken direkt an den Scrollfortschritt haengen -
   dann wird --scroll gar nicht gebraucht. */
@supports (animation-timeline: scroll()) {
  .scroll-road-line {
    width: 100%;
    transform-origin: left;
    animation: road-fill linear both;
    animation-timeline: scroll(root block);
  }
  .scroll-truck {
    left: 0;
    animation: truck-travel linear both;
    animation-timeline: scroll(root block);
  }
  @keyframes road-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @keyframes truck-travel {
    from { left: 0; }
    to   { left: calc(100% - clamp(46px, 6vw, 68px)); }
  }
}

/* Sanft einblenden, damit die Leiste nicht schon im Hero stoert */
@media (prefers-reduced-motion: no-preference) {
  .scroll-road { animation: road-appear 0.6s ease 1.9s both; }
  @keyframes road-appear { from { opacity: 0; } to { opacity: 1; } }
}

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

/* Telefonnummer in der Kopfleiste - klickbar, faellt auf schmalen Screens weg */
.nav-phone { font-weight: 600; white-space: nowrap; }
@media (max-width: 720px) { .nav-phone { display: none; } }
.contact-line a, .site-footer a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.contact-line a:hover, .site-footer a:hover { opacity: 1; color: var(--brand); }
