/* ==========================================================================
   Audi Club 174 — критический CSS (первый экран, загружается синхронно)
   ========================================================================== */

:root {
    /* Палитра */
    --ac174-bg: #08090b;
    --ac174-bg-2: #0b0d10;
    --ac174-surface: #101216;
    --ac174-surface-2: #14171c;
    --ac174-line: rgba(255, 255, 255, .10);
    --ac174-line-strong: rgba(255, 255, 255, .18);
    --ac174-text: #eef1f4;
    --ac174-text-soft: #c5cad0;
    --ac174-text-muted: #868d95;
    --ac174-accent: #e30613;
    --ac174-accent-soft: #ff2b33;
    --ac174-accent-dim: rgba(227, 6, 19, .14);

    /* Типографика */
    --ac174-font: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Roboto", "Helvetica Neue", Arial, sans-serif;
    --ac174-mono: "Cascadia Mono", "Consolas", ui-monospace, "SFMono-Regular", monospace;

    /* Ритм */
    --ac174-shell: 1320px;
    --ac174-gutter: clamp(18px, 5vw, 72px);
    --ac174-radius: 3px;
    --ac174-radius-lg: 5px;

    /* Анимация */
    --ac174-ease: cubic-bezier(.22, .61, .36, 1);
    --ac174-ease-out: cubic-bezier(.16, .84, .44, 1);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    background: var(--ac174-bg);
}

body.page {
    margin: 0;
    background: var(--ac174-bg);
    color: var(--ac174-text);
    font-family: var(--ac174-font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img, svg, picture { display: block; max-width: 100%; }
h1, h2, h3, p, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }

.shell {
    width: 100%;
    max-width: var(--ac174-shell);
    margin: 0 auto;
    padding-inline: var(--ac174-gutter);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    padding: 12px 18px;
    background: var(--ac174-surface-2);
    color: var(--ac174-text);
    border: 1px solid var(--ac174-line-strong);
}
.skip-link:focus { left: 12px; top: 12px; }

:focus-visible {
    outline: 2px solid var(--ac174-accent-soft);
    outline-offset: 3px;
}

/* --- Топбар ------------------------------------------------------------- */
.topbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    transition: background-color .4s var(--ac174-ease), backdrop-filter .4s var(--ac174-ease), border-color .4s var(--ac174-ease);
    border-bottom: 1px solid transparent;
}
.topbar::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(6, 7, 9, .78) 0%, rgba(6, 7, 9, 0) 100%);
    opacity: 1;
    transition: opacity .4s var(--ac174-ease);
    pointer-events: none;
}
.topbar.is-stuck {
    background: rgba(8, 9, 11, .82);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    border-bottom-color: var(--ac174-line);
}
.topbar.is-stuck::before { opacity: 0; }

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 64px;
    padding-block: 10px;
}
.topbar__brand { display: inline-flex; align-items: center; gap: 12px; }
.topbar__mark { color: var(--ac174-text); display: inline-flex; }
.topbar__wordmark {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .26em;
    text-transform: uppercase;
    white-space: nowrap;
}
.topbar__nav { display: inline-flex; align-items: center; gap: 4px; }
.topbar__link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .04em;
    color: var(--ac174-text-soft);
    border-radius: var(--ac174-radius);
    transition: color .3s var(--ac174-ease), background-color .3s var(--ac174-ease);
}
.topbar__link:hover { color: var(--ac174-text); background: rgba(255, 255, 255, .06); }
/* Иконки в шапке выравниваем по той же вертикальной оси, что и кнопки CTA внизу */
.topbar__link-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; color: currentColor; }
.topbar__link-icon svg { width: 19px; height: 19px; }

/* --- Hero --------------------------------------------------------------- */
.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100svh;
    overflow: hidden;
    isolation: isolate;
}
.hero__media { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: #06070a; }
.hero__media picture { display: block; width: 100%; height: 100%; }
.hero__img,
.hero__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Кадр держим по центру: и шпиль здания, и машины остаются в видимой области
       на любой ширине экрана. */
    object-position: 50% 38%;
    will-change: transform;
    transform: scale(1.02);
    transition: transform 1.6s var(--ac174-ease-out), opacity 1.2s var(--ac174-ease);
    opacity: 1;
}
.hero__scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(6, 7, 9, .52) 0%, rgba(6, 7, 9, .08) 30%, rgba(6, 7, 9, .58) 84%, #08090b 100%),
        linear-gradient(98deg, rgba(6, 7, 9, .64) 0%, rgba(6, 7, 9, .26) 40%, rgba(6, 7, 9, 0) 76%);
}
.hero__light {
    position: absolute;
    inset: -20%;
    background: radial-gradient(38% 42% at var(--mx, 26%) var(--my, 34%), rgba(255, 255, 255, .13), rgba(255, 255, 255, 0) 62%);
    mix-blend-mode: screen;
    opacity: 0;
    transition: opacity .8s var(--ac174-ease);
    pointer-events: none;
}
.hero.is-lit .hero__light { opacity: 1; }

.hero__plate {
    position: absolute;
    left: 50%;
    bottom: -3.4vw;
    transform: translateX(-50%);
    font-size: clamp(260px, 40vw, 700px);
    font-weight: 700;
    line-height: .78;
    letter-spacing: -.05em;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, .10);
    user-select: none;
    pointer-events: none;
}

.hero__inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
    gap: clamp(16px, 2.4vh, 30px);
    padding-top: 108px;
}
/* Текст и кнопки лежат в одном контейнере (.shell), поэтому левый край заголовка
   и правый край кнопок совпадают с логотипом и нижней строкой страницы. */
.hero__actions { justify-self: start; }

/* Жёсткая привязка к левой оси: надзаголовок, заголовок, подзаголовок и нижняя
   строка обязаны начинаться на одной вертикали с логотипом в шапке. */
.hero__overline,
.hero__title,
.hero__subtitle,
.hero__meta,
.hero__tagline { text-align: left; margin-left: 0; padding-left: 0; }
.hero__title-line { text-align: left; }

.hero__overline {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: #d3d8dd;
}
.hero__dot {
    width: 7px;
    height: 7px;
    background: var(--ac174-accent);
    flex: 0 0 auto;
}

.hero__title {
    font-size: clamp(46px, 11.2vw, 152px);
    font-weight: 700;
    line-height: .86;
    letter-spacing: -.035em;
    text-transform: none;
    color: var(--ac174-text);
    margin: 0;
    text-shadow: 0 2px 40px rgba(4, 5, 8, .5);
}
.hero__title-line { display: block; overflow: hidden; padding-bottom: .02em; }
.hero__title-inner {
    display: inline-block;
    transform: translateY(102%);
    animation: ac174-rise 1.15s var(--ac174-ease-out) .06s forwards;
}
.hero__title-line:nth-child(2) .hero__title-inner { animation-delay: .16s; }

@keyframes ac174-rise {
    from { transform: translateY(102%); }
    to { transform: translateY(0); }
}

.hero__subtitle {
    /* ширина подобрана так, чтобы строка «Клуб владельцев Audi в Челябинске
       и Челябинской области» помещалась в одну строку на десктопе */
    max-width: 62ch;
    font-size: clamp(15px, 1.1vw, 18px);
    line-height: 1.5;
    color: #d6dbe0;
    text-shadow: 0 1px 18px rgba(4, 5, 8, .75);
}

/* На телефоне строка длиннее экрана — там перенос уместен */
@media (max-width: 860px) {
    .hero__subtitle { max-width: 34ch; }
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: stretch;
}
/* На широком экране кнопки встают справа и прижимаются к правому краю сетки:
   правые края кнопок в шапке, в Hero и в подвале лежат на одной вертикали. */
@media (min-width: 1000px) {
    .hero__actions { justify-self: end; }
}

/* --- Кнопки CTA --------------------------------------------------------- */
.cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-width: 248px;
    padding: 15px 18px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: var(--ac174-radius);
    background: linear-gradient(180deg, rgba(12, 14, 18, .88), rgba(9, 10, 13, .78));
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: var(--ac174-text);
    overflow: hidden;
    isolation: isolate;
    transition: border-color .35s var(--ac174-ease), transform .35s var(--ac174-ease), box-shadow .35s var(--ac174-ease);
}
.cta::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    transform: translateY(101%);
    transition: transform .45s var(--ac174-ease-out);
}
.cta:hover { transform: translateY(-2px); }
.cta:hover::after { transform: translateY(0); }
.cta:active { transform: translateY(0) scale(.985); }

.cta__icon-wrap { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: 0 0 auto; }
.cta__icon { width: 24px; height: 24px; }
.cta__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cta__label { font-size: 16px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.cta__caption { font-size: 11.5px; letter-spacing: .05em; color: #a8aeb5; white-space: nowrap; transition: color .35s var(--ac174-ease); text-shadow: 0 1px 10px rgba(4, 5, 8, .9); }
.cta__arrow {
    margin-left: auto;
    color: var(--ac174-text-muted);
    transition: transform .4s var(--ac174-ease), color .4s var(--ac174-ease);
}
.cta:hover .cta__arrow { transform: translate3d(3px, -3px, 0); color: var(--ac174-text); }

/* Telegram — главное действие: красный акцент Audi, но сдержанно */
.cta--tg { border-color: rgba(227, 6, 19, .55); }
.cta--tg::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--ac174-accent);
    z-index: 1;
}
.cta--tg::after { background: linear-gradient(180deg, rgba(227, 6, 19, .28), rgba(227, 6, 19, .16)); }
.cta--tg:hover { border-color: rgba(255, 70, 80, .85); box-shadow: 0 18px 40px -22px rgba(227, 6, 19, .95); }
.cta--tg:hover .cta__arrow { color: #fff; }
.cta--tg .cta__icon-wrap { color: #fff; }

.cta--vk::after { background: linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .06)); }
.cta--vk:hover { border-color: rgba(255, 255, 255, .4); }
.cta--vk:hover .cta__caption { color: var(--ac174-text-soft); }
.cta--vk .cta__icon-wrap { color: var(--ac174-text); }
.cta--lg { min-width: 284px; padding: 18px 20px; }
.cta--lg .cta__label { font-size: 17px; }

/* --- Подвал hero -------------------------------------------------------- */
.hero__foot {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 14px 24px;
    padding-bottom: 26px;
}
.hero__meta {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #9aa0a8;
    text-shadow: 0 1px 12px rgba(4, 5, 8, .9);
}
.hero__meta-sep { width: 22px; height: 1px; background: var(--ac174-line-strong); }
.hero__tagline { font-size: 13.5px; color: #c9ced4; text-shadow: 0 1px 12px rgba(4, 5, 8, .9); }
.hero__scroll {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--ac174-text-muted);
    transition: color .3s var(--ac174-ease);
}
.hero__scroll:hover { color: var(--ac174-text); }
.hero__scroll-line { position: relative; width: 46px; height: 1px; background: var(--ac174-line-strong); overflow: hidden; }
.hero__scroll-line::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 40%;
    background: var(--ac174-accent);
    animation: ac174-scan 2.6s var(--ac174-ease) infinite;
}
@keyframes ac174-scan {
    0% { transform: translateX(-100%); }
    60%, 100% { transform: translateX(250%); }
}

/* --- Появление при скролле --------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translate3d(0, 22px, 0);
    transition: opacity .9s var(--ac174-ease-out), transform .9s var(--ac174-ease-out);
    transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (max-width: 860px) {
    .hero { min-height: 100vh; min-height: 100svh; }
    .hero__inner { padding-top: 88px; gap: 14px; }
    .hero__title { font-size: clamp(42px, 12.2vw, 96px); }
    .hero__img, .hero__media img { object-position: 50% 40%; }
    .hero__scrim {
        background:
            linear-gradient(180deg, rgba(6, 7, 9, .72) 0%, rgba(6, 7, 9, .06) 22%, rgba(6, 7, 9, .48) 48%, rgba(6, 7, 9, .9) 78%, #08090b 100%),
            linear-gradient(90deg, rgba(6, 7, 9, .5) 0%, rgba(6, 7, 9, .06) 62%, rgba(6, 7, 9, 0) 100%);
    }
    .hero__plate { font-size: 48vw; bottom: 2vw; -webkit-text-stroke-color: rgba(255, 255, 255, .08); }
    .hero__actions { gap: 10px; }
    .cta { flex: 1 1 100%; min-width: 0; min-height: 62px; }
    .cta__caption { font-size: 12px; }
    .hero__foot { padding-bottom: 18px; gap: 8px; }
    .hero__tagline { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .hero__meta { font-size: 10.5px; letter-spacing: .12em; gap: 9px; }
    .hero__meta span { white-space: nowrap; }
    .hero__meta-sep { width: 14px; }
    .hero__scroll-line { width: 34px; }
    .hero__scroll-text { display: none; }
}

@media (max-width: 430px) {
    /* Узкие телефоны: в шапке остаются иконки со ссылками, без подписей */
    .topbar__inner { gap: 10px; min-height: 60px; }
    .topbar__brand { gap: 9px; }
    .topbar__wordmark { font-size: 12.5px; letter-spacing: .18em; }
    .topbar__nav { gap: 2px; }
    .topbar__link { padding: 12px 10px; }
    .topbar__link > span:last-child { display: none; }
    .topbar__link-icon svg { width: 22px; height: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .hero__title-inner { animation: none; transform: none; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .hero__scroll-line::after { animation: none; }
    .hero__img, .hero__media img { transition: none; transform: none; }
    .hero__light { display: none; }
}
