/* sbom.day — Deep-Space Botanical Expedition Log */

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

:root {
    --deep-void: #0d1a14;
    --specimen-chamber: #1a2f2a;
    --bio-teal: #4ecdc4;
    --alert-coral: #e85d4a;
    --parchment: #e8e0d0;
    --faded-ink: #b8b0a0;
    --phosphor-amber: #d4a04a;
    --grid-channel: #2d4a3a;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--deep-void);
    color: var(--parchment);
    font-family: 'EB Garamond', serif;
    overflow-x: hidden;
    line-height: 1.65;
}

/* Scanline Overlay */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(13, 26, 20, 0.15) 2px, rgba(13, 26, 20, 0.15) 4px);
    pointer-events: none;
    z-index: 9999;
}

/* Top Strip */
.top-strip {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: rgba(13, 26, 20, 0.9);
    backdrop-filter: blur(4px);
    z-index: 100;
    border-bottom: 1px solid var(--grid-channel);
}

.domain-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--faded-ink);
}

.pulse-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bio-teal);
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { background: var(--bio-teal); box-shadow: 0 0 4px var(--bio-teal); }
    50% { background: var(--specimen-chamber); box-shadow: none; }
}

/* Zone — General */
.zone {
    min-height: 100vh;
    position: relative;
}

/* Zone 1 — Arrival */
.zone-arrival {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.organism-hero {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3rem;
}

.organism-core {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--bio-teal) 0%, rgba(78, 205, 196, 0.3) 50%, transparent 70%);
    animation: breathe 4s ease-in-out infinite;
    position: absolute;
}

.organism-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(78, 205, 196, 0.3);
}

.ring-1 { width: 100px; height: 100px; animation: breathe 4s ease-in-out infinite 0.5s; }
.ring-2 { width: 160px; height: 160px; animation: breathe 4s ease-in-out infinite 1s; }
.ring-3 { width: 240px; height: 240px; animation: breathe 4s ease-in-out infinite 1.5s; }

@keyframes breathe {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.03); opacity: 0.7; }
}

.organism-tendrils {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.tendril {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: tendril-grow 8s ease-out forwards;
    opacity: 0.7;
    filter: blur(0.3px);
}

.t1 { animation-delay: 1s; }
.t2 { animation-delay: 2s; }
.t3 { animation-delay: 3s; }
.t4 { animation-delay: 4s; }
.t5 { animation-delay: 5s; }
.t6 { animation-delay: 6s; }

@keyframes tendril-grow {
    to { stroke-dashoffset: 0; }
}

.arrival-title {
    font-family: 'EB Garamond', serif;
    font-weight: 700;
    font-size: clamp(4rem, 12vw, 9rem);
    color: var(--parchment);
    letter-spacing: 0.02em;
    line-height: 1.15;
    min-height: 1.2em;
}

.arrival-subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: var(--faded-ink);
    margin-top: 1rem;
    opacity: 0;
    animation: fade-in 2s ease forwards 3s;
}

@keyframes fade-in {
    to { opacity: 1; }
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr 0.8fr 1.2fr;
    gap: 3px;
    padding: 3px;
    background: linear-gradient(180deg, var(--grid-channel) 0%, #1a2f2a 100%);
    max-width: 1400px;
    margin: 0 auto;
}

/* Specimen Cards */
.specimen-card {
    background: var(--specimen-chamber);
    perspective: 1200px;
    overflow: hidden;
}

.card-2x2 {
    grid-column: span 2;
    min-height: 320px;
}

.card-1x1 {
    min-height: 200px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: inherit;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-style: preserve-3d;
}

.specimen-card:not(.log-entry):hover .card-inner {
    transform: rotateY(180deg);
    box-shadow: 0 10px 40px rgba(78, 205, 196, 0.15);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.card-back {
    transform: rotateY(180deg);
    background: var(--deep-void);
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.5rem;
}

.card-back h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    color: var(--bio-teal);
    font-size: 1rem;
}

.card-back code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    background: rgba(30, 50, 42, 0.6);
    border-left: 2px solid var(--bio-teal);
    padding: 0.3em 0.6em;
    color: var(--parchment);
}

.card-back .license,
.card-back .dep-count {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    color: var(--phosphor-amber);
    font-feature-settings: 'tnum';
}

.card-back .field-note {
    font-style: italic;
    color: var(--faded-ink);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.card-back .cve {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: var(--alert-coral);
}

.card-back .severity {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    color: var(--alert-coral);
    font-weight: 500;
}

.card-back .pathology-note {
    color: var(--alert-coral);
    opacity: 0.85;
}

.risk-dot {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.risk-low { background: var(--bio-teal); }
.risk-medium { background: var(--phosphor-amber); }
.risk-high { background: var(--alert-coral); }
.risk-critical { background: var(--alert-coral); animation: flicker 0.5s ease-in-out infinite; }

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.pkg-name {
    font-family: 'EB Garamond', serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    color: var(--parchment);
    letter-spacing: 0.02em;
    margin-top: 1rem;
}

/* Organism Glyphs */
.organism-glyph {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(78, 205, 196, 0.4) 0%, rgba(212, 160, 74, 0.2) 40%, transparent 70%);
    position: relative;
    animation: breathe 4s ease-in-out infinite;
    filter: blur(0.5px);
    mix-blend-mode: screen;
}

.organism-glyph::before {
    content: '';
    position: absolute;
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-radius: 50%;
    background: radial-gradient(circle at 60% 60%, rgba(78, 205, 196, 0.6) 0%, transparent 60%);
}

.organism-glyph::after {
    content: '';
    position: absolute;
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
    border-radius: 50%;
    background: var(--bio-teal);
    opacity: 0.3;
    filter: blur(8px);
}

.organism-glyph.distressed {
    animation: breathe 4s ease-in-out infinite, flicker 1.5s ease-in-out infinite;
    background: radial-gradient(circle at 30% 30%, rgba(232, 93, 74, 0.5) 0%, rgba(212, 160, 74, 0.2) 40%, transparent 70%);
    filter: blur(0.8px) saturate(0.6);
}

.organism-glyph.distressed::before {
    background: radial-gradient(circle at 60% 60%, rgba(232, 93, 74, 0.5) 0%, transparent 60%);
}

/* Log Entries */
.log-front {
    align-items: flex-start;
    justify-content: flex-start;
}

.timestamp {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--phosphor-amber);
    margin-bottom: 0.75rem;
}

.log-text {
    font-style: italic;
    font-size: 1rem;
    color: var(--faded-ink);
    line-height: 1.65;
}

/* Data Strips */
.data-strip {
    grid-column: 1 / -1;
    background: var(--deep-void);
    padding: 0.75rem 1.5rem;
    display: flex;
    gap: 2rem;
    align-items: center;
    overflow-x: auto;
    border-top: 1px solid var(--grid-channel);
    border-bottom: 1px solid var(--grid-channel);
}

.telemetry {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    color: var(--faded-ink);
    white-space: nowrap;
    font-feature-settings: 'tnum';
}

.telemetry em {
    font-style: normal;
    color: var(--bio-teal);
}

/* Zone 3 — Deep Scan */
.zone-deepscan {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.mycelium-container {
    width: 100%;
    max-width: 1200px;
    height: 500px;
    margin: 2rem 0;
}

.mycelium-network {
    width: 100%;
    height: 100%;
}

.mycelium-network line {
    stroke: var(--bio-teal);
    stroke-width: 0.3px;
    opacity: 0.15;
}

.mycelium-network circle {
    fill: var(--bio-teal);
    opacity: 0.4;
}

.deepscan-prose {
    max-width: 700px;
    margin: 2rem auto;
}

.field-journal {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    color: var(--faded-ink);
    line-height: 1.65;
    margin-bottom: 1.5rem;
}

.top-strip-data, .bottom-strip-data {
    background: var(--deep-void);
    padding: 0.75rem 1.5rem;
    display: flex;
    gap: 2rem;
    border: 1px solid var(--grid-channel);
    width: 100%;
    max-width: 1200px;
}

/* Zone 4 — Pathology */
.zone-pathology {
    padding: 0;
}

.biome-panel {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.biome-fractured {
    background: var(--deep-void);
}

.terrain-layer {
    position: absolute;
    width: 100%;
    height: 100%;
}

.t-layer-1 {
    clip-path: polygon(0% 70%, 15% 45%, 30% 65%, 45% 35%, 60% 55%, 75% 30%, 90% 50%, 100% 40%, 100% 100%, 0% 100%);
    background: linear-gradient(180deg, var(--alert-coral) 0%, rgba(232, 93, 74, 0.3) 100%);
    opacity: 0.4;
}

.t-layer-2 {
    clip-path: polygon(0% 80%, 20% 60%, 35% 75%, 50% 50%, 65% 70%, 80% 45%, 95% 65%, 100% 55%, 100% 100%, 0% 100%);
    background: linear-gradient(180deg, var(--phosphor-amber) 0%, rgba(212, 160, 74, 0.2) 100%);
    opacity: 0.3;
}

.t-layer-3 {
    clip-path: polygon(0% 85%, 10% 75%, 25% 85%, 40% 70%, 55% 80%, 70% 65%, 85% 78%, 100% 70%, 100% 100%, 0% 100%);
    background: var(--specimen-chamber);
    opacity: 0.6;
}

.pathology-grid {
    padding: 3px;
}

.compromised .card-front {
    border: 1px solid rgba(232, 93, 74, 0.3);
}

/* Zone 5 — Complete */
.zone-complete {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 4rem 2rem;
    position: relative;
}

.growth-rings-container {
    margin-bottom: 3rem;
}

#growth-rings-canvas {
    max-width: 100%;
    height: auto;
}

.completion-text {
    max-width: 650px;
    text-align: center;
}

.final-entry {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    margin-bottom: 1.5rem;
}

.log-end {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    color: var(--phosphor-amber);
    letter-spacing: 0.1em;
    display: block;
    margin-top: 2rem;
}

.organism-callback {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}

.organism-callback .organism-core {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--bio-teal) 0%, rgba(78, 205, 196, 0.3) 50%, transparent 70%);
    animation: breathe 4s ease-in-out infinite;
    position: absolute;
}

.organism-callback .ring-1 { width: 60px; height: 60px; }
.organism-callback .ring-2 { width: 100px; height: 100px; }

.organism-tendrils-full {
    position: absolute;
}

.organism-tendrils-full .tendril {
    animation: none;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    opacity: 0.5;
}

/* Scroll reveal */
.specimen-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Responsive */
@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr 1fr;
    }
    .card-2x2 {
        grid-column: span 2;
    }
    .organism-hero {
        width: 200px;
        height: 200px;
    }
}

@media (max-width: 480px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .card-2x2 {
        grid-column: span 1;
    }
    .data-strip, .top-strip-data, .bottom-strip-data {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}
