/* ============================================================
   EdvardCode — formain.css (v2.1, полная версия)
   ============================================================ */

/* ===== HERO ===== */
.hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: center;
    padding: 24px 0 56px;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 14px;
    background: var(--surface);
}
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 10px #22c55e;
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot { 50% { opacity: 0.35; } }

#welcome {
    font-size: clamp(2.1rem, 4.5vw, 3.5rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin: 22px 0 18px;
}
#welcome .accent { color: var(--primary); }
#welcome .marker { position: relative; white-space: nowrap; z-index: 0; }
#welcome .marker::after {
    content: '';
    position: absolute;
    left: -2px; right: -2px; bottom: 4px;
    height: 0.32em;
    background: var(--primary-soft);
    border-radius: 4px;
    z-index: -1;
}

#description {
    color: var(--text-dim);
    max-width: 46ch;
    line-height: 1.7;
    font-size: 1.02rem;
}

.hero-actions { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.btn-primary, .btn-ghost {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    padding: 13px 24px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 8px 24px rgba(255, 7, 58, 0.25);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(255, 7, 58, 0.4);
}
.btn-ghost {
    color: var(--text);
    border: 1px solid var(--border);
    background: transparent;
}
.btn-ghost:hover {
    border-color: var(--primary-border);
    color: var(--primary);
    transform: translateY(-2px);
}

/* ===== ОКНО КОДА ===== */
.code-window {
    background: #0d0d11;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: rotate(1.5deg);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.code-window:hover { transform: rotate(0deg) translateY(-4px); }
.code-window__bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot--r { background: #ff5f57; }
.dot--y { background: #febc2e; }
.dot--g { background: #28c840; }
.code-window__title {
    margin-left: 10px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
}
.code-window__body {
    padding: 20px 18px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.9;
    overflow-x: auto;
    counter-reset: line;
    color: #c9d1d9;
}
.code-window__body .line { display: block; padding-left: 3.4em; position: relative; }
.code-window__body .line::before {
    counter-increment: line;
    content: counter(line);
    position: absolute;
    left: 0;
    width: 2.2em;
    text-align: right;
    color: #3f3f46;
}
.tok-kw  { color: #ff5c7a; }
.tok-str { color: #9ece6a; }
.tok-fn  { color: #7aa2f7; }
.tok-num { color: #bb9af7; }
.tok-var { color: #e2e8f0; }
.tok-com { color: #565f89; font-style: italic; }

/* ===== БЕГУЩАЯ СТРОКА ===== */
.ticker {
    overflow: hidden;
    border-block: 1px solid var(--border);
    padding: 14px 0;
    margin: 0 0 60px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker__track { display: flex; width: max-content; animation: ticker 30s linear infinite; }
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__group { display: flex; gap: 28px; padding-right: 28px; align-items: center; }
.ticker span {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
    color: var(--text-dim);
    white-space: nowrap;
}
.ticker i { color: var(--primary); font-style: normal; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ===== СЕКЦИИ ===== */
.section { margin-top: 56px; }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.section-head h2 { font-size: clamp(1.4rem, 2.5vw, 1.9rem); letter-spacing: -0.01em; }
.mono-hash {
    font-family: var(--font-mono);
    color: var(--primary);
    font-weight: 400;
    margin-right: 6px;
}
.section-note { font-size: 0.75rem; color: #52525b; }
.link-arrow {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.3s;
}
.link-arrow span { display: inline-block; transition: transform 0.3s; }
.link-arrow:hover { color: var(--primary); }
.link-arrow:hover span { transform: translateX(5px); }

/* ===== НОВОСТИ ===== */
.news-feed { display: grid; gap: 12px; }
.news-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-dim);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 30px;
}
.spinner {
    width: 14px; height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.live-dot {
    width: 8px; height: 8px;
    background: var(--primary);
    border-radius: 50%;
    display: inline-block;
    margin-left: 10px;
    box-shadow: 0 0 8px var(--primary);
    animation: pulse-dot 1.6s infinite;
    vertical-align: middle;
}
.news-card {
    position: relative;
    max-height: 300px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
}
.news-date {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 700;
}
.news-content { font-size: 0.95rem; line-height: 1.6; color: #d4d4d8; }
.news-fade {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(to top, rgba(9, 9, 11, 0.95), transparent);
    pointer-events: none;
}
.news-empty {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-dim);
    padding: 24px;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
}

/* ===== BENTO-СЕТКА ===== */
.bento {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.bento-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.35s, background 0.35s;
}
.bento-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.35s;
    background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%),
                rgba(255, 7, 58, 0.14), transparent 65%);
}
.bento-card:hover::before { opacity: 1; }
.bento-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-border);
    background: rgba(255, 255, 255, 0.055);
}
.span-2x2 { grid-column: span 2; grid-row: span 2; padding: 28px; }
.span-2x1 { grid-column: span 2; }
.span-2x2::after {
    content: '';
    position: absolute;
    right: -50px; bottom: -50px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(255, 7, 58, 0.16), transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.bento-top { display: flex; justify-content: space-between; align-items: center; }
.bento-icon {
    width: 44px; height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}
/* ⚠️ ГЛАВНОЕ: ограничиваем размер иконок */
.bento-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}
.bento-card:hover .bento-icon {
    border-color: var(--primary-border);
    transform: scale(1.07) rotate(-4deg);
}
.bento-tag {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-dim);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: 6px;
}
.bento-status {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 400;
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.08);
    padding: 3px 8px;
    border-radius: 99px;
    vertical-align: middle;
    white-space: nowrap;
}
.bento-card h3 { font-size: 1.02rem; margin-top: 6px; }
.span-2x2 h3 { font-size: 1.5rem; }
.bento-card p {
    color: var(--text-dim);
    font-size: 0.88rem;
    line-height: 1.55;
    flex-grow: 1;
}
.bento-arrow {
    align-self: flex-end;
    font-family: var(--font-mono);
    color: var(--primary);
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.3s;
}
.bento-card:hover .bento-arrow { opacity: 1; transform: none; }

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1024px) {
    .hero { grid-template-columns: 1fr; gap: 36px; }
    .code-window { max-width: 600px; transform: none; }
    .bento { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .bento { grid-template-columns: 1fr; }
    .span-2x2, .span-2x1 { grid-column: auto; grid-row: auto; }
    .hero { padding-bottom: 40px; }
}