/* sbom.wiki — Airy Minimalist Magazine Encyclopedia
   Typography: Inter 600/700, Fira Code 400 monospace
   (SPDX identifiers rendered in Fira Code
   Active section tracked via IntersectionObserver (Intersection Observer) */

/* =============================================
   RESET & BASE
   ============================================= */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #FFFFFF;
    color: #4B5563;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =============================================
   TYPOGRAPHY
   ============================================= */
h1, h2, h3, h4 {
    font-family: 'Inter', sans-serif;
    color: #1A1A2E;
    line-height: 1.3;
}

a {
    color: #22895E;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #1a6d4a;
}

/* =============================================
   HERO ZONE
   ============================================= */
.hero {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem 2.5rem;
    text-align: center;
}

.site-title {
    font-weight: 700;
    font-size: 2.2rem;
    color: #1A1A2E;
    letter-spacing: 0.12em;
    margin-bottom: 0.5rem;
}

.site-subtitle {
    font-size: 1rem;
    color: #4B5563;
    font-weight: 400;
    margin-bottom: 2rem;
}

/* Search Bar */
.search-bar {
    max-width: 580px;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    border: 1px solid #D1D5DB;
    border-radius: 24px;
    padding: 0.75rem 1.25rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    background: #FFFFFF;
}

.search-bar:focus-within {
    border-color: #22895E;
    box-shadow: 0 0 0 3px rgba(34, 137, 94, 0.2);
}

.search-icon {
    flex-shrink: 0;
    margin-right: 0.75rem;
    transition: stroke 0.2s ease;
}

.search-bar:focus-within .search-icon {
    stroke: #22895E;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    background: transparent;
    color: #1A1A2E;
}

.search-input::placeholder {
    color: #D1D5DB;
}

.search-kbd {
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    color: #D1D5DB;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.search-bar:focus-within .search-kbd {
    opacity: 1;
}

/* Category Navigation */
.cat-nav {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.cat-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: #4B5563;
    text-decoration: none;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.cat-link:hover,
.cat-link.active {
    color: #22895E;
    border-bottom-color: #22895E;
}

/* =============================================
   SECTIONS (SHARED)
   ============================================= */
.section-heading {
    font-weight: 700;
    font-size: 1.75rem;
    color: #1A1A2E;
    margin-bottom: 1.5rem;
}

/* =============================================
   FEATURED ENTRIES (BENTO)
   ============================================= */
.featured {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.bento-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.bento-large {
    grid-column: span 2;
    background: #F8FAF8;
    padding: 2rem;
    border-radius: 10px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.bento-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(26, 26, 46, 0.06);
}

.bento-small {
    background: #F8FAF8;
    padding: 1.5rem;
    border-radius: 10px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.bento-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(26, 26, 46, 0.06);
}

.cat-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #22895E;
    display: block;
    margin-bottom: 0.5rem;
}

.entry-title {
    font-weight: 600;
    font-size: 1rem;
    color: #1A1A2E;
    margin-bottom: 0.35rem;
    line-height: 1.4;
}

.bento-large .entry-title {
    font-size: 1.35rem;
}

.entry-excerpt {
    font-size: 0.92rem;
    color: #4B5563;
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.entry-excerpt-short {
    font-size: 0.85rem;
    color: #4B5563;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.entry-footer {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.entry-meta {
    font-size: 0.75rem;
    color: #4B5563;
    font-weight: 500;
}

.entry-date {
    font-size: 0.75rem;
    color: #D1D5DB;
}

/* =============================================
   STANDARDS COMPARISON
   ============================================= */
.comparison {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.comparison-intro {
    font-size: 0.95rem;
    color: #4B5563;
    margin-bottom: 2rem;
    max-width: 600px;
}

.comparison-layout {
    display: flex;
    gap: 0;
    border: 1px solid #D1D5DB;
    border-radius: 10px;
    overflow: hidden;
    background: #FFFFFF;
}

.comparison-col {
    flex: 1;
    padding: 2rem;
}

.comparison-divider {
    width: 1px;
    background: #D1D5DB;
    flex-shrink: 0;
}

.standard-name {
    font-weight: 700;
    font-size: 1.3rem;
    color: #1A1A2E;
    margin-bottom: 0.25rem;
}

.standard-version {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: #22895E;
    display: inline-block;
    background: #E6F4ED;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.standard-desc {
    font-size: 0.85rem;
    color: #4B5563;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.field-list {
    list-style: none;
    margin-bottom: 1.25rem;
}

.field-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid #D1D5DB;
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.field-list li:last-child {
    border-bottom: none;
}

.field-code {
    font-family: 'Fira Code', monospace;
    font-size: 0.82rem;
    color: #1A1A2E;
    white-space: nowrap;
}

.field-desc {
    font-size: 0.75rem;
    color: #4B5563;
}

.spec-link {
    font-size: 0.85rem;
    color: #22895E;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.spec-link:hover {
    color: #1a6d4a;
}

/* =============================================
   ARTICLE PREVIEW
   ============================================= */
.article-preview {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
    border-top: 1px solid #D1D5DB;
}

.breadcrumbs {
    font-size: 0.8rem;
    color: #4B5563;
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
}

.article-layout {
    display: flex;
    gap: 3rem;
}

.article-main {
    flex: 1;
    min-width: 0;
}

.article-title {
    font-weight: 700;
    font-size: 1.75rem;
    color: #1A1A2E;
    margin-bottom: 1.25rem;
    position: relative;
}

.heading-anchor {
    color: #22895E;
    text-decoration: none;
    font-weight: 400;
    font-size: 0.85em;
    opacity: 0;
    margin-right: 0.35rem;
    transition: opacity 0.2s ease;
    position: absolute;
    left: -1.5rem;
}

.article-title:hover .heading-anchor,
.article-subheading:hover .heading-anchor {
    opacity: 1;
}

.edit-link {
    font-size: 0.8rem;
    color: #DC7633;
    text-decoration: none;
    font-weight: 400;
    vertical-align: middle;
    margin-left: 0.5rem;
    transition: color 0.2s ease;
}

.edit-link:hover {
    color: #c06520;
}

.article-body {
    font-size: 1rem;
    color: #4B5563;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.article-subheading {
    font-weight: 600;
    font-size: 1.2rem;
    color: #1A1A2E;
    margin-bottom: 0.75rem;
    margin-top: 2rem;
    position: relative;
}

/* Callout Block */
.callout-block {
    border-left: 4px solid #22895E;
    background: #E6F4ED;
    padding: 1.25rem 1.5rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: 1.5rem;
}

.callout-text {
    font-size: 0.9rem;
    color: #4B5563;
    line-height: 1.7;
}

/* Code Block */
.code-block {
    background: #1A1A2E;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.code-header {
    padding: 0.5rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-lang {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: #4B5563;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.code-content {
    font-family: 'Fira Code', monospace;
    font-size: 0.82rem;
    color: #E6F4ED;
    padding: 1.25rem;
    line-height: 1.7;
    overflow-x: auto;
}

/* TOC Sidebar */
.toc-sidebar {
    min-width: 170px;
    max-width: 170px;
    position: sticky;
    top: 2rem;
    align-self: flex-start;
}

.toc-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1A1A2E;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.toc-item {
    display: block;
    font-size: 0.82rem;
    color: #4B5563;
    text-decoration: none;
    padding: 0.35rem 0.75rem;
    border-left: 3px solid transparent;
    margin-bottom: 0.15rem;
    transition: border-color 0.2s ease, color 0.2s ease, font-weight 0.15s ease;
}

.toc-item:hover {
    color: #1A1A2E;
}

.toc-item.active {
    border-left-color: #22895E;
    font-weight: 600;
    color: #1A1A2E;
}

/* =============================================
   CONTRIBUTE CTA
   ============================================= */
.contribute {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.contribute-inner {
    background: #F8FAF8;
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
}

.contribute-heading {
    font-weight: 700;
    font-size: 1.5rem;
    color: #1A1A2E;
    margin-bottom: 0.75rem;
}

.contribute-text {
    font-size: 0.95rem;
    color: #4B5563;
    max-width: 500px;
    margin: 0 auto 1.75rem;
    line-height: 1.7;
}

.contribute-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.contribute-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.7rem 1.75rem;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.contribute-btn.primary {
    background: #22895E;
    color: #FFFFFF;
}

.contribute-btn.primary:hover {
    background: #1a6d4a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 137, 94, 0.25);
    color: #FFFFFF;
}

.contribute-btn.secondary {
    background: #FFFFFF;
    color: #1A1A2E;
    border: 1px solid #D1D5DB;
}

.contribute-btn.secondary:hover {
    background: #F8FAF8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 26, 46, 0.06);
    color: #1A1A2E;
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
    max-width: 800px;
    margin: 0 auto;
    padding: 2.5rem 2rem 3rem;
    border-top: 1px solid #D1D5DB;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-heading {
    font-weight: 600;
    font-size: 0.8rem;
    color: #1A1A2E;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.footer-link {
    display: block;
    font-size: 0.8rem;
    color: #4B5563;
    text-decoration: none;
    margin-bottom: 0.35rem;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #22895E;
}

.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid #D1D5DB;
    text-align: center;
}

.footer-license {
    font-size: 0.75rem;
    color: #D1D5DB;
}

/* =============================================
   ANIMATIONS
   ============================================= */
.fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.fade-in:nth-child(2) { transition-delay: 0.08s; }
.fade-in:nth-child(3) { transition-delay: 0.16s; }
.fade-in:nth-child(4) { transition-delay: 0.24s; }
.fade-in:nth-child(5) { transition-delay: 0.32s; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 640px) {
    .hero {
        padding: 3rem 1.25rem 2rem;
    }

    .site-title {
        font-size: 1.6rem;
    }

    .cat-nav {
        gap: 1.25rem;
    }

    .featured,
    .comparison,
    .article-preview,
    .contribute,
    .footer {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .bento-grid {
        grid-template-columns: 1fr;
    }

    .bento-large {
        grid-column: span 1;
    }

    .comparison-layout {
        flex-direction: column;
    }

    .comparison-divider {
        width: 100%;
        height: 1px;
    }

    .article-layout {
        flex-direction: column;
    }

    .toc-sidebar {
        position: static;
        max-width: 100%;
        min-width: 0;
        border-left: none;
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 1rem 0;
        border-top: 1px solid #D1D5DB;
        order: -1;
        margin-bottom: 1.5rem;
    }

    .toc-sidebar .toc-title {
        width: 100%;
    }

    .toc-item {
        border-left: none;
        border-bottom: 2px solid transparent;
        padding: 0.25rem 0.5rem;
    }

    .toc-item.active {
        border-left: none;
        border-bottom-color: #22895E;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .contribute-inner {
        padding: 2rem 1.5rem;
    }

    .heading-anchor {
        position: static;
        opacity: 0.5;
    }

    .section-heading {
        font-size: 1.4rem;
    }
}
