/* ==========================================================================
   QRİO — base.css
   Токены, сброс, типографика, контейнер, утилиты, система появления
   ========================================================================== */

:root {
    /* Цвета */
    --c-bg: #F6F4EF;
    --c-bg-2: #EFEBE2;
    --c-surface: #FFFFFF;
    --c-ink: #10231B;
    --c-text: #3A4841;
    --c-muted: #7B8580;
    --c-line: #E6E1D6;
    --c-line-2: #D9D3C6;

    --c-primary: #143A2C;
    --c-primary-2: #1C4A38;
    --c-primary-3: #245C46;
    --c-primary-soft: #E3EDE7;
    --c-primary-ink: #F3F7F4;

    --c-accent: #A0543C;
    --c-gold: #E9C46A;
    --c-gold-soft: #F7EBC6;
    --c-success: #2F8A5B;

    /* Типографика */
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --font-hand: "Caveat", "Segoe Script", cursive;

    --fs-xs: 0.75rem;
    --fs-sm: 0.875rem;
    --fs-base: 1rem;
    --fs-md: 1.125rem;
    --fs-lg: 1.25rem;
    --fs-h3: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
    --fs-h2: clamp(2rem, 1.35rem + 2.4vw, 3.25rem);
    --fs-h1: clamp(2.6rem, 1.4rem + 4.6vw, 5.25rem);

    /* Сетка */
    --container: 1340px;
    --gutter: 24px;
    --section-y: clamp(72px, 5rem + 4vw, 140px);

    /* Скругления */
    --r-xs: 8px;
    --r-sm: 12px;
    --r: 16px;
    --r-lg: 24px;
    --r-xl: 32px;
    --r-pill: 999px;

    /* Тени */
    --sh-xs: 0 1px 2px rgba(16, 35, 27, 0.06);
    --sh-sm: 0 2px 8px rgba(16, 35, 27, 0.06), 0 1px 2px rgba(16, 35, 27, 0.04);
    --sh: 0 12px 32px -12px rgba(16, 35, 27, 0.18), 0 2px 6px rgba(16, 35, 27, 0.05);
    --sh-lg: 0 30px 70px -20px rgba(16, 35, 27, 0.28), 0 8px 20px -8px rgba(16, 35, 27, 0.1);
    --sh-primary: 0 14px 30px -12px rgba(20, 58, 44, 0.55);

    /* Анимация */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --t-fast: 0.2s;
    --t: 0.35s;

    --header-h: 84px;
}

@media (max-width: 767px) {
    :root {
        --gutter: 16px;
        --header-h: 68px;
    }
}

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

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: var(--fs-base);
    line-height: 1.6;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

main {
    display: block;
    overflow-x: clip;
}

body.is-locked {
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote {
    margin: 0;
}

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

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

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

img {
    height: auto;
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
}

:focus-visible {
    outline: 2px solid var(--c-primary-3);
    outline-offset: 3px;
    border-radius: 6px;
}

::selection {
    background: var(--c-primary);
    color: var(--c-primary-ink);
}

/* ---------- Типографика ---------- */
h1, h2, h3, h4 {
    color: var(--c-ink);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.05;
}

.h2 {
    font-size: var(--fs-h2);
    line-height: 1.06;
    text-wrap: balance;
}

.lead {
    font-size: var(--fs-md);
    color: var(--c-text);
    line-height: 1.65;
    max-width: 34em;
}

.eyebrow {
    display: inline-block;
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--c-muted);
    margin-bottom: 18px;
}

.eyebrow--accent {
    color: var(--c-accent);
}

/* ---------- Контейнер ---------- */
.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.section {
    padding-block: var(--section-y);
    position: relative;
}

/* ---------- Утилиты ---------- */
.visually-hidden {
    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: fixed;
    top: 12px;
    left: 12px;
    z-index: 1000;
    padding: 10px 16px;
    border-radius: var(--r-sm);
    background: var(--c-primary);
    color: #fff;
    transform: translateY(-160%);
    transition: transform var(--t) var(--ease-out);
}

.skip-link:focus {
    transform: none;
}

.icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ==========================================================================
   Система появления при скролле
   Работает только при включённом JS (класс .js ставит boot.js)
   ========================================================================== */
.js [data-reveal] {
    opacity: 0;
    transition:
        opacity 0.9s var(--ease-out),
        transform 1.1s var(--ease-out),
        filter 0.9s var(--ease-out);
    will-change: opacity, transform;
}

.js [data-reveal="up"] { transform: translate3d(0, 44px, 0); }
.js [data-reveal="down"] { transform: translate3d(0, -30px, 0); }
.js [data-reveal="left"] { transform: translate3d(-70px, 0, 0); }
.js [data-reveal="right"] { transform: translate3d(70px, 0, 0); }
.js [data-reveal="scale"] { transform: translate3d(0, 30px, 0) scale(0.94); }
.js [data-reveal="blur"] { filter: blur(12px); transform: translate3d(0, 20px, 0); }

.js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
    filter: none;
}

[data-reveal-delay="1"] { transition-delay: 0.08s !important; }
[data-reveal-delay="2"] { transition-delay: 0.16s !important; }
[data-reveal-delay="3"] { transition-delay: 0.24s !important; }
[data-reveal-delay="4"] { transition-delay: 0.32s !important; }
[data-reveal-delay="5"] { transition-delay: 0.40s !important; }
[data-reveal-delay="6"] { transition-delay: 0.48s !important; }
[data-reveal-delay="7"] { transition-delay: 0.56s !important; }
[data-reveal-delay="8"] { transition-delay: 0.64s !important; }

/* После появления задержка больше не нужна (hover-эффекты должны быть мгновенными) */
.js [data-reveal].is-done {
    transition-delay: 0s !important;
    will-change: auto;
}

/* ---------- Медиа с запасным фоном (если фото ещё не загружено) ---------- */
.media {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 30% 25%, #F3D9A8 0%, transparent 55%),
        radial-gradient(90% 80% at 75% 80%, #C8714A 0%, transparent 60%),
        linear-gradient(135deg, #E9B872 0%, #9C4B2F 100%);
}

.media-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.6s ease, transform 1.2s var(--ease-out);
}

.media-img.is-missing {
    opacity: 0;
}

/* ---------- Доступность: меньше движения ---------- */
@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;
        transition-delay: 0s !important;
    }

    .js [data-reveal] {
        opacity: 1;
        transform: none;
        filter: none;
    }
}
