/* namu.quest - Crystalline Botanical Encyclopedia */
/* Colors: #5B1A2A Deep Burgundy, #FBF7F2 Vellum, #F0E8E4 Parchment Dust, #C8A84E Gilt, #E8C4C8 Crystal Rose, #1A1218 Obsidian, #4A8B7F Verdigris */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    color: #1A1218;
    background-color: #FBF7F2;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ===== Plate General ===== */
.plate {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 5rem 2rem;
}

.plate-number {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #C8A84E;
    margin-bottom: 2rem;
}

.section-title {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: #5B1A2A;
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
}

.section-body {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-size: clamp(1.05rem, 1.5vw, 1.2rem);
    color: #1A1218;
    line-height: 1.85;
    max-width: 650px;
    margin-bottom: 3rem;
    opacity: 0.85;
}

/* ===== Frontispiece ===== */
#frontispiece {
    background: linear-gradient(135deg, #FBF7F2 0%, #F0E8E4 50%, #FBF7F2 100%);
    border-bottom: 1px solid rgba(200, 168, 78, 0.2);
}

.frontispiece-layout {
    display: flex;
    align-items: center;
    gap: 4rem;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
}

.specimen-main {
    flex-shrink: 0;
    width: 280px;
}

.crystal-tree {
    width: 100%;
    height: auto;
}

.tree-path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: drawPath 2s ease forwards;
}

.tree-path:nth-child(n+5) { animation-delay: 0.3s; }
.tree-path:nth-child(n+8) { animation-delay: 0.6s; }
.tree-path:nth-child(n+11) { animation-delay: 0.9s; }
.tree-path:nth-child(n+14) { animation-delay: 1.2s; }
.tree-path:nth-child(n+17) { animation-delay: 1.5s; }

@keyframes drawPath {
    to { stroke-dashoffset: 0; }
}

.frontispiece-text {
    max-width: 400px;
}

.quest-title {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: #5B1A2A;
    line-height: 1.1;
    margin-bottom: 0.8rem;
}

.quest-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.3rem);
    color: #4A8B7F;
    margin-bottom: 2rem;
}

.specimen-tag {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1rem;
    border: 1px solid rgba(200, 168, 78, 0.3);
    background: rgba(251, 247, 242, 0.8);
}

.tag-label {
    font-family: 'Fira Code', monospace;
    font-weight: 500;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: #C8A84E;
}

.tag-value {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 0.95rem;
    color: #5B1A2A;
}

/* ===== Taxonomy ===== */
#taxonomy {
    background: #FBF7F2;
}

.flow-content {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.specimen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.specimen-plate {
    background: rgba(240, 232, 228, 0.5);
    border: 1px solid rgba(91, 26, 42, 0.1);
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.specimen-plate:hover {
    transform: rotate(0deg) !important;
    box-shadow: 0 8px 32px rgba(26, 18, 24, 0.08);
}

.specimen-plate svg {
    width: 120px;
    height: 160px;
    margin: 0 auto 1rem;
    display: block;
}

.plate-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.species-name {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 1.1rem;
    color: #5B1A2A;
}

.species-data {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 0.65rem;
    color: #4A8B7F;
    letter-spacing: 0.05em;
}

/* ===== Crystal Garden ===== */
#garden {
    background: linear-gradient(180deg, #FBF7F2 0%, #F0E8E4 100%);
}

.garden-content {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.garden-display {
    position: relative;
    height: 300px;
    margin-top: 1rem;
}

.garden-ambient {
    position: relative;
    width: 100%;
    height: 100%;
}

.prism {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    transition: opacity 1s ease;
}

.prism-1 {
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 25px solid rgba(200, 168, 78, 0.2);
    top: 20%;
    left: 10%;
}

.prism-2 {
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 35px solid rgba(232, 196, 200, 0.25);
    top: 40%;
    left: 30%;
}

.prism-3 {
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 20px solid rgba(74, 139, 127, 0.2);
    top: 15%;
    left: 55%;
}

.prism-4 {
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-bottom: 30px solid rgba(200, 168, 78, 0.15);
    top: 55%;
    left: 50%;
}

.prism-5 {
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 18px solid rgba(232, 196, 200, 0.2);
    top: 30%;
    left: 75%;
}

.prism-6 {
    border-left: 22px solid transparent;
    border-right: 22px solid transparent;
    border-bottom: 38px solid rgba(74, 139, 127, 0.15);
    top: 60%;
    left: 80%;
}

.prism-7 {
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-bottom: 24px solid rgba(200, 168, 78, 0.2);
    top: 70%;
    left: 20%;
}

.prism.visible {
    opacity: 1;
}

/* ===== Research Log ===== */
#log {
    background: #FBF7F2;
}

.log-content {
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}

.log-entries {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.log-entry {
    padding-left: 2rem;
    border-left: 2px solid rgba(200, 168, 78, 0.4);
}

.log-date {
    font-family: 'Fira Code', monospace;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #C8A84E;
    display: block;
    margin-bottom: 0.5rem;
}

.log-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-size: 1.05rem;
    color: #1A1218;
    line-height: 1.8;
    opacity: 0.85;
}

/* ===== Footer ===== */
#colophon {
    background: #1A1218;
    padding: 4rem 2rem;
    text-align: center;
}

.footer-inner {
    max-width: 600px;
    margin: 0 auto;
}

.gilt-line {
    width: 60px;
    height: 2px;
    background: #C8A84E;
    margin: 0 auto 2rem;
}

.footer-domain {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: #E8C4C8;
    margin-bottom: 0.3rem;
}

.footer-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 0.9rem;
    color: #C8A84E;
    opacity: 0.6;
    margin-bottom: 2rem;
}

.plate-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.plate-link {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: #F0E8E4;
    text-decoration: none;
    opacity: 0.5;
    transition: opacity 0.3s ease, color 0.3s ease;
}

.plate-link:hover {
    opacity: 1;
    color: #C8A84E;
}

/* ===== Scroll Reveal ===== */
.flow-content,
.garden-content,
.log-content,
.frontispiece-layout {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.flow-content.revealed,
.garden-content.revealed,
.log-content.revealed,
.frontispiece-layout.revealed {
    opacity: 1;
    transform: translateY(0);
}

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

    .frontispiece-layout {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .specimen-main {
        width: 200px;
    }

    .specimen-grid {
        grid-template-columns: 1fr;
        max-width: 300px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .quest-title {
        font-size: clamp(2rem, 10vw, 3rem);
    }
}
