/* =============================================================
   base.css — clever fit Voerde
   Design-Tokens, Reset, Typografie-System, Utilities.
   Wird auf allen Seiten eingebunden, vor jeder page-spezifischen CSS.
   ============================================================= */

/* -------------------------------------------------------------
   0. Lokale Fonts (Inter + Inter Tight, Variable, OFL-lizensiert)
      Latin + Latin-Ext Subsets. Kein Drittanbieter-Request.
   ------------------------------------------------------------- */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Inter Tight';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter/inter-tight-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter Tight';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter/inter-tight-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* -------------------------------------------------------------
   1. Design-Tokens (CSS Custom Properties)
   ------------------------------------------------------------- */
:root {
    /* ----- Farben (Dark-First, Cinematic Premium Red) ----- */
    --color-dark-950: #050506;  /* True Black Base */
    --color-dark-900: #0a0a0c;
    --color-dark-800: #14141a;
    --color-dark-700: #1e1e26;
    --color-dark-600: #2a2a34;

    --color-light-100: #f5f1e8;
    --color-light-200: #ece8df;
    --color-light-300: #d6d1c4;

    --color-gray-400: #8a8a94;
    --color-gray-500: #6b6b75;
    --color-gray-600: #4a4a54;

    --color-red-500: #ff0030;   /* Hotter Red für Glow */
    --color-red-600: #e2001a;   /* Clever-Fit Primary */
    --color-red-700: #b8001a;   /* Pressed */
    --color-red-glow: rgba(255, 0, 48, 0.35);

    /* Semantische Aliase — Dark-First */
    --bg-page: var(--color-dark-950);
    --bg-elevated: rgba(255, 255, 255, 0.03);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-inverse: var(--color-dark-900);

    --text-primary: #f5f1e8;
    --text-secondary: rgba(245, 241, 232, 0.6);
    --text-inverse: var(--color-light-100);
    --text-accent: var(--color-red-500);

    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --border-glow: rgba(255, 0, 48, 0.4);

    /* ----- Typografie ----- */
    --font-display: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

    --fs-hero: clamp(48px, 6vw, 88px);
    --fs-h1: clamp(36px, 4vw, 56px);
    --fs-h2: clamp(28px, 3vw, 40px);
    --fs-h3: clamp(20px, 2vw, 24px);
    --fs-body-lg: 20px;
    --fs-body: 18px;
    --fs-body-sm: 16px;
    --fs-small: 14px;
    --fs-micro: 12px;

    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-black: 900;

    --lh-display: 1.05;
    --lh-heading: 1.2;
    --lh-body: 1.6;

    --tracking-display: -0.02em;
    --tracking-body: 0;
    --tracking-micro: 0.08em;

    /* ----- Spacing (8-px-Raster) ----- */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 48px;
    --space-xl: 80px;
    --space-2xl: 120px;
    --space-3xl: 200px;

    /* ----- Container ----- */
    --container-narrow: 768px;
    --container-default: 1200px;
    --container-wide: 1440px;
    --container-padding-mobile: var(--space-sm);
    --container-padding-desktop: var(--space-lg);

    /* ----- Radius ----- */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* ----- Shadow & Glow ----- */
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-card-hover: 0 12px 48px rgba(0, 0, 0, 0.6);
    --shadow-button-hover: 0 12px 40px rgba(255, 0, 48, 0.5);
    --glow-red-sm: 0 0 24px rgba(255, 0, 48, 0.25);
    --glow-red-md: 0 0 48px rgba(255, 0, 48, 0.35);
    --glow-red-lg: 0 0 120px rgba(255, 0, 48, 0.4);
    --glow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.08);

    /* ----- Motion ----- */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --duration-fast: 150ms;
    --duration-medium: 300ms;
    --duration-slow: 600ms;
    --duration-hero: 20s;

    /* ----- Z-Index ----- */
    --z-header: 100;
    --z-dropdown: 200;
    --z-modal: 300;
    --z-toast: 400;
}

/* -------------------------------------------------------------
   2. Modern Reset (modern-normalize inspiriert, reduziert)
   ------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    tab-size: 4;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    color: var(--text-primary);
    background-color: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    position: relative;
    overflow-x: hidden;
}

/* Grain-Texture-Overlay — subtile Textur über die ganze Seite */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0.05;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.8 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: var(--fw-bold);
    line-height: var(--lh-heading);
    letter-spacing: var(--tracking-display);
    color: var(--text-primary);
}

p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    color: inherit;
}

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

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Reduced motion — respektiert die User-Präferenz */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* -------------------------------------------------------------
   3. Typografie-Klassen
   ------------------------------------------------------------- */
.t-hero {
    font-family: var(--font-display);
    font-size: var(--fs-hero);
    font-weight: var(--fw-black);
    line-height: var(--lh-display);
    letter-spacing: var(--tracking-display);
}

.t-h1 {
    font-size: var(--fs-h1);
    font-weight: var(--fw-bold);
    line-height: var(--lh-display);
}

.t-h2 {
    font-size: var(--fs-h2);
    font-weight: var(--fw-bold);
}

.t-h3 {
    font-size: var(--fs-h3);
    font-weight: var(--fw-semibold);
}

.t-body-lg {
    font-size: var(--fs-body-lg);
    line-height: var(--lh-body);
}

.t-body {
    font-size: var(--fs-body);
    line-height: var(--lh-body);
}

.t-small {
    font-size: var(--fs-small);
    line-height: 1.5;
}

.t-micro {
    font-size: var(--fs-micro);
    line-height: 1.4;
    letter-spacing: var(--tracking-micro);
    text-transform: uppercase;
    font-weight: var(--fw-semibold);
}

.t-muted {
    color: var(--text-secondary);
}

.t-accent {
    color: var(--text-accent);
}

/* -------------------------------------------------------------
   4. Layout Utilities
   ------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-default);
    margin-inline: auto;
    padding-inline: var(--container-padding-mobile);
}

@media (min-width: 1024px) {
    .container {
        padding-inline: var(--container-padding-desktop);
    }
}

.container--narrow {
    max-width: var(--container-narrow);
}

.container--wide {
    max-width: var(--container-wide);
}

.section {
    padding-block: var(--space-2xl);
}

@media (max-width: 767px) {
    .section {
        padding-block: var(--space-lg);
    }
}

.section {
    position: relative;
    z-index: 3;
}

.section--dark {
    background-color: transparent;
    color: var(--text-primary);
}

/* Light sections — warmes Creme statt Schwarz.
   Overridet nur die Custom Properties, Children erben automatisch. */
.section--light {
    --text-primary: #0a0a0c;
    --text-secondary: rgba(10, 10, 10, 0.62);
    --bg-elevated: #ffffff;
    --border-subtle: rgba(10, 10, 10, 0.06);
    --border-strong: rgba(10, 10, 10, 0.14);
    background-color: #f5f1e8;
    color: var(--text-primary);
}

.section--light h1,
.section--light h2,
.section--light h3,
.section--light h4,
.section--light h5,
.section--light h6 {
    color: var(--text-primary);
}

/* Visuell verstecken, aber für Screen-Reader verfügbar */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* -------------------------------------------------------------
   5. Buttons
   ------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 18px 32px;
    font-family: var(--font-display);
    font-size: var(--fs-body);
    font-weight: var(--fw-semibold);
    line-height: 1;
    letter-spacing: 0;
    border-radius: var(--radius-full);
    transition:
        background-color var(--duration-medium) var(--ease-out),
        transform var(--duration-fast) var(--ease-out),
        box-shadow var(--duration-medium) var(--ease-out);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn:active {
    transform: translateY(1px);
}

.btn--primary {
    background: linear-gradient(180deg, #ff1a42 0%, #e2001a 100%);
    color: #ffffff;
    box-shadow: var(--glow-red-sm), var(--glow-inner);
    position: relative;
    overflow: hidden;
}

.btn--primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.3), transparent 70%);
    opacity: 0.8;
    pointer-events: none;
}

.btn--primary:hover {
    background: linear-gradient(180deg, #ff3355 0%, #ff0030 100%);
    box-shadow: var(--shadow-button-hover), var(--glow-inner);
    transform: translateY(-1px);
}

.btn--primary:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 3px;
}

.btn--secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 2px solid var(--color-dark-900);
}

.btn--secondary:hover {
    background-color: var(--color-dark-900);
    color: var(--text-inverse);
}

.btn--ghost-light {
    background-color: transparent;
    color: var(--text-inverse);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn--ghost-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
}

.btn--lg {
    padding: 22px 40px;
    font-size: var(--fs-body-lg);
}

.btn--sm {
    padding: 12px 20px;
    font-size: var(--fs-small);
}

/* -------------------------------------------------------------
   6. Scroll-Reveal (Intersection Observer Target)
   ------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition:
        opacity var(--duration-slow) var(--ease-out),
        transform var(--duration-slow) var(--ease-out);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal--delay-1 { transition-delay: 100ms; }
.reveal--delay-2 { transition-delay: 200ms; }
.reveal--delay-3 { transition-delay: 300ms; }
.reveal--delay-4 { transition-delay: 400ms; }

/* Rote Underline-Animation vor Headlines */
.accent-line {
    display: inline-block;
    width: 0;
    height: 4px;
    background-color: var(--color-red-500);
    margin-bottom: var(--space-sm);
    transition: width var(--duration-slow) var(--ease-out);
}

.reveal.is-visible .accent-line {
    width: 64px;
}
