/* nlbd.dev - Midnight Botanical Archive Terminal */

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

:root {
    --void: #0a0e1a;
    --terminal-bg: #0f1729;
    --primary: #2d6a9f;
    --secondary: #5b8fb9;
    --amber: #c4955a;
    --green: #3a7d5e;
    --text: #b8c4d4;
    --muted: #6a7a8e;
    --rust: #a85a3a;
    --border: #1a3a5c;
}

body {
    background: var(--void);
    color: var(--text);
    font-family: 'Source Serif 4', serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.72;
    overflow-x: hidden;
}

.terminal-frame {
    max-width: 720px;
    margin: 0 auto;
    background: var(--terminal-bg);
    border: 2px solid var(--border);
    box-shadow: 0 0 40px rgba(26, 58, 92, 0.3);
    border-radius: 8px;
    position: relative;
    min-height: 100vh;
    background-image: radial-gradient(circle at 50% 50%, rgba(45, 106, 159, 0.08) 1px, transparent 1px);
    background-size: 20px 20px;
}

.terminal-frame::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(10, 14, 26, 0.6) 100%);
    pointer-events: none;
    z-index: 10;
}

.terminal-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    pointer-events: none;
    z-index: 10;
    border-radius: 8px;
}

/* Sections */
section {
    padding: clamp(4rem, 8vh, 8rem) clamp(1.5rem, 4vw, 3rem);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-header {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text);
    text-shadow: 0 0 4px rgba(91, 143, 185, 0.3);
    margin-bottom: 1rem;
}

.section-divider {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    color: var(--muted);
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: 0.3em;
}

/* Boot Sequence */
.boot-sequence {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    letter-spacing: 0.04em;
    color: var(--secondary);
    text-shadow: 0 0 4px rgba(91, 143, 185, 0.3);
    transition: opacity 1.5s ease;
}

.boot-sequence.faded {
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

.boot-text {
    white-space: pre-wrap;
    min-height: 200px;
}

.cursor {
    color: var(--amber);
    animation: blink 1.2s step-end infinite;
}

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

/* Specimen Index */
.specimen-index {
    opacity: 0;
    transition: opacity 1s ease;
}

.specimen-index.visible {
    opacity: 1;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.specimen-card {
    background: rgba(15, 23, 41, 0.9);
    border: 1px solid var(--primary);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.specimen-card::before {
    content: '┌';
    position: absolute;
    top: 4px;
    left: 6px;
    color: var(--primary);
    font-size: 18px;
    font-family: monospace;
}

.specimen-card::after {
    content: '┘';
    position: absolute;
    bottom: 4px;
    right: 6px;
    color: var(--primary);
    font-size: 18px;
    font-family: monospace;
}

.specimen-card.expanded {
    transform: scale(1.05);
    z-index: 5;
    box-shadow: 0 0 30px rgba(45, 106, 159, 0.3);
    grid-column: span 1;
}

.specimen-code {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    color: var(--muted);
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 0.5rem;
}

.card-svg {
    width: 80px;
    height: 80px;
    display: block;
    margin: 0.5rem auto;
}

.card-expanded {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 500ms ease, opacity 400ms ease;
}

.specimen-card.expanded .card-expanded {
    max-height: 300px;
    opacity: 1;
}

.specimen-name {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text);
    margin: 1rem 0 0.5rem;
}

.specimen-class {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.specimen-desc {
    font-family: 'Source Serif 4', serif;
    font-weight: 300;
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.6;
}

/* Specimen Deep View */
.specimen-deep-view {
    min-height: 100vh;
    height: auto;
}

.deep-view-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 600px) {
    .deep-view-content {
        grid-template-columns: 1fr;
    }
}

.deep-view-illustration {
    position: relative;
}

.deep-svg {
    width: 100%;
    max-width: 300px;
    height: auto;
}

.hud-label {
    position: absolute;
    border: 1px solid var(--primary);
    background: rgba(15, 23, 41, 0.85);
    padding: 4px 8px;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.7rem;
    color: var(--secondary);
    letter-spacing: 0.04em;
}

.label-data {
    color: var(--muted);
}

.label-1 {
    top: 10%;
    left: 0;
}

.label-2 {
    top: 40%;
    right: 0;
}

.label-3 {
    bottom: 5%;
    left: 30%;
}

.specimen-name-large {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text);
    text-shadow: 0 0 4px rgba(91, 143, 185, 0.3);
}

.specimen-latin {
    font-family: 'Source Serif 4', serif;
    font-weight: 300;
    font-style: italic;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.specimen-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.meta-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.7rem;
    color: var(--muted);
    letter-spacing: 0.04em;
}

.meta-value {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--amber);
}

.specimen-notes {
    font-family: 'Source Serif 4', serif;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 1rem;
    line-height: 1.72;
}

/* Transmission Log */
.transmission-log {
    height: auto;
    min-height: 100vh;
}

.log-entries {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.log-entry {
    border-left: 3px solid var(--primary);
    padding: 1rem 1.5rem;
    color: #8bb8d4;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.log-entry.revealed {
    opacity: 1;
    transform: translateY(0);
}

.log-timestamp {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    color: var(--amber);
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 0.5rem;
}

.log-entry p {
    font-family: 'Source Serif 4', serif;
    font-weight: 400;
    line-height: 1.72;
}

/* End Transmission */
.end-transmission {
    text-align: center;
}

.end-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.end-text {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: 0.08em;
    color: var(--text);
    text-shadow: 0 0 4px rgba(91, 143, 185, 0.3);
}

.restart-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.restart-link {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--rust);
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: color 300ms ease;
}

.restart-link:hover {
    color: var(--amber);
}

/* Reveal animations */
.reveal-item {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* SVG draw-on animation */
.draw-on {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.5s ease;
}

.draw-on.drawn {
    stroke-dashoffset: 0;
}

/* Scanning line */
@keyframes scanline {
    0% { top: 0; }
    100% { top: 100%; }
}

.deep-view-illustration::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(91, 143, 185, 0.2), transparent);
    animation: scanline 4s linear infinite;
    pointer-events: none;
}
