/* Vorozhka — дизайн-система по макетам Figma (страница «Сайт arcus», нижний блок).
   Цвета сняты пиксельно с рендеров: ~/arcus/.ref/figma/desk-*.png.
   Точные семейства шрифтов и отступы ждут дерева узлов Figma (эндпоинт nodes
   в лимите), пока — подбор по рендерам. Бид arcus-oe8.28.6. */

@font-face {
    /* Ruslan Display — ремейк шрифта Олега Снарского 1970-х по мотивам полуустава
       XVI века, письма русских и украинских книг. Нужен только логотипу.
       Одна касса: строчных букв нет, «Ворожка» набирается прописными по замыслу
       самого шрифта, а не через text-transform.
       Лицензия OFL 1.1 — assets/fonts/RuslanDisplay-OFL.txt. Самостоятельно, без
       CDN: внешний шрифт — это и зависимость, и утечка адресов посетителей. */
    font-family: "Vorozhka Mark";
    src: url("/assets/fonts/ruslan-display.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    /* Playfair Display, подмножество из одних цифр и тире: 3,7 КБ.
       Лицензия OFL 1.1 — assets/fonts/PlayfairDisplay-OFL.txt.
       Самостоятельно, без CDN: внешний шрифт — это и зависимость, и утечка
       адресов посетителей. */
    font-family: "Vorozhka Digits";
    src: url("/assets/fonts/playfair-digits.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    unicode-range: U+30-39, U+2014;
}

:root {
    /* поверхности */
    --bg: #07050f;
    --bg-soft: #0c0a16;
    --line: #241f33;
    --line-accent: #3b2f57;

    /* акцент */
    --accent: #775ba6;
    --accent-bright: #8f74bd;
    --accent-soft: #9e97b3;
    --accent-dim: rgba(119, 91, 166, 0.22);
    /* золото и фон карточки — из макета блока практик (Figma 3370-11021) */
    --gold: #e5c158;
    --card-bg: #120e22;

    /* текст */
    --text: #f5f2fa;
    --text-warm: #f7f6f1;
    --text-muted: #a49dba;
    /* Осветлён против макета до контраста 4.6:1 на фоне: этим цветом набран
       мелкий текст (надстрочники 12px, подписи, ссылки подвала), а для него
       WCAG требует 4.5:1. В макете этот оттенок давал 3.84:1. */
    --text-dim: #7c7492;
    --on-light: #16121f;

    /* типографика */
    --serif: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
    /* Цифры результата: отдельное начертание, чтобы число читалось как знак,
       а не как часть текста. Запасной вариант — та же антиква. */
    --digits: "Vorozhka Digits", var(--serif);
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* сетка */
    --page: 1240px;
    --gutter: 100px;
    --radius: 20px;
    --radius-sm: 14px;
}

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

/* [hidden] в UA-стилях бьётся любым классом с display: держим его сильнее */
[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* ─── примитивы ──────────────────────────────────────────────────────────── */

.shell {
    width: min(100% - 48px, var(--page));
    margin-inline: auto;
}

.eyebrow {
    display: block;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-dim);
}

h1,
h2,
h3 {
    font-family: var(--serif);
    font-weight: 400;
    line-height: 1.08;
    margin: 0;
}

h1 {
    font-size: clamp(44px, 5.4vw, 76px);
}

h2 {
    font-size: clamp(30px, 3.4vw, 50px);
}

h3 {
    font-size: 24px;
}

.accent {
    color: var(--accent-bright);
}

.serif-accent {
    font-family: var(--serif);
    color: var(--accent-bright);
    font-style: italic;
}

p {
    margin: 0 0 16px;
}

a {
    color: inherit;
}

/* ─── шапка ──────────────────────────────────────────────────────────────── */

header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
    background: rgba(7, 5, 15, 0.82);
    border-bottom: 1px solid var(--line);
    border-radius: 0 0 var(--radius) var(--radius);
}

header .shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.brand {
    font-family: "Vorozhka Mark", var(--serif);
    font-size: 26px;
    /* у полуустава буквы и так плотные: разрядка нужна меньше, чем у антиквы */
    letter-spacing: 0.06em;
    text-decoration: none;
    color: var(--text);
}

.brand:hover {
    color: var(--accent-bright);
}

.header-link {
    font-size: 13px;
    color: var(--text-dim);
    text-decoration: none;
}

.header-link:hover {
    color: var(--text-muted);
}

/* ─── герой ──────────────────────────────────────────────────────────────── */

.hero {
    position: relative;
    text-align: center;
    padding: 96px 0 72px;
    overflow: hidden;
}

.hero .wheel {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(680px, 92vw);
    transform: translate(-50%, -50%);
    opacity: 0.55;
    pointer-events: none;
}

.hero > .shell {
    position: relative;
}

.hero h1 {
    margin-bottom: 18px;
}

.hero .eyebrow {
    margin-bottom: 18px;
}

.hero .lead {
    max-width: 560px;
    margin: 0 auto 36px;
    color: var(--text-muted);
}

/* переключатель методов */

.methods {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.methods button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 24px;
    border-radius: 999px;
    border: 1px solid var(--line-accent);
    background: transparent;
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.methods button span.index {
    color: var(--text-dim);
    font-size: 13px;
}

.methods button:hover {
    border-color: var(--accent);
}

.methods button[aria-pressed="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.methods button[aria-pressed="true"] span.index {
    color: rgba(255, 255, 255, 0.72);
}

/* ─── блок инструмента ───────────────────────────────────────────────────── */

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 64px;
    align-items: start;
    padding: 64px 0 40px;
}

.workspace .intro h2 {
    margin: 14px 0 16px;
}

.workspace .intro p {
    color: var(--text-muted);
    max-width: 420px;
}

.fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

input,
select {
    width: 100%;
    padding: 15px 18px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--on-light);
    font-family: var(--sans);
    font-size: 15px;
}

input::placeholder {
    color: rgba(22, 18, 31, 0.55);
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
summary:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent-bright);
    outline-offset: 3px;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.6;
    cursor: pointer;
}

.primary {
    width: 100%;
    margin-top: 24px;
    padding: 18px 28px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    font-family: var(--sans);
    font-size: 16px;
    cursor: pointer;
    transition: background 0.18s ease;
}

.primary:hover:not(:disabled) {
    background: var(--accent-bright);
}

.primary:disabled {
    opacity: 0.55;
    cursor: progress;
}

.privacy {
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-dim);
}

.status {
    min-height: 22px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ─── результаты ─────────────────────────────────────────────────────────── */

.result-head {
    text-align: center;
    padding: 40px 0 8px;
}

.result-head h2 {
    color: var(--accent-bright);
}

.result-head p {
    max-width: 640px;
    margin: 16px auto 0;
    color: var(--text-muted);
}

.empty {
    border: 1px dashed var(--line-accent);
    border-radius: var(--radius);
    padding: 64px 24px;
    text-align: center;
    color: var(--text-muted);
}

.empty .mark {
    font-size: 22px;
    color: var(--accent-bright);
}

.empty h3 {
    margin: 12px 0 8px;
    color: var(--text);
}

.empty p {
    margin: 0;
    color: var(--accent-bright);
    font-size: 14px;
}

.results {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    padding: 24px 0 8px;
}

.results.one {
    grid-template-columns: minmax(0, 420px);
    justify-content: center;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 26px 28px 22px;
    border: 1px solid var(--line-accent);
    border-radius: var(--radius);
    background: radial-gradient(120% 90% at 82% 18%, rgba(119, 91, 166, 0.16), transparent 60%), var(--bg-soft);
}

.card > small {
    font-family: var(--serif);
    font-size: 15px;
    color: var(--text-muted);
}

.card .number {
    position: relative;
    display: grid;
    place-items: center;
    width: 132px;
    height: 132px;
    margin: 26px auto 22px;
    font-family: var(--digits);
    font-size: clamp(64px, 6vw, 88px);
    line-height: 1;
    color: var(--accent-bright);
    font-feature-settings: "lnum" 1;
}

/* Кольцо вокруг числа — тот же мотив, что у кружков шагов и у колеса в герое. */
.card .number::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid var(--line-accent);
    border-radius: 50%;
}

/* Мягкое свечение: число должно быть центром карточки, а не просто крупным. */
.card .number::after {
    content: "";
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(143, 116, 189, 0.22), transparent 70%);
    z-index: -1;
}

.card h3 {
    color: var(--accent-bright);
    margin: 10px 0 12px;
}

.card p {
    color: var(--text-muted);
    font-size: 15px;
}

.card .foot {
    margin-top: auto;
    padding-top: 18px;
}

details {
    margin-top: 10px;
}

details > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-family: var(--serif);
    font-size: 16px;
    color: var(--text-muted);
}

details > summary::-webkit-details-marker {
    display: none;
}

details > summary::after {
    content: "→";
    color: var(--text-dim);
    transition: transform 0.18s ease;
}

details[open] > summary::after {
    transform: rotate(90deg);
}

details > summary:hover {
    color: var(--accent-bright);
}

.body-text,
.chain-list {
    margin-top: 14px;
    font-size: 14px;
    color: var(--text-muted);
    white-space: pre-wrap;
}

.chain-list p {
    margin: 0 0 6px;
}

.notes {
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
    padding: 12px 0 0;
}

/* карта таро */

.tarot-image {
    width: 168px;
    margin: 18px auto 14px;
    border-radius: 6px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.image-fallback {
    margin: 18px auto 14px;
    padding: 28px 16px;
    width: 168px;
    border: 1px dashed var(--line-accent);
    border-radius: 6px;
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
}

.card .card-title {
    font-family: var(--serif);
    font-size: 34px;
    color: var(--accent-bright);
    text-align: center;
    margin: 4px 0 2px;
}

.card .card-sub {
    font-family: var(--serif);
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
}

/* квадрат психоматрицы */

.matrix {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    padding: 24px 0;
}

.matrix .cell {
    background: var(--accent-soft);
    color: var(--on-light);
    border-radius: var(--radius-sm);
    padding: 26px 16px;
    text-align: center;
}

.matrix .cell strong {
    display: block;
    font-family: var(--digits);
    font-size: 38px;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.matrix .cell small {
    display: block;
    margin-top: 6px;
    font-size: 17px;
}

/* ─── блок «Наші сакральні практики» ─────────────────────────────────────── */

/* По макету Figma 3370-11021. Оттуда взяты цвета и раскладка; шрифты подставлены
   наши: Iowan Old Style в макете — системный шрифт macOS, в вебе его нет. */

.practices-head {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 44px;
}

.practices-head h2 {
    margin: 0 0 14px;
}

.practices-head p {
    color: var(--accent-soft);
    margin: 0;
}

.practices-sep {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 22px;
    color: var(--gold);
}

.practices-sep i {
    width: 60px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--line-accent), transparent);
}

.practices-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
}

.practice {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px 20px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card-bg);
    color: inherit;
    text-decoration: none;
    /* identity, чтобы наведение не создавало новый stacking context рывком */
    translate: 0;
    transition:
        translate 220ms cubic-bezier(0.2, 0.7, 0.2, 1),
        border-color 220ms ease,
        box-shadow 220ms ease;
}

.practice:hover,
.practice:focus-visible {
    translate: 0 -5px;
    border-color: var(--line-accent);
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.5);
}

.practice:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

.practice-photo {
    display: block;
    aspect-ratio: 341 / 220;
    border-radius: var(--radius-sm);
    background-size: cover;
    background-position: center;
}

.practice-body {
    display: block;
    flex: 1;
}

.practice-badge {
    display: block;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--gold);
    text-transform: uppercase;
}

.practice h3 {
    font-family: var(--serif);
    font-size: 28px;
    font-weight: 400;
    margin: 8px 0 10px;
}

.practice p {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-muted);
}

.practice-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--gold);
}

.practice-action i {
    font-style: normal;
    transition: translate 220ms ease;
    translate: 0;
}

.practice:hover .practice-action i {
    translate: 3px -3px;
}

@media (max-width: 900px) {
    .practices-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
    }
}

/* ─── переключатель раскладов таро ───────────────────────────────────────── */

/* Один орган управления на весь раздел: он виден и на вытягивании карт, и на
   карте дня. Раньше на карте дня оставался селект из формы, а в ритуале был свой
   переключатель — два разных способа сделать одно и то же. */
.tarot-switch {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 28px;
}

.tarot-switch button {
    padding: 10px 22px;
    border: 1px solid var(--line-accent);
    border-radius: 999px;
    background: none;
    color: var(--text-muted);
    font: inherit;
    font-size: 15px;
    cursor: pointer;
    transition:
        background 180ms ease,
        color 180ms ease;
}

.tarot-switch button:hover {
    color: var(--text);
}

.tarot-switch button[aria-pressed='true'] {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ─── секции лендинга ────────────────────────────────────────────────────── */

section.band {
    padding: 96px 0;
}

.band-head {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 48px;
    align-items: start;
}

.band-head p {
    color: var(--text-muted);
    text-align: right;
}

.pill-link {
    display: inline-flex;
    align-items: center;
    gap: 28px;
    margin-top: 32px;
    padding: 12px 12px 12px 32px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-family: var(--serif);
    font-size: 20px;
}

.pill-link .circle {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fff;
    color: var(--accent);
    font-size: 20px;
}

.pill-link:hover {
    background: var(--accent-bright);
}

.steps {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 64px;
    margin-top: 56px;
}

.steps .lead-text {
    font-family: var(--serif);
    font-size: 24px;
    line-height: 1.35;
}

.steps .lead-text em {
    display: block;
    margin-top: 20px;
    font-size: 17px;
    color: var(--text-muted);
    font-family: var(--sans);
}

.step {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    padding: 20px 0;
    border-top: 1px solid var(--line);
}

.step:first-child {
    border-top: none;
}

.step .num {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1px solid var(--line-accent);
    font-family: var(--serif);
    font-size: 22px;
    color: var(--text-muted);
}

.step h3 {
    color: var(--accent-bright);
    font-size: 22px;
    margin-bottom: 8px;
}

.step p {
    margin: 0;
    font-style: italic;
    color: var(--text-muted);
    font-size: 15px;
}

.motto {
    text-align: center;
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 56px 0 0;
}

/* ─── подвал ─────────────────────────────────────────────────────────────── */

footer {
    margin-top: 72px;
    border-top: 1px solid var(--line);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 56px 0 40px;
}

footer .brand {
    font-size: 24px;
}

footer .about {
    max-width: 620px;
    margin: 18px 0 40px;
    color: var(--text-dim);
    font-size: 14px;
}

footer .bottom {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-dim);
}

footer .bottom nav {
    display: flex;
    gap: 28px;
}

footer .bottom a {
    color: var(--text-muted);
    text-decoration: none;
}

footer .bottom a:hover {
    color: var(--text);
}

footer .age {
    color: var(--text-dim);
}

/* ─── мобильная раскладка ────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .shell {
        width: min(100% - 32px, var(--page));
    }

    .hero {
        padding: 56px 0 48px;
    }

    .methods {
        flex-direction: column;
        align-items: stretch;
    }

    .methods button {
        justify-content: center;
    }

    .workspace,
    .band-head,
    .steps {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }

    .band-head p {
        text-align: left;
    }

    .workspace {
        padding: 40px 0 24px;
        text-align: center;
    }

    .workspace .intro p {
        margin-inline: auto;
    }

    .fields {
        grid-template-columns: minmax(0, 1fr);
    }

    label {
        text-align: left;
    }

    .results,
    .matrix {
        grid-template-columns: minmax(0, 1fr);
    }

    .card .number {
        width: 112px;
        height: 112px;
        font-size: 62px;
    }

    .focus-box .ready {
        width: 152px;
        height: 152px;
        font-size: 23px;
    }

    section.band {
        padding: 64px 0;
    }

    .tile {
        min-height: 200px;
    }
}

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

    * {
        transition: none !important;
        animation: none !important;
    }
}

/* ─── FAQ с источниками (требование плана §6.1) ──────────────────────────── */

.faq {
    padding-top: 72px;
}

.faq-head {
    text-align: center;
    margin-bottom: 36px;
}

.faq-head h2 {
    margin-top: 14px;
}

.faq-body {
    max-width: 820px;
    margin-inline: auto;
    color: var(--text-muted);
}

/* Вопрос — строка, по которой нажимают; ответ раскрывается под ней. */
.faq-item {
    border-top: 1px solid var(--line);
}

.faq-item:last-of-type {
    border-bottom: 1px solid var(--line);
}

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 2px;
    cursor: pointer;
    list-style: none;
    font-family: var(--serif);
    font-size: 21px;
    color: var(--text);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

/* Знак вместо стандартного треугольника: он у браузеров разный и мелкий. */
.faq-item summary::after {
    content: '+';
    flex: none;
    font-family: var(--sans);
    font-size: 24px;
    line-height: 1;
    color: var(--accent-bright);
    transition: rotate 200ms ease;
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item summary:hover {
    color: var(--accent-bright);
}

.faq-item summary:focus-visible {
    outline: 2px solid var(--accent-bright);
    outline-offset: 2px;
}

.faq-answer {
    padding-bottom: 20px;
}

.faq-answer > :first-child {
    margin-top: 0;
}

.faq-body h3,
.faq-body h4 {
    font-family: var(--serif);
    color: var(--accent-bright);
    font-size: 24px;
    margin: 36px 0 12px;
}

.faq-body ul {
    padding-left: 20px;
}

.faq-body li {
    margin-bottom: 10px;
}

.faq-body a {
    color: var(--accent-bright);
    text-underline-offset: 3px;
}

.faq-body code,
.body-text code,
.notes code {
    font-size: 0.92em;
    color: var(--text);
}

.body-text h3,
.body-text h4 {
    font-family: var(--serif);
    color: var(--text);
    font-size: 18px;
    margin: 18px 0 8px;
}

.body-text ul {
    padding-left: 18px;
}

/* ─── момент сосредоточения перед вытягиванием карты ─────────────────────── */

.focus-box {
    border: 1px dashed var(--line-accent);
    border-radius: var(--radius);
    padding: 72px 24px 64px;
    text-align: center;
}

.focus-box .mark {
    font-size: 22px;
    color: var(--accent-bright);
    animation: focus-pulse 2.4s ease-in-out infinite;
}

.focus-box h2 {
    margin: 18px auto 14px;
    max-width: 620px;
}

.focus-box p {
    color: var(--text-muted);
    max-width: 520px;
    margin-inline: auto;
}

/* Карту открывает человек, а не таймер: большая круглая кнопка — сама по себе
   пауза, которую он держит ровно столько, сколько нужно. */
.focus-box .ready {
    display: grid;
    place-items: center;
    width: 176px;
    height: 176px;
    margin: 36px auto 0;
    border-radius: 50%;
    border: 1px solid var(--accent);
    background: radial-gradient(circle at 50% 35%, var(--accent-bright), var(--accent) 70%);
    color: #fff;
    font-family: var(--serif);
    font-size: 26px;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 0 0 0 rgba(143, 116, 189, 0.45);
    animation: ready-breath 3.2s ease-in-out infinite;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.focus-box .ready:hover {
    transform: scale(1.03);
}

.focus-box .ready:active {
    transform: scale(0.98);
}

@keyframes ready-breath {
    0%, 100% { box-shadow: 0 0 0 0 rgba(143, 116, 189, 0.38); }
    50% { box-shadow: 0 0 0 18px rgba(143, 116, 189, 0); }
}

.again {
    display: block;
    margin: 28px auto 0;
    padding: 14px 32px;
    border: 1px solid var(--line-accent);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    cursor: pointer;
}

.again:hover {
    border-color: var(--accent);
    color: var(--accent-bright);
}

@keyframes focus-pulse {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .focus-box .mark,
    .focus-box .ready {
        animation: none;
        opacity: 1;
    }
}

/* ─── переходы между состояниями ─────────────────────────────────────────── */

/* Имя перехода должно быть уникальным: по одному элементу до и после, иначе
   браузер тихо обновит разметку без анимации. */
#hero-title {
    view-transition-name: hero-title;
    width: fit-content;
    margin-inline: auto;
}

.workspace .intro {
    view-transition-name: tool-intro;
}

#result {
    view-transition-name: result;
}

#result:focus-visible {
    outline: 2px solid var(--accent-bright);
    outline-offset: 6px;
}

#heading:focus-visible {
    outline: 2px solid var(--accent-bright);
    outline-offset: 6px;
}

/* Корневой снимок не анимируем: меняется область результата и блок
   инструмента, а не вся страница — общий кросс-фейд только добавлял бы
   лишнюю отрисовку и задержку. */
::view-transition-old(root),
::view-transition-new(root) {
    animation: none;
}

::view-transition-old(result),
::view-transition-new(result) {
    animation-duration: 220ms;
}

::view-transition-old(hero-title),
::view-transition-new(hero-title),
::view-transition-old(tool-intro),
::view-transition-new(tool-intro) {
    animation-duration: 220ms;
}

/* Карточки проявляются со сдвигом; переменная --i задаётся в скрипте. */
.card-in {
    animation: card-in 260ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
    animation-delay: calc(var(--i, 0) * 45ms);
}

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none !important;
    }

    .card-in {
        animation: none;
    }
}

/* Отступ при прокрутке к результату: шапка липкая, без него карточка
   подъезжает прямо под неё. */
.results .card,
.matrix {
    scroll-margin-top: 96px;
}

/* Любая прокрутка к якорю должна оставлять место под липкую шапку: без этого
   цель подъезжает прямо под неё. Касается и ссылки «Більше деталей», и будущих
   якорей на странице. */
:target,
#form,
.workspace,
.faq,
section[id] {
    scroll-margin-top: 96px;
}

/* ─── страница 404 ───────────────────────────────────────────────────────── */

.notfound {
    padding: 96px 0 120px;
}

.notfound .code {
    font-family: var(--serif);
    font-size: 64px;
    line-height: 1;
    color: var(--accent-bright);
}

.notfound h3 {
    font-size: 26px;
}

.notfound-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
    margin-top: 28px;
    font-size: 14px;
}

.notfound-links a {
    color: var(--accent-bright);
    text-decoration: none;
}

.notfound-links a:hover {
    text-decoration: underline;
}
