/* ==========================================================================
   senggack.net - Dark-Academia + Dopamine-Neon Botanical Scholar's Workstation
   ========================================================================== */

/* CSS Custom Properties */
:root {
    --deep-leather: #2a1f17;
    --walnut-shadow: #16110c;
    --dark-mahogany: #241c14;
    --desk-edge: #1e1510;
    --aged-brass: #9c7a4a;
    --warm-parchment: #e8dcc4;
    --faded-linen: #b8a98e;
    --neon-magenta: #ff2d78;
    --neon-chartreuse: #b8f030;
    --cyan-pulse: #00e5ff;
    --magenta-wash: rgba(255, 45, 120, 0.12);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    background: var(--deep-leather);
    color: var(--warm-parchment);
    overflow: hidden;
    min-height: 100vh;
}

.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ==========================================================================
   Hero / Narrative Entry
   ========================================================================== */

.hero {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    /* Leather texture layers */
    background:
        linear-gradient(to bottom, transparent 70%, rgba(0,0,0,0.15) 100%),
        radial-gradient(ellipse at 40% 35%, rgba(156,122,74,0.08) 0%, transparent 60%),
        var(--deep-leather);
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.hero.hero-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.hero-botanical {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(70vw, 400px);
    height: min(70vw, 400px);
}

.peony-svg {
    width: 100%;
    height: 100%;
}

.peony-svg .peony-group path,
.peony-svg .peony-group line,
.peony-svg .peony-group ellipse,
.peony-svg .peony-group circle {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    opacity: 0;
}

.peony-svg.animating .peony-group path,
.peony-svg.animating .peony-group line,
.peony-svg.animating .peony-group ellipse,
.peony-svg.animating .peony-group circle {
    opacity: 0.3;
    animation: drawStroke 2.5s ease-out forwards;
}

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

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

.hero-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 900;
    font-size: clamp(2.8rem, 7vw, 6rem);
    letter-spacing: -0.02em;
    color: var(--warm-parchment);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

.hero-underline {
    height: 2px;
    background: var(--neon-magenta);
    margin: 0.5rem auto 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.8s ease-out;
    max-width: 400px;
    box-shadow: 0 0 12px rgba(255, 45, 120, 0.35);
}

.hero-underline.visible {
    transform: scaleX(1);
}

.hero-tagline {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--warm-parchment);
    opacity: 0;
    margin-top: 1rem;
    transition: opacity 0.8s ease-out;
}

.hero-tagline.visible {
    opacity: 0.7;
}

/* ==========================================================================
   Dashboard Frame
   ========================================================================== */

.dashboard {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    padding: 8px;
    display: grid;
    grid-template-columns: 55% 45%;
    grid-template-rows: 65% 35%;
    grid-template-areas:
        "viewer sidebar"
        "viewer tray";
    gap: 0;
    border: 8px solid var(--desk-edge);
    opacity: 0;
    transition: opacity 0.6s ease;
    z-index: 50;
}

.dashboard.visible {
    opacity: 1;
}

/* ==========================================================================
   Specimen Viewer (Left Panel)
   ========================================================================== */

.specimen-viewer {
    grid-area: viewer;
    overflow-y: auto;
    overflow-x: hidden;
    /* Leather texture */
    background:
        linear-gradient(to bottom, transparent 70%, rgba(0,0,0,0.15) 100%),
        radial-gradient(ellipse at 40% 35%, rgba(156,122,74,0.08) 0%, transparent 60%),
        var(--deep-leather);
    border-right: 1px solid var(--aged-brass);
    position: relative;
    filter: url(#leather-grain);
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

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

/* Custom scrollbar */
.specimen-viewer::-webkit-scrollbar {
    width: 6px;
}

.specimen-viewer::-webkit-scrollbar-track {
    background: var(--walnut-shadow);
}

.specimen-viewer::-webkit-scrollbar-thumb {
    background: var(--aged-brass);
    border-radius: 3px;
}

.specimen-content {
    padding: clamp(2rem, 4vw, 5rem);
    max-width: 680px;
    margin: 0 auto;
}

/* ==========================================================================
   Content Sections
   ========================================================================== */

.content-section {
    margin-bottom: 2.5rem;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.content-section.in-view {
    opacity: 1;
    transform: translateY(0);
}

.section-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.4rem);
    letter-spacing: 0.01em;
    color: var(--warm-parchment);
    margin-bottom: 1.2rem;
}

.body-text {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.6vw, 1.05rem);
    line-height: 1.75;
    letter-spacing: 0.03em;
    color: rgba(232, 220, 196, 0.88);
    margin-bottom: 1rem;
}

.specimen-name {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-style: italic;
    color: var(--neon-chartreuse);
    text-shadow: 0 0 12px rgba(184, 240, 48, 0.35);
}

.pull-quote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    border-left: 2px solid var(--neon-magenta);
    box-shadow: -4px 0 20px rgba(255, 45, 120, 0.1);
}

.pull-quote p {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--warm-parchment);
    line-height: 1.6;
}

/* ==========================================================================
   Floral Dividers
   ========================================================================== */

.floral-divider {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.divider-svg {
    width: 120px;
    height: 40px;
}

.divider-stem,
.divider-leaf-1,
.divider-leaf-2,
.divider-leaf-3 {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1.2s ease;
}

.floral-divider.in-view .divider-stem {
    stroke-dashoffset: 0;
}

.floral-divider.in-view .divider-leaf-1 {
    stroke-dashoffset: 0;
    transition-delay: 0.2s;
}

.floral-divider.in-view .divider-leaf-2 {
    stroke-dashoffset: 0;
    transition-delay: 0.4s;
}

.floral-divider.in-view .divider-leaf-3 {
    stroke-dashoffset: 0;
    transition-delay: 0.6s;
}

/* ==========================================================================
   Sidebar Cabinet
   ========================================================================== */

.sidebar-cabinet {
    grid-area: sidebar;
    background: var(--walnut-shadow);
    border-bottom: 1px solid var(--aged-brass);
    overflow-y: auto;
    padding: 1.2rem;
    position: relative;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.sidebar-cabinet.panel-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Spore scatter pattern */
.sidebar-cabinet::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle, rgba(184, 240, 48, 0.03) 1px, transparent 1px),
        radial-gradient(circle, rgba(184, 240, 48, 0.02) 1.5px, transparent 1.5px);
    background-size: 47px 53px, 89px 97px;
    background-position: 0 0, 23px 31px;
    pointer-events: none;
    z-index: 0;
}

.sidebar-cabinet::-webkit-scrollbar {
    width: 4px;
}

.sidebar-cabinet::-webkit-scrollbar-track {
    background: var(--walnut-shadow);
}

.sidebar-cabinet::-webkit-scrollbar-thumb {
    background: var(--aged-brass);
    border-radius: 2px;
}

.cabinet-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   Specimen Cards
   ========================================================================== */

.specimen-card {
    position: relative;
    border: 1px solid var(--aged-brass);
    padding: 1.2rem;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
    background: var(--walnut-shadow);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;
}

.specimen-card:hover {
    border-color: var(--neon-magenta);
    filter: brightness(1.05);
    box-shadow:
        inset 0 1px 3px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(255, 45, 120, 0.1);
}

.specimen-card:hover .card-corner-floral {
    background-color: var(--neon-chartreuse);
    box-shadow: 0 0 8px rgba(184, 240, 48, 0.3);
}

.card-corner-floral {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    opacity: 0.4;
    background-color: var(--aged-brass);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1'%3E%3Cpath d='M20,4 Q12,4 12,12 Q12,4 4,4' /%3E%3Cpath d='M20,4 Q20,12 12,12' /%3E%3Cpath d='M14,10 Q10,14 8,20' /%3E%3Cpath d='M12,12 Q16,16 16,22' /%3E%3C/svg%3E");
    mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1'%3E%3Cpath d='M20,4 Q12,4 12,12 Q12,4 4,4' /%3E%3Cpath d='M20,4 Q20,12 12,12' /%3E%3Cpath d='M14,10 Q10,14 8,20' /%3E%3Cpath d='M12,12 Q16,16 16,22' /%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
}

.card-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(0.95rem, 1.8vw, 1.3rem);
    color: var(--warm-parchment);
    margin-bottom: 0.4rem;
}

.card-meta {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-weight: 300;
    font-size: 0.8rem;
    color: rgba(232, 220, 196, 0.6);
    letter-spacing: 0.03em;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.card-count {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--faded-linen);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ==========================================================================
   Instrument Tray
   ========================================================================== */

.instrument-tray {
    grid-area: tray;
    background: var(--dark-mahogany);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.instrument-tray.panel-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Corner brackets */
.tray-corner {
    position: absolute;
    width: 16px;
    height: 16px;
}

.tray-corner-tl {
    top: 8px;
    left: 8px;
    border-top: 2px solid var(--neon-chartreuse);
    border-left: 2px solid var(--neon-chartreuse);
    box-shadow:
        -2px -2px 8px rgba(184, 240, 48, 0.15),
        inset 1px 1px 4px rgba(184, 240, 48, 0.1);
}

.tray-corner-tr {
    top: 8px;
    right: 8px;
    border-top: 2px solid var(--neon-chartreuse);
    border-right: 2px solid var(--neon-chartreuse);
    box-shadow:
        2px -2px 8px rgba(184, 240, 48, 0.15),
        inset -1px 1px 4px rgba(184, 240, 48, 0.1);
}

.tray-corner-bl {
    bottom: 8px;
    left: 8px;
    border-bottom: 2px solid var(--neon-chartreuse);
    border-left: 2px solid var(--neon-chartreuse);
    box-shadow:
        -2px 2px 8px rgba(184, 240, 48, 0.15),
        inset 1px -1px 4px rgba(184, 240, 48, 0.1);
}

.tray-corner-br {
    bottom: 8px;
    right: 8px;
    border-bottom: 2px solid var(--neon-chartreuse);
    border-right: 2px solid var(--neon-chartreuse);
    box-shadow:
        2px 2px 8px rgba(184, 240, 48, 0.15),
        inset -1px -1px 4px rgba(184, 240, 48, 0.1);
}

/* Scan line animation */
.tray-scan-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 60px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--cyan-pulse), transparent);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
    transform: translateX(-100%);
    animation: scanLine 8s linear infinite;
}

@keyframes scanLine {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateX(calc(100vw * 0.45 / 60 * 100%));
        opacity: 0;
    }
}

.tray-content {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1.2rem 2rem;
    position: relative;
    z-index: 1;
}

.tray-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tray-label {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-weight: 300;
    font-size: 0.7rem;
    color: rgba(232, 220, 196, 0.6);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tray-value {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--warm-parchment);
    letter-spacing: 0.03em;
}

.tray-value-cyan {
    color: var(--cyan-pulse);
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
}

/* ==========================================================================
   Ripple Effect
   ========================================================================== */

.ripple-target {
    position: relative;
    overflow: hidden;
}

.ripple-span {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    transform: scale(0);
    animation: rippleExpand 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.ripple-span.ripple-magenta {
    background: radial-gradient(circle, rgba(255, 45, 120, 0.25) 0%, transparent 70%);
}

.ripple-span.ripple-chartreuse {
    background: radial-gradient(circle, rgba(184, 240, 48, 0.25) 0%, transparent 70%);
}

.ripple-span.ripple-cyan {
    background: radial-gradient(circle, rgba(0, 229, 255, 0.25) 0%, transparent 70%);
}

@keyframes rippleExpand {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ==========================================================================
   Responsive Collapse (below 768px)
   ========================================================================== */

@media (max-width: 768px) {
    body {
        overflow-y: auto;
        overflow-x: hidden;
    }

    .dashboard {
        position: relative;
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        grid-template-columns: none;
        grid-template-rows: none;
        padding-bottom: 56px;
    }

    .specimen-viewer {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--aged-brass);
        overflow-y: visible;
        min-height: auto;
    }

    .sidebar-cabinet {
        width: 100%;
        border-bottom: 1px solid var(--aged-brass);
        overflow-y: visible;
        overflow-x: auto;
    }

    .cabinet-cards {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .specimen-card {
        min-width: 220px;
        flex-shrink: 0;
    }

    .instrument-tray {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 48px;
        z-index: 60;
        border-top: 1px solid var(--aged-brass);
    }

    .tray-content {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 1rem;
        padding: 0.5rem 1rem;
    }

    .tray-corner {
        display: none;
    }

    .hero-botanical {
        width: min(90vw, 300px);
        height: min(90vw, 300px);
    }
}

/* ==========================================================================
   Scrollbar styles for Firefox
   ========================================================================== */

.specimen-viewer,
.sidebar-cabinet {
    scrollbar-width: thin;
    scrollbar-color: var(--aged-brass) var(--walnut-shadow);
}
