/* Parcelscan design system — ElectroFleet branding.
 *
 * Tokens are taken from the live LocationPlanner frontend
 * (Prod/locationplanner/Frontend/styles/base.css + theme.css) so both products
 * look like one company. The brand teal #62c1b3 is the value in the official
 * logo.svg, corroborated by the "ElectroFleet" colour scheme in
 * Consulting_Pipeline/Templates/Slide_Master_EF.pptx.
 *
 * Two deliberate additions on top of what LocationPlanner has:
 *   1. Inter is actually loaded. The corporate slide master names it as the
 *      heading font, but no project in the tree ever linked a webfont, so every
 *      app silently fell back to the system stack.
 *   2. Semantic tokens (--success/--warning/--danger) exist. LocationPlanner
 *      hardcodes these per component and has drifted into a mix of its own muted
 *      set and leaked Tailwind reds.
 */

/* Inter, self-hosted via the variable font on Google's CDN. `swap` so text is
   readable immediately rather than invisible while the font downloads. */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap");

:root {
  /* Surfaces & ink */
  --bg: #f4f8f7;
  --surface: #ffffff;
  --surface-2: #f9fbfb;
  --surface-3: #eef5f4;
  --text: #132523;
  --text-strong: #0a1a18;
  --muted: #5f7f7a;
  --border: #dcebea;
  --border-2: #e6efee;

  /* Brand */
  --brand: #62c1b3;
  --brand-strong: #4fb2a4;
  --brand-deep: #2c7a6e;
  --brand-ink: #17645a;
  --brand-soft: rgba(98, 193, 179, 0.14);
  --brand-softer: rgba(98, 193, 179, 0.07);

  /* Semantic — muted to match the consultative tone, not alert-red */
  --success: #4fb2a4;
  --warning: #8a5e1c;
  --warning-soft: rgba(217, 164, 86, 0.16);
  --danger: #a14545;
  --danger-soft: rgba(217, 119, 119, 0.14);

  /* Score bands: one ramp, five steps, readable in both themes */
  --band-1: #b4544a;
  --band-2: #c98a3f;
  --band-3: #b7a23c;
  --band-4: #6ba05a;
  --band-5: #2f9e86;

  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 6px 14px rgba(0, 0, 0, 0.08);
  --shadow-brand: 0 8px 18px rgba(98, 193, 179, 0.28);

  /* Deliberately tight radii: soft 16-22px corners on every surface are the
     single strongest "AI template" marker. Sharper corners read as technical
     precision, which is the brand's register. */
  --radius-xl: 12px;
  --radius-lg: 8px;
  --radius-md: 6px;
  --radius-sm: 4px;
  --radius-pill: 999px;

  --pad-1: 10px;
  --pad-2: 14px;
  --pad-3: 18px;
  --pad-4: 22px;
  --pad-5: 32px;
  --pad-6: 48px;

  --header-h: 68px;
  --max-w: 1240px;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* easeOutQuint — the motion signature from the newest EF frontend
     (Automation/SharepointAndInfo). Decelerating, never bouncy. */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 160ms;
  --dur: 280ms;
  --dur-slow: 520ms;
}

:root[data-theme="dark"] {
  --bg: #0f1714;
  --surface: #1a2420;
  --surface-2: #1e2b27;
  --surface-3: #233330;
  --text: #d6e5e2;
  --text-strong: #f0f7f5;
  --muted: #8aa8a2;
  --border: #2a3d38;
  --border-2: #233330;

  --brand: #62c1b3;
  /* Inverted against light mode: on a dark surface the emphasis colour has to
     get brighter, not darker, to stay the accent. */
  --brand-strong: #7ad4c7;
  --brand-deep: #9ce0d5;
  --brand-ink: #a8ded6;
  --brand-soft: rgba(98, 193, 179, 0.16);
  --brand-softer: rgba(98, 193, 179, 0.08);

  --success: #7ad4c7;
  --warning: #e0b458;
  --warning-soft: rgba(224, 180, 88, 0.14);
  --danger: #f08b7d;
  --danger-soft: rgba(240, 139, 125, 0.12);

  --band-1: #e0705c;
  --band-2: #e39a52;
  --band-3: #d4bc4e;
  --band-4: #8fbe63;
  --band-5: #58c294;

  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 6px 14px rgba(0, 0, 0, 0.28);
  --shadow-brand: 0 8px 18px rgba(98, 193, 179, 0.22);
}

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

html {
  scroll-behavior: smooth;
  /* Anchor targets must clear the sticky header. */
  scroll-padding-top: calc(var(--header-h) + 12px);
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* The signature EF canvas: two soft teal glows over the base colour. Fixed so
   it does not scroll away, and behind everything. (The hero paints its own
   background on top — that is where the charging-station video will live.) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 600px at 18% -8%, rgba(98, 193, 179, 0.18), transparent 60%),
    radial-gradient(900px 520px at 92% 6%, rgba(98, 193, 179, 0.12), transparent 55%),
    var(--bg);
}

/* Kartenquellen kompakt hinter einem Info-Symbol. Die Anbieter verlangen eine
   erreichbare Attribution; im normalen Layout bleibt deshalb nur das kleine
   Symbol sichtbar und der vollständige Text öffnet sich erst bei Bedarf. */
.map-data {
  position: absolute;
  z-index: 850;
  right: 12px;
  bottom: 12px;
}

.map-data > summary {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1;
  opacity: 0.72;
  transition:
    opacity var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}

.map-data > summary::-webkit-details-marker {
  display: none;
}

.map-data > summary:hover,
.map-data[open] > summary {
  opacity: 1;
  color: var(--brand-ink);
  border-color: var(--brand);
}

.map-data-card {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: min(290px, calc(100vw - 24px));
  padding: 10px 12px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 0.68rem;
  line-height: 1.45;
}

.map-data-card a {
  color: var(--brand-ink);
  text-underline-offset: 2px;
}

:root[data-theme="dark"] body::before {
  background:
    radial-gradient(1100px 600px at 18% -8%, rgba(98, 193, 179, 0.1), transparent 60%),
    radial-gradient(900px 520px at 92% 6%, rgba(98, 193, 179, 0.07), transparent 55%),
    var(--bg);
}

/* --- typography ----------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  color: var(--text-strong);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.2rem, 1.3rem + 2.8vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.04;
}

h2 {
  font-size: clamp(1.6rem, 1.15rem + 1.5vw, 2.4rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1em;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--brand-ink);
  text-underline-offset: 3px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-ink);
  margin-bottom: 14px;
}

.lead {
  font-size: clamp(1.02rem, 0.96rem + 0.3vw, 1.18rem);
  color: var(--muted);
  max-width: 62ch;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.86rem;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* `hidden` only gets `display:none` from the UA stylesheet, which any
   class-based `display` rule outranks. Everything toggled from JS relies on
   this. */
[hidden] {
  display: none !important;
}

/* --- layout --------------------------------------------------------------- */

.shell {
  width: min(100% - 40px, var(--max-w));
  margin-inline: auto;
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 28px, var(--max-w));
  }
}

.section {
  padding-block: clamp(56px, 4vw + 34px, 104px);
}

.section-head {
  max-width: 68ch;
  margin-bottom: clamp(28px, 3vw, 48px);
}

/* --- buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease),
    transform 60ms var(--ease),
    color var(--dur-fast) var(--ease);
}

.btn:active {
  transform: none;
  filter: brightness(0.96);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand);
  color: #08221e;
  font-weight: 700;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-strong);
  box-shadow: var(--shadow-brand);
}

.btn-secondary {
  background: var(--brand-soft);
  border-color: rgba(98, 193, 179, 0.35);
  color: var(--brand-ink);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(98, 193, 179, 0.2);
  border-color: rgba(98, 193, 179, 0.55);
  box-shadow: 0 6px 14px rgba(98, 193, 179, 0.18);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--brand);
}

.btn-ghost[aria-pressed="true"] {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-ink);
}

.btn-sm {
  padding: 9px 15px;
  font-size: 0.88rem;
}

.btn-lg {
  padding: 16px 30px;
  font-size: 1.02rem;
}

.btn-icon {
  padding: 9px;
  width: 38px;
  height: 38px;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--brand-strong);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- surfaces ------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  border: 1px solid rgba(98, 193, 179, 0.3);
  color: var(--brand-ink);
  font-size: 0.8rem;
  font-weight: 600;
}

/* --- motion --------------------------------------------------------------- */

/* Scroll-reveal. Elements start slightly low and transparent; `is-visible` is
   set by an IntersectionObserver where a page uses it. */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--dur-slow) var(--ease),
    transform var(--dur-slow) var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }
.reveal-delay-4 { transition-delay: 320ms; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.6; }
  70% { transform: scale(1.35); opacity: 0; }
  100% { opacity: 0; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* Motion is decoration here; every animation has a static end state that is
   equally usable, so honouring the preference costs nothing. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
