/* luminescence.dev - Field Station for Living Light */

/* Noise texture as inline SVG data URI */
:root {
    --bg-deep: #1c1a16;
    --bg-panel: #252219;
    --bg-panel-hover: #2d2a1f;
    --text-primary: #a8a08c;
    --text-headline: #c2b280;
    --glow-foxfire: #8ba86e;
    --glow-amber: #b8860b;
    --glow-biolume: #5b8c85;
    --line-brass: #7a7462;
    --hover-warm: #e8e0cc;
    --soil-dark: #3d3828;
    --accent-muted-gold: #a89968;
    --transition-bio: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-primary);
    font-family: 'Newsreader', Georgia, serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    overflow-x: hidden;
    position: relative;
    /* Noise texture overlay */
    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' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

/* Fixed geometric grid substrate */
#grid-substrate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

.grid-shapes {
    animation: gridPulse 4s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1.5; }
}

/* Annotation lines overlay */
#annotation-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    pointer-events: none;
}

.annotation-line {
    opacity: 0;
    transition: opacity 1.5s ease-in-out, stroke var(--transition-bio);
}

.annotation-line.visible {
    opacity: 1;
    stroke-dashoffset: 0;
}

.annotation-line.highlight {
    stroke: var(--text-headline);
}

/* Stages */
.stage {
    position: relative;
    width: 100%;
}

/* Stage 0: The Dark Field */
.stage-dark-field {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.stage-0-content {
    text-align: center;
}

.site-title {
    font-family: 'Stint Ultra Expanded', serif;
    font-weight: 400;
    font-size: clamp(1.8rem, 5vw, 3.6rem);
    color: var(--text-headline);
    letter-spacing: 0.03em;
    text-transform: lowercase;
    opacity: 0;
    transition: opacity 800ms ease-in-out;
}

.site-title.visible {
    opacity: 1;
}

.site-meta {
    font-family: 'Azeret Mono', monospace;
    font-weight: 400;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    color: var(--line-brass);
    margin-top: 1.2rem;
    opacity: 0;
    transition: opacity 800ms ease-in-out;
}

.site-meta.visible {
    opacity: 1;
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 2rem;
    padding: 4rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Left Column */
.col-left {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 2rem;
}

.meta-tag {
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(122, 116, 98, 0.15);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 600ms ease-in-out, transform 600ms ease-in-out;
}

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

.meta-label {
    display: block;
    font-family: 'Azeret Mono', monospace;
    font-weight: 400;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--line-brass);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.meta-value {
    display: block;
    font-family: 'Azeret Mono', monospace;
    font-weight: 400;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    color: var(--text-primary);
}

/* Center Column */
.col-center {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* Specimen Frames */
.specimen-frame {
    background: var(--bg-panel);
    border: 1px solid var(--line-brass);
    border-radius: 2px;
    padding: 1.2rem;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 600ms ease-in-out, transform 600ms ease-in-out, border-color var(--transition-bio);
}

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

.specimen-frame:hover {
    border-color: var(--text-headline);
}

.specimen-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(122, 116, 98, 0.15);
}

.specimen-number {
    font-family: 'Azeret Mono', monospace;
    font-weight: 400;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    color: var(--line-brass);
}

.specimen-type {
    font-family: 'Stint Ultra Expanded', serif;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--text-headline);
    letter-spacing: 0.03em;
    text-transform: lowercase;
}

.specimen-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-width: 320px;
    margin: 0 auto;
}

.specimen-shape {
    width: 100%;
    height: 100%;
}

/* Glow animations */
.glow-foxfire {
    filter: drop-shadow(0 0 4px rgba(139, 168, 110, 0.15));
    animation: glowFoxfire 6s ease-in-out infinite;
}

.glow-amber {
    filter: drop-shadow(0 0 4px rgba(184, 134, 11, 0.15));
    animation: glowAmber 6s ease-in-out infinite;
    animation-delay: 1.5s;
}

.glow-biolume {
    filter: drop-shadow(0 0 4px rgba(91, 140, 133, 0.15));
    animation: glowBiolume 6s ease-in-out infinite;
    animation-delay: 3s;
}

.glow-gold {
    filter: drop-shadow(0 0 4px rgba(194, 178, 128, 0.15));
    animation: glowGold 6s ease-in-out infinite;
    animation-delay: 4.5s;
}

@keyframes glowFoxfire {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(139, 168, 110, 0.15)); }
    50% { filter: drop-shadow(0 0 12px rgba(139, 168, 110, 0.4)); }
}

@keyframes glowAmber {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(184, 134, 11, 0.15)); }
    50% { filter: drop-shadow(0 0 12px rgba(184, 134, 11, 0.4)); }
}

@keyframes glowBiolume {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(91, 140, 133, 0.15)); }
    50% { filter: drop-shadow(0 0 12px rgba(91, 140, 133, 0.4)); }
}

@keyframes glowGold {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(194, 178, 128, 0.15)); }
    50% { filter: drop-shadow(0 0 12px rgba(194, 178, 128, 0.4)); }
}

/* Hover intensified glow */
.specimen-frame:hover .glow-foxfire {
    animation: glowFoxfireHover 6s ease-in-out infinite;
}

.specimen-frame:hover .glow-amber {
    animation: glowAmberHover 6s ease-in-out infinite;
}

.specimen-frame:hover .glow-biolume {
    animation: glowBiolumeHover 6s ease-in-out infinite;
}

.specimen-frame:hover .glow-gold {
    animation: glowGoldHover 6s ease-in-out infinite;
}

@keyframes glowFoxfireHover {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(139, 168, 110, 0.3)); }
    50% { filter: drop-shadow(0 0 24px rgba(139, 168, 110, 0.6)); }
}

@keyframes glowAmberHover {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(184, 134, 11, 0.3)); }
    50% { filter: drop-shadow(0 0 24px rgba(184, 134, 11, 0.6)); }
}

@keyframes glowBiolumeHover {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(91, 140, 133, 0.3)); }
    50% { filter: drop-shadow(0 0 24px rgba(91, 140, 133, 0.6)); }
}

@keyframes glowGoldHover {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(194, 178, 128, 0.3)); }
    50% { filter: drop-shadow(0 0 24px rgba(194, 178, 128, 0.6)); }
}

/* Right Column: Data Cards */
.col-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 2rem;
}

.data-card {
    display: flex;
    background: var(--bg-panel);
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 600ms ease-in-out, transform 600ms ease-in-out, background-color var(--transition-bio);
}

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

.data-card:hover {
    background-color: var(--bg-panel-hover);
}

.data-card:hover .data-value,
.data-card:hover .data-label {
    color: var(--hover-warm);
}

.data-card-border {
    /* Default muted gold #a89968 */
    width: 4px;
    min-height: 100%;
    flex-shrink: 0;
    border-left: 4px solid var(--line-brass);
}

.data-card-content {
    padding: 0.8rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.data-label {
    font-family: 'Azeret Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    color: var(--line-brass);
    text-transform: uppercase;
    transition: color var(--transition-bio);
}

.data-value {
    font-family: 'Azeret Mono', monospace;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    color: var(--text-primary);
    transition: color var(--transition-bio);
}

.data-annotation {
    font-family: 'Azeret Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: var(--line-brass);
    opacity: 0.7;
}

/* Sparklines */
.sparkline {
    width: 80px;
    height: 24px;
    margin-top: 0.4rem;
}

/* Field Notes (Stage 3) */
.field-notes {
    background: var(--bg-panel);
    border: 1px solid var(--line-brass);
    border-radius: 2px;
    padding: 2rem;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 600ms ease-in-out, transform 600ms ease-in-out;
}

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

.field-notes-title {
    font-family: 'Stint Ultra Expanded', serif;
    font-weight: 400;
    font-size: clamp(1.3rem, 3.5vw, 2.2rem);
    color: var(--text-headline);
    letter-spacing: 0.03em;
    text-transform: lowercase;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(122, 116, 98, 0.15);
}

.field-notes-body p {
    margin-bottom: 1.2rem;
    color: var(--text-primary);
    font-weight: 300;
}

.field-notes-body p:last-child {
    margin-bottom: 0;
}

/* Terminal Line */
.terminal-line {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(122, 116, 98, 0.15);
    font-family: 'Azeret Mono', monospace;
    font-weight: 400;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    color: var(--line-brass);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 600ms ease-in-out, transform 600ms ease-in-out;
    flex-wrap: wrap;
}

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

.terminal-separator {
    color: rgba(122, 116, 98, 0.4);
}

/* Mycelium decoration */
.mycelium-lines {
    width: 100%;
    height: 50px;
    opacity: 0.4;
    margin-top: 2rem;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .glow-foxfire,
    .glow-amber,
    .glow-biolume,
    .glow-gold {
        animation: none !important;
    }

    .grid-shapes {
        animation: none !important;
    }

    .meta-tag,
    .specimen-frame,
    .data-card,
    .field-notes,
    .terminal-line {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .site-title,
    .site-meta {
        opacity: 1 !important;
        transition: none !important;
    }
}

/* Mobile: Single column layout */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 2rem 1.2rem;
    }

    .col-left {
        order: 1;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding-top: 0;
        border-bottom: 1px solid rgba(122, 116, 98, 0.15);
        padding-bottom: 1rem;
    }

    .meta-tag {
        border-bottom: none;
        padding: 0.4rem 0.8rem;
        background: var(--bg-panel);
        border-radius: 2px;
    }

    .col-center {
        order: 2;
    }

    .col-right {
        order: 3;
        padding-top: 0;
        border-top: 1px solid rgba(122, 116, 98, 0.15);
        padding-top: 1rem;
    }

    .specimen-viewport {
        max-width: 240px;
    }

    .terminal-line {
        flex-direction: column;
        gap: 0.3rem;
        align-items: flex-start;
    }
}

/* Tablet adjustment */
@media (max-width: 1200px) and (min-width: 901px) {
    .dashboard-grid {
        grid-template-columns: 1fr 3fr 1fr;
        gap: 1.5rem;
        padding: 3rem 1.5rem;
    }
}

/* Stage 3 grid brightening via class */
.stage-full-activation.activated #grid-substrate {
    opacity: 1;
}
