:root {
    color-scheme: dark;

    --bg: #0d0e10;
    --surface: #15171a;

    --text: #f5f5f7;
    --muted: #92959c;
    --muted-strong: #b3b5ba;

    --border: #292c31;
    --border-hover: #484c53;

    --radius: 14px;
    --content-width: 680px;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    min-height: 100vh;

    background: var(--bg);
    color: var(--text);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    font-size: 17px;
    line-height: 1.65;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.container {
    width: 100%;
    max-width: var(--content-width);

    margin: 0 auto;
    padding: 38px 24px 56px;
}


/* =========================================================
   OBSCURA / hologram
   ========================================================= */

.brand {
    position: relative;
    display: inline-block;

    margin: 0 0 34px;

    color: #85888f;

    font-size: 12px;
    font-weight: 800;
    line-height: 1;

    letter-spacing: 0.24em;

    text-shadow:
        1px 0 rgba(255,255,255,0.14),
        -1px 0 rgba(150,190,255,0.08);

    animation: obscura-flicker 7s infinite;
}

/*
 * Очень слабая "голографическая" копия текста.
 * Не мешает читать и не превращает legal в игровой лендинг.
 */
.brand::after {
    content: "OBSCURA";

    position: absolute;
    inset: 0;

    color: rgba(255,255,255,0.16);

    pointer-events: none;

    transform: translateX(0);
    opacity: 0;

    animation: obscura-glitch 8s infinite;
}

@keyframes obscura-flicker {
    0%,
    91%,
    93%,
    95%,
    100% {
        opacity: 1;
    }

    92% {
        opacity: 0.72;
    }

    94% {
        opacity: 0.9;
    }
}

@keyframes obscura-glitch {
    0%,
    87%,
    100% {
        opacity: 0;
        transform: translateX(0);
    }

    88% {
        opacity: 0.45;
        transform: translateX(2px);
    }

    89% {
        opacity: 0.18;
        transform: translateX(-2px);
    }

    90% {
        opacity: 0;
        transform: translateX(0);
    }
}


/* =========================================================
   Typography
   ========================================================= */

h1,
h2,
h3 {
    color: var(--text);
    text-wrap: balance;
}

h1 {
    margin: 0 0 16px;

    font-size: clamp(34px, 8vw, 50px);
    line-height: 1.05;

    font-weight: 760;
    letter-spacing: -0.04em;
}

h2 {
    margin: 40px 0 12px;

    font-size: 24px;
    line-height: 1.2;

    font-weight: 700;
    letter-spacing: -0.025em;
}

h3 {
    margin: 32px 0 10px;

    font-size: 19px;
    line-height: 1.3;

    font-weight: 700;
}

p {
    margin: 0 0 20px;
}

.lead {
    max-width: 560px;

    margin: 0;

    color: var(--muted);

    font-size: 18px;
    line-height: 1.55;
}

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


/* =========================================================
   Legal pages
   ========================================================= */

.card {
    margin: 0;
    padding: 0;

    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.card > :last-child {
    margin-bottom: 0;
}


/* =========================================================
   Documents
   ========================================================= */

.doc-list {
    display: grid;
    gap: 12px;

    margin-top: 38px;
}

.doc-link {
    position: relative;

    display: flex;
    align-items: center;

    min-height: 76px;
    padding: 20px 22px;

    overflow: hidden;

    color: var(--text);

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    text-decoration: none;

    font-size: 17px;
    font-weight: 650;
    line-height: 1.3;

    isolation: isolate;

    transition:
        border-color 220ms ease,
        transform 220ms cubic-bezier(.2,.8,.2,1),
        box-shadow 220ms ease;
}


/*
 * Полупрозрачный белый слой.
 * При наведении "затекает" слева направо.
 */
.doc-link::before {
    content: "";

    position: absolute;
    inset: 0;

    z-index: -1;

    background:
        linear-gradient(
            90deg,
            rgba(255,255,255,0.12),
            rgba(255,255,255,0.07)
        );

    transform: scaleX(0);
    transform-origin: left center;

    transition:
        transform 420ms cubic-bezier(.16,1,.3,1);
}


/*
 * Стрелки больше нет.
 */
.doc-link::after {
    content: none;
}


/*
 * span нужен, чтобы сам текст тоже мог плавно двигаться.
 */
.doc-link span {
    position: relative;

    transition:
        transform 300ms cubic-bezier(.16,1,.3,1),
        color 220ms ease;
}


.doc-link:visited {
    color: var(--text);
}


@media (hover: hover) {
    .doc-link:hover {
        border-color: var(--border-hover);

        transform: translateY(-2px);

        box-shadow:
            0 10px 30px rgba(0,0,0,0.22);
    }

    .doc-link:hover::before {
        transform: scaleX(1);
    }

    .doc-link:hover span {
        transform: translateX(6px);
    }
}


/*
 * На телефоне hover нет, поэтому делаем эффект при нажатии.
 */
.doc-link:active {
    transform: scale(0.985);
    border-color: var(--border-hover);
}

.doc-link:active::before {
    transform: scaleX(1);
}


/* =========================================================
   Back
   ========================================================= */

.back {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    margin: 0 0 28px;
    padding: 4px 0;

    color: var(--muted-strong);

    font-size: 15px;
    font-weight: 600;

    text-decoration: none;

    transition:
        color 180ms ease,
        transform 180ms ease;
}

.back:visited {
    color: var(--muted-strong);
}

@media (hover: hover) {
    .back:hover {
        color: var(--text);
        transform: translateX(-2px);
    }
}


/* =========================================================
   Links inside legal text
   ========================================================= */

.card a:not(.back) {
    color: var(--text);

    text-decoration-color: #676a70;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.card a:not(.back):visited {
    color: var(--text);
}

.card a:not(.back):hover {
    text-decoration-color: var(--text);
}


/* =========================================================
   Lists
   ========================================================= */

ul,
ol {
    margin: 0 0 22px;
    padding-left: 24px;
}

li {
    margin: 7px 0;
}

li::marker {
    color: #73767c;
}


/* =========================================================
   Dividers
   ========================================================= */

hr {
    height: 1px;

    margin: 36px 0;

    background: var(--border);

    border: 0;
}


/* =========================================================
   Accessibility
   ========================================================= */

a:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 4px;
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 520px) {
    .container {
        padding: 30px 20px 44px;
    }

    .brand {
        margin-bottom: 28px;
    }

    h1 {
        font-size: 36px;
    }

    .lead {
        font-size: 17px;
    }

    .doc-list {
        gap: 10px;
        margin-top: 32px;
    }

    .doc-link {
        min-height: 68px;
        padding: 17px 18px;
    }
}


/* =========================================================
   Reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        transition-duration: 0.01ms !important;

        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
