/* sbom.study — Herbarium Archive Styles */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'EB Garamond', serif;
    background-color: #f5ede0;
    color: #7a6a52;
    overflow-x: hidden;
    filter: sepia(0.08);
}

/* Grain overlay */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Progress thread */
.progress-thread {
    position: fixed;
    left: 30px;
    top: 0;
    height: 100vh;
    width: 2px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.progress-line {
    position: absolute;
    top: 10%;
    bottom: 10%;
    width: 1px;
    background: #c4a880;
    opacity: 0.5;
}

.progress-marker {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid #7a6a52;
    background: #f5ede0;
    position: absolute;
    transition: background 0.5s ease, transform 0.3s ease;
}

.progress-marker[data-chamber="1"] { top: 10%; }
.progress-marker[data-chamber="2"] { top: 30%; }
.progress-marker[data-chamber="3"] { top: 50%; }
.progress-marker[data-chamber="4"] { top: 70%; }
.progress-marker[data-chamber="5"] { top: 90%; }

.progress-marker.active {
    background: #c4622d;
    transform: scale(1.4);
}

/* Chambers */
.chamber {
    min-height: 100vh;
    display: flex;
    position: relative;
    padding: 80px 120px 80px 80px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.chamber.visible {
    opacity: 1;
    transform: translateY(0);
}

.chamber-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 800px;
    margin-left: 60px;
}

/* Marginalia */
.marginalia {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 140px;
}

.margin-note {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 0.85rem;
    color: #8a7a6a;
    line-height: 1.5;
    opacity: 0.7;
}

/* Chamber I: Title */
.chamber-1 {
    align-items: center;
    text-align: center;
}

.chamber-1 .chamber-content {
    align-items: center;
    margin-left: 0;
}

.title-ornament {
    margin-bottom: 2rem;
}

.title-ornament.bottom {
    margin-top: 2.5rem;
    margin-bottom: 0;
}

.botanical-rule {
    width: 200px;
    height: 60px;
}

.leaf-cluster {
    width: 120px;
    height: 40px;
}

.main-title {
    font-family: 'EB Garamond', serif;
    font-weight: 700;
    font-size: clamp(2.2rem, 5vw, 4.8rem);
    letter-spacing: 0.03em;
    line-height: 1.2;
    color: #7a6a52;
}

.title-line {
    display: block;
}

.subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: #8a7a6a;
    margin-top: 1.5rem;
    line-height: 1.6;
}

.title-meta {
    margin-top: 2rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #c4a880;
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Section headings */
.section-heading {
    font-family: 'EB Garamond', serif;
    font-weight: 500;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    letter-spacing: 0.03em;
    margin-bottom: 2.5rem;
    color: #7a6a52;
}

.heading-text {
    position: relative;
    display: inline-block;
}

.heading-text::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: #c4622d;
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.chamber.visible .heading-text::after {
    width: 100%;
}

/* Specimen cards */
.specimen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
}

.specimen-card {
    position: relative;
    background: #f0e6d4;
    padding: 2rem;
    border: 1px solid #d4c4a8;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.specimen-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(122, 106, 82, 0.12);
}

.card-border {
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border: 1px solid #c4a880;
    pointer-events: none;
    opacity: 0.5;
}

.specimen-name {
    font-family: 'EB Garamond', serif;
    font-weight: 500;
    font-size: 1.3rem;
    color: #7a6a52;
    margin-bottom: 1rem;
}

.specimen-body {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #8a7a6a;
}

.card-stamp {
    position: absolute;
    bottom: 10px;
    right: 14px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: #c4a880;
    opacity: 0.6;
}

/* Chamber III: Dependency Tree */
.tree-container {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.dependency-tree {
    width: 100%;
    height: auto;
}

.tree-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    fill: #7a6a52;
}

.tree-label.small {
    font-size: 10px;
    fill: #8a7a6a;
}

.tree-label.tiny {
    font-size: 9px;
    fill: #c4a880;
}

.tree-node {
    transition: transform 0.3s ease;
}

.tree-branch {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1.5s ease;
}

.chamber-3.visible .tree-branch {
    stroke-dashoffset: 0;
}

.tree-caption {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1rem;
    color: #8a7a6a;
    text-align: center;
    margin-top: 2rem;
}

/* Chamber IV: Vulnerability Ledger */
.ledger {
    width: 100%;
    border-top: 1px solid #d4c4a8;
}

.ledger-row {
    display: grid;
    grid-template-columns: 1.5fr 0.8fr 1.5fr 0.8fr;
    padding: 1rem 0;
    border-bottom: 1px solid #e0d0b8;
    align-items: center;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.chamber-4.visible .ledger-row {
    opacity: 1;
    transform: translateX(0);
}

.chamber-4.visible .ledger-row:nth-child(1) { transition-delay: 0.1s; }
.chamber-4.visible .ledger-row:nth-child(2) { transition-delay: 0.25s; }
.chamber-4.visible .ledger-row:nth-child(3) { transition-delay: 0.4s; }
.chamber-4.visible .ledger-row:nth-child(4) { transition-delay: 0.55s; }

.ledger-id {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    color: #7a6a52;
}

.ledger-severity {
    font-family: 'EB Garamond', serif;
    font-size: 0.9rem;
    font-weight: 500;
}

.ledger-severity.critical { color: #c4622d; }
.ledger-severity.high { color: #b8533a; }
.ledger-severity.medium { color: #c4a880; }
.ledger-severity.low { color: #8a7a6a; }

.ledger-component {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: #8a7a6a;
}

.ledger-status {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 0.9rem;
    color: #7a6a52;
}

.ledger-note {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1rem;
    color: #8a7a6a;
    margin-top: 2rem;
}

/* Chamber V: Colophon */
.chamber-5 {
    text-align: center;
}

.chamber-5 .chamber-content {
    align-items: center;
    margin-left: 0;
}

.colophon-content {
    max-width: 560px;
}

.colophon-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #7a6a52;
    margin-bottom: 1.5rem;
}

.colophon-sigil {
    margin: 2.5rem 0;
}

.sigil-svg {
    width: 80px;
    height: 80px;
    animation: sigil-rotate 20s linear infinite;
}

@keyframes sigil-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.colophon-domain {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #c4a880;
}

/* Responsive */
@media (max-width: 768px) {
    .chamber {
        padding: 60px 30px 60px 50px;
    }

    .chamber-content {
        margin-left: 20px;
    }

    .marginalia {
        display: none;
    }

    .progress-thread {
        left: 15px;
    }

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

    .ledger-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
}
