/* ========================================
   graphers.dev - Victorian Botanical Observatory
   Color Palette:
   - Deep Forest Night: #0d1f17
   - Moss Shadow: #1a3a2a
   - Fern Glade: #2d5a42
   - Aged Parchment: #f0e6d0
   - Weathered Vellum: #d4cbb8
   - Gaslight Gilt: #c9a84c
   - Botanical Copper: #b87a4b
   - Chlorophyll: #4a9e6e
   - Autumn Berry: #a63d40
   ======================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(180deg, #0d1f17 0%, #1a3a2a 40%, #0d1f17 100%);
    color: #f0e6d0;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.05rem, 1.3vw, 1.2rem);
    line-height: 1.75;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background botanical pattern (very subtle texture) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cpath d='M20,180 Q25,120 30,60 Q35,30 40,10' fill='none' stroke='%234a9e6e' stroke-width='1'/%3E%3Cpath d='M25,140 Q15,135 10,125' fill='none' stroke='%234a9e6e' stroke-width='0.8'/%3E%3Cpath d='M27,110 Q35,105 40,95' fill='none' stroke='%234a9e6e' stroke-width='0.8'/%3E%3Cpath d='M28,80 Q18,75 14,65' fill='none' stroke='%234a9e6e' stroke-width='0.8'/%3E%3Cpath d='M120,190 Q122,130 125,70 Q128,40 130,15' fill='none' stroke='%234a9e6e' stroke-width='1'/%3E%3Cpath d='M122,150 Q112,145 108,135' fill='none' stroke='%234a9e6e' stroke-width='0.8'/%3E%3Cpath d='M123,120 Q133,115 138,105' fill='none' stroke='%234a9e6e' stroke-width='0.8'/%3E%3Cpath d='M80,195 Q82,160 85,120 L88,80' fill='none' stroke='%234a9e6e' stroke-width='0.6'/%3E%3Cpath d='M160,185 Q162,140 165,90' fill='none' stroke='%234a9e6e' stroke-width='0.6'/%3E%3C/svg%3E");
    background-repeat: repeat;
    z-index: 0;
}

/* ========================================
   COMPASS ROSE NAVIGATION
   ======================================== */
.compass-nav {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
}

.compass-rose {
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.compass-nav:hover .compass-rose {
    transform: scale(1.15);
}

.compass-menu {
    position: absolute;
    top: 56px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: rgba(13, 31, 23, 0.95);
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 2px;
    padding: 0.8rem 1.2rem;
}

.compass-nav:hover .compass-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.compass-link {
    font-family: 'Poiret One', sans-serif;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #d4cbb8;
    text-decoration: none;
    padding: 0.25rem 0;
    transition: color 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    white-space: nowrap;
}

.compass-link::before {
    content: attr(data-section) '. ';
    color: #c9a84c;
    opacity: 0.6;
}

.compass-link:hover {
    color: #c9a84c;
}

/* ========================================
   SHEETS (Common styles)
   ======================================== */
.sheet {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* ========================================
   SHEET I: THE FRONTISPIECE
   ======================================== */
.sheet-frontispiece {
    min-height: 100vh;
    background: #0d1f17;
}

.cartouche {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(320px, 60vw, 600px);
    height: clamp(200px, 36vw, 360px);
}

.cartouche-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.cartouche-svg .filigree-path {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: drawFiligree 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.cartouche-svg .cartouche-border {
    stroke-dasharray: 1440;
    stroke-dashoffset: 1440;
    animation: drawBorder 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s forwards;
}

.cartouche-svg .graph-edge {
    animation: pulseEdge 4s ease-in-out 3s infinite;
}

.cartouche-svg .graph-node {
    animation: pulseNode 4s ease-in-out 3s infinite;
}

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

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

@keyframes pulseEdge {
    0%, 100% { opacity: 0.4; stroke: #4a9e6e; }
    50% { opacity: 0.8; stroke: #4a9e6e; }
}

@keyframes pulseNode {
    0%, 100% { opacity: 0.4; r: 2; }
    50% { opacity: 0.9; r: 3; }
}

.cartouche-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.site-title {
    font-family: 'Poiret One', sans-serif;
    font-size: clamp(2.6rem, 5vw, 4.4rem);
    font-weight: 400;
    letter-spacing: 0.15em;
    color: #f0e6d0;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeInTitle 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1s forwards;
}

.site-tagline {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: #d4cbb8;
    margin-top: 0.8rem;
    letter-spacing: 0.04em;
    opacity: 0;
    animation: fadeInTitle 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.8s forwards;
}

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

/* ========================================
   ORNAMENTAL DIVIDERS
   ======================================== */
.ornamental-divider {
    position: relative;
    z-index: 1;
    padding: 1.5rem 0;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ornamental-divider.revealed {
    opacity: 1;
}

.divider-svg {
    width: 100%;
    height: 40px;
    display: block;
}

/* ========================================
   SHEET II: THE TAXONOMY
   ======================================== */
.sheet-taxonomy {
    min-height: 100vh;
    padding: 6rem 2rem;
}

.taxonomy-cards {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2.5rem;
    margin-left: clamp(2rem, 15vw, 35%);
    max-width: 400px;
}

.taxonomy-card {
    position: relative;
    max-width: 320px;
    border: 2px solid #c9a84c;
    border-radius: 2px;
    background: #1a3a2a;
    padding: 2rem;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                border-color 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
}

.taxonomy-card:nth-child(1) { margin-left: 0; }
.taxonomy-card:nth-child(2) { margin-left: 3vw; }
.taxonomy-card:nth-child(3) { margin-left: 1vw; }

.taxonomy-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.taxonomy-card:hover {
    border-color: #4a9e6e;
}

.card-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74, 158, 110, 0.15) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.taxonomy-card.revealed .card-ripple {
    animation: cardRipple 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes cardRipple {
    0% { width: 0; height: 0; opacity: 1; }
    100% { width: 400px; height: 400px; opacity: 0; }
}

.card-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1.2rem;
}

.card-icon svg {
    width: 100%;
    height: 100%;
}

.card-title {
    font-family: 'Poiret One', sans-serif;
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    font-weight: 400;
    letter-spacing: 0.12em;
    color: #f0e6d0;
    margin-bottom: 0.6rem;
}

.card-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.7;
    color: #d4cbb8;
    margin-bottom: 1rem;
}

.card-flourish {
    width: 100%;
}

.card-flourish svg {
    width: 100%;
    height: 12px;
    display: block;
}

/* ========================================
   SHEET III: THE SPECIMEN
   ======================================== */
.sheet-specimen {
    min-height: 100vh;
    padding: 4rem 2rem;
}

.specimen-frame {
    position: relative;
    width: clamp(300px, 60vmin, 600px);
    height: clamp(300px, 60vmin, 600px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.specimen-frame.revealed {
    opacity: 1;
}

.specimen-border {
    position: absolute;
    top: -8%;
    left: -8%;
    width: 116%;
    height: 116%;
}

.specimen-border .border-draw {
    stroke-dasharray: 2720;
    stroke-dashoffset: 2720;
    transition: stroke-dashoffset 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.specimen-frame.revealed .border-draw {
    stroke-dashoffset: 0;
}

.graph-visualization {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
}

/* Graph node hover effects */
.graph-flower-node {
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.graph-flower-node:hover {
    transform: scale(1.15);
}

.graph-vine-edge {
    transition: stroke 0.3s, opacity 0.3s, stroke-width 0.3s;
}

.graph-vine-edge.highlighted {
    stroke: #4a9e6e;
    opacity: 0.9;
    stroke-width: 2.5;
}

/* ========================================
   SHEET IV: THE FIELD NOTES
   ======================================== */
.sheet-field-notes {
    min-height: 100vh;
    padding: 6rem 2rem;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    position: relative;
}

.field-notes-margin {
    position: absolute;
    left: clamp(1rem, 10vw, 30vw);
    top: 8rem;
    width: 40px;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.margin-fern {
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.margin-fern.revealed {
    opacity: 1;
}

.fern-1 { width: 40px; height: 120px; }
.fern-2 { width: 40px; height: 100px; }

.field-notes-content {
    max-width: 38ch;
    margin-left: 38vw;
    padding-top: 2rem;
}

.field-paragraph {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.05rem, 1.3vw, 1.2rem);
    line-height: 1.75;
    color: #d4cbb8;
    /* On light backgrounds, use color: #2d4a3a; */
    margin-bottom: 1.8rem;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.field-paragraph.revealed {
    opacity: 1;
    transform: translateY(0);
}

.drop-cap {
    float: left;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 700;
    font-size: 4.5em;
    line-height: 0.75;
    margin-right: 0.1em;
    margin-top: 0.05em;
    color: #f0e6d0;
    position: relative;
}

.drop-cap::after {
    content: '';
    position: absolute;
    top: 0;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: radial-gradient(ellipse at center, rgba(74, 158, 110, 0.12) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* ========================================
   SHEET V: THE COLOPHON
   ======================================== */
.sheet-colophon {
    min-height: 60vh;
    background: #0d1f17;
}

.colophon-content {
    text-align: center;
}

.colophon-seal {
    width: 120px;
    height: 120px;
    opacity: 0.6;
    animation: rotateSeal 120s linear infinite;
    margin-bottom: 2rem;
}

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

.colophon-title {
    font-family: 'Poiret One', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.3em;
    color: #f0e6d0;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.colophon-year {
    font-family: 'Poiret One', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    color: #d4cbb8;
    opacity: 0.6;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .compass-nav {
        top: 1rem;
        right: 1rem;
    }

    .compass-rose {
        width: 40px;
        height: 40px;
    }

    .taxonomy-cards {
        margin-left: 1.5rem;
        align-items: stretch;
    }

    .taxonomy-card {
        max-width: 100%;
    }

    .taxonomy-card:nth-child(1),
    .taxonomy-card:nth-child(2),
    .taxonomy-card:nth-child(3) {
        margin-left: 0;
    }

    .field-notes-content {
        margin-left: 2rem;
        margin-right: 2rem;
        max-width: none;
    }

    .field-notes-margin {
        display: none;
    }

    .sheet-field-notes {
        justify-content: center;
    }
}
