/* ============================================
   Racetry – Shared Styles
   ============================================ */

/* --- Fonts (self-hosted, DSGVO-friendly) --- */
@font-face {
    font-family: 'Geist';
    src: url('/fonts/Geist-Variable.woff2') format('woff2-variations');
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: 'Geist Mono';
    src: url('/fonts/GeistMono-Variable.woff2') format('woff2-variations');
    font-weight: 100 900;
    font-display: swap;
}

/* --- Design Tokens --- */
:root {
    --bg: #0a0a0a;
    --bg-elevated: #111111;
    --bg-card: #161616;
    --border: #222222;
    --border-strong: #2a2a2a;
    --text: #fafafa;
    --text-muted: #888888;
    --text-dim: #555555;
    --accent: #ff3030;
    --accent-dim: #cc1f1f;
    --warning: #ffb800;
    --success: #00d97e;

    --font-display: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Geist Mono', ui-monospace, "SF Mono", Menlo, monospace;
    --font-body: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --max-width: 1200px;
    --section-gap: clamp(4rem, 10vw, 8rem);
    --radius: 16px;
    --radius-sm: 8px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Subtle grid background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

main, header, footer {
    position: relative;
    z-index: 1;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --- Header --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(10, 10, 10, 0.75);
    border-bottom: 1px solid var(--border);
}

.site-header__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 16px var(--accent);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* Language switcher */
.lang-switch {
    display: flex;
    align-items: center;
}

.lang-switch select {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    outline: none;
    transition: color 0.2s, border-color 0.2s;
}

.lang-switch select:hover,
.lang-switch select:focus {
    color: var(--text);
    border-color: var(--border-strong);
}

/* --- Layout --- */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

section {
    padding: var(--section-gap) 0;
    border-bottom: 1px solid var(--border);
}

section:last-of-type {
    border-bottom: none;
}

/* --- Hero --- */
.hero {
    padding: clamp(3rem, 8vw, 6rem) 0 var(--section-gap);
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent);
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent-dim);
    border-radius: 999px;
    margin-bottom: 2rem;
    background: rgba(255, 48, 48, 0.05);
}

.hero__eyebrow::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

.hero__title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.02;
    margin-bottom: 1.5rem;
    max-width: 24ch;
    margin-left: auto;
    margin-right: auto;
}

.hero__title em {
    font-style: normal;
    background: linear-gradient(135deg, var(--accent) 0%, #ff7070 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
}

.hero__subtitle {
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    color: var(--text-muted);
    max-width: 55ch;
    margin: 0 auto 3rem;
}

.hero__icon {
    width: 96px;
    height: 96px;
    border-radius: 22px;
    margin: 0 auto 2rem;
    display: block;
    box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.5),
                0 0 0 1px var(--border);
}

.hero__icon-fallback {
    width: 96px;
    height: 96px;
    border-radius: 22px;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2.5rem;
    color: var(--text);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
    box-shadow: 0 20px 60px -10px rgba(255, 48, 48, 0.4),
                0 0 0 1px var(--border);
    letter-spacing: -0.04em;
}

.app-store-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.8rem 1.6rem;
    background: var(--text);
    color: var(--bg);
    border-radius: var(--radius);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.app-store-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px -10px rgba(0, 0, 0, 0.5);
}

.app-store-cta svg {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.app-store-cta__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.25;
}

.app-store-cta__small {
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.75;
}

.app-store-cta__big {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Hero device showcase */
.hero__showcase {
    margin-top: clamp(3rem, 6vw, 5rem);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    align-content: flex-end;
    gap: clamp(2.5rem, 7vw, 6rem);
    flex-wrap: wrap;
}

.hero__tablet,
.hero__phone {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    padding: 4px;
    overflow: hidden;
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.7);
}

.hero__tablet {
    width: 100%;
    max-width: 460px;
    flex-shrink: 0;
    border-radius: 28px;
}

.hero__phone {
    width: 220px;
    flex-shrink: 0;
    border-radius: 32px;
}

.device-frame__screen {
    background: #000;
}

.device-frame__screen img {
    display: block;
    width: 100%;
    height: auto;
}

.device-frame__placeholder {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-align: center;
    padding: 2rem;
}

/* --- About / Naming Section --- */
.about {
    text-align: center;
    padding: clamp(3rem, 7vw, 5rem) 0;
}

.about__naming {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.about__src {
    color: var(--accent);
    font-weight: 700;
}

.about__name {
    color: var(--text);
    font-weight: 700;
}

.about__pronunciation {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
    margin-bottom: 2.5rem;
}

.about__tagline {
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    color: var(--text-muted);
    max-width: 50ch;
    margin: 0 auto;
    line-height: 1.55;
}

.about__tagline strong {
    display: block;
    margin-top: 0.5rem;
    color: var(--text);
    font-weight: 600;
}

/* --- Feature Sections --- */
.section-eyebrow {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-bottom: 1.25rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1rem;
    max-width: 22ch;
}

.section-title--centered {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.section-lead {
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    color: var(--text-muted);
    max-width: 55ch;
    margin-bottom: 0;
}

.section-lead--centered {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.feature {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 768px) {
    .feature {
        grid-template-columns: 1fr 1fr;
        gap: 5rem;
    }

    .feature--reverse .feature__visual {
        order: -1;
    }
}

.feature__visual {
    position: relative;
    display: flex;
    justify-content: center;
}

.feature__screenshot {
    width: 100%;
    max-width: 280px;
    padding: 4px;
    border-radius: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    overflow: hidden;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
}

/* iPad Landscape (z.B. Rundenanalyse) */
.feature__screenshot--landscape {
    max-width: 560px;
    border-radius: 24px;
}

.feature__screenshot img {
    display: block;
    width: 100%;
    height: auto;
}

.feature__placeholder {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-align: center;
    padding: 2rem;
}

/* Multi-device variant */
.multi-device {
    text-align: center;
}

.multi-device__visual {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: clamp(2rem, 5vw, 4rem);
    margin-top: 3rem;
    flex-wrap: wrap;
}

.multi-device__phone,
.multi-device__tablet {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    padding: 4px;
    overflow: hidden;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
}

.multi-device__phone {
    width: 200px;
    flex-shrink: 0;
    border-radius: 28px;
}

.multi-device__tablet {
    width: 100%;
    max-width: 540px;
    flex-shrink: 0;
    border-radius: 22px;
}

/* Setup section */
.setup {
    text-align: center;
}

.setup__steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 800px;
    margin: 3rem auto 0;
}

@media (min-width: 640px) {
    .setup__steps {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .setup__steps {
        grid-template-columns: repeat(4, 1fr);
    }
}

.setup__step {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    transition: border-color 0.2s, transform 0.2s;
}

.setup__step:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.setup__step-num {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.setup__step-label {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 3rem 1.5rem 4rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.875rem;
}

.site-footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.footer-nav a {
    color: var(--text-muted);
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: var(--text);
}

.site-footer__copy {
    font-size: 0.8rem;
}

.site-footer__legal {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    max-width: 50ch;
    margin-left: auto;
    margin-right: auto;
}

/* --- Legal pages --- */
.legal {
    max-width: 720px;
    margin: 0 auto;
    padding: 4rem 0;
}

.legal h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 2.5rem;
}

.legal h2 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    margin: 2.5rem 0 0.75rem;
    letter-spacing: -0.02em;
    color: var(--text);
}

.legal h2:first-of-type {
    margin-top: 0;
}

.legal p {
    margin-bottom: 1rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.legal p strong {
    color: var(--text);
}

.legal a {
    color: var(--accent);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.legal a:hover {
    border-bottom-color: var(--accent);
}

/* --- RTL support (for later: Arabic) --- */
[dir="rtl"] .lang-switch {
    flex-direction: row-reverse;
}

[dir="rtl"] .feature--reverse .feature__visual {
    order: 0;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
