/* public/css/main.css */

/* Убираем outline при клике, сохраняем для клавиатурной навигации */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
[tabindex]:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}



@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/Inter-Regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/Inter-Medium.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/Inter-SemiBold.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/Inter-Bold.woff2') format('woff2');
}

:root {
    --brand: #1a84d8;
    --brand-d: #1266b0;
    --brand-dd: #0d4f8a;
    --brand-l: #e8f3fc;
    --brand-ll: #f0f7fe
}

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

body {
    font-family: 'Inter', sans-serif;
    background: #f8fafc;
    color: #111827;
    -webkit-font-smoothing: antialiased
}

/* Pure CSS dot-matrix hero background via pseudo-element */
.hero-section {
    background: #F8FAFC;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(26, 132, 216, 0.045) 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    background-position: center;
    -webkit-mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 1) 35%, rgba(0, 0, 0, 0) 100%);
    mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 1) 35%, rgba(0, 0, 0, 0) 100%);
}

.hero-content {
    position: relative;
    z-index: 10;
}

@keyframes pulse-green {
    0%, 100% {
        opacity: 1;
        transform: scale(1)
    }
    50% {
        opacity: .4;
        transform: scale(1.6)
    }
}

@keyframes ping-green {
    0% {
        transform: scale(1);
        opacity: .8
    }
    100% {
        transform: scale(2.5);
        opacity: 0
    }
}

@keyframes bar-fill {
    from {
        width: 0
    }
    to {
        width: 45%
    }
}

@keyframes fadein {
    from {
        opacity: 0;
        transform: translateY(14px)
    }
    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes tab-in {
    from {
        opacity: 0;
        transform: translateY(8px)
    }
    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes wave {
    0%, 100% {
        transform: scaleY(.4)
    }
    50% {
        transform: scaleY(1)
    }
}

@keyframes shimmer {
    to {
        transform: translateX(100%)
    }
}

.pulse-green {
    animation: pulse-green 2s ease-in-out infinite
}

.ping-green {
    animation: ping-green 1.8s ease-out infinite
}

.bar-anim {
    animation: bar-fill 1.6s cubic-bezier(.4, 0, .2, 1) forwards
}

.fade-in {
    animation: fadein .7s ease both
}

.tab-content {
    display: none
}

.tab-content.active {
    display: block;
    animation: tab-in .28s ease both
}

.card-hover {
    transition: transform .2s ease, box-shadow .22s ease
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(26, 132, 216, .1)
}

.tag-blue {
    display: inline-block;
    background: var(--brand-l);
    color: var(--brand-d);
    font-size: .68rem;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 999px;
    letter-spacing: .04em
}

.tag-gray {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    font-size: .68rem;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 999px;
    letter-spacing: .04em
}

.tab-btn {
    padding: 9px 16px;
    font-size: .8rem;
    font-weight: 400;
    text-transform: uppercase;
    color: #6b7280;
    border-radius: 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap
}

.tab-btn:hover {
    color: #374151
}

.tab-btn.active {
    background: #fff;
    color: var(--brand);
    font-weight: 400;
    box-shadow: 0 1px 10px rgba(0, 0, 0, .09)
}

.btn-brand {
    background: var(--brand);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background .18s
}

.btn-brand:hover {
    background: var(--brand-d)
}

.btn-outline {
    background: #fff;
    color: #374151;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    transition: background .18s
}

.btn-outline:hover {
    background: #f8fafc
}

nav a {
    transition: color .15s
}

nav a:hover {
    color: var(--brand)
}

.bg-warm {
    border: 1px solid #e8ddd0;
    background: linear-gradient(145deg,#fdf6ee 0%,#fefcf7 40%,#fffdf9 100%)
}
.bg-cool {
    background: linear-gradient(135deg,#dcecfc 0%,var(--brand-ll) 50%,#ffffff 100%);
    border: 1px solid #c5dff5
}
.badge-green {
    color: #059669;
    border: 1px solid #a7f3d0;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(4px)
}
.tag-warm {
    display: inline-block;
    background: linear-gradient(145deg,#fdf6ee 0%,#fefcf7 40%,#fffdf9 100%);
    color: #9a7b5e;
    font-size: .68rem;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 999px;
    letter-spacing: .04em;
    border: 1px solid #e8ddd0
}
.btn-copy {
    transition: background .15s;
    cursor: pointer;
    border-radius: 8px
}

.btn-copy:hover {
    background: var(--brand-l)
}

.img-placeholder {
    background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 50%, #e2e8f0 100%);
    background-size: 200% 200%;
    position: relative;
    overflow: hidden
}

.img-placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .45) 50%, transparent 100%);
    transform: translateX(-100%);
    animation: shimmer 2.2s ease infinite
}

.wbar {
    width: 3px;
    background: var(--brand);
    border-radius: 2px;
    opacity: .7
}

.wbar:nth-child(1) {
    height: 6px;
    animation: wave 1.1s .0s ease-in-out infinite
}

.wbar:nth-child(2) {
    height: 14px;
    animation: wave 1.1s .1s ease-in-out infinite
}

.wbar:nth-child(3) {
    height: 10px;
    animation: wave 1.1s .2s ease-in-out infinite
}

.wbar:nth-child(4) {
    height: 18px;
    animation: wave 1.1s .3s ease-in-out infinite
}

.wbar:nth-child(5) {
    height: 8px;
    animation: wave 1.1s .4s ease-in-out infinite
}

.wbar:nth-child(6) {
    height: 16px;
    animation: wave 1.1s .15s ease-in-out infinite
}

.wbar:nth-child(7) {
    height: 6px;
    animation: wave 1.1s .25s ease-in-out infinite
}

.chat-user {
    border-radius: 18px 18px 18px 4px
}

.chat-admin {
    border-radius: 18px 18px 4px 18px
}

/* Brand utility classes (replacing inline styles) */
.text-brand { color:var(--brand) }
.text-brand-d { color:var(--brand-d) }
.text-brand-dd { color:var(--brand-dd) }
.bg-brand { background:var(--brand) }
.bg-brand-l { background:var(--brand-l) }
.border-brand { border-color:var(--brand) }
.shadow-brand { box-shadow:0 4px 12px rgba(26,132,216,.2) }
.opacity-65 { opacity:.65 }
.text-white { color:#fff }
.fw-500 { font-weight:500 }

/* Article body styles (moved from layout inline) */
.article-body p {
    margin-bottom: 1rem;
    line-height: 1.75;
    font-size: .95rem;
    color: #334155
}

.article-body ul, .article-body ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    line-height: 1.75;
    font-size: .95rem;
    color: #334155
}

.article-body ul {
    list-style: disc
}

.article-body ol {
    list-style: decimal
}

.article-body li {
    margin-bottom: .35rem
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: .75rem;
    margin: 1.5rem auto;
    display: block
}

.article-body h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.75rem 0 .75rem;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: .02em
}

.article-body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.5rem 0 .5rem;
    color: #1e293b
}

.article-body blockquote {
    border-left: 3px solid #cbd5e1;
    padding: .5rem 0 .5rem 1rem;
    margin: 1rem 0 1rem .5rem;
    color: #64748b;
    font-style: italic;
    background: #f8fafc;
    border-radius: 0 .5rem .5rem 0
}

.article-body a {
    color: #2563eb;
    text-decoration: underline
}

.article-body a:hover {
    color: #1d4ed8
}

.article-body iframe {
    max-width: 100%;
    border-radius: .75rem;
    margin: 1.5rem auto;
    display: block
}

.article-body pre {
    background: #f1f5f9;
    border-radius: .75rem;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
    font-size: .85rem;
    line-height: 1.5
}

.article-body code {
    background: #f1f5f9;
    padding: .15rem .4rem;
    border-radius: .35rem;
    font-size: .85rem
}

.article-body figure {
    margin: 1.5rem 0;
    text-align: center
}

.article-body figcaption {
    font-size: .8rem;
    color: #94a3b8;
    margin-top: .5rem
}

.comment-content a {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 500
}

.comment-content a:hover {
    color: #1d4ed8
}
