/* archetypos.dev - Greek Philosophical Codex */

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

body {
    background-color: #0E0E12;
    color: #E8E4DC;
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.85;
    overflow-x: hidden;
}

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

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #8A8690;
    animation: starPulse 6s ease-in-out infinite;
}

.star:nth-child(odd) { animation-delay: -3s; }
.star:nth-child(3n) { animation-delay: -1.5s; }

@keyframes starPulse {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.2; }
}

#constellation-lines {
    position: absolute;
    top: 0;
    left: 0;
}

/* Peristyle Column */
#peristyle-column {
    position: fixed;
    left: 38.2%;
    top: 0;
    height: 100%;
    display: flex;
    gap: 3px;
    z-index: 1;
    pointer-events: none;
}

.flute {
    width: 1px;
    height: 100%;
    background: #3A3A45;
}

.flute:nth-child(1) { opacity: 0.15; }
.flute:nth-child(2) { opacity: 0.25; }
.flute:nth-child(3) { opacity: 0.4; }
.flute:nth-child(4) { opacity: 0.25; }
.flute:nth-child(5) { opacity: 0.15; }

/* Pronaos */
#pronaos {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding: 0 60px;
    z-index: 2;
}

.stylobate {
    position: absolute;
    top: 61.8%;
    left: 60px;
    right: 60px;
    height: 1px;
    background: #3A3A45;
    opacity: 0;
}

.stylobate.drawn {
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.pronaos-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: 0.15em;
    color: #E8E4DC;
    position: absolute;
    top: calc(61.8% - 80px);
    left: 38.2%;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.pronaos-title.visible {
    opacity: 1;
}

.pronaos-greek {
    font-family: 'Noto Serif', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 1.1rem;
    color: #7B3F7D;
    position: absolute;
    top: calc(61.8% + 16px);
    left: 38.2%;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 1s ease, transform 1s ease;
}

.pronaos-greek.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Content Islands */
#content {
    position: relative;
    z-index: 2;
    padding: 0 60px;
}

.content-island {
    max-width: 560px;
    margin-left: 38.2%;
    margin-bottom: 0;
    padding: clamp(120px, 20vh, 240px) 0;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    position: relative;
}

.content-island.visible {
    opacity: 1;
}

.section-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: 0.15em;
    color: #E8E4DC;
    margin-bottom: 24px;
}

.content-island p {
    margin-bottom: 1.3em;
}

.content-island em {
    font-style: italic;
}

/* Greek Terms */
.greek-term {
    font-family: 'Noto Serif', serif;
    font-style: italic;
    color: #7B3F7D;
}

/* Etymology Annotations */
.etymology {
    margin-top: 24px;
    position: relative;
    padding-left: 40px;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.etymology:hover {
    opacity: 1;
}

.etymology-line {
    position: absolute;
    left: 0;
    top: 50%;
    width: 30px;
    height: 1px;
    border-top: 1px dashed #3A3A45;
}

.etymology-text {
    font-family: 'Noto Serif', serif;
    font-style: italic;
    font-size: 0.9rem;
    color: #C4A33A;
}

/* Annotation Code */
.annotation-code {
    margin-top: 16px;
}

.annotation-code code {
    font-family: 'Source Code Pro', monospace;
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: #4A8C72;
}

/* Meander Border */
.meander-border {
    position: absolute;
    top: 0;
    left: -20px;
    width: calc(100% + 40px);
    height: 20px;
    overflow: hidden;
}

.meander-svg {
    width: 100%;
    height: 100%;
}

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

.content-island.visible .meander-path {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 3s ease;
}

/* Golden Spirals */
.spiral-container {
    display: flex;
    justify-content: center;
    padding: clamp(60px, 10vh, 120px) 0;
    margin-left: 38.2%;
    max-width: 560px;
}

.spiral-path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
}

.spiral-container.in-view .spiral-path {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 4s ease-in-out;
}

/* Entablature Footer */
#entablature {
    margin-top: clamp(120px, 20vh, 240px);
    padding: 0 60px;
    position: relative;
    z-index: 2;
}

.architrave {
    height: 1px;
    background: #3A3A45;
    opacity: 0.3;
    margin-bottom: 16px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
}

.footer-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: 1.2rem;
    letter-spacing: 0.15em;
    color: #8A8690;
}

.footer-annotation {
    font-family: 'Noto Serif', serif;
    font-style: italic;
    font-size: 0.85rem;
    color: #8A8690;
    opacity: 0.5;
}

.cornice {
    height: 1px;
    background: #3A3A45;
    opacity: 0.3;
    margin-top: 16px;
    margin-bottom: 80px;
}

/* Deep void sections */
.content-island + .spiral-container {
    background: #080810;
    margin-left: 0;
    max-width: 100%;
    padding-left: calc(38.2% + 60px);
}

/* Responsive */
@media (max-width: 900px) {
    .content-island {
        margin-left: 60px;
    }
    .pronaos-title,
    .pronaos-greek {
        left: 60px;
    }
    #peristyle-column {
        left: 40px;
    }
    .spiral-container {
        margin-left: 60px;
    }
}

@media (max-width: 600px) {
    body {
        padding: 0;
    }
    #pronaos,
    #content,
    #entablature {
        padding: 0 24px;
    }
    .content-island {
        margin-left: 0;
    }
    .pronaos-title,
    .pronaos-greek {
        left: 24px;
    }
    #peristyle-column {
        display: none;
    }
    .spiral-container {
        margin-left: 0;
        padding-left: 0 !important;
    }
}
