:root {
    --color-black: #0A0A0A;
    --color-near-black: #0F0D0B;
    --color-pure-black: #050505;
    --color-gold: #C5A55A;
    --color-gold-light: #D4B978;
    --color-gold-dark: #8B7340;
    --color-cream: #F5ECD7;
    --color-stone: #7A7368;

    --font-display: 'Cormorant Garamond', serif;
    --font-reading: 'Crimson Pro', serif;
    --font-system: 'Inter', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-reading);
    background: var(--color-black);
    color: var(--color-cream);
    line-height: 1.8;
    overflow-x: hidden;
}

/* Opening Rule Animation */
.opening-rule {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 1px;
    background: var(--color-gold);
    z-index: 1000;
    pointer-events: none;
    animation: ruleExpand 2s cubic-bezier(0.23, 1, 0.32, 1) 0.5s forwards;
    opacity: 0;
}

@keyframes ruleExpand {
    0% { width: 0; opacity: 0; }
    20% { opacity: 1; }
    100% { width: 200px; opacity: 0; }
}

/* Scroll-to-top Seal Button */
.seal-button {
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.5s ease;
    padding: 0;
}

.seal-button.is-visible {
    opacity: 1;
}

.seal-btn-svg {
    width: 48px;
    height: 48px;
    transition: transform 0.3s ease;
}

.seal-button:hover .seal-btn-svg {
    transform: scale(1.1);
}

/* Document */
.document {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Chambers */
.chamber {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6rem 0;
}

.chamber--threshold {
    min-height: 100vh;
    align-items: center;
    text-align: center;
}

.chamber__content {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s cubic-bezier(0.23, 1, 0.32, 1);
}

.chamber__content.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.chamber__number {
    display: block;
    font-family: var(--font-system);
    font-weight: 300;
    font-size: 0.65rem;
    letter-spacing: 0.4em;
    color: var(--color-stone);
    margin-bottom: 1.5rem;
}

.chamber__title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.5rem, 3.5vw, 3rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-cream);
    margin-bottom: 2rem;
}

.chamber__text {
    font-family: var(--font-reading);
    font-weight: 300;
    font-size: 1.05rem;
    line-height: 2;
    color: var(--color-cream);
    opacity: 0.85;
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.chamber__quote {
    font-family: var(--font-reading);
    font-weight: 300;
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--color-gold-light);
    padding-left: 1.5rem;
    border-left: 1px solid var(--color-gold-dark);
    margin-top: 2rem;
}

/* Brass Rules */
.brass-rule {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
    margin: 3rem 0;
    transform: scaleX(0);
    transition: transform 1.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.brass-rule.is-drawn {
    transform: scaleX(1);
}

.brass-rule--hero {
    margin: 0 0 3rem;
}

.brass-rule--thin {
    max-width: 120px;
    background: var(--color-gold-dark);
    margin: 2rem 0;
}

/* Hero */
.hero-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.4rem, 6vw, 5rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-cream);
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-family: var(--font-reading);
    font-weight: 300;
    font-style: italic;
    font-size: clamp(0.9rem, 1.5vw, 1.15rem);
    color: var(--color-stone);
    letter-spacing: 0.05em;
}

/* Motifs */
.seal-motif, .triangle-motif, .concentric-motif {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.seal-svg {
    width: 120px;
    height: 120px;
    animation: sealRotate 120s linear infinite;
}

.triangle-svg {
    width: 60px;
    height: 52px;
}

.concentric-svg {
    width: 80px;
    height: 80px;
    animation: sealRotate 90s linear infinite reverse;
}

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

/* Evidence Panel */
.evidence-panel {
    border: 1px solid rgba(197, 165, 90, 0.15);
    padding: 0;
}

.evidence-item {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(197, 165, 90, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.evidence-item:last-child {
    border-bottom: none;
}

.evidence-label {
    font-family: var(--font-system);
    font-weight: 400;
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--color-gold);
}

.evidence-desc {
    font-family: var(--font-reading);
    font-weight: 300;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--color-stone);
}

/* Archive Grid */
.archive-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    border: 1px solid rgba(197, 165, 90, 0.12);
}

.archive-volume {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-right: 1px solid rgba(197, 165, 90, 0.08);
    border-bottom: 1px solid rgba(197, 165, 90, 0.08);
    transition: background 0.4s ease;
}

.archive-volume:hover {
    background: rgba(197, 165, 90, 0.03);
}

.archive-volume:nth-child(2n) {
    border-right: none;
}

.archive-volume:nth-child(n+3) {
    border-bottom: none;
}

.volume-number {
    font-family: var(--font-system);
    font-size: 0.6rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--color-gold);
}

.volume-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-cream);
    letter-spacing: 0.04em;
}

.volume-year {
    font-family: var(--font-system);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: var(--color-stone);
}

/* Verdict */
.chamber--verdict {
    text-align: center;
    align-items: center;
}

.verdict-seal {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.verdict-svg {
    width: 120px;
    height: 120px;
    animation: sealRotate 120s linear infinite;
}

.colophon {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 1rem;
    margin-top: 3rem;
}

.colophon__domain {
    font-family: var(--font-system);
    font-size: 0.6rem;
    letter-spacing: 0.35em;
    color: var(--color-stone);
}

.colophon__separator {
    color: var(--color-gold-dark);
}

.colophon__year {
    font-family: var(--font-system);
    font-size: 0.6rem;
    letter-spacing: 0.25em;
    color: var(--color-gold-dark);
}

/* Responsive */
@media (max-width: 768px) {
    .document {
        padding: 0 1.5rem;
    }

    .chamber {
        padding: 4rem 0;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 3.5rem);
    }

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

    .archive-volume {
        border-right: none;
        border-bottom: 1px solid rgba(197, 165, 90, 0.08);
    }

    .archive-volume:last-child {
        border-bottom: none;
    }
}

@media (max-width: 480px) {
    .chamber {
        padding: 3rem 0;
        min-height: auto;
    }

    .chamber__title {
        font-size: clamp(1.2rem, 5vw, 2rem);
    }

    .chamber__text {
        font-size: 0.95rem;
    }

    .evidence-item {
        padding: 1rem;
    }

    .archive-volume {
        padding: 1.25rem;
    }
}
