/* ── GUI2 — scroll-first layout ──────────────────────── */

.background-scope {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    opacity: .38;
    pointer-events: none;
    z-index: 0;
}

/* Logo blinking cursor */
.logo-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1;
}
.logo-cursor {
    display: inline-block;
    width: 0.5em;
    height: 0.9em;
    background: var(--accent);
    vertical-align: middle;
    margin-left: 3px;
    animation: cur-blink 1s step-end infinite;
    box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent);
}
@keyframes cur-blink { 50% { opacity: 0; } }
.logo-sub {
    font-size: 0.56rem;
    color: var(--accent-2);
    letter-spacing: 0.05em;
    margin-top: 1px;
    opacity: 0.8;
}

/* ── CYBERPUNK BUTTONS ── */
.btn {
    background: transparent;
    color: var(--muted);
    border: 1px solid rgba(127,255,212,0.2);
    padding: 0.22rem 0.65rem;
    border-radius: 3px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    text-decoration: none;
    display: inline-block;
}
.btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(127,255,212,0.06);
}
.btn.small { padding: 0.18rem 0.55rem; font-size: 0.68rem; }
.btn.danger { border-color: rgba(255,77,109,0.35); color: var(--error); }
.btn.danger:hover { border-color: var(--error); background: rgba(255,77,109,0.06); }
.btn.ok { border-color: rgba(124,252,0,0.35); color: var(--ok); }
.btn.ok:hover { border-color: var(--ok); background: rgba(124,252,0,0.06); }

/* ── STICKY NAV ── */
.g2-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.45rem 1.25rem;
    background: rgba(6,9,15,0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(138,43,226,0.25);
}
.g2-nav-logo { flex-shrink: 0; }
.g2-nav-links {
    display: flex;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}
.g2-nav-links::-webkit-scrollbar { display: none; }
.g2-nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.78rem;
    padding: 0.3rem 0.75rem;
    border-right: 1px solid rgba(127,255,212,0.1);
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.g2-nav-links a:first-child { border-left: 1px solid rgba(127,255,212,0.1); }
.g2-nav-links a:hover { color: var(--accent); background: rgba(127,255,212,0.05); }
.g2-nav-links a.active { color: var(--accent); background: rgba(127,255,212,0.08); }
.g2-nav-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

/* Nav height offset */
:root { --nav-h: 52px; --banner-h: 40px; }

/* ── NEWS BANNER ── */
.news-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--banner-h);
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: var(--bg);
    overflow: hidden;
    z-index: 300;
    border-bottom: 1px solid rgba(0,0,0,0.2);
}
.news-content {
    height: 100%;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.news-items {
    display: flex;
    animation: scroll-news linear infinite;
    white-space: nowrap;
    will-change: transform;
}
.news-item {
    padding: 0 3rem;
    font-size: 0.85em;
    font-weight: 500;
}
.news-item a { color: inherit; text-decoration: none; }
.news-item a:hover { text-decoration: underline; }
@keyframes scroll-news {
    0%   { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
}

/* When banner is active: push nav down, add padding to content */
.news-banner-active .g2-nav { top: var(--banner-h); }
.news-banner-active #landing { padding-top: calc(var(--banner-h) + var(--nav-h)); }
.news-banner-active .g2-detail-back { padding-top: calc(var(--banner-h) + var(--nav-h) + 1.25rem); }

/* ── HERO ── */
.g2-hero {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(var(--nav-h) + 3rem) 1.25rem 3rem;
    position: relative;
    background:
        radial-gradient(900px 600px at 15% 30%, rgba(138,43,226,.13), transparent),
        radial-gradient(900px 600px at 85% 70%, rgba(127,255,212,.07), transparent);
}
.g2-hero-inner { max-width: 600px; width: 100%; }

.g2-id-card {
    background: rgba(11,17,25,0.65);
    border: 1px solid rgba(127,255,212,0.18);
    border-radius: 14px;
    padding: 1.75rem;
    backdrop-filter: blur(6px);
    box-shadow: 0 0 60px rgba(127,255,212,0.04), 0 0 120px rgba(138,43,226,0.05);
}

.g2-id-header { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1rem; }
.g2-avatar {
    width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent) 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: bold; color: var(--bg);
    box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 30%, transparent);
}
.g2-id-meta {}
.g2-id-name {
    font-size: 1.6rem; font-weight: bold; color: var(--accent);
    text-shadow: 0 0 16px color-mix(in srgb, var(--accent) 35%, transparent);
    line-height: 1;
}
.g2-id-handle { color: var(--accent-2); font-size: 0.78rem; margin-top: 0.3rem; }
.g2-id-handle a { color: inherit; text-decoration: none; }
.g2-id-handle a:hover { text-decoration: underline; }

.g2-id-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1rem; }
.g2-tag {
    font-size: 0.66rem; padding: 0.18rem 0.5rem; border-radius: 3px;
    border: 1px solid rgba(138,43,226,0.35);
    background: rgba(138,43,226,0.1); color: var(--text);
}
.g2-tag-primary {
    border-color: rgba(127,255,212,0.3);
    background: rgba(127,255,212,0.07); color: var(--accent);
}

.g2-id-bio {
    color: var(--muted); font-size: 0.85rem; line-height: 1.65;
    margin-bottom: 1.2rem;
    padding-left: 0.75rem;
    border-left: 2px solid rgba(138,43,226,0.35);
}

.g2-id-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.g2-id-link {
    font-size: 0.76rem; padding: 0.28rem 0.75rem;
    border: 1px solid rgba(127,255,212,0.28); border-radius: 4px;
    color: var(--accent); text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}
.g2-id-link:hover { background: rgba(127,255,212,0.09); }
.g2-id-link-sec { border-color: rgba(138,43,226,0.35); color: var(--text); }
.g2-id-link-sec:hover { background: rgba(138,43,226,0.1); }

.g2-scroll-hint {
    margin-top: 2rem;
    color: var(--muted); font-size: 1rem;
    animation: bounce-hint 2s ease-in-out infinite;
}
@keyframes bounce-hint {
    0%,100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(6px); opacity: 1; }
}

/* ── SECTIONS ── */
#landing { padding-top: var(--nav-h); }

.g2-section {
    border-top: 1px solid rgba(127,255,212,0.06);
    padding: 3.5rem 1.25rem;
}
.g2-section-inner { max-width: 1060px; margin: 0 auto; }

.g2-section-header {
    display: flex; align-items: baseline; gap: 1rem;
    margin-bottom: 1.75rem;
}
.g2-section-title {
    font-size: 1.2rem; color: var(--accent); font-weight: bold;
    text-shadow: 0 0 10px color-mix(in srgb, var(--accent) 20%, transparent);
}
.g2-section-title::before { content: "# "; color: rgba(127,255,212,0.3); }
.g2-section-more {
    margin-left: auto; font-size: 0.76rem;
    color: var(--accent-2); text-decoration: none;
}
.g2-section-more:hover { text-decoration: underline; }

/* Prose */
.g2-prose { color: var(--muted); font-size: 0.88rem; line-height: 1.8; max-width: 700px; }
.g2-prose p { margin-bottom: 0.75rem; }
.g2-prose a { color: var(--accent); }

/* Blog list */
.g2-blog-list { display: flex; flex-direction: column; gap: 0.35rem; }
.g2-blog-item {
    display: flex; align-items: baseline; gap: 1.25rem;
    padding: 0.55rem 0.7rem;
    border-left: 2px solid transparent;
    border-radius: 0 5px 5px 0;
    transition: border-left-color 0.2s, background 0.2s;
}
.g2-blog-item:hover { border-left-color: var(--accent-2); background: rgba(138,43,226,0.05); }
.g2-blog-link { color: var(--text); text-decoration: none; flex: 1; font-size: 0.88rem; }
.g2-blog-link:hover { color: var(--accent); }
.g2-blog-date { color: var(--muted); font-size: 0.76rem; white-space: nowrap; }

/* Card grid */
.g2-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.1rem;
}
.g2-card {
    background: rgba(11,17,25,0.45);
    border: 1px solid rgba(138,43,226,0.28);
    border-radius: 8px; padding: 1.2rem;
    text-decoration: none; display: block; color: inherit;
    transition: border-color 0.22s, background 0.22s, transform 0.22s;
}
.g2-card:hover {
    border-color: var(--accent);
    background: rgba(127,255,212,0.04);
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.28);
}
.g2-card-title { color: var(--accent); font-size: 0.95rem; margin-bottom: 0.45rem; font-weight: bold; }
.g2-card-desc { color: var(--muted); font-size: 0.78rem; line-height: 1.5; }
.g2-card-badge { margin-top: 0.7rem; font-size: 0.65rem; color: var(--accent-2); }

/* Docs grid */
.g2-docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.9rem;
}
.g2-docs-cat {
    background: rgba(11,17,25,0.45);
    border: 1px solid rgba(138,43,226,0.22);
    border-radius: 8px; padding: 0.9rem;
    display: flex; align-items: center; gap: 0.65rem;
    cursor: pointer; transition: border-color 0.2s, background 0.2s;
    text-decoration: none; color: inherit;
}
.g2-docs-cat:hover { border-color: var(--accent); background: rgba(127,255,212,0.04); }
.g2-docs-icon { font-size: 1.4rem; flex-shrink: 0; }
.g2-docs-cat-title { color: var(--accent); font-size: 0.84rem; font-weight: bold; }
.g2-docs-cat-count { color: var(--muted); font-size: 0.7rem; margin-top: 0.1rem; }

/* Loading spinner */
.loading {
    display: flex; justify-content: center; align-items: center;
    height: 120px;
}
.loading::after {
    content: "";
    width: 28px; height: 28px;
    border: 3px solid rgba(127,255,212,0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
.g2-footer {
    max-width: 1060px; margin: 0 auto;
    padding: 1.25rem 1.25rem 2rem;
    border-top: 1px solid rgba(127,255,212,0.07);
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.8rem; color: var(--muted);
}
.g2-footer a { color: var(--accent); text-decoration: none; }
.g2-footer a:hover { text-decoration: underline; }

/* ── DETAIL VIEW ── */
.g2-detail-back {
    max-width: 1060px; margin: 0 auto;
    padding: calc(var(--nav-h) + 1.25rem) 1.25rem 0.5rem;
}
#detailView #view {
    max-width: 1060px; margin: 0 auto;
    padding: 1rem 1.25rem 3rem;
}

/* Content animations */
@keyframes content-enter {
    from { opacity: 0; transform: translateY(16px) scale(0.97); filter: blur(3px); }
    to   { opacity: 1; transform: translateY(0)  scale(1);    filter: blur(0); }
}
@keyframes content-explode {
    0%   { opacity: 1; transform: scale(1)    translateY(0);    filter: blur(0); }
    60%  { opacity: 0; transform: scale(1.07) translateY(-5px); filter: blur(5px); }
    100% { opacity: 0; transform: scale(1.1)  translateY(-9px); filter: blur(9px); }
}
#view.content-enter   { animation: content-enter   0.35s cubic-bezier(0.22,1,0.36,1) both; }
#view.content-explode { animation: content-explode 0.22s ease-in forwards; }

/* Markdown content in detail view */
.markdown-content { width: min(100%, 1040px); margin: 0 auto; }
.markdown-content h1 { color: var(--heading-1, var(--accent)) !important; }
.markdown-content h2 { color: var(--heading-2, var(--accent-2)) !important; }
.markdown-content h3 { color: var(--heading-3, color-mix(in srgb, var(--accent) 65%, var(--text) 35%)) !important; }
.markdown-content strong { color: var(--bold, var(--accent)); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .g2-nav { gap: 0.75rem; padding: 0.4rem 0.75rem; }
    .g2-nav-logo .logo-sub { display: none; }
    .g2-id-card { padding: 1.25rem; }
    .g2-card-grid { grid-template-columns: 1fr; }
    .g2-docs-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .g2-footer { flex-direction: column; gap: 0.4rem; text-align: center; }
}

@media (max-width: 480px) {
    .g2-nav-actions .btn:not(.danger):last-child { display: none; }
    .g2-id-name { font-size: 1.3rem; }
    .g2-section { padding: 2.5rem 0.9rem; }
    .g2-blog-item { flex-direction: column; gap: 0.1rem; }
    .g2-blog-date { text-align: left; }
}
