/* =========================================================================
   TaleForks — marketing landing (root taleforks.com)
   Палитра и токены едины с app-entry landing/, но композиция другая:
   полноширинный hero, крупные how-it-works с illustrations, отдельная
   секция для авторов, мини-FAQ + showcase.
   ========================================================================= */

/* === Tokens =============================================================== */

:root {
    color-scheme: light dark;

    --bg: #fbf8f1;
    --bg-soft: #f4eee1;
    --surface: #ffffff;
    --surface-2: #fbf8f1;
    --ink: #1a1816;
    --ink-soft: rgba(26, 24, 22, 0.65);
    --ink-muted: rgba(26, 24, 22, 0.48);
    --stroke: rgba(26, 24, 22, 0.12);
    --stroke-strong: rgba(26, 24, 22, 0.22);

    --accent: #e85d3a;
    --accent-2: #5a8b6f;
    --accent-3: #c8862b;
    --accent-soft: rgba(232, 93, 58, 0.12);
    --accent-2-soft: rgba(90, 139, 111, 0.14);
    --accent-3-soft: rgba(200, 134, 43, 0.14);

    --shadow-1: 0 1px 0 rgba(26, 24, 22, 0.04),
        0 12px 28px rgba(26, 24, 22, 0.06);
    --shadow-2: 0 1px 0 rgba(26, 24, 22, 0.05),
        0 22px 48px rgba(26, 24, 22, 0.1);
    --shadow-3: 0 1px 0 rgba(26, 24, 22, 0.06),
        0 36px 72px rgba(26, 24, 22, 0.16);

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;

    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro",
        "Segoe UI", "Helvetica Neue", Roboto, Arial, sans-serif;
    --font-serif: "New York", "Iowan Old Style", "Charter", "Cambria",
        "Times New Roman", Georgia, serif;
    --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco,
        Consolas, "Liberation Mono", monospace;

    --max-w: 1180px;
    --space: clamp(20px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] {
        --bg: #0d0d14;
        --bg-soft: #131722;
        --surface: #161a26;
        --surface-2: #1b2030;
        --ink: #f0ece4;
        --ink-soft: rgba(240, 236, 228, 0.7);
        --ink-muted: rgba(240, 236, 228, 0.45);
        --stroke: rgba(240, 236, 228, 0.1);
        --stroke-strong: rgba(240, 236, 228, 0.2);

        --accent: #ff7a55;
        --accent-2: #82b894;
        --accent-3: #e6a347;
        --accent-soft: rgba(255, 122, 85, 0.16);
        --accent-2-soft: rgba(130, 184, 148, 0.16);
        --accent-3-soft: rgba(230, 163, 71, 0.16);

        --shadow-1: 0 1px 0 rgba(0, 0, 0, 0.25),
            0 14px 30px rgba(0, 0, 0, 0.35);
        --shadow-2: 0 1px 0 rgba(0, 0, 0, 0.3),
            0 24px 50px rgba(0, 0, 0, 0.45);
        --shadow-3: 0 1px 0 rgba(0, 0, 0, 0.35),
            0 40px 78px rgba(0, 0, 0, 0.55);
    }
}

:root[data-theme="dark"] {
    --bg: #0d0d14;
    --bg-soft: #131722;
    --surface: #161a26;
    --surface-2: #1b2030;
    --ink: #f0ece4;
    --ink-soft: rgba(240, 236, 228, 0.7);
    --ink-muted: rgba(240, 236, 228, 0.45);
    --stroke: rgba(240, 236, 228, 0.1);
    --stroke-strong: rgba(240, 236, 228, 0.2);
    --accent: #ff7a55;
    --accent-2: #82b894;
    --accent-3: #e6a347;
    --accent-soft: rgba(255, 122, 85, 0.16);
    --accent-2-soft: rgba(130, 184, 148, 0.16);
    --accent-3-soft: rgba(230, 163, 71, 0.16);
    --shadow-1: 0 1px 0 rgba(0, 0, 0, 0.25), 0 14px 30px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 1px 0 rgba(0, 0, 0, 0.3), 0 24px 50px rgba(0, 0, 0, 0.45);
    --shadow-3: 0 1px 0 rgba(0, 0, 0, 0.35), 0 40px 78px rgba(0, 0, 0, 0.55);
}

/* === Reset / base ========================================================= */

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

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

body {
    margin: 0;
    min-height: 100svh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

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

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

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

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

::selection {
    background: var(--accent-soft);
    color: var(--ink);
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    padding: 10px 14px;
    background: var(--ink);
    color: var(--bg);
    border-radius: var(--radius-sm);
    z-index: 1000;
    transform: translateY(-200%);
    transition: transform 200ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

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

/* === Background canvas ==================================================== */

.bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.bg-grain {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--stroke) 1px, transparent 1px),
        linear-gradient(90deg, var(--stroke) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(
        ellipse at 50% 0%,
        rgba(0, 0, 0, 0.75) 0%,
        transparent 65%
    );
    opacity: 0.5;
}

.bg-glow {
    position: absolute;
    width: 70vmax;
    height: 70vmax;
    border-radius: 999px;
    filter: blur(90px);
    opacity: 0.32;
    pointer-events: none;
}

.bg-glow-a {
    background: radial-gradient(
        circle at 50% 50%,
        var(--accent) 0%,
        transparent 60%
    );
    top: -30vmax;
    left: -25vmax;
}

.bg-glow-b {
    background: radial-gradient(
        circle at 50% 50%,
        var(--accent-2) 0%,
        transparent 60%
    );
    top: 35vmax;
    right: -25vmax;
    opacity: 0.22;
}

.bg-glow-c {
    background: radial-gradient(
        circle at 50% 50%,
        var(--accent-3) 0%,
        transparent 60%
    );
    bottom: -25vmax;
    left: 30vmax;
    opacity: 0.16;
    width: 50vmax;
    height: 50vmax;
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] .bg-glow {
        opacity: 0.22;
    }
    :root[data-theme="auto"] .bg-glow-b {
        opacity: 0.16;
    }
    :root[data-theme="auto"] .bg-glow-c {
        opacity: 0.12;
    }
}

:root[data-theme="dark"] .bg-glow {
    opacity: 0.22;
}
:root[data-theme="dark"] .bg-glow-b {
    opacity: 0.16;
}
:root[data-theme="dark"] .bg-glow-c {
    opacity: 0.12;
}

/* === Layout =============================================================== */

.wrap {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--space);
}

.section {
    padding: clamp(64px, 10vw, 112px) 0;
}

.section.tight {
    padding: clamp(40px, 7vw, 80px) 0;
}

/* === Header =============================================================== */

.top {
    max-width: var(--max-w);
    margin: 18px auto 0;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--stroke);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    position: sticky;
    top: 12px;
    z-index: 50;
    box-shadow: var(--shadow-1);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: -0.01em;
    font-size: 17px;
    color: var(--ink);
}

.brand-mark {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--accent);
    background: var(--accent-soft);
}

.brand-mark.small {
    width: 24px;
    height: 24px;
    border-radius: 7px;
}

.top-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--ink-soft);
    font-weight: 500;
    font-size: 14.5px;
    transition: color 160ms ease, background 160ms ease;
}

.nav-link:hover {
    color: var(--ink);
    background: var(--accent-soft);
}

.theme-toggle {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: var(--ink);
    border: 1px solid var(--stroke);
    background: var(--surface);
    transition: background 160ms ease, transform 160ms ease;
}

.theme-toggle:hover {
    background: var(--bg-soft);
}

.theme-toggle .ic-sun,
.theme-toggle .ic-moon {
    grid-area: 1 / 1;
    transition: opacity 200ms ease, transform 200ms ease;
}

.theme-toggle .ic-sun {
    opacity: 0;
    transform: rotate(-90deg) scale(0.6);
}

.theme-toggle .ic-moon {
    opacity: 1;
    transform: rotate(0) scale(1);
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] .theme-toggle .ic-sun {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
    :root[data-theme="auto"] .theme-toggle .ic-moon {
        opacity: 0;
        transform: rotate(90deg) scale(0.6);
    }
}

:root[data-theme="dark"] .theme-toggle .ic-sun {
    opacity: 1;
    transform: rotate(0) scale(1);
}

:root[data-theme="dark"] .theme-toggle .ic-moon {
    opacity: 0;
    transform: rotate(90deg) scale(0.6);
}

/* === Buttons ============================================================== */

.btn {
    --btn-h: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: var(--btn-h);
    padding: 0 24px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.005em;
    transition: transform 160ms ease, background 160ms ease,
        box-shadow 200ms ease, border-color 160ms ease;
    white-space: nowrap;
    line-height: 1;
}

.btn.primary {
    background: var(--ink);
    color: var(--bg);
    box-shadow: var(--shadow-1);
}

.btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-2);
    background: color-mix(in srgb, var(--ink) 92%, var(--accent));
}

.btn.ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--stroke-strong);
}

.btn.ghost:hover {
    transform: translateY(-1px);
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--ink);
}

.btn.accent {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-1);
}

.btn.accent:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-2);
    background: color-mix(in srgb, var(--accent) 88%, var(--ink));
}

.btn.sm {
    --btn-h: 40px;
    padding: 0 18px;
    font-size: 14px;
}

/* === Hero ================================================================= */

.hero {
    padding: clamp(48px, 9vw, 120px) 0 clamp(40px, 7vw, 80px);
    text-align: center;
    position: relative;
}

.hero-inner {
    max-width: 880px;
    margin: 0 auto;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.hero-title {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: clamp(44px, 7vw, 86px);
    line-height: 1.02;
    letter-spacing: -0.025em;
    margin: 22px 0 0;
    color: var(--ink);
    text-wrap: balance;
}

.accent-word {
    color: var(--accent);
    font-style: italic;
}

.hero-sub {
    margin: 26px auto 0;
    font-size: clamp(17px, 1.7vw, 21px);
    line-height: 1.55;
    color: var(--ink-soft);
    max-width: 58ch;
}

.hero-cta {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-top: 36px;
}

.hero-meta {
    margin: 28px auto 0;
    padding: 0;
    list-style: none;
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 24px;
    font-size: 13.5px;
    color: var(--ink-muted);
    font-family: var(--font-mono);
}

.hero-meta li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hero-meta li::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: var(--accent-2);
}

.hero-art {
    margin: clamp(40px, 6vw, 64px) auto 0;
    max-width: 900px;
    width: 100%;
    aspect-ratio: 16 / 7;
    position: relative;
}

.hero-art svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.art-branches path {
    stroke-dasharray: 480;
    stroke-dashoffset: 480;
    animation: draw 1600ms cubic-bezier(0.6, 0.05, 0.2, 1) forwards;
}

.art-branches path:nth-child(1) {
    animation-delay: 200ms;
}
.art-branches path:nth-child(2) {
    animation-delay: 320ms;
}
.art-branches path:nth-child(3) {
    animation-delay: 540ms;
}
.art-branches path:nth-child(4) {
    animation-delay: 660ms;
}
.art-branches path:nth-child(5) {
    animation-delay: 780ms;
}
.art-branches path:nth-child(6) {
    animation-delay: 900ms;
}
.art-branches path:nth-child(7) {
    animation-delay: 1020ms;
}

.art-nodes circle,
.art-labels text {
    opacity: 0;
    animation: fade 700ms ease forwards;
}

.art-nodes circle:nth-child(1) {
    animation-delay: 260ms;
}
.art-nodes circle:nth-child(2),
.art-nodes circle:nth-child(3) {
    animation-delay: 720ms;
}
.art-nodes circle:nth-child(n + 4) {
    animation-delay: 1100ms;
}

.art-labels text {
    animation-delay: 1300ms;
}

@keyframes draw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes fade {
    to {
        opacity: 1;
    }
}

/* === Section heads ======================================================== */

.section-head {
    max-width: 760px;
    margin: 0 auto clamp(36px, 5vw, 56px);
    text-align: center;
}

.section-head.left {
    text-align: left;
    margin-left: 0;
}

.kicker {
    display: inline-block;
    margin: 0 0 14px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-2);
}

.section-title {
    margin: 0;
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: clamp(30px, 4.5vw, 50px);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-wrap: balance;
}

.section-lead {
    margin: 16px auto 0;
    font-size: clamp(15px, 1.5vw, 18px);
    color: var(--ink-soft);
    max-width: 60ch;
    line-height: 1.55;
}

.section-head.left .section-lead {
    margin-left: 0;
}

/* === How it works ========================================================= */

.how-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(18px, 2.8vw, 32px);
    counter-reset: step;
}

.how-step {
    counter-increment: step;
    position: relative;
    padding: 32px 28px 30px;
    border-radius: var(--radius-xl);
    background: var(--surface);
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow-1);
    transition: transform 220ms ease, box-shadow 220ms ease;
    overflow: hidden;
}

.how-step:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-2);
}

.how-step::before {
    content: "0" counter(step);
    position: absolute;
    top: 22px;
    right: 26px;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.05em;
}

.how-illo {
    width: 100%;
    aspect-ratio: 5 / 3;
    margin-bottom: 22px;
    background: linear-gradient(
        180deg,
        var(--accent-soft) 0%,
        transparent 80%
    );
    border-radius: var(--radius);
    border: 1px solid var(--stroke);
    overflow: hidden;
    position: relative;
}

.how-illo svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.how-step h3 {
    margin: 0 0 10px;
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.015em;
    color: var(--ink);
}

.how-step p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 15.5px;
    line-height: 1.6;
}

/* === Features ============================================================= */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(16px, 2vw, 24px);
}

.feature {
    padding: 28px 24px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--stroke);
    transition: transform 220ms ease, box-shadow 220ms ease,
        border-color 220ms ease;
    display: flex;
    flex-direction: column;
}

.feature:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--shadow-2);
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 18px;
}

.feature:nth-child(2) .feature-icon {
    background: var(--accent-2-soft);
    color: var(--accent-2);
}

.feature:nth-child(3) .feature-icon {
    background: var(--accent-3-soft);
    color: var(--accent-3);
}

.feature h3 {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.feature p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 14.5px;
    line-height: 1.55;
}

/* === Showcase ============================================================= */

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(16px, 2.4vw, 26px);
}

.story-card {
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--stroke);
    overflow: hidden;
    box-shadow: var(--shadow-1);
    transition: transform 240ms ease, box-shadow 240ms ease;
    display: flex;
    flex-direction: column;
}

.story-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-2);
}

.story-cover {
    position: relative;
    aspect-ratio: 3 / 2;
    overflow: hidden;
}

.story-cover svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.story-body {
    padding: 20px 22px 22px;
}

.story-genre {
    font-family: var(--font-mono);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-2);
    font-weight: 600;
}

.story-title {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 22px;
    line-height: 1.15;
    margin: 6px 0 8px;
    letter-spacing: -0.015em;
    color: var(--ink);
}

.story-desc {
    margin: 0;
    color: var(--ink-soft);
    font-size: 14.5px;
    line-height: 1.55;
}

.story-foot {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: var(--ink-muted);
    font-family: var(--font-mono);
}

.story-foot span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.story-foot svg {
    width: 14px;
    height: 14px;
    color: var(--accent);
}

/* === Creators ============================================================= */

.creators {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(28px, 5vw, 64px);
    align-items: center;
    padding: clamp(40px, 6vw, 72px);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(
            ellipse at 0% 0%,
            var(--accent-2-soft) 0%,
            transparent 60%
        ),
        radial-gradient(
            ellipse at 100% 100%,
            var(--accent-soft) 0%,
            transparent 60%
        ),
        var(--surface);
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow-2);
}

.creators-text h2 {
    margin: 12px 0 0;
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-wrap: balance;
}

.creators-text p {
    margin: 18px 0 0;
    font-size: clamp(15px, 1.5vw, 17px);
    color: var(--ink-soft);
    line-height: 1.6;
    max-width: 48ch;
}

.creators-list {
    margin: 22px 0 28px;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 12px;
}

.creators-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 15px;
    color: var(--ink);
}

.creators-list .check {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--accent-2-soft);
    color: var(--accent-2);
    display: grid;
    place-items: center;
    margin-top: 1px;
}

.creators-list .check svg {
    width: 12px;
    height: 12px;
}

.creators-art {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow-1);
}

.creators-art svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* === Mini FAQ ============================================================= */

.faq-list {
    display: grid;
    gap: 12px;
    max-width: 760px;
    margin: 0 auto;
}

.faq-item {
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--stroke);
    overflow: hidden;
    transition: border-color 200ms ease;
}

.faq-item[open] {
    border-color: var(--accent);
}

.faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    user-select: none;
}

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

.faq-icon {
    position: relative;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.faq-icon::before,
.faq-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 2px;
    border-radius: 2px;
    background: var(--ink-soft);
    transform: translate(-50%, -50%);
    transition: transform 220ms ease, background 220ms ease;
}

.faq-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.faq-item[open] .faq-icon::before,
.faq-item[open] .faq-icon::after {
    background: var(--accent);
}

.faq-item[open] .faq-icon::after {
    transform: translate(-50%, -50%) rotate(0deg);
}

.faq-body {
    padding: 0 24px 24px;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.6;
    animation: faq-open 260ms ease;
}

.faq-body p {
    margin: 0;
}

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

@keyframes faq-open {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.faq-foot {
    margin-top: 18px;
    text-align: center;
    color: var(--ink-muted);
    font-size: 14.5px;
}

.faq-foot a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

/* === CTA band ============================================================= */

.cta-band {
    margin: clamp(48px, 7vw, 88px) 0 clamp(64px, 10vw, 112px);
    padding: clamp(44px, 6vw, 72px);
    border-radius: var(--radius-xl);
    text-align: center;
    background:
        radial-gradient(
            ellipse at 50% 0%,
            var(--accent-soft) 0%,
            transparent 65%
        ),
        var(--surface);
    border: 1px solid var(--stroke);
    box-shadow: var(--shadow-3);
}

.cta-band h2 {
    margin: 0 0 12px;
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: clamp(28px, 4vw, 42px);
    letter-spacing: -0.02em;
    line-height: 1.1;
    text-wrap: balance;
}

.cta-band p {
    margin: 0 auto 26px;
    color: var(--ink-soft);
    font-size: clamp(15px, 1.4vw, 17px);
    max-width: 52ch;
}

.cta-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
}

/* === Footer =============================================================== */

.footer {
    border-top: 1px solid var(--stroke);
    background: var(--bg-soft);
}

.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 32px var(--space) 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--ink-soft);
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--ink);
}

.footer-nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.footer-nav a {
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--ink-soft);
    transition: color 160ms ease, background 160ms ease;
}

.footer-nav a:hover {
    color: var(--ink);
    background: var(--accent-soft);
}

.footer-copy {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-soft);
}

/* === Reveal animations ==================================================== */

.reveal {
    transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
        transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.js .reveal {
    opacity: 0;
    transform: translateY(20px);
    will-change: opacity, transform;
}

.js .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.js .reveal-stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
        transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.js .reveal-stagger.is-visible > * {
    opacity: 1;
    transform: translateY(0);
}

.js .reveal-stagger.is-visible > *:nth-child(2) {
    transition-delay: 80ms;
}
.js .reveal-stagger.is-visible > *:nth-child(3) {
    transition-delay: 160ms;
}
.js .reveal-stagger.is-visible > *:nth-child(4) {
    transition-delay: 240ms;
}

/* === Responsive =========================================================== */

@media (max-width: 980px) {
    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .showcase-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .creators {
        grid-template-columns: 1fr;
    }
    .creators-art {
        order: -1;
        max-width: 480px;
        margin: 0 auto;
        width: 100%;
    }
}

@media (max-width: 760px) {
    .top {
        margin: 12px 12px 0;
        padding: 10px 14px;
        border-radius: 22px;
    }
    .top-actions .nav-link {
        display: none;
    }
    .brand {
        font-size: 16px;
    }

    .hero {
        padding: 36px 0 24px;
    }
    .hero-cta {
        width: 100%;
    }
    .hero-cta .btn {
        flex: 1 1 100%;
    }
    .hero-art {
        aspect-ratio: 4 / 3;
    }
    .hero-meta {
        font-size: 12.5px;
        gap: 8px 18px;
    }

    .how-list {
        grid-template-columns: 1fr;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .showcase-grid {
        grid-template-columns: 1fr;
    }

    .creators {
        padding: 28px;
    }

    .cta-actions .btn {
        flex: 1 1 100%;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
}

@media (max-width: 400px) {
    :root {
        --space: 16px;
    }
    .btn {
        padding: 0 20px;
        font-size: 14px;
    }
    .hero-title {
        font-size: 40px;
    }
}

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

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    html {
        scroll-behavior: auto;
    }
    .reveal,
    .js .reveal,
    .js .reveal-stagger > * {
        opacity: 1;
        transform: none;
    }
    .art-branches path {
        stroke-dashoffset: 0;
    }
    .art-nodes circle,
    .art-labels text {
        opacity: 1;
    }
}

/* === Stories catalog (/stories/) ========================================== */

.catalog-section {
    padding-top: clamp(48px, 8vw, 96px);
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(20px, 2.4vw, 28px);
    margin: 0 0 clamp(40px, 6vw, 64px);
}

.catalog-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-1);
    transition: transform 220ms ease, box-shadow 220ms ease,
        border-color 220ms ease;
    isolation: isolate;
}

.catalog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-2);
    border-color: var(--accent);
}

.catalog-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: linear-gradient(
        180deg,
        var(--accent-soft) 0%,
        var(--bg-soft) 100%
    );
    overflow: hidden;
}

.catalog-cover-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 320ms ease;
}

.catalog-card:hover .catalog-cover-img {
    transform: scale(1.04);
}

.catalog-cover-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-family: var(--font-serif);
    font-size: clamp(64px, 8vw, 96px);
    font-weight: 500;
    color: var(--accent);
    letter-spacing: -0.04em;
}

.catalog-age {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 1;
    padding: 4px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ink) 78%, transparent);
    color: var(--bg);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.catalog-body {
    padding: 22px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.catalog-title {
    margin: 0;
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--ink);
}

.catalog-desc {
    margin: 0;
    color: var(--ink-soft);
    font-size: 14.5px;
    line-height: 1.5;
    /* Описания у нас длинные — режем до 3 строк, чтобы карточки оставались одинаковыми. */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.catalog-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-muted);
}

.catalog-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.catalog-meta span::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--accent-2);
}

.catalog-meta span:first-child::before {
    background: var(--accent);
}

.catalog-open {
    margin-top: auto;
    padding-top: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: -0.005em;
    transition: gap 200ms ease;
}

.catalog-card:hover .catalog-open {
    color: color-mix(in srgb, var(--accent) 80%, var(--ink));
}

/* Skeleton placeholders пока идёт fetch — не оставлять пустой грид на slow-3g. */
.catalog-skeleton .catalog-cover {
    background: linear-gradient(
        90deg,
        var(--bg-soft) 0%,
        color-mix(in srgb, var(--surface) 60%, var(--bg-soft)) 50%,
        var(--bg-soft) 100%
    );
    background-size: 200% 100%;
    animation: catalog-shimmer 1.4s linear infinite;
}

.catalog-skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(
        90deg,
        var(--bg-soft) 0%,
        color-mix(in srgb, var(--surface) 60%, var(--bg-soft)) 50%,
        var(--bg-soft) 100%
    );
    background-size: 200% 100%;
    animation: catalog-shimmer 1.4s linear infinite;
}

.catalog-skeleton-line.w-40 {
    width: 40%;
}
.catalog-skeleton-line.w-60 {
    width: 60%;
}
.catalog-skeleton-line.w-90 {
    width: 90%;
}

@keyframes catalog-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.catalog-empty,
.catalog-error {
    text-align: center;
    padding: 48px 24px 32px;
    color: var(--ink-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.catalog-empty p,
.catalog-error p {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(18px, 2.2vw, 22px);
    color: var(--ink);
}

@media (max-width: 980px) {
    .catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .catalog-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .catalog-skeleton .catalog-cover,
    .catalog-skeleton-line {
        animation: none;
    }
    .catalog-card:hover {
        transform: none;
    }
    .catalog-card:hover .catalog-cover-img {
        transform: none;
    }
}
