/* ==========================================================================
   ARCHETYPOS.DEV — Styles
   Gold-black-luxury palette, F-pattern layout, crystalline motifs
   ========================================================================== */

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

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: #0A0A0A;
    color: #C8BFA0;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 1.05rem;
    line-height: 1.75;
    letter-spacing: 0.02em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    border-color: #000000;
}

/* ---------- Navigation Rail ---------- */
.nav-rail {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    z-index: 100;
    padding: 20px 0;
}

.nav-line {
    position: absolute;
    left: 50%;
    top: 15%;
    bottom: 15%;
    width: 1px;
    background-color: #D4A843;
    opacity: 0.2;
    transform: translateX(-50%);
}

.nav-diamond {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    text-decoration: none;
    transition: opacity 0.6s ease;
}

.nav-diamond svg polygon {
    fill: none;
    stroke: #D4A843;
    stroke-width: 1.5;
    transition: fill 0.6s ease, stroke 0.6s ease;
}

.nav-diamond.active svg polygon {
    fill: #D4A843;
    stroke: #FFFFFF;
}

.nav-diamond:hover svg polygon {
    stroke: #E8D5A3;
}

.nav-diamond.active:hover svg polygon {
    fill: #E8D5A3;
    stroke: #E8D5A3;
}

/* ---------- Main Dossier Container ---------- */
.dossier {
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
}

/* ---------- Dossier Page (Section) ---------- */
.dossier-page {
    position: relative;
    width: 100%;
    min-height: 100vh;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0;
    overflow: hidden;
    background-color: #0A0A0A;
}

/* ---------- Background Section Number ---------- */
.section-bg-number {
    position: absolute;
    top: 50%;
    right: 8%;
    transform: translateY(-50%);
    font-family: 'Share Tech Mono', monospace;
    font-size: 15vw;
    font-weight: 400;
    color: #D4A843;
    opacity: 0.04;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

/* ---------- Crystal Constellations (Background) ---------- */
.crystal-constellation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.constellation-svg {
    position: absolute;
    opacity: 0.07;
    will-change: transform;
    animation: constellationRotate 60s linear infinite;
}

.crystal-constellation-1 .constellation-svg {
    width: 500px;
    height: 500px;
    top: 10%;
    right: -5%;
}

.crystal-constellation-2 .constellation-svg {
    width: 550px;
    height: 550px;
    top: 5%;
    right: -8%;
}

.crystal-constellation-3 .constellation-svg {
    width: 480px;
    height: 480px;
    top: 15%;
    right: -3%;
}

.crystal-constellation-4 .constellation-svg {
    width: 520px;
    height: 520px;
    top: 8%;
    right: -6%;
}

.crystal-constellation-5 .constellation-svg {
    width: 500px;
    height: 500px;
    top: 12%;
    right: -4%;
}

.crystal-constellation-6 .constellation-svg {
    width: 540px;
    height: 540px;
    top: 6%;
    right: -7%;
}

@keyframes constellationRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ---------- Hero Crystals (Right Margin) ---------- */
.hero-crystal {
    position: absolute;
    z-index: 1;
    pointer-events: none;
    will-change: transform;
    animation: heroRotate 45s linear infinite;
}

.hero-crystal svg {
    width: 100%;
    height: 100%;
    animation: crystalPulse 8s ease-in-out infinite;
}

.hero-crystal-1 { width: 280px; height: 280px; top: 20%; right: 8%; }
.hero-crystal-2 { width: 260px; height: 260px; top: 25%; right: 6%; }
.hero-crystal-3 { width: 300px; height: 300px; top: 18%; right: 10%; }
.hero-crystal-4 { width: 250px; height: 250px; top: 22%; right: 7%; }
.hero-crystal-5 { width: 270px; height: 270px; top: 20%; right: 9%; }
.hero-crystal-6 { width: 290px; height: 290px; top: 15%; right: 8%; }

@keyframes heroRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes crystalPulse {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.25; }
}

/* ---------- Section Content (F-Pattern Layout) ---------- */
.section-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
    margin-left: calc(48px + 8%);
    padding: 6vh 0 4vh 0;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ---------- Classification Stamp ---------- */
.classification-stamp {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #5A5040;
    margin-bottom: 16px;
}

/* ---------- Section Rule ---------- */
.section-rule {
    width: 100%;
    height: 1px;
    background-color: #D4A843;
    opacity: 0.3;
    margin-bottom: 32px;
}

/* ---------- Top Bar ---------- */
.top-bar {
    margin-bottom: 24px;
}

.section-heading {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 2.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #D4A843;
    line-height: 1.15;
    margin-bottom: 12px;
}

.section-subheading {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #7A7260;
    line-height: 1.5;
}

/* ---------- Second Scan ---------- */
.second-scan {
    margin-bottom: 28px;
}

.section-secondary {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.1rem;
    line-height: 1.75;
    color: #C8BFA0;
    max-width: 600px;
}

/* ---------- Content Body ---------- */
.content-body {
    flex: 1;
}

.body-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.05rem;
    line-height: 1.75;
    color: #C8BFA0;
    margin-bottom: 24px;
    max-width: 640px;
}

/* ---------- Data Callouts ---------- */
.data-callout {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(212, 168, 67, 0.15);
}

.callout-number {
    font-family: 'Share Tech Mono', monospace;
    font-size: 2.4rem;
    color: #D4A843;
    line-height: 1;
}

.callout-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #7A7260;
}

/* ---------- Archetype List ---------- */
.archetype-list {
    list-style: none;
    margin-top: 24px;
}

.archetype-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(212, 168, 67, 0.08);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.95rem;
    color: #C8BFA0;
    letter-spacing: 0.02em;
}

.archetype-item:last-child {
    border-bottom: none;
}

.list-crystal {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ---------- Methodology Steps ---------- */
.methodology-steps {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.method-step {
    padding-left: 20px;
    border-left: 1px solid rgba(212, 168, 67, 0.25);
}

.step-number {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.6rem;
    color: #D4A843;
    display: block;
    margin-bottom: 4px;
    line-height: 1;
}

.step-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #E8D5A3;
    display: block;
    margin-bottom: 8px;
}

.step-desc {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.65;
    color: #7A7260;
    max-width: 560px;
}

/* ---------- Archive Grid ---------- */
.archive-grid {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.archive-entry {
    display: grid;
    grid-template-columns: 100px 1fr 120px;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(212, 168, 67, 0.1);
    align-items: baseline;
}

.archive-entry:last-child {
    border-bottom: none;
}

.archive-id {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: #D4A843;
    letter-spacing: 0.05em;
}

.archive-name {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.95rem;
    color: #C8BFA0;
}

.archive-family {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #5A5040;
    text-align: right;
}

/* ---------- Transmission Block ---------- */
.transmission-block {
    margin-top: 28px;
    padding: 24px;
    background-color: #111111;
    border-left: 2px solid #D4A843;
}

.transmission-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #5A5040;
    margin-bottom: 12px;
}

.transmission-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #D4A843;
    animation: statusPulse 3s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.status-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1rem;
    color: #E8D5A3;
}

.transmission-freq {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #7A7260;
}

/* ---------- Contact Block ---------- */
.contact-block {
    margin-top: 20px;
}

.contact-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.65;
    color: #7A7260;
}

/* ---------- Section Separator ---------- */
.section-separator {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 3;
}

.separator-line {
    width: 100%;
    height: 1px;
    background-color: #D4A843;
    opacity: 0.2;
}

.separator-crystals {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.separator-crystal {
    width: 36px;
    height: 36px;
    opacity: 0.35;
}

/* ---------- Footer ---------- */
.dossier-footer {
    margin-top: auto;
    padding: 0 0 40px 0;
}

.footer-rule {
    width: 100%;
    height: 1px;
    background-color: #D4A843;
    opacity: 0.15;
    margin-bottom: 20px;
}

.footer-content {
    display: flex;
    gap: 32px;
    align-items: baseline;
}

.footer-mark {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #5A5040;
}

.footer-year {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    color: #7A7260;
}

.footer-class {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #5A5040;
}

/* ---------- Fade Elements ---------- */
.fade-element {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-element.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Ruled Lines Background Texture ---------- */
.dossier-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 59px,
            rgba(212, 168, 67, 0.03) 59px,
            rgba(212, 168, 67, 0.03) 60px
        );
    pointer-events: none;
    z-index: 0;
}

/* ---------- Vignette Effect ---------- */
.dossier-page::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 30% 40%, transparent 50%, #050505 100%);
    pointer-events: none;
    z-index: 1;
}

/* ---------- Hover States ---------- */
a:hover,
.nav-diamond:hover {
    transition: opacity 0.4s ease;
}

.archetype-item:hover {
    color: #F0EDE5;
    transition: color 0.4s ease;
}

.archive-entry:hover .archive-name {
    color: #F0EDE5;
    transition: color 0.4s ease;
}

.archive-entry:hover .archive-id {
    color: #E8D5A3;
    transition: color 0.4s ease;
}

/* ---------- Responsive: below 768px ---------- */
@media (max-width: 768px) {
    html {
        scroll-snap-type: y mandatory;
    }

    .nav-rail {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 48px;
        flex-direction: row;
        justify-content: center;
        gap: 20px;
        padding: 0 20px;
        background-color: rgba(10, 10, 10, 0.95);
    }

    .nav-line {
        left: 15%;
        right: 15%;
        top: 50%;
        bottom: auto;
        width: auto;
        height: 1px;
        transform: translateY(-50%);
    }

    .section-content {
        margin-left: 6%;
        margin-right: 6%;
        padding: 4vh 0 60px 0;
    }

    .section-heading {
        font-size: 1.8rem;
    }

    .section-bg-number {
        font-size: 25vw;
        right: 5%;
    }

    .hero-crystal {
        display: none;
    }

    .crystal-constellation {
        display: none;
    }

    .data-callout {
        flex-direction: column;
        gap: 4px;
    }

    .callout-number {
        font-size: 1.8rem;
    }

    .archive-entry {
        grid-template-columns: 80px 1fr;
        gap: 8px;
    }

    .archive-family {
        grid-column: 1 / -1;
        text-align: left;
    }

    .method-step {
        padding-left: 14px;
    }

    .footer-content {
        flex-direction: column;
        gap: 8px;
    }

    .separator-crystals {
        display: none;
    }

    .transmission-block {
        padding: 16px;
    }
}

/* ---------- Scrollbar Styling ---------- */
.dossier::-webkit-scrollbar {
    width: 4px;
}

.dossier::-webkit-scrollbar-track {
    background: #0A0A0A;
}

.dossier::-webkit-scrollbar-thumb {
    background: rgba(212, 168, 67, 0.3);
    border-radius: 2px;
}

.dossier::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 168, 67, 0.5);
}

/* ---------- Selection Color ---------- */
::selection {
    background-color: rgba(212, 168, 67, 0.3);
    color: #F0EDE5;
}
