/* =====================================================
   LUNGLESS.DEV - LIGHT-ACADEMIA OBSERVATORY
   ===================================================== */

:root {
    --color-darkest: #3A2A1A;
    --color-gold: #B89A5A;
    --color-bronze: #8A6A4A;
    --color-rust: #C47A3A;
    --color-black: #2A1A0A;
    --color-cream: #E8D8C0;
    --color-parchment: #F8F0E4;
    --color-tan: #8A7A5A;
    --color-brown: #5A4A3A;
    --color-starburst: #D8C090;

    --font-serif: 'Spectral', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Courier Prime', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-serif);
    background-color: var(--color-parchment);
    color: var(--color-darkest);
    line-height: 1.7;
    font-size: 16px;
}

main {
    width: 100%;
}

/* =====================================================
   SECTION BASE STYLES
   ===================================================== */

.section {
    width: 100%;
    padding: 60px 5%;
    position: relative;
}

.foyer {
    background-color: var(--color-parchment);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.archive {
    background-color: #FCFAF6;
    padding: 80px 5% 60px;
}

.collection {
    background-color: var(--color-parchment);
    padding: 80px 5%;
}

.library {
    background-color: var(--color-darkest);
    color: var(--color-cream);
    padding: 80px 5%;
}

/* =====================================================
   SECTION 1: FOYER
   ===================================================== */

.foyer-container {
    max-width: 90vw;
    margin: 0 auto;
    padding-top: 30vh;
    text-align: center;
}

.domain-name {
    margin-bottom: 40px;
}

.title {
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 300;
    font-family: var(--font-serif);
    letter-spacing: 0.05em;
    line-height: 1.1;
    margin: 0;
}

.letter {
    display: inline-block;
    opacity: 0;
    animation: fadeInLetter 0.6s ease-out forwards;
}

.letter:nth-child(1) { animation-delay: 0.1s; }
.letter:nth-child(2) { animation-delay: 0.15s; }
.letter:nth-child(3) { animation-delay: 0.2s; }
.letter:nth-child(4) { animation-delay: 0.25s; }
.letter:nth-child(5) { animation-delay: 0.3s; }
.letter:nth-child(6) { animation-delay: 0.35s; }
.letter:nth-child(7) { animation-delay: 0.4s; }
.letter:nth-child(8) { animation-delay: 0.45s; }
.letter:nth-child(9) { animation-delay: 0.5s; }
.letter:nth-child(10) { animation-delay: 0.55s; }
.letter:nth-child(11) { animation-delay: 0.6s; }
.letter:nth-child(12) { animation-delay: 0.65s; }

@keyframes fadeInLetter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.foyer-subtext {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--color-bronze);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    animation: fadeInSubtext 1s ease-out 0.8s both;
}

.foyer-subtext p {
    margin: 0;
}

@keyframes fadeInSubtext {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* =====================================================
   SECTION 2: ARCHIVE
   ===================================================== */

.archive-header {
    margin-bottom: 60px;
}

.archive-header h2 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    line-height: 1.2;
}

.section-subhead {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--color-bronze);
    font-weight: 400;
    letter-spacing: 0.1em;
}

.archive-content {
    max-width: 1400px;
    margin: 0 auto;
}

.content-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
    margin-bottom: 80px;
    animation: slideInContent 0.8s ease-out;
}

.content-block.reversed {
    direction: rtl;
}

.content-block.reversed > * {
    direction: ltr;
}

@keyframes slideInContent {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.text-portion {
    padding-right: 40px;
}

.content-block.reversed .text-portion {
    padding-right: 0;
    padding-left: 40px;
}

.text-portion h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--color-darkest);
}

.text-portion p {
    margin-bottom: 18px;
    font-size: 1.05rem;
    color: var(--color-darkest);
}

.text-portion p:last-child {
    margin-bottom: 0;
}

.imagery-portion {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.celestial-diagram {
    width: 100%;
    max-width: 300px;
    height: auto;
    animation: celestialFloat 6s ease-in-out infinite;
    --star-color: #D8C090;
}

@keyframes celestialFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

/* =====================================================
   SECTION 3: COLLECTION
   ===================================================== */

.collection-header {
    text-align: center;
    margin-bottom: 60px;
}

.collection-header h2 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.specimen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.specimen-card {
    background-color: #FEFCF8;
    padding: 40px 30px;
    border-left: 4px solid var(--color-rust);
    transition: all 0.4s ease;
    animation: cardReveal 0.6s ease-out;
}

.specimen-card:nth-child(1) { animation-delay: 0.1s; }
.specimen-card:nth-child(2) { animation-delay: 0.2s; }
.specimen-card:nth-child(3) { animation-delay: 0.3s; }
.specimen-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes cardReveal {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.specimen-card:hover {
    transform: translateY(-5px);
    background-color: #FFFAF5;
}

.specimen-card h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-darkest);
}

.specimen-detail {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-bronze);
    margin-bottom: 16px;
    font-weight: 400;
}

.specimen-card p:not(.specimen-detail) {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-brown);
}

/* =====================================================
   SECTION 4: LIBRARY
   ===================================================== */

.library-container {
    max-width: 1100px;
    margin: 0 auto;
}

.library-container h2 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 50px;
    text-align: center;
}

.library-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
    align-items: start;
}

.library-text p {
    font-size: 1.05rem;
    margin-bottom: 24px;
    line-height: 1.8;
    color: var(--color-cream);
}

.library-closing {
    font-style: italic;
    color: var(--color-gold);
}

.library-metadata {
    background-color: rgba(184, 154, 90, 0.1);
    padding: 30px;
    border-left: 3px solid var(--color-gold);
    font-family: var(--font-mono);
}

.metadata-label {
    font-size: 0.8rem;
    color: var(--color-gold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 20px;
    margin-bottom: 5px;
    font-weight: 700;
}

.metadata-label:first-of-type {
    margin-top: 0;
}

.metadata-value {
    font-size: 1rem;
    color: var(--color-cream);
    margin-bottom: 15px;
    font-weight: 400;
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */

@media (max-width: 1024px) {
    .content-block {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .text-portion {
        padding-right: 0;
    }

    .content-block.reversed .text-portion {
        padding-left: 0;
    }

    .library-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 40px 4%;
    }

    .foyer {
        min-height: 80vh;
    }

    .foyer-container {
        padding-top: 20vh;
    }

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

    .archive-header h2,
    .collection-header h2,
    .library-container h2 {
        font-size: 1.8rem;
    }

    .archive-content {
        padding: 0;
    }

    .text-portion h3 {
        font-size: 1.4rem;
    }

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

    .specimen-card {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }

    .section {
        padding: 30px 3%;
    }

    .title {
        font-size: clamp(1.5rem, 7vw, 2.5rem);
    }

    .foyer-subtext {
        font-size: 0.95rem;
    }

    .archive-header h2,
    .collection-header h2,
    .library-container h2 {
        font-size: 1.4rem;
        margin-bottom: 30px;
    }

    .archive-header {
        margin-bottom: 40px;
    }

    .section-subhead {
        font-size: 0.85rem;
    }

    .content-block {
        margin-bottom: 50px;
    }

    .text-portion {
        padding-right: 0;
    }

    .text-portion h3 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }

    .text-portion p {
        font-size: 0.95rem;
        margin-bottom: 14px;
    }

    .specimen-grid {
        gap: 20px;
    }

    .specimen-card {
        padding: 20px 15px;
    }

    .specimen-card h3 {
        font-size: 1.1rem;
    }

    .library-content {
        gap: 30px;
    }

    .library-text p {
        font-size: 0.95rem;
        margin-bottom: 18px;
    }

    .library-metadata {
        padding: 20px;
    }

    .metadata-label {
        font-size: 0.75rem;
        margin-top: 15px;
    }

    .metadata-value {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }
}

/* =====================================================
   PRINT STYLES
   ===================================================== */

@media print {
    body {
        background-color: white;
    }

    .section {
        page-break-inside: avoid;
    }

    a {
        text-decoration: none;
    }
}
