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

:root {
    --parchment: #f2f0eb;
    --carbon: #2b2b2b;
    --red: #e63946;
    --blue: #1982c4;
    --gold: #f5a623;
    --gray: #8a8580;
    --obsidian: #1a1a1e;
    --chalk: #c4c0b8;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--parchment);
    color: var(--carbon);
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.72;
    -webkit-font-smoothing: antialiased;
}

/* === BACKGROUND GRID PATTERN === */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        repeating-linear-gradient(to right, rgba(43,43,43,0.08) 0px, rgba(43,43,43,0.08) 1px, transparent 1px, transparent 60px),
        repeating-linear-gradient(to bottom, rgba(43,43,43,0.08) 0px, rgba(43,43,43,0.08) 1px, transparent 1px, transparent 60px);
}

/* === CHAMBER DIVIDERS === */
.chamber-divider {
    border: none;
    height: 4px;
    background-color: var(--carbon);
    margin: 0;
}

.chamber-divider--light {
    background-color: var(--chalk);
}

/* === REGISTRATION MARKS === */
.registration-mark {
    position: absolute;
    z-index: 2;
}
.mark-tl { top: 20px; left: 20px; }
.mark-tr { top: 20px; right: 20px; }
.mark-bl { bottom: 20px; left: 20px; }
.mark-br { bottom: 20px; right: 20px; }

/* === CHAMBER 0 — INSCRIPTION WALL === */
.inscription-wall {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--parchment);
    z-index: 1;
}

.inscription-content {
    text-align: center;
    z-index: 1;
}

.site-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(4rem, 12vw, 10rem);
    letter-spacing: -0.02em;
    color: var(--carbon);
    line-height: 1;
    cursor: default;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.site-title:hover {
    transform: scale(1.08);
}

.site-epigraph {
    font-family: 'Source Serif 4', Georgia, serif;
    font-style: italic;
    font-size: 1.25rem;
    color: var(--gray);
    margin-top: 1.5rem;
}

/* === CHAMBER 1 — CLASSIFICATION HALL === */
.classification-hall {
    position: relative;
    background-color: var(--parchment);
    padding: 80px 24px;
    min-height: 80vh;
    z-index: 1;
}

.chamber-column {
    max-width: 720px;
    margin: 0 auto;
}

.classification-hall .chamber-column {
    border-left: 6px solid var(--red);
    padding-left: 32px;
}

.section-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 4vw, 3rem);
    letter-spacing: -0.02em;
    color: var(--carbon);
    margin-bottom: 48px;
}

.taxonomy-list {
    display: flex;
    flex-direction: column;
}

.taxonomy-entry {
    padding: 24px 0;
    border-bottom: 1px dashed var(--chalk);
    transform: scale(0.96);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
}

.taxonomy-entry.visible {
    transform: scale(1);
    opacity: 1;
}

.taxonomy-entry:last-child {
    border-bottom: none;
}

.entry-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 8px;
}

.entry-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.taxonomy-icon {
    flex-shrink: 0;
}

.entry-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--carbon);
    margin-bottom: 4px;
}

.entry-desc {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1rem;
    color: var(--carbon);
    line-height: 1.65;
}

/* === CHAMBER 2 — DIAGRAM FLOOR === */
.diagram-floor {
    position: relative;
    height: 100vh;
    background-color: var(--obsidian);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 3px,
        rgba(242, 240, 235, 0.03) 3px,
        rgba(242, 240, 235, 0.03) 4px
    );
    animation: scanline-drift 20s linear infinite;
}

@keyframes scanline-drift {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100px); }
}

.diagram-container {
    max-width: 900px;
    max-height: 70vh;
    width: 90%;
    z-index: 1;
}

#hero-journey-diagram {
    width: 100%;
    height: auto;
}

.diagram-path {
    stroke-dasharray: 2500;
    stroke-dashoffset: 2500;
    transition: stroke-dashoffset 2.5s ease-in-out;
}

.diagram-path.animated {
    stroke-dashoffset: 0;
}

.secondary-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
}

.secondary-path.animated {
    stroke-dashoffset: 0;
    transition-delay: 0.5s;
}

.diagram-node {
    transition: opacity 0.6s ease;
}

.diagram-node.animated {
    opacity: 1;
}

.data-node {
    transition: opacity 0.8s ease;
}

.data-node.animated {
    opacity: 0.5;
}

.diagram-label {
    font-family: 'Space Mono', monospace;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 1s ease;
}

.diagram-label.animated {
    opacity: 1;
}

/* === CHAMBER 3 — ARCHIVE STACKS === */
.archive-stacks {
    position: relative;
    background-color: var(--parchment);
    padding: 80px 24px;
    z-index: 1;
}

.archive-entry {
    margin-bottom: 48px;
}

.archive-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--carbon);
    margin-bottom: 12px;
    display: inline;
    background-image: linear-gradient(var(--gold), var(--gold));
    background-size: 0% 2px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.4s ease;
    padding-bottom: 2px;
}

.archive-heading:hover {
    background-size: 100% 2px;
}

.archive-text {
    margin-top: 12px;
    font-size: 1.1rem;
    line-height: 1.72;
}

.pull-quote-block {
    margin: 48px 0;
}

.annotation-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 12px;
}

.pull-quote-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bracket {
    flex-shrink: 0;
}

.pull-quote {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--blue);
    line-height: 1.3;
}

/* === CHAMBER 4 — COLOPHON === */
.colophon {
    position: relative;
    background-color: var(--carbon);
    color: var(--parchment);
    padding: 80px 24px;
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.colophon-content {
    text-align: center;
}

.colophon-domain {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    color: var(--parchment);
    letter-spacing: 0.05em;
    margin-bottom: 20px;
}

.ornamental-rule {
    display: block;
    margin: 0 auto 20px;
}

.colophon-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--chalk);
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    .classification-hall .chamber-column {
        padding-left: 16px;
        border-left-width: 4px;
    }

    .entry-row {
        gap: 12px;
    }

    .taxonomy-icon {
        width: 36px;
        height: 36px;
    }
}
