/* ════════════════════════════════════════════════════════════
   VIP SITE — CORE
   Design language: "Studio Archive" — editorial, typographic,
   hairline rules instead of glass/shadow, oversized numerals.
   ════════════════════════════════════════════════════════════ */

/* ── TOKENS ────────────────────────────────────────────── */
:root {
    /* Surfaces — warm near-black, not cold slate */
    --ink: #0D0C08;
    --ink-raised: #14120C;
    --ink-sunken: #080703;

    /* Text */
    --fg: #F4F1E8;
    --fg-muted: #A39C8A;
    --fg-faint: #6B6555;

    /* Accents — gold is the single primary accent */
    --gold: #C9A227;
    --gold-bright: #E3C567;
    --gold-dim: rgba(201, 162, 39, 0.18);
    /* Text that sits on a gold fill — flips with the theme */
    --on-gold: #0D0C08;
    /* Secondary accent used sparingly: wax-seal red */
    --seal: #8C2633;

    /* Hairlines — the structural element of this design */
    --rule: rgba(244, 241, 232, 0.14);
    --rule-strong: rgba(244, 241, 232, 0.28);
    --rule-gold: rgba(201, 162, 39, 0.35);

    --ok: #4E9F6B;
    --warn: #C98A27;
    --err: #B04A4A;

    /* Type */
    --font-display: "Unbounded", "Arial Black", sans-serif;
    --font-body: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;

    /* Editorial scale */
    --t-mega: clamp(2.6rem, 5.4vw, 4.6rem);
    --t-h1: clamp(2.2rem, 4.4vw, 3.6rem);
    --t-h2: clamp(1.75rem, 3.2vw, 2.7rem);
    --t-h3: clamp(1.25rem, 2vw, 1.6rem);
    --t-body: clamp(1rem, 1.05vw, 1.0625rem);
    --t-small: 0.875rem;
    --t-micro: 0.75rem;

    /* Rhythm — 8px base */
    --u: 8px;
    --gutter: clamp(1.25rem, 4vw, 3rem);
    --measure: 68ch;
    --shell: 1240px;

    /* Radii — near-square; this design does not use pills */
    --r-sm: 2px;
    --r-md: 4px;

    /* Motion */
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --fast: 180ms var(--ease);
    --base: 320ms var(--ease);
    --slow: 620ms var(--ease);
}

/* Paper theme — deliberately warm cream, not sterile white */
:root[data-theme="light"],
body.light-theme {
    --ink: #F7F4EC;
    --ink-raised: #FFFDF7;
    --ink-sunken: #EDE8DA;

    --fg: #17150E;
    --fg-muted: #57513F;
    --fg-faint: #857E6B;

    --gold: #8A6D12;
    --gold-bright: #6E560D;
    --gold-dim: rgba(138, 109, 18, 0.14);
    --on-gold: #FFFDF7;
    --seal: #8C2633;

    --rule: rgba(23, 21, 14, 0.16);
    --rule-strong: rgba(23, 21, 14, 0.32);
    --rule-gold: rgba(138, 109, 18, 0.38);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    background: var(--ink);
    color: var(--fg);
    font-family: var(--font-body);
    font-size: var(--t-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "kern" 1, "liga" 1;
    overflow-x: hidden;
    transition: background var(--base), color var(--base);
}

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

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

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

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

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

::selection {
    background: var(--gold);
    color: var(--on-gold);
}

/* ── FOCUS — visible, not a removed outline ───────────── */
:focus-visible {
    outline: 2px solid var(--gold-bright);
    outline-offset: 3px;
}

.sr-only {
    position: absolute;
    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: -100px;
    left: var(--gutter);
    z-index: 200;
    padding: 0.75rem 1.25rem;
    background: var(--gold);
    color: var(--on-gold);
    font-weight: 700;
    transition: top var(--fast);
}

.skip-link:focus {
    top: 1rem;
}

/* ── LAYOUT ────────────────────────────────────────────── */
.shell {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.band {
    padding-block: clamp(4.5rem, 10vw, 9rem);
    position: relative;
}

.band + .band {
    border-top: 1px solid var(--rule);
}

/* Section marker: number + label on a hairline. The recurring
   structural motif of this design — replaces eyebrow pills. */
.marker {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding-bottom: 0.875rem;
    margin-bottom: clamp(2rem, 4vw, 3.5rem);
    border-bottom: 1px solid var(--rule);
}

.marker__no {
    font-family: var(--font-mono);
    font-size: var(--t-micro);
    letter-spacing: 0.18em;
    color: var(--gold);
    flex-shrink: 0;
}

.marker__label {
    font-family: var(--font-mono);
    font-size: var(--t-micro);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--fg-faint);
}

.lede {
    max-width: var(--measure);
    color: var(--fg-muted);
    font-size: clamp(1.05rem, 1.5vw, 1.3rem);
    line-height: 1.55;
}

/* ── BUTTONS ───────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 48px;
    padding: 0.9rem 1.6rem;
    border-radius: var(--r-sm);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9375rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background var(--fast), color var(--fast), border-color var(--fast);
    white-space: nowrap;
}

.btn--solid {
    background: var(--gold);
    color: var(--on-gold);
}

.btn--solid:hover {
    background: var(--gold-bright);
}

.btn--ghost {
    border: 1px solid var(--rule-strong);
    color: var(--fg);
}

.btn--ghost:hover {
    border-color: var(--gold);
    color: var(--gold-bright);
}

.btn--lg {
    min-height: 58px;
    padding: 1.1rem 2.2rem;
    font-size: 1.0625rem;
}

.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Text link with a rule that draws on hover.
   Padding keeps the tap target at 44px without breaking the text line. */
.tlink {
    display: inline-block;
    color: var(--gold-bright);
    font-weight: 600;
    padding: 0.5rem 0;
    background-image: linear-gradient(var(--gold), var(--gold));
    background-size: 0% 1px;
    background-position: 0 calc(100% - 0.5rem);
    background-repeat: no-repeat;
    transition: background-size var(--base);
}

.tlink:hover {
    background-size: 100% 1px;
}

/* ── HEADER ────────────────────────────────────────────── */
.masthead {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--ink) 88%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rule);
}

.masthead__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 68px;
}

/* Monogram: drawn mark, not a stock icon */
.wordmark {
    display: flex;
    align-items: center;
    min-height: 44px;
    gap: 0.7rem;
    flex-shrink: 0;
}

.wordmark__seal {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.wordmark__text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.02em;
    line-height: 1;
}

.wordmark__text em {
    font-style: normal;
    color: var(--gold);
}

.mainnav {
    display: flex;
    gap: clamp(1.25rem, 2.5vw, 2.25rem);
    align-items: center;
}

.mainnav a {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--fg-muted);
    padding-block: 0.5rem;
    transition: color var(--fast);
}

.mainnav a:hover,
.mainnav a.is-active {
    color: var(--fg);
}

.masthead__tools {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Language switch — RU/EN, a hairline-divided pair */
.langswitch {
    display: flex;
    align-items: center;
    border: 1px solid var(--rule);
    border-radius: var(--r-sm);
    overflow: hidden;
}

.langswitch a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 0.7rem;
    font-family: var(--font-mono);
    font-size: var(--t-micro);
    letter-spacing: 0.08em;
    color: var(--fg-faint);
    transition: background var(--fast), color var(--fast);
}

.langswitch a + a {
    border-left: 1px solid var(--rule);
}

.langswitch a:hover {
    color: var(--fg);
}

.langswitch a[aria-current="true"] {
    background: var(--gold-dim);
    color: var(--gold-bright);
}

.iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--rule);
    border-radius: var(--r-sm);
    color: var(--fg-muted);
    transition: border-color var(--fast), color var(--fast);
}

.iconbtn:hover {
    border-color: var(--gold);
    color: var(--gold-bright);
}

.only-wide {
    display: none;
}

.only-narrow {
    display: inline-flex;
}

@media (min-width: 900px) {
    .only-wide {
        display: flex;
    }

    .only-narrow {
        display: none;
    }
}

/* ── MOBILE DRAWER ─────────────────────────────────────── */
.drawer {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: var(--ink);
    display: flex;
    flex-direction: column;
    padding: var(--gutter);
    transform: translateX(100%);
    transition: transform var(--base);
    visibility: hidden;
}

.drawer.is-open {
    transform: translateX(0);
    visibility: visible;
}

.drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--rule);
}

.drawer__links {
    display: flex;
    flex-direction: column;
    padding-block: 1rem;
}

.drawer__links a {
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--rule);
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.drawer__foot {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ── FOOTER ────────────────────────────────────────────── */
.colophon {
    border-top: 1px solid var(--rule-strong);
    padding-top: clamp(3rem, 6vw, 4.5rem);
    padding-bottom: 2.5rem;
    background: var(--ink-sunken);
}

.colophon__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 760px) {
    .colophon__grid {
        grid-template-columns: 1.4fr repeat(3, 1fr);
        gap: 2rem;
    }
}

.colophon__brand p {
    margin-top: 1rem;
    color: var(--fg-muted);
    font-size: var(--t-small);
    max-width: 34ch;
}

.colophon__contacts {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1.5rem;
}

.colophon__contacts a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    gap: 0.55rem;
    color: var(--fg-muted);
    font-size: var(--t-small);
    transition: color var(--fast);
}

.colophon__contacts a:hover {
    color: var(--gold-bright);
}

.colophon__col h4,
.colophon__col .colophon__h {
    font-family: var(--font-mono);
    font-size: var(--t-micro);
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--fg-faint);
    margin-bottom: 1.1rem;
}

.colophon__col a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.35rem 0;
    color: var(--fg-muted);
    font-size: var(--t-small);
    transition: color var(--fast);
}

.colophon__col a:hover {
    color: var(--fg);
}

.colophon__base {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: clamp(2.5rem, 5vw, 4rem);
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
    font-size: var(--t-micro);
    color: var(--fg-faint);
}

.colophon__base nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.colophon__base nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.colophon__base a:hover {
    color: var(--fg-muted);
}

/* ── FLOATING CONTROLS ─────────────────────────────────── */
.themetoggle {
    position: fixed;
    left: 1.25rem;
    bottom: 1.25rem;
    z-index: 90;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ink-raised);
    border: 1px solid var(--rule);
    border-radius: var(--r-sm);
    color: var(--fg-muted);
    transition: border-color var(--fast), color var(--fast);
}

.themetoggle:hover {
    border-color: var(--gold);
    color: var(--gold-bright);
}

.reachout {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 90;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 0.6rem;
}

.reachout__items {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity var(--fast), transform var(--fast), visibility var(--fast);
}

.reachout.is-open .reachout__items {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.reachout__items a {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ink-raised);
    border: 1px solid var(--rule);
    border-radius: var(--r-sm);
    color: var(--fg-muted);
    transition: border-color var(--fast), color var(--fast);
}

.reachout__items a:hover {
    border-color: var(--gold);
    color: var(--gold-bright);
}

.reachout__main {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gold);
    color: var(--on-gold);
    border-radius: var(--r-sm);
    transition: background var(--fast);
}

.reachout__main:hover {
    background: var(--gold-bright);
}

/* ── COOKIE NOTICE ─────────────────────────────────────── */
.cookienote {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 120;
    max-width: 640px;
    margin-inline: auto;
    padding: 1.25rem;
    background: var(--ink-raised);
    border: 1px solid var(--rule-strong);
    border-radius: var(--r-md);
    display: none;
}

.cookienote.is-shown {
    display: block;
}

.cookienote p {
    font-size: var(--t-small);
    color: var(--fg-muted);
    margin-bottom: 1rem;
}

.cookienote__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ── REVEAL ────────────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity var(--slow), transform var(--slow);
}

.reveal.is-in {
    opacity: 1;
    transform: none;
}

@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;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
