/* ==========================================================================
   Base — fonts, design tokens, reset, typography, utilities
   ========================================================================== */

/* Self-hosted fonts (Google Fonts, SIL OFL): only the Cyrillic and Latin subsets
   are shipped; the browser downloads a file only when the page uses its range. */
@font-face {
    font-family: "Onest";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/onest-cyrillic.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: "Onest";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/onest-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: "Lora";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/lora-600-cyrillic.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
    font-family: "Lora";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/lora-600-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;
}

:root {
    /* Colour — brand green taken from the INFINITY TOUR logo (#2e6b59) */
    --color-primary: #2e6b59;
    --color-primary-dark: #1f4f41;
    --color-primary-soft: #e7f0ec;
    --color-secondary: #12352b;
    --color-accent: #e2a948;
    --color-accent-dark: #c98f2e;
    --color-background: #ffffff;
    --color-surface: #f7f4ee;
    --color-heading: #10261f;
    --color-text: #1c2723;
    --color-text-muted: #56625d;
    --color-text-inverse: #ffffff;
    --color-border: #e4dfd6;
    --color-border-strong: #cbc3b6;
    --color-error: #b3261e;
    --color-focus: var(--color-primary);
    --overlay: 10 30 24;

    /* Typography */
    --font-sans: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-serif: "Lora", Georgia, "Times New Roman", serif;
    --fs-xs: 0.8125rem;
    --fs-sm: 0.9375rem;
    --fs-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
    --fs-lg: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
    --fs-h3: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
    --fs-h2: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
    --fs-h1: clamp(2.125rem, 1.6rem + 2.6vw, 3.5rem);
    --lh-tight: 1.15;
    --lh-snug: 1.35;
    --lh-base: 1.65;

    /* Spacing & layout */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
    --section-y: clamp(56px, 8vw, 104px);
    --container: 1200px;
    --gutter: clamp(16px, 4vw, 32px);
    --header-h: 64px;

    /* Shape & depth */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgb(18 53 43 / 0.06), 0 2px 6px rgb(18 53 43 / 0.06);
    --shadow: 0 18px 40px -20px rgb(18 53 43 / 0.35);

    /* Motion */
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --dur: 0.2s;
}

@media (min-width: 1024px) {
    :root { --header-h: 76px; }
}

/* 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;
    display: flex;
    flex-direction: column;
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: var(--lh-base);
    color: var(--color-text);
    background: var(--color-background);
    -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

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

img { height: auto; }

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

ul[role="list"],
ol[role="list"] { list-style: none; padding: 0; }

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

/* Typography -------------------------------------------------------------- */
h1, h2 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: var(--lh-tight);
    letter-spacing: -0.01em;
    color: var(--color-heading);
    text-wrap: balance;
}

h3, h4 {
    font-weight: 600;
    line-height: var(--lh-snug);
    color: var(--color-heading);
}

p { text-wrap: pretty; }

a {
    color: var(--color-primary);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: color var(--dur) var(--ease);
}

a:hover { color: var(--color-primary-dark); }

:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 3px;
    border-radius: 4px;
}

::selection { background: var(--color-primary); color: var(--color-text-inverse); }

.on-dark { --color-focus: var(--color-accent); }

/* Utilities --------------------------------------------------------------- */
.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: absolute;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    background: var(--color-secondary);
    color: var(--color-text-inverse);
    font-weight: 600;
    transform: translateY(-150%);
}

.skip-link:focus { transform: none; color: var(--color-text-inverse); }

.icon {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Scroll-driven reveal: pure CSS, no JS; content is always visible without support */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .reveal {
            animation: reveal linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 55%;
        }
    }
}

@keyframes reveal {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
