/* ============================================================
   CatWorld — современный журнал о кошках
   ============================================================ */

:root {
    --bg: #0d0f14;
    --bg-soft: #141821;
    --bg-card: #1a1f2b;
    --bg-elev: #212836;
    --border: #2a3242;
    --text: #e8ecf3;
    --text-dim: #9aa5b8;
    --text-mute: #6b7688;
    --accent: #ff8a3d;
    --accent-soft: #ffb37a;
    --accent-glow: rgba(255, 138, 61, 0.18);
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.3);
    --maxw: 1240px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
    --bg: #fbfaf8;
    --bg-soft: #f4f2ee;
    --bg-card: #ffffff;
    --bg-elev: #ffffff;
    --border: #e4e0d8;
    --text: #1a1d23;
    --text-dim: #5a6270;
    --text-mute: #8b93a1;
    --accent: #e06a1f;
    --accent-soft: #c95a12;
    --accent-glow: rgba(224, 106, 31, 0.12);
    --shadow: 0 20px 50px rgba(30, 25, 15, 0.1);
    --shadow-sm: 0 8px 24px rgba(30, 25, 15, 0.07);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    transition: background 0.35s var(--ease), color 0.35s var(--ease);
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(18px) saturate(1.4);
    border-bottom: 1px solid var(--border);
    transition: background 0.35s var(--ease), border-color 0.35s var(--ease);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.22rem;
    letter-spacing: -0.03em;
    flex-shrink: 0;
}

.logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #ff5f6d);
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.nav {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.nav a {
    padding: 8px 15px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-dim);
    transition: all 0.22s var(--ease);
    white-space: nowrap;
}

.nav a:hover { color: var(--text); background: var(--bg-soft); }
.nav a.active { color: var(--accent); background: var(--accent-glow); }

.header-actions { display: flex; gap: 8px; align-items: center; }

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: var(--text-dim);
    border: 1px solid var(--border);
    transition: all 0.22s var(--ease);
    font-size: 1.05rem;
}

.icon-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
    transform: translateY(-1px);
}

.burger { display: none; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding: 72px 0 56px;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: -280px;
    right: -180px;
    width: 720px;
    height: 720px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 68%);
    pointer-events: none;
    filter: blur(20px);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 56px;
    align-items: center;
    position: relative;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 100px;
    background: var(--accent-glow);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 22px;
}

.eyebrow .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.82); }
}

.hero h1 {
    font-size: clamp(2.4rem, 5vw, 3.9rem);
    line-height: 1.06;
    letter-spacing: -0.045em;
    font-weight: 800;
    margin-bottom: 22px;
}

.hero h1 em {
    font-style: normal;
    background: linear-gradient(120deg, var(--accent), #ff5f6d 60%, #ffb37a);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p.lead {
    font-size: 1.1rem;
    color: var(--text-dim);
    max-width: 52ch;
    margin-bottom: 32px;
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 13px 26px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.25s var(--ease);
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #ff6b35);
    color: #fff;
    box-shadow: 0 8px 26px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px var(--accent-glow);
}

.btn-ghost {
    border-color: var(--border);
    color: var(--text-dim);
    background: var(--bg-card);
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.hero-media {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
    aspect-ratio: 4 / 3.2;
    background: var(--bg-card);
}

.hero-media video,
.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.55), transparent 55%);
    pointer-events: none;
}

.hero-badge {
    position: absolute;
    bottom: 18px;
    left: 18px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    border-radius: 100px;
    background: rgba(10, 12, 18, 0.72);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.14);
    font-size: 0.84rem;
    font-weight: 600;
    color: #fff;
}

.hero-badge .live {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); }
    70% { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* ---------- Stats ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 56px 0;
}

.stat {
    background: var(--bg-card);
    padding: 26px 22px;
    text-align: center;
    transition: background 0.25s var(--ease);
}

.stat:hover { background: var(--bg-elev); }

.stat b {
    display: block;
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--accent);
    line-height: 1.2;
}

.stat span {
    font-size: 0.82rem;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 600;
}

/* ---------- Section ---------- */
.section { padding: 56px 0; }

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 34px;
    flex-wrap: wrap;
}

.section-head h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    letter-spacing: -0.035em;
    font-weight: 800;
    line-height: 1.15;
}

.section-head p {
    color: var(--text-dim);
    font-size: 0.98rem;
    margin-top: 8px;
    max-width: 60ch;
}

.link-more {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.92rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.22s var(--ease);
    white-space: nowrap;
}

.link-more:hover { gap: 11px; }

/* ---------- Gallery ---------- */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.3s var(--ease);
    display: block;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.card-media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--bg-soft);
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s var(--ease);
}

.card:hover .card-media img { transform: scale(1.07); }

.card-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 12px;
    border-radius: 100px;
    background: rgba(10, 12, 18, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.13);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
}

.card-body { padding: 18px 20px 20px; }

.card-body h3 {
    font-size: 1.06rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 7px;
    line-height: 1.35;
}

.card-body p {
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.55;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
    font-size: 0.78rem;
    color: var(--text-mute);
    font-weight: 500;
}

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

/* ---------- Video grid ---------- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.video-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    border: 1px solid var(--border);
    aspect-ratio: 16 / 9;
    cursor: pointer;
    transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.video-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.1) 45%, transparent 70%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 18px;
    pointer-events: none;
}

.video-overlay h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.video-overlay p {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.72);
    margin-top: 3px;
}

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(255,255,255,0.16);
    backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255,255,255,0.4);
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.15rem;
    transition: all 0.3s var(--ease);
    pointer-events: none;
}

.video-card:hover .play-btn {
    background: var(--accent);
    border-color: var(--accent);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-card.playing .play-btn,
.video-card.playing .video-overlay { opacity: 0; }

/* ---------- Article ---------- */
.article-hero {
    padding: 48px 0 0;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    color: var(--text-mute);
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.breadcrumbs a { color: var(--text-dim); transition: color 0.2s; }
.breadcrumbs a:hover { color: var(--accent); }

.article-title {
    font-size: clamp(2rem, 4.4vw, 3.2rem);
    line-height: 1.1;
    letter-spacing: -0.04em;
    font-weight: 800;
    margin-bottom: 20px;
    max-width: 22ch;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 36px;
    font-size: 0.87rem;
    color: var(--text-mute);
}

.author {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dim);
    font-weight: 600;
}

.author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #ff5f6d);
    display: grid;
    place-items: center;
    font-size: 0.9rem;
    color: #fff;
    font-weight: 700;
}

.article-cover {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
}

.article-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 56px;
    align-items: start;
    padding-bottom: 64px;
}

.prose { font-size: 1.06rem; line-height: 1.78; color: var(--text-dim); }
.prose > * + * { margin-top: 1.35em; }
.prose h2 {
    font-size: 1.55rem;
    color: var(--text);
    letter-spacing: -0.03em;
    font-weight: 750;
    margin-top: 2em;
    line-height: 1.25;
}
.prose h3 {
    font-size: 1.2rem;
    color: var(--text);
    font-weight: 700;
    margin-top: 1.7em;
    letter-spacing: -0.02em;
}
.prose strong { color: var(--text); font-weight: 650; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.5em; }
.prose blockquote {
    border-left: 3px solid var(--accent);
    padding: 4px 0 4px 22px;
    font-style: italic;
    color: var(--text);
    font-size: 1.1rem;
}
.prose figure { margin: 2em 0; }
.prose figure img { border-radius: var(--radius-sm); width: 100%; }
.prose figcaption {
    font-size: 0.84rem;
    color: var(--text-mute);
    margin-top: 10px;
    text-align: center;
}
.prose code {
    background: var(--bg-soft);
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.9em;
    color: var(--accent-soft);
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.sidebar { position: sticky; top: 96px; display: grid; gap: 24px; }

.sidebar-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}

.sidebar-box h4 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-mute);
    font-weight: 700;
    margin-bottom: 16px;
}

.related-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    transition: opacity 0.2s;
}

.related-item:last-child { border-bottom: none; padding-bottom: 0; }
.related-item:hover { opacity: 0.75; }

.related-item img {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.related-item h5 {
    font-size: 0.87rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
}

.related-item span {
    font-size: 0.75rem;
    color: var(--text-mute);
    display: block;
    margin-top: 4px;
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
    padding: 6px 13px;
    border-radius: 100px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 500;
    transition: all 0.22s var(--ease);
}

.tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
    padding: 56px 0 32px;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 44px;
}

.footer-brand p {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-top: 14px;
    max-width: 34ch;
    line-height: 1.65;
}

.footer-col h5 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-mute);
    font-weight: 700;
    margin-bottom: 16px;
}

.footer-col a {
    display: block;
    color: var(--text-dim);
    font-size: 0.9rem;
    padding: 5px 0;
    transition: color 0.2s;
}

.footer-col a:hover { color: var(--accent); }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding-top: 26px;
    border-top: 1px solid var(--border);
    font-size: 0.84rem;
    color: var(--text-mute);
    flex-wrap: wrap;
}

.socials { display: flex; gap: 8px; }

.socials a {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    color: var(--text-dim);
    transition: all 0.22s var(--ease);
    font-size: 0.95rem;
}

.socials a:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
    transform: translateY(-2px);
}

/* ---------- Reveal animation ---------- */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .hero-grid { grid-template-columns: 1fr; gap: 36px; }
    .hero-media { aspect-ratio: 16 / 10; }
    .article-layout { grid-template-columns: 1fr; gap: 40px; }
    .sidebar { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
    .nav {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 2px;
        padding: 14px 18px 20px;
        background: var(--bg-soft);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-sm);
        transform: translateY(-12px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s;
        z-index: 99;
    }
    .nav.nav-open {
        transform: none;
        opacity: 1;
        visibility: visible;
    }
    .nav a { padding: 12px 14px; font-size: 1rem; }
    .burger { display: grid; }
    .header-inner { height: 64px; gap: 16px; }
    .hero { padding: 44px 0 36px; }
    .section { padding: 40px 0; }
    .gallery { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
    .video-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .article-title { max-width: none; }
    .wrap { padding: 0 18px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
}
