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

html {
    overflow-x: hidden;
}

body {
    background: #f8f4eb;
    color: #2a2820;
    font-family: 'Lora', serif;
    --sea-worn-brown: #5a4a38;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    line-height: 1.85;
    overflow-x: hidden;
}

/* Paper grain */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* Title Page */
.title-page {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.main-title {
    font-family: 'Abril Fatface', serif;
    font-weight: 400;
    font-size: clamp(3rem, 7vw, 6rem);
    color: #2a2820;
    text-transform: lowercase;
    opacity: 0;
    animation: titleFade 1s ease-out 0.5s forwards;
}

.main-subtitle {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 1.2rem;
    color: #6a6050;
    margin-top: 12px;
    opacity: 0;
    animation: titleFade 1s ease-out 1s forwards;
}

.title-wave {
    margin-top: 20px;
    opacity: 0;
    animation: titleFade 1s ease-out 1.5s forwards;
}

.wave-path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: drawPath 1.5s ease-in-out 2s forwards;
}

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

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

/* Pressed specimen bands */
.pressed-band {
    width: 100%;
    height: 30px;
    background: #e8e0d0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pressed-svg {
    width: 100%;
    height: 30px;
}

.final-band {
    margin-top: 40px;
}

/* Editorial sections */
.editorial {
    position: relative;
    padding: 60px 20px;
    z-index: 2;
}

.editorial-column {
    max-width: 680px;
    margin: 0 auto;
}

.editorial-text {
    margin-bottom: 2rem;
    color: #2a2820;
}

.editorial-text em {
    color: #6a6050;
}

/* Margin notes */
.margin-note {
    position: absolute;
    width: 180px;
    transform: rotate(var(--rotation, 0deg));
    font-family: 'Lora', serif;
    font-size: 0.8rem;
    color: #8a7a68;
    line-height: 1.5;
    opacity: 0;
    transition: opacity 0.5s ease 0.2s;
}

.margin-note.visible {
    opacity: 1;
}

.left-note {
    left: 5vw;
    top: 80px;
}

.margin-doodle {
    display: block;
    margin-bottom: 6px;
}

/* Specimen Cards */
.specimen-card {
    width: 90vw;
    max-width: 1200px;
    margin: 40px auto;
    min-height: 60vh;
    background: #f0f0e8;
    display: grid;
    grid-template-columns: 55% 40%;
    gap: 5%;
    padding: 40px;
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out, background-color 0.6s ease;
}

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

/* Tape motifs */
.tape {
    position: absolute;
    width: 30px;
    height: 12px;
    background: rgba(200, 190, 170, 0.4);
    z-index: 5;
}

.top-left {
    top: 10px;
    left: 10px;
    transform: rotate(-45deg);
}

.top-right {
    top: 10px;
    right: 10px;
    transform: rotate(45deg);
}

.bottom-right {
    bottom: 50px;
    right: 10px;
    transform: rotate(45deg);
}

/* Specimen illustration */
.specimen-illustration {
    position: relative;
}

.field-sketch {
    width: 100%;
    max-width: 400px;
    height: auto;
}

.sketch-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 3s ease-in-out;
}

.specimen-card.visible .sketch-path {
    stroke-dashoffset: 0;
}

/* Reference renders */
.reference-render {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    transition: border-radius 2s ease, background 2s ease;
}

.render-opt {
    background: radial-gradient(ellipse at 35% 30%, rgba(100,140,150,0.4), rgba(80,120,70,0.2));
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.specimen-card.visible .render-opt {
    border-radius: 40% 60% 50% 50%;
}

.render-zk {
    background: radial-gradient(ellipse at 40% 30%, rgba(100,140,150,0.5), rgba(90,74,56,0.2));
    border-radius: 40%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.specimen-card.visible .render-zk {
    border-radius: 50% 50% 40% 40%;
}

.render-val {
    background: radial-gradient(ellipse at 50% 20%, rgba(100,140,150,0.3), transparent);
    border-radius: 50% 50% 30% 30%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.render-sov {
    background: radial-gradient(ellipse at 40% 40%, rgba(80,120,70,0.3), rgba(90,74,56,0.15));
    border-radius: 45%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.specimen-card.visible .render-sov {
    border-radius: 40% 50% 50% 40%;
}

/* Field notes */
.field-notes {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.species-name {
    font-family: 'Abril Fatface', serif;
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: #c87858;
    text-transform: lowercase;
    line-height: 1.1;
    margin-bottom: 8px;
}

.species-latin {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 1rem;
    color: #6a6050;
    margin-bottom: 16px;
}

.field-note-text {
    font-family: 'Lora', serif;
    font-weight: 400;
    color: #2a2820;
    margin-bottom: 12px;
    line-height: 1.85;
}

/* Specimen label strip */
.specimen-label {
    grid-column: 1 / -1;
    background: #d0c8b8;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: #6a6050;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 20px;
}

/* Compass */
.compass-container {
    display: flex;
    justify-content: center;
    padding: 40px 0 60px;
}

.compass-rose {
    animation: compassSpin 60s linear infinite;
}

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

/* Closing */
.closing {
    padding-bottom: 20px;
}

/* Responsive */
@media (max-width: 900px) {
    .specimen-card {
        grid-template-columns: 1fr;
        width: 95vw;
        padding: 24px;
    }

    .specimen-illustration {
        max-width: 300px;
        margin: 0 auto;
    }

    .margin-note {
        display: none;
    }

    .specimen-label {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 12px;
        gap: 4px;
    }

    .specimen-label span {
        font-size: 0.65rem;
    }
}

@media (min-width: 1200px) {
    .margin-note {
        display: block;
    }
}

@media (max-width: 1199px) {
    .margin-note {
        display: none;
    }
}
