/* ============================================================
   RRIDDL.com — Styles
   Botanical Dashboard / Naturalist's Cabinet
   ============================================================ */

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

html {
    scroll-behavior: smooth;
    background-color: #2c2416;
}

body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
    color: #3d3225;
    background-color: #f5edd3;
    overflow-x: hidden;
}

/* --- Scroll-Driven Lamp Vignette --- */
#lamp-vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: radial-gradient(ellipse 80% 80% at 50% 30%, transparent 30%, rgba(44,36,22,0.25) 100%);
    transition: background 0.1s linear;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #2c2416;
    overflow: hidden;
}

/* Gradient-mesh specimen plate */
#hero-mesh {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 45% 55% at 35% 40%, #e8c96d 0%, transparent 60%),
        radial-gradient(ellipse 40% 50% at 65% 55%, #c49a2a 0%, transparent 50%),
        radial-gradient(ellipse 60% 60% at 50% 50%, rgba(239,229,204,0.3) 0%, transparent 70%),
        radial-gradient(ellipse 30% 35% at 45% 45%, rgba(232,201,109,0.6) 0%, transparent 50%);
    opacity: 0.85;
}

/* Dot-stipple texture overlay */
#hero-stipple {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.08;
    background-image:
        radial-gradient(circle 0.75px at 3px 3px, #a0876a 100%, transparent 100%),
        radial-gradient(circle 0.75px at 13px 11px, #a0876a 100%, transparent 100%);
    background-size: 16px 14px;
}

/* Hero content */
#hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

#hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 8vw;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #f5edd3;
    line-height: 1;
    margin-bottom: 1.5rem;
}

#hero-title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: letterStamp 0.5s ease-out forwards;
    animation-delay: calc(var(--i) * 0.12s);
}

@keyframes letterStamp {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(1.1);
    }
    60% {
        opacity: 1;
        transform: translateY(-3px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#hero-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 300;
    font-size: 1.2rem;
    letter-spacing: 0.06em;
    color: #8b7355;
    opacity: 0;
    animation: subtitleFade 1s ease forwards;
    animation-delay: 1.5s;
}

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

/* ============================================================
   DASHBOARD / MAIN GRID
   ============================================================ */
#dashboard {
    position: relative;
    max-width: 1360px;
    margin: 0 auto;
    padding: 60px 24px 40px;
}

/* Dashboard row = one viewport-height stage */
.dashboard-row {
    display: grid;
    grid-template-columns: 1fr 1.618fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 0;
    min-height: 60vh;
    align-items: start;
}

/* ============================================================
   PANELS (Specimen Cards)
   ============================================================ */
.panel {
    position: relative;
    background-color: #efe5cc;
    padding: 0;
    overflow: hidden;
    clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
    /* Cross-hatch background */
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(160,135,106,0.15) 4px, rgba(160,135,106,0.15) 5px);
    background-color: #efe5cc;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Unique gradient mesh per panel, uses CSS vars */
.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at var(--gx1) var(--gy1), var(--gc1) 0%, transparent var(--gs1)),
        radial-gradient(ellipse at var(--gx2) var(--gy2), var(--gc2) 0%, transparent var(--gs2)),
        linear-gradient(135deg, #f5edd3, #efe5cc);
    opacity: 0.25;
    transition: background-position 0.6s ease;
    pointer-events: none;
}

.panel:hover::before {
    opacity: 0.4;
    background-position: 10px 10px;
}

/* Panel-wide spans golden-ratio column */
.panel-wide {
    grid-column: span 1;
}
.dashboard-row .panel-wide {
    grid-column: span 1;
}
/* First row: second panel spans golden column */
.dashboard-row:nth-child(1) .panel:nth-child(2) {
    grid-column: 2;
}

/* SVG Border draw animation */
.panel-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.panel-border polygon {
    fill: none;
    stroke: #a0876a;
    stroke-width: 1.2;
    vector-effect: non-scaling-stroke;
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.panel.visible .panel-border polygon {
    animation: borderDraw 0.8s ease-out forwards;
}

@keyframes borderDraw {
    from { stroke-dashoffset: 800; }
    to { stroke-dashoffset: 0; }
}

.panel:hover .panel-border polygon {
    stroke: #c49a2a;
}

/* Panel inner content */
.panel-inner {
    position: relative;
    z-index: 10;
    padding: 28px 24px 24px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
}

.panel.visible .panel-inner {
    opacity: 0;
    animation: contentReveal 0.4s ease forwards;
    animation-delay: 0.85s;
}

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

/* Specimen number */
.specimen-number {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.7rem;
    color: #8b7355;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 12px;
}

/* Panel heading */
.panel-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1rem, 2vw, 1.4rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #3d3225;
    margin-bottom: 10px;
    line-height: 1.3;
}

/* Panel body text */
.panel-body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
    color: #3d3225;
    margin-bottom: 14px;
}

/* Panel caption (specimen label) */
.panel-caption {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    color: #8b7355;
    border-top: 1px solid rgba(160,135,106,0.3);
    padding-top: 10px;
    margin-top: 4px;
}

/* ============================================================
   CORNER ORNAMENTS
   ============================================================ */
.corner-ornament {
    position: absolute;
    width: 30px;
    height: 30px;
    z-index: 6;
    opacity: 0.4;
    transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.corner-ornament svg {
    width: 100%;
    height: 100%;
}

.corner-ornament svg path {
    fill: none;
    stroke: #a0876a;
    stroke-width: 1.2;
}

.corner-ornament svg circle {
    fill: #a0876a;
}

.corner-ornament.tl {
    top: 4px;
    left: 4px;
}

.corner-ornament.br {
    bottom: 4px;
    right: 4px;
}

.panel:hover .corner-ornament {
    opacity: 0.8;
}

/* ============================================================
   INTERSTITIAL VINE STRIPS
   ============================================================ */
.vine-strip {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0 20px;
}

.vine-svg {
    width: 100%;
    height: 80px;
}

.vine-path {
    fill: none;
    stroke: #6b7c4e;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 0.05s linear;
}

.vine-leaf {
    fill: #6b7c4e;
    opacity: 0.6;
    stroke: none;
}

.vine-berry {
    fill: none;
    stroke: #6b7c4e;
    stroke-width: 1;
    opacity: 0.5;
}

/* ============================================================
   FOOTER
   ============================================================ */
#footer {
    max-width: 1360px;
    margin: 80px auto 0;
    padding: 40px 24px 60px;
    text-align: center;
    border-top: 1px solid rgba(160,135,106,0.3);
}

#footer-nav {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-link {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 1rem;
    letter-spacing: 0.04em;
    color: #8b7355;
    text-decoration: none;
    transition: color 0.3s ease;
    cursor: pointer;
}

.footer-link:hover {
    color: #c49a2a;
}

.footer-divider {
    color: #a0876a;
    font-size: 1.2rem;
    opacity: 0.5;
}

#footer-inscription {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #a0876a;
    opacity: 0.6;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 1024px) {
    .dashboard-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        min-height: auto;
    }

    .dashboard-row .panel-wide,
    .dashboard-row:nth-child(1) .panel:nth-child(2) {
        grid-column: 1 / -1;
    }

    #hero-title {
        font-size: 12vw;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .dashboard-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .dashboard-row .panel-wide,
    .dashboard-row:nth-child(1) .panel:nth-child(2) {
        grid-column: 1;
    }

    #dashboard {
        padding: 30px 16px 20px;
    }

    #hero-title {
        font-size: 14vw;
    }

    .panel-inner {
        padding: 22px 18px 18px;
    }

    .vine-strip {
        height: 80px;
    }

    #footer {
        padding: 30px 16px 40px;
    }
}
