/* ============================================================
   CTC – Car Tech Center | Base Styles v2
   Reset, Typography, Grain Texture, Layout Utilities
   ============================================================ */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: var(--nav-height);
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--ctc-text-primary);
    background-color: var(--ctc-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition:
        background-color var(--transition-theme),
        color var(--transition-theme);
    overflow-x: hidden;
    position: relative;
}

/* ── Grain/Noise Texture Overlay ── */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: var(--ctc-noise-filter);
    background-repeat: repeat;
    background-size: 200px 200px;
    opacity: var(--ctc-grain-opacity);
    pointer-events: none;
    z-index: 9998;
    mix-blend-mode: overlay;
}

/* ── Accessibility: Skip to Content ── */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-sm) var(--space-lg);
    background: var(--ctc-blue-primary);
    color: #fff;
    border-radius: var(--radius-md);
    z-index: 9999;
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    transition: top var(--transition-fast);
}

.skip-to-content:focus {
    top: var(--space-md);
}

/* ── Typography ── */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--ctc-text-primary);
    letter-spacing: var(--letter-spacing-tight);
}

h1 {
    font-size: var(--font-size-hero);
    font-weight: var(--font-weight-extrabold);
}

h2 {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
}

p {
    line-height: var(--line-height-relaxed);
    color: var(--ctc-text-secondary);
}

p+p {
    margin-top: var(--space-md);
}

a {
    color: var(--ctc-blue-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--ctc-blue-light);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul,
ol {
    list-style: none;
}

strong {
    font-weight: var(--font-weight-semibold);
    color: var(--ctc-text-primary);
}

/* ── Focus Styles (Accessibility) ── */
*:focus-visible {
    outline: 2px solid var(--ctc-blue-primary);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* ── Selection ── */
::selection {
    background: var(--ctc-blue-primary);
    color: #fff;
}

/* ── Layout Utilities ── */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding-inline: var(--section-padding-x);
}

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

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

.section {
    padding-block: var(--section-padding-y);
    position: relative;
    overflow: hidden;
    max-width: 100vw;
}

.section--surface {
    background-color: var(--ctc-surface);
}

.section--dark {
    background-color: var(--ctc-surface);
    position: relative;
}

.section--dark::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--ctc-diagonal-pattern);
    pointer-events: none;
}

.section--accent {
    background-color: var(--ctc-surface-accent);
}

/* ── Text Utilities ── */
.text-center {
    text-align: center;
}

.text-blue {
    color: var(--ctc-blue-primary);
}

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

/* ── Gradient Text ── */
.text-gradient {
    background: var(--ctc-blue-gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Section Parts ── */
.section-label {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--ctc-blue-primary);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-widest);
    margin-bottom: var(--space-md);
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    margin-bottom: var(--space-lg);
    letter-spacing: var(--letter-spacing-tight);
}

.section-subtitle {
    font-size: var(--font-size-lg);
    color: var(--ctc-text-secondary);
    max-width: 640px;
    margin-inline: auto;
    line-height: var(--line-height-relaxed);
}

/* ── Divider ── */
.divider {
    width: 64px;
    height: 3px;
    background: var(--ctc-blue-gradient);
    border-radius: var(--radius-full);
    margin: var(--space-lg) auto;
}

/* ── Breadcrumbs ── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-sm);
    color: var(--ctc-text-muted);
    margin-bottom: var(--space-xl);
}

.breadcrumb a {
    color: var(--ctc-text-muted);
    transition: color var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--ctc-blue-primary);
}

.breadcrumb__separator {
    font-size: 0.7em;
    opacity: 0.5;
}

.breadcrumb__current {
    color: var(--ctc-text-primary);
    font-weight: var(--font-weight-medium);
}

/* ── Page Hero (Subpages) ── */
.page-hero {
    padding: calc(var(--nav-height) + var(--space-4xl)) 0 var(--space-4xl);
    background: var(--ctc-surface);
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--ctc-diagonal-pattern);
    pointer-events: none;
}

.page-hero::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, var(--ctc-bg), transparent);
    pointer-events: none;
}

.page-hero__content {
    position: relative;
    z-index: 1;
}

.page-hero__title {
    font-size: var(--font-size-page-hero);
    font-weight: var(--font-weight-extrabold);
    margin-bottom: var(--space-md);
}

.page-hero__subtitle {
    font-size: var(--font-size-lg);
    color: var(--ctc-text-secondary);
    max-width: 600px;
}

.page-hero__accent {
    position: absolute;
    top: 50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--ctc-accent-glow-strong) 0%, transparent 70%);
    border-radius: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.6;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    :root {
        --nav-height: 64px;
    }

    .page-hero {
        padding: calc(var(--nav-height) + var(--space-2xl)) 0 var(--space-2xl);
    }

    .page-hero__accent {
        width: 200px;
        height: 200px;
        right: -15%;
        opacity: 0.4;
    }

    .page-hero__subtitle {
        font-size: var(--font-size-base);
    }

    .section-subtitle {
        font-size: var(--font-size-base);
    }

    .divider {
        width: 48px;
    }
}

@media (max-width: 480px) {
    .page-hero__accent {
        display: none;
    }

    .breadcrumb {
        font-size: var(--font-size-xs);
        flex-wrap: wrap;
    }
}