/* CometSpec custom styles */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');

.sidebar-brand-text,
.sidebar-brand > .sidebar-brand-text,
a.sidebar-brand .sidebar-brand-text {
    font-family: 'Bebas Neue', sans-serif !important;
    letter-spacing: 3px;
    font-size: 2.4rem !important;
}

/* Remove underline from links in body content (keep on hover for affordance) */
article a,
article a:visited {
    text-decoration: none;
}
article a:hover {
    text-decoration: underline;
}

/* Mirror left-sidebar hover effect on the right "On this page" TOC */
.toc-tree {
    /* Extend the .toc-tree box leftward via negative margin while keeping
       its content visually in place via matching padding. The hover shadow
       (-100vw on the link) is then clipped here, so it stops a little
       short of the column's left vertical separator. Tweak the value to
       move closer to or further from the line. */

    overflow: hidden;
}
.toc-tree a {
    display: block;
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.toc-tree a:hover {
    background: var(--color-sidebar-item-background--hover);
    color: var(--color-sidebar-link-text--hover);
    text-decoration: none;
    /* -100vw guarantees the colored area reaches the column's left edge
       regardless of viewport width; the parent's overflow:hidden clips it
       cleanly at the vertical separator. */
    box-shadow: -100vw 0 0 0 var(--color-sidebar-item-background--hover);
}

/* Comet animation — nucleus above "spectra", tail to top-left */
.hero-comet {
    position: absolute;
    top: 52%;
    left: 85%;
    width: 160%;
    transform: translate(-50%, -50%) rotate(45deg);
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
}

/* Keep all hero text above the comet */
.hero-section h1,
.hero-section .hero-tagline,
.hero-section .hero-badges {
    position: relative;
    z-index: 2;
}

/* Hero section styling */
.hero-section {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #0D1117 0%, #1B2838 40%, #1a2744 70%, #0D1117 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 30% 70%, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 50% 10%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 70% 50%, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 90% 80%, rgba(255,255,255,0.5), transparent),
        radial-gradient(2px 2px at 20% 60%, rgba(200,220,255,0.7), transparent),
        radial-gradient(1px 1px at 80% 30%, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 60% 90%, rgba(255,255,255,0.3), transparent),
        radial-gradient(1.5px 1.5px at 40% 40%, rgba(180,210,255,0.6), transparent),
        radial-gradient(1px 1px at 15% 85%, rgba(255,255,255,0.4), transparent);
    pointer-events: none;
}

.hero-section h1 {
    font-family: 'Bebas Neue', sans-serif !important;
    color: #C9D1D9 !important;
    font-size: 5rem !important;
    margin-bottom: 0.3rem !important;
    font-weight: 700 !important;
    letter-spacing: 2px;
    border: none !important;
}

.hero-section .hero-tagline {
    color: #8B949E;
    font-size: 1.15rem;
    margin-bottom: 1.2rem;
    font-style: italic;
}

.hero-section .hero-badges {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.hero-section .hero-badges a {
    text-decoration: none;
}

/* Feature cards */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.feature-card {
    padding: 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--color-background-border, #e0e0e0);
    background: var(--color-background-secondary, #f8f9fa);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.feature-card .feature-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.feature-card h3 {
    margin: 0 0 0.4rem !important;
    font-size: 1rem !important;
}

.feature-card p {
    margin: 0 !important;
    font-size: 0.9rem;
    color: var(--color-foreground-secondary, #666);
}

/* Code block enhancements */
div.highlight pre {
    border-radius: 8px;
    padding: 1rem;
}

/* Admonition styling */
.admonition {
    border-radius: 8px !important;
    border-left-width: 4px !important;
}

/* Sidebar refinements */
.sidebar-brand {
    font-weight: 700;
}

/* API docs styling */
dl.py dt {
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}
dl.py > dt:hover {
    background: var(--color-api-background-hover);
}

/* Responsive tweaks */
@media (max-width: 600px) {
    .hero-section h1 {
        font-size: 2rem !important;
    }
    .feature-grid {
        grid-template-columns: 1fr;
    }
}
