/* ==========================================================================
   Taxi Fredy – base.css
   Design-Tokens (aus Figma extrahiert), Reset, Typografie, Utilities
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design-Tokens  ·  Quelle: Figma „styles" (Relume-System)
   -------------------------------------------------------------------------- */
:root {
  /* Farben */
  --color-red:          #b50e0b;   /* Milano Red – primärer Akzent */
  --color-red-hover:    #950c09;
  --color-white:        #ffffff;
  --color-off-white:    #f2f2f2;   /* Foreground – helle Bereiche (Figma) */
  --color-dark:         #191919;   /* dunkle Sections / Color Scheme 1 BG */
  --color-black:        #0d0d0d;
  --color-neutral:      #7f7f7f;   /* muted Text */
  --color-neutral-light:#b2b2b2;
  --color-gray-100:     #f0f0f0;
  --color-gray-200:     #e0e0e0;
  --color-text:         #191919;
  --color-text-light:   #ffffff;

  /* Semantische Aliase */
  --bg:            var(--color-white);
  --bg-alt:        var(--color-off-white);
  --bg-dark:       var(--color-dark);
  --text:          var(--color-text);
  --text-muted:    var(--color-neutral);
  --text-on-dark:  var(--color-text-light);
  --text-muted-on-dark: rgba(255, 255, 255, 0.65);
  --border:        var(--color-gray-200);
  --border-dark:   rgba(255, 255, 255, 0.2);

  /* Typografie */
  --font-heading: 'Michroma', 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;

  /* Schriftgrössen (Figma: H1 40 / H2 36 / H4 24, Body 14/16, Small 12) */
  --text-small:   0.875rem;   /* 14 – Regular */
  --text-xsmall:  0.75rem;    /* 12 – Small */
  --text-body:    1rem;       /* 16 – Medium */
  --text-medium:  1.125rem;   /* 18 */
  --text-large:   1.25rem;    /* 20 */
  --text-tagline: 1rem;       /* 16 – Inter SemiBold */

  --text-h1:      2.5rem;     /* 40 · line-height 1.1 */
  --text-h2:      2.25rem;    /* 36 · line-height 1.2 */
  --text-h3:      1.75rem;    /* 28 (Zwischenstufe, nicht in Figma) */
  --text-h4:      1.5rem;     /* 24 · line-height 1.1 */
  --text-h5:      1.25rem;    /* 20 */
  --text-h6:      1.125rem;   /* 18 */

  --leading-tight: 1.1;
  --leading-h2:    1.2;
  --leading-base:  1.5;

  --tracking-tight:   -1px;     /* Headings (Figma: letter-spacing -1px) */
  --tracking-eyebrow:  0.1em;   /* Tagline/Eyebrow uppercase */

  /* Spacing-Skala (Figma 8px-Basis) */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Layout (Figma: container 1280, padding-global 20 → 80, section 64) */
  --container:        1440px;
  --container-text:   1024px;
  --gutter:           clamp(1.25rem, 0.25rem + 4vw, 5rem);  /* 20 → 80px */
  --section-y:        clamp(3rem, 2.5rem + 1.5vw, 4rem);    /* 48 → 64px */
  --section-y-lg:     4rem;                                 /* 64px (Figma section-large) */
  --section-y-md:     3rem;                                 /* 48px (Footer) */
  --header-h:         72px;

  /* Radius / Stroke */
  --radius:        0;       /* Cards/Sections scharfkantig (Radius/Large = 0) */
  --radius-btn:    6px;     /* Buttons */
  --border-w:      1px;

  /* Sonstiges */
  --transition:      0.2s ease;
  --transition-slow: 0.4s ease;
  --shadow-nav:    0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-card:   0 10px 30px rgba(0, 0, 0, 0.10);

  /* z-index */
  --z-header:   100;
  --z-dropdown: 200;
  --z-overlay:  900;
  --z-drawer:   1000;
}

/* --------------------------------------------------------------------------
   Modern CSS Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-base);
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul[role='list'], ol[role='list'] { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

/* --------------------------------------------------------------------------
   Typografie
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 400;          /* Michroma hat nur Regular */
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: inherit;
}
h1 { font-size: var(--text-h1); line-height: 1.1; }
h2 { font-size: var(--text-h2); line-height: var(--leading-h2); }
h3 { font-size: var(--text-h3); }
h4 { font-size: var(--text-h4); line-height: 1.1; }
h5 { font-family: var(--font-heading); font-weight: 400; font-size: var(--text-h5); line-height: 1.3; letter-spacing: var(--tracking-tight); }
h6 { font-family: var(--font-heading); font-weight: 400; font-size: var(--text-h6); line-height: 1.3; letter-spacing: var(--tracking-tight); }

/* Rote Heading-Variante (z. B. „Was wir für dich tun") */
.text-red { color: var(--color-red); }

p { max-width: 65ch; }

.lead {
  font-size: var(--text-medium);
  color: var(--text-muted);
}

small { font-size: var(--text-small); }
strong, b { font-weight: 600; }

a:not([class]) {
  color: var(--color-red);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:not([class]):hover { color: var(--color-red-hover); }

/* --------------------------------------------------------------------------
   Layout-Utilities
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  /* Inhaltsbreite = var(--container) (1280) + Gutter beidseitig, damit der
     Content-Bereich überall gleich breit ist wie der Footer (einheitliche Breite). */
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--text { max-width: calc(var(--container-text) + 2 * var(--gutter)); }

.section { padding-block: var(--section-y); }
.section--lg { padding-block: var(--section-y-lg); }
.section--alt  { background: var(--bg-alt); }
.section--dark {
  background: var(--bg-dark);
  color: var(--text-on-dark);
}
.section--dark .lead { color: var(--text-muted-on-dark); }

.section-header { max-width: 48rem; margin-bottom: var(--space-16); }
.section-header--center { margin-inline: auto; text-align: center; }
.section-header--center .eyebrow { text-align: center; }
.section-header--center .eyebrow::after { margin-inline: auto; }
.section-header .lead { margin-top: var(--space-6); }
.section-header__actions { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-8); }
.section-header--center .section-header__actions { justify-content: center; }

/* Tagline / Eyebrow (Figma: 16px SemiBold, kontextfarben, mit kurzer roter Linie) */
.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 600;
  line-height: 1.2;
  color: inherit;
  margin-bottom: var(--space-6);
}
.eyebrow::after {
  content: '';
  display: block;
  width: 69px;
  height: 2px;
  margin-top: var(--space-4);
  background: var(--color-red);
}

.grid { display: grid; gap: var(--space-8); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.flow > * + * { margin-top: var(--space-4); }
.flow--lg > * + * { margin-top: var(--space-6); }

/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */
.visually-hidden, .sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-drawer);
  padding: var(--space-3) var(--space-4);
  background: var(--color-red);
  color: var(--color-white);
}
.skip-link:focus { top: var(--space-4); }

:focus-visible {
  outline: 3px solid var(--color-red);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Scroll-Reveal
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Smartphone: keine Scroll-Reveal-Animation → Inhalt sofort sichtbar (kein weisser Screen am Start) */
@media (max-width: 768px) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
/* Smartphone: Titel-Hierarchie klar abstufen (H1 deutlich grösser als H2 …) */
@media (max-width: 768px) {
  :root {
    --text-h1: 2rem;
    --text-h2: 1.625rem;
    --text-h3: 1.375rem;
    --text-h4: 1.25rem;
  }
}

@media (max-width: 992px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
