/* ============================================================
   ppuzzl.bid — Scandinavian Scholarly Classicism
   Palette: honeyed-neutral / Aesthetic: scandinavian
   ============================================================ */

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

:root {
    --vellum-white: #f5efe6;
    --warm-alabaster: #ede4d4;
    --scholarly-dark: #2c2418;
    --patina-bronze: #9a8b72;
    --amber-glow: #d4a843;
    --honey-wash: #e8c87a;
    --veined-grey: #b8b0a4;
    --library-umber: #3d3224;
    --nav-border: #c9b896;
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
}

body {
    background-color: var(--vellum-white);
    color: var(--scholarly-dark);
    font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background-color: rgba(245, 239, 230, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.nav.nav--hidden {
    transform: translateY(-100%);
}

.nav-border {
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--nav-border);
    z-index: 100;
    transition: transform 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.nav.nav--hidden ~ .nav-border {
    transform: translateY(-52px);
}

.nav-domain {
    font-family: 'DM Mono', monospace;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--scholarly-dark);
}

.nav-link {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--scholarly-dark);
    text-decoration: none;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--amber-glow);
    transition: width 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.nav-link:hover::after {
    width: 100%;
}

/* --- Hero Section --- */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    scroll-snap-align: start;
}

.hero-flare {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    transform: translate(-50%, -55%);
    background: radial-gradient(circle at 50% 40%, rgba(212, 168, 67, 0.15) 0%, transparent 60%);
    animation: flare-breathe 8s ease-in-out infinite;
    pointer-events: none;
}

.hero-flare-spot {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: flare-breathe 8s ease-in-out infinite;
}

.hero-flare-spot--1 {
    width: 12px;
    height: 12px;
    top: 38%;
    left: 55%;
    background: rgba(232, 200, 122, 0.25);
    animation-delay: -2s;
}

.hero-flare-spot--2 {
    width: 8px;
    height: 8px;
    top: 45%;
    left: 42%;
    background: rgba(232, 200, 122, 0.2);
    animation-delay: -4s;
}

.hero-flare-spot--3 {
    width: 6px;
    height: 6px;
    top: 35%;
    left: 60%;
    background: rgba(212, 168, 67, 0.18);
    animation-delay: -6s;
}

@keyframes flare-breathe {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.2; }
}

.hero-dust {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.dust-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--veined-grey);
    border-radius: 50%;
    opacity: 0;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
    animation: hero-reveal 1.5s cubic-bezier(0.25, 0.1, 0.25, 1) 0.6s forwards;
}

@keyframes hero-reveal {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.hero-title {
    font-family: 'DM Mono', monospace;
    font-weight: 500;
    font-size: clamp(3.5rem, 10vw, 8rem);
    letter-spacing: 0.06em;
    color: var(--scholarly-dark);
    line-height: 1.1;
}

.hero-subtitle {
    margin-top: 2rem;
    opacity: 0;
    animation: subtitle-fade 1s cubic-bezier(0.25, 0.1, 0.25, 1) 2.5s forwards;
}

@keyframes subtitle-fade {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.hero-rule {
    width: 200px;
    height: 1px;
    background-color: var(--veined-grey);
    border: none;
    margin: 0 auto 1.2rem;
}

.hero-tagline {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--patina-bronze);
    text-transform: uppercase;
}

/* --- Marble Vein Dividers --- */
.marble-divider {
    display: flex;
    justify-content: center;
    padding: 0;
    margin: 0 auto;
    max-width: 880px;
    width: 90%;
}

.marble-divider svg {
    width: 100%;
    height: 40px;
    overflow: visible;
}

.marble-vein {
    fill: none;
    stroke: var(--veined-grey);
    stroke-width: 1;
    stroke-opacity: 0.5;
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.marble-vein.marble-vein--visible {
    stroke-dashoffset: 0;
}

/* --- Content Plinths --- */
.plinth {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
    padding: clamp(3rem, 6vh, 5rem) clamp(1.5rem, 4vw, 2.5rem);
    margin-top: clamp(3rem, 6vh, 5rem);
    margin-bottom: clamp(3rem, 6vh, 5rem);
    background-color: var(--warm-alabaster);
    border-radius: 2px;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
    scroll-snap-align: start;
}

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

.plinth--wide {
    max-width: 880px;
}

.plinth-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 2px;
    box-shadow: 0 0 80px 20px rgba(212, 168, 67, 0.0);
    transition: box-shadow 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    pointer-events: none;
}

.plinth:hover .plinth-glow {
    box-shadow: 0 0 80px 20px rgba(212, 168, 67, 0.06);
}

.plinth-label {
    display: block;
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--patina-bronze);
    margin-bottom: 1.5rem;
}

.plinth-heading {
    font-family: 'DM Mono', monospace;
    font-weight: 500;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    letter-spacing: 0.06em;
    color: var(--scholarly-dark);
    line-height: 1.3;
    margin-bottom: 1.5rem;
}

.plinth-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    color: var(--scholarly-dark);
    margin-bottom: 1.5rem;
}

.plinth-text:last-of-type {
    margin-bottom: 0;
}

.plinth-text strong {
    font-weight: 600;
}

/* --- Fragment Grid Section --- */
.fragment-grid-section {
    position: relative;
    margin-top: 2.5rem;
    padding: 2rem;
}

.fragment-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(to right, var(--warm-alabaster) 1px, transparent 1px),
        linear-gradient(to bottom, var(--warm-alabaster) 1px, transparent 1px);
    background-size: 48px 48px;
    background-position: center center;
    opacity: 0.3;
    pointer-events: none;
}

.specimen-block {
    position: relative;
    text-align: center;
    z-index: 1;
}

.specimen-image {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
}

.volute-ornament--large {
    width: 120px;
    height: 120px;
}

.specimen-caption {
    display: block;
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--patina-bronze);
    margin-top: 1rem;
}

/* --- Collection List --- */
.collection-list {
    margin-top: 2rem;
}

.collection-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.2rem 0;
    border-bottom: 1px solid rgba(184, 176, 164, 0.3);
}

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

.volute-bullet {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-top: 4px;
}

.collection-item-text {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.collection-item-id {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--patina-bronze);
}

.collection-item-desc {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.5vw, 1rem);
    line-height: 1.6;
    color: var(--scholarly-dark);
}

/* --- Index Grid --- */
.index-grid {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.index-entry {
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(184, 176, 164, 0.25);
    transition: background-color 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.index-entry:hover {
    background-color: rgba(232, 200, 122, 0.08);
}

.index-number {
    font-family: 'DM Mono', monospace;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.06em;
    color: var(--amber-glow);
    margin-bottom: 0.3rem;
}

.index-title {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 600;
    font-size: clamp(0.95rem, 1.6vw, 1.05rem);
    line-height: 1.4;
    color: var(--scholarly-dark);
    margin-bottom: 0.25rem;
}

.index-date {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--patina-bronze);
}

/* --- Footer --- */
.footer {
    position: relative;
    background-color: var(--library-umber);
    padding: clamp(4rem, 8vh, 6rem) 2rem;
    text-align: center;
    margin-top: clamp(6rem, 12vh, 10rem);
    scroll-snap-align: end;
}

.footer-compass {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.compass-svg {
    width: 120px;
    height: 120px;
    animation: compass-rotate 60s linear infinite;
}

@keyframes compass-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.footer-domain {
    font-family: 'DM Mono', monospace;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.06em;
    color: var(--warm-alabaster);
}

.footer-note {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: 14px;
    font-style: italic;
    color: var(--patina-bronze);
    line-height: 1.5;
}

.footer-meta {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--veined-grey);
    opacity: 0.5;
    margin-top: 0.5rem;
}

/* --- Mosaic Background (fragment assembly) --- */
.mosaic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.mosaic-piece {
    position: absolute;
    border: 1px solid rgba(184, 176, 164, 0.12);
    border-radius: 1px;
    transition: transform 1.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                opacity 1.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .plinth {
        max-width: 90vw;
        width: 90vw;
        padding: 2rem 1.5rem;
    }

    .plinth--wide {
        max-width: 90vw;
    }

    .index-grid {
        grid-template-columns: 1fr;
    }

    .hero-flare {
        width: 350px;
        height: 350px;
    }

    .hero-flare-spot--3 {
        display: none;
    }

    .marble-divider {
        width: 90%;
    }

    .compass-svg {
        width: 72px;
        height: 72px;
    }

    .nav {
        padding: 12px 20px;
    }

    .nav-border {
        top: 44px;
    }
}

@media (max-width: 480px) {
    .hero-flare-spot--2 {
        display: none;
    }

    .fragment-grid-section {
        padding: 1rem;
    }
}

/* --- Selection styling --- */
::selection {
    background-color: rgba(232, 200, 122, 0.3);
    color: var(--scholarly-dark);
}
