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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #f2e8d5;
    color: #2b2118;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    position: relative;
}

/* === GRAIN OVERLAY === */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    filter: url(#grain);
    opacity: 0.12;
}

/* === CONSTELLATION BACKGROUND === */
#constellation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* === NAVIGATION === */
#side-nav {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.nav-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: rgba(160, 139, 109, 0.4);
    transform: translateX(-50%);
    z-index: -1;
}

.nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #a08b6d;
    cursor: pointer;
    position: relative;
    transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-dot:hover {
    width: 10px;
    height: 10px;
}

.nav-dot.active {
    background: #c9a84c;
    width: 8px;
    height: 8px;
}

.nav-label {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.65rem, 1vw, 0.8rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #a08b6d;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.nav-dot:hover .nav-label {
    opacity: 1;
}

/* === PLATES (General) === */
.plate {
    position: relative;
    z-index: 1;
}

.content-plate {
    padding: clamp(12vh, 15vw, 20vh) 0;
}

/* === COVER PLATE === */
.cover-plate {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

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

.cover-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(4rem, 12vw, 10rem);
    letter-spacing: -0.04em;
    line-height: 0.92;
    color: #a0522d;
    opacity: 0;
    transform: scale(1.02);
    animation: developTitle 2s ease-out 1.2s forwards;
}

.cover-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.8rem, 1.5vw, 1.2rem);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6b5e52;
    opacity: 0;
    animation: developTitle 1.5s ease-out 3.2s forwards;
    margin-top: 1rem;
}

.north-star {
    position: absolute;
    bottom: 12vh;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: developTitle 1.5s ease-out 4s forwards;
    filter: drop-shadow(0 0 40px rgba(201, 168, 76, 0.15));
}

@keyframes developTitle {
    0% { opacity: 0; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1.0); }
}

/* === PLATE INNER LAYOUT === */
.plate-inner {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2vw;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4vw;
    position: relative;
}

.plate-left .plate-text {
    grid-column: 2 / 6;
}

.plate-left .plate-diagram {
    grid-column: 7 / 11;
}

.plate-right .plate-diagram {
    grid-column: 1 / 5;
}

.plate-right .plate-text {
    grid-column: 6 / 11;
}

.plate-center {
    display: flex;
    justify-content: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4vw;
    position: relative;
}

.plate-center .archive-content {
    grid-column: 4 / 9;
    max-width: 600px;
    width: 100%;
}

/* === CROSSHAIRS === */
.plate-crosshair {
    position: absolute;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    color: #a08b6d;
    opacity: 0.2;
    transition: opacity 0.3s ease;
    pointer-events: none;
    line-height: 1;
}

.plate-inner:hover .plate-crosshair {
    opacity: 0.6;
}

.plate-crosshair.tl { top: -20px; left: 0; }
.plate-crosshair.tr { top: -20px; right: 0; }
.plate-crosshair.bl { bottom: -20px; left: 0; }
.plate-crosshair.br { bottom: -20px; right: 0; }

/* === REGISTRATION RULES === */
.plate-inner::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 0.5px;
    background: rgba(160, 139, 109, 0.2);
}

.plate-inner::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 0.5px;
    background: rgba(160, 139, 109, 0.2);
}

/* === TYPOGRAPHY === */
.section-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: -0.04em;
    line-height: 0.92;
    color: #a0522d;
    margin-bottom: 2rem;
}

.section-body {
    color: #6b5e52;
    margin-bottom: 1.5rem;
}

/* === DIAGRAM === */
.plate-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
}

.plate-diagram svg {
    max-width: 100%;
    max-height: 400px;
}

/* === STAR DIVIDER === */
.star-divider {
    display: flex;
    justify-content: center;
    padding-top: clamp(6vh, 8vw, 10vh);
}

/* === ARCHIVE === */
.archive-heading {
    text-align: center;
    margin-bottom: 3rem;
}

.archive-entries {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.archive-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.25rem;
}

.archive-date {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.65rem, 1vw, 0.8rem);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #a08b6d;
}

.archive-desc {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.65rem, 1vw, 0.8rem);
    letter-spacing: 0.02em;
    color: #6b5e52;
    max-width: 480px;
}

.archive-star {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0;
}

/* === COLOPHON === */
.colophon-plate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: clamp(12vh, 15vw, 20vh);
}

.colophon-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.65rem, 1vw, 0.8rem);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #a08b6d;
    text-align: center;
}

.colophon-spacer {
    height: 30vh;
}

/* === BOUNCE-IN ANIMATION === */
@keyframes bounceIn {
    0% { opacity: 0; transform: translateY(60px); }
    60% { opacity: 1; transform: translateY(-8px); }
    80% { transform: translateY(3px); }
    100% { opacity: 1; transform: translateY(0); }
}

.bounce-item {
    opacity: 0;
    transform: translateY(60px);
}

.bounce-item.visible {
    animation: bounceIn 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .plate-left .plate-text,
    .plate-right .plate-text {
        grid-column: 1 / -1;
    }

    .plate-left .plate-diagram,
    .plate-right .plate-diagram {
        grid-column: 3 / 11;
        margin-top: 3rem;
    }

    .plate-inner {
        grid-template-columns: repeat(12, 1fr);
    }

    #side-nav {
        display: none;
    }

    .plate-crosshair {
        display: none;
    }
}
