/* ============================================
   prototype.quest — Surreal Retro-Futuristic Sanctum
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Libre Baskerville', Georgia, serif;
    background-color: #F8F4EA;
    color: #3A3428;
    overflow-x: hidden;
    position: relative;
}

/* --- Blueprint Grid Background --- */
#blueprint-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(#B0A890 1px, transparent 1px),
        linear-gradient(90deg, #B0A890 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.03;
}

/* --- Central Vertical Rule --- */
#central-axis {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 100%;
    background-color: #B0A890;
    opacity: 0.15;
    z-index: 1;
    pointer-events: none;
}

/* --- Skeleton Loading Overlay --- */
#skeleton-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #F8F4EA;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 0 clamp(40px, 10vw, 160px);
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#skeleton-overlay.revealed {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.skeleton-block {
    background: linear-gradient(90deg, #E8E0D0 25%, #F0E8DA 50%, #E8E0D0 75%);
    background-size: 200% 100%;
    animation: unearth 2s infinite;
    border-radius: 2px;
    max-width: 660px;
    width: 100%;
}

.skeleton-title {
    height: 48px;
    width: 60%;
}

.skeleton-subtitle {
    height: 24px;
    width: 45%;
}

.skeleton-paragraph {
    height: 80px;
    width: 100%;
}

.skeleton-image {
    height: 200px;
    width: 80%;
}

.skeleton-paragraph-sm {
    height: 50px;
    width: 70%;
}

.skeleton-image-sm {
    height: 120px;
    width: 60%;
}

@keyframes unearth {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* --- Main Content --- */
#sanctum {
    position: relative;
    z-index: 2;
    opacity: 0;
    transition: opacity 1s ease 0.3s;
}

#sanctum.visible {
    opacity: 1;
}

/* --- Section Layout --- */
.section {
    padding: 0 clamp(40px, 10vw, 160px);
}

.section-inner {
    max-width: 660px;
    margin: 0 auto;
    padding: clamp(80px, 12vh, 140px) 0;
    text-align: center;
}

/* --- Hero Section --- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#hero .section-inner {
    padding: 0;
}

/* --- Typography --- */
.display-heading {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3rem);
    color: #1A1810;
    line-height: 1.25;
    margin-bottom: 1.2em;
    letter-spacing: 0.02em;
}

.heading-dot {
    color: #608888;
}

.hero-subtitle {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(0.95rem, 1.3vw, 1.15rem);
    color: #807050;
    line-height: 1.8;
    margin-bottom: 2em;
}

.hero-tagline {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    color: #3A3428;
    line-height: 1.9;
    opacity: 0.7;
}

.body-text {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.9;
    color: #3A3428;
    margin-bottom: 1.5em;
}

.blueprint-label {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: #807050;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 1.5em;
    opacity: 0.7;
}

.card-title {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.1rem, 1.6vw, 1.3rem);
    color: #1A1810;
    margin-bottom: 0.8em;
}

/* --- Divider --- */
.divider-line {
    width: 80px;
    height: 1px;
    background-color: #B0A890;
    margin: 0 auto 2em;
}

/* --- Archive Grid --- */
.archive-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(40px, 6vh, 70px);
    margin-top: 2.5em;
}

.archive-card {
    background-color: #FFF8EE;
    border: 1px solid #B0A890;
    border-radius: 2px;
    padding: 0;
    text-align: left;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.archive-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.archive-card:hover {
    border-color: #608888;
    box-shadow: 0 4px 20px rgba(26, 24, 16, 0.06);
}

.archive-card .blueprint-label {
    padding: 1.5em 1.8em 0;
    margin-bottom: 0.5em;
}

.archive-card .card-title {
    padding: 0 1.4em;
}

.archive-card .body-text {
    padding: 0 1.8em 1.8em;
    margin-bottom: 0;
}

.archive-image {
    width: 100%;
    overflow: hidden;
    border-bottom: 1px solid #C8B898;
}

.archive-image svg {
    width: 100%;
    height: auto;
    display: block;
    filter: sepia(0.4) contrast(1.05);
}

/* --- Process Steps --- */
.process-steps {
    margin-top: 2.5em;
    display: flex;
    flex-direction: column;
    gap: clamp(30px, 5vh, 50px);
}

.process-step {
    display: flex;
    align-items: flex-start;
    gap: 2em;
    text-align: left;
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.process-step.visible {
    opacity: 1;
    transform: translateY(0);
}

.step-number {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border: 1px solid #B0A890;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #FFF8EE;
    transition: border-color 0.4s ease;
}

.process-step:hover .step-number {
    border-color: #608888;
}

.step-number .blueprint-label {
    margin-bottom: 0;
    font-size: 1rem;
    opacity: 1;
}

.step-content {
    flex: 1;
}

.step-content .body-text {
    margin-bottom: 0;
}

/* --- Study Grid --- */
.study-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(25px, 4vh, 40px);
    margin-top: 2.5em;
}

.study-item {
    background-color: #FFF8EE;
    border: 1px solid #B0A890;
    border-radius: 2px;
    padding: 2em 1.5em;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.study-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.study-item:hover {
    border-color: #608888;
    box-shadow: 0 2px 12px rgba(26, 24, 16, 0.05);
}

.study-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.2em;
}

.study-icon svg {
    width: 100%;
    height: 100%;
}

.study-item .card-title {
    font-size: 1.05rem;
}

.study-item .body-text {
    font-size: 0.88rem;
    margin-bottom: 0;
}

/* --- Colophon --- */
#colophon .section-inner {
    padding-bottom: clamp(60px, 10vh, 100px);
}

.colophon-text {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    color: #3A3428;
    line-height: 1.8;
    margin-bottom: 0.5em;
}

.colophon-secondary {
    font-style: italic;
    color: #807050;
    font-size: 0.9rem;
    margin-bottom: 2em;
}

#colophon .divider-line {
    margin-bottom: 2.5em;
}

/* --- Reveal Animation Helpers --- */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

[data-reveal].visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .study-grid {
        grid-template-columns: 1fr;
    }

    .process-step {
        flex-direction: column;
        gap: 1em;
        align-items: center;
        text-align: center;
    }

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