/*
 * ═══════════════════════════════════════════════════════
 *  DULKÓÐA - ENHANCED NORDIC WINTER TERMINAL
 * ═══════════════════════════════════════════════════════
 * 
 * Inspired by:
 * - Icelandic winter nights & Northern Lights
 * - Viking longships & rune stones  
 * - Nordic minimalism & brutalist design
 * - Ancient Norse mythology
 * 
 * "Í myrkri kemur ljósið" - In darkness comes the light
 * "Þögn bindur og leysir í einu" - Silence binds and frees
 * 
 * ═══════════════════════════════════════════════════════
 */

/* ═══════════════════════════════════════════════════════
   NORD COLOR PALETTE - Extended
   ═══════════════════════════════════════════════════════ */

:root {
    /* Polar Night - Deep Blues */
    --nord0: #2e3440;
    --nord1: #3b4252;
    --nord2: #434c5e;
    --nord3: #4c566a;
    
    /* Snow Storm - Whites */
    --nord4: #d8dee9;
    --nord5: #e5e9f0;
    --nord6: #eceff4;
    
    /* Frost - Cyan/Blue */
    --nord7: #8fbcbb;
    --nord8: #88c0d0;
    --nord9: #81a1c1;
    --nord10: #5e81ac;
    
    /* Aurora - Accents */
    --nord11: #bf616a;  /* Red */
    --nord12: #d08770;  /* Orange */
    --nord13: #ebcb8b;  /* Yellow */
    --nord14: #a3be8c;  /* Green */
    --nord15: #b48ead;  /* Purple */
    
    /* Custom - Enhanced */
    --bg-deep: #1a1f2e;
    --bg-darker: #242933;
    --shadow-strong: rgba(0, 0, 0, 0.5);
    --glow-ice: rgba(136, 192, 208, 0.4);
    --glow-aurora: rgba(163, 190, 140, 0.3);
}

/* ═══════════════════════════════════════════════════════
   BASE & RESET
   ═══════════════════════════════════════════════════════ */

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

body {
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    font-size: 15px;
    line-height: 1.6;
    background: linear-gradient(180deg, #0a0e1a 0%, #1a1f2e 50%, #242933 100%);
    color: var(--nord4);
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

/* Nordic Sky Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        /* Northern Lights Layer 1 - Green Aurora */
        radial-gradient(ellipse at 30% 20%, rgba(163, 190, 140, 0.25) 0%, transparent 50%),
        /* Northern Lights Layer 2 - Blue Aurora */
        radial-gradient(ellipse at 70% 35%, rgba(136, 192, 208, 0.2) 0%, transparent 45%),
        /* Northern Lights Layer 3 - Purple Aurora */
        radial-gradient(ellipse at 50% 10%, rgba(180, 142, 173, 0.15) 0%, transparent 55%),
        /* Star Field */
        radial-gradient(circle at 15% 25%, rgba(236, 239, 244, 0.8) 1px, transparent 1px),
        radial-gradient(circle at 85% 15%, rgba(236, 239, 244, 0.6) 1.5px, transparent 1.5px),
        radial-gradient(circle at 50% 40%, rgba(236, 239, 244, 0.5) 1px, transparent 1px),
        radial-gradient(circle at 10% 80%, rgba(236, 239, 244, 0.7) 1px, transparent 1px),
        /* Texture */
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(136, 192, 208, 0.01) 2px,
            rgba(136, 192, 208, 0.01) 4px
        );
    background-size: 
        100% 100%,
        100% 100%,
        100% 100%,
        250px 250px,
        150px 150px,
        300px 300px,
        200px 200px,
        100% 100%;
    pointer-events: none;
    animation: aurora-borealis 25s ease-in-out infinite;
    z-index: 0;
}

/* Snow Particles - Multiple Layers */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        /* Snow Layer 1 - Small, distant flakes */
        radial-gradient(circle at 5px 10px, rgba(236, 239, 244, 0.5) 1px, transparent 1px),
        /* Snow Layer 2 - Medium flakes */
        radial-gradient(circle at 15px 30px, rgba(236, 239, 244, 0.4) 2px, transparent 2px);
    background-size: 50px 50px, 80px 80px;
    background-position: 0 0, 25px 25px;
    pointer-events: none;
    animation: snow-fall 15s linear infinite;
    z-index: 0;
}

@keyframes aurora-shift {
    0%, 100% {
        opacity: 0.3;
        filter: hue-rotate(0deg);
    }
    50% {
        opacity: 0.5;
        filter: hue-rotate(30deg);
    }
}

@keyframes aurora-borealis {
    0% {
        background-position: 
            0% 0%,
            0% 0%,
            0% 0%,
            0% 0%,
            0% 0%,
            0% 0%,
            0% 0%,
            0% 0%;
        opacity: 0.6;
        filter: hue-rotate(0deg) saturate(1);
    }
    25% {
        opacity: 0.8;
        filter: hue-rotate(-10deg) saturate(1.2);
    }
    50% {
        background-position: 
            10% 10%,
            -10% 5%,
            5% 0%,
            20% 20%,
            -5% 15%,
            15% 10%,
            0% 0%,
            0% 0%;
        opacity: 1;
        filter: hue-rotate(0deg) saturate(1.5);
    }
    75% {
        opacity: 0.8;
        filter: hue-rotate(10deg) saturate(1.2);
    }
    100% {
        background-position: 
            0% 0%,
            0% 0%,
            0% 0%,
            0% 0%,
            0% 0%,
            0% 0%,
            0% 0%,
            0% 0%;
        opacity: 0.6;
        filter: hue-rotate(0deg) saturate(1);
    }
}

@keyframes snow-fall {
    0% {
        background-position: 0% 0%, 25px 25px;
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        background-position: 0% 100%, 25px 125px;
        opacity: 0.3;
    }
}

@keyframes frost-shimmer {
    0%, 100% {
        box-shadow: 
            0 0 30px rgba(136, 192, 208, 0.3),
            0 0 60px rgba(136, 192, 208, 0.1),
            inset 0 0 30px rgba(136, 192, 208, 0.05);
    }
    50% {
        box-shadow: 
            0 0 40px rgba(136, 192, 208, 0.5),
            0 0 80px rgba(180, 142, 173, 0.2),
            inset 0 0 40px rgba(136, 192, 208, 0.1);
    }
}

@keyframes ice-crystals {
    0%, 100% {
        opacity: 0.4;
        transform: translateY(0px) rotateZ(0deg);
    }
    50% {
        opacity: 0.7;
        transform: translateY(-5px) rotateZ(10deg);
    }
}

@keyframes rune-fall-left {
    0% {
        top: -50px;
        opacity: 0;
        transform: rotateZ(0deg) rotateX(0deg) translateX(0);
    }
    10% {
        opacity: 1;
    }
    50% {
        transform: rotateZ(180deg) rotateX(180deg) translateX(-60px);
    }
    90% {
        opacity: 1;
    }
    100% {
        top: 100vh;
        opacity: 0;
        transform: rotateZ(360deg) rotateX(360deg) translateX(-100px);
    }
}

@keyframes rune-fall-right {
    0% {
        top: -50px;
        opacity: 0;
        transform: rotateZ(0deg) rotateX(0deg) translateX(0);
    }
    10% {
        opacity: 1;
    }
    50% {
        transform: rotateZ(180deg) rotateX(180deg) translateX(60px);
    }
    90% {
        opacity: 1;
    }
    100% {
        top: 100vh;
        opacity: 0;
        transform: rotateZ(360deg) rotateX(360deg) translateX(100px);
    }
}

@keyframes rune-fall-straight {
    0% {
        top: -50px;
        opacity: 0;
        transform: rotateZ(0deg) rotateX(0deg) rotateY(0deg);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        top: 100vh;
        opacity: 0;
        transform: rotateZ(360deg) rotateX(360deg) rotateY(360deg);
    }
}

/* Rune Blizzard Container Styling */
.falling-rune {
    animation-timing-function: linear;
    filter: drop-shadow(0 0 8px rgba(136, 192, 208, 0.6)) drop-shadow(0 0 15px rgba(163, 190, 140, 0.3));
}

@keyframes fade-out {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes terminal-close {
    0% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
    50% {
        transform: scale(0.95) rotateY(-10deg);
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: scale(0.8) rotateY(90deg);
        pointer-events: none;
    }
}

@keyframes terminal-maximize {
    0% {
        border-radius: 12px;
        opacity: 0.95;
    }
    100% {
        border-radius: 0;
        opacity: 1;
    }
}

@keyframes terminal-restore {
    0% {
        border-radius: 0;
        opacity: 1;
    }
    100% {
        border-radius: 12px;
        opacity: 0.95;
    }
}

@keyframes button-press {
    0% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    }
    50% {
        transform: scale(0.85);
        box-shadow: 0 0 25px rgba(255, 255, 255, 0.6);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    }
}

::selection {
    background: var(--nord8);
    color: var(--nord0);
}

/* ═══════════════════════════════════════════════════════
   BOOT SEQUENCE - Epic Viking Entry
   ═══════════════════════════════════════════════════════ */

.boot-sequence {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-deep);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    animation: boot-fade-out 0.8s ease-out 4s forwards;
}

@keyframes boot-fade-out {
    to {
        opacity: 0;
        pointer-events: none;
        transform: scale(0.95);
    }
}

.boot-logo {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 10px;
    line-height: 1.2;
    color: var(--nord8);
    text-shadow: 
        0 0 20px var(--glow-ice),
        0 0 40px var(--glow-ice),
        0 0 60px rgba(136, 192, 208, 0.2);
    margin-bottom: 2rem;
    opacity: 0;
    animation: logo-dramatic-entry 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards;
    letter-spacing: -1px;
    white-space: pre;
    text-align: center;
}

@keyframes logo-dramatic-entry {
    0% {
        opacity: 0;
        transform: scale(0.5) rotateY(90deg);
        filter: blur(10px);
    }
    60% {
        transform: scale(1.05) rotateY(-5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
        filter: blur(0);
    }
}

.boot-sequence p {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    margin: 6px 0;
    color: var(--nord14);
    opacity: 0;
    animation: boot-line-slide 0.4s ease-out forwards;
    text-shadow: 0 0 10px var(--glow-aurora);
}

.boot-sequence p:nth-child(2) { animation-delay: 0.3s; }
.boot-sequence p:nth-child(3) { animation-delay: 0.6s; }
.boot-sequence p:nth-child(4) { animation-delay: 0.9s; }
.boot-sequence p:nth-child(5) { animation-delay: 1.2s; }
.boot-sequence p:nth-child(6) { animation-delay: 1.5s; }
.boot-sequence p:nth-child(7) { animation-delay: 1.8s; }
.boot-sequence p:nth-child(8) { animation-delay: 2.1s; }

@keyframes boot-line-slide {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ═══════════════════════════════════════════════════════
   TERMINAL CONTAINER - Viking Longship Frame
   ═══════════════════════════════════════════════════════ */

.terminal {
    background: linear-gradient(135deg, var(--nord1) 0%, var(--nord0) 100%);
    border-radius: 12px;
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(136, 192, 208, 0.1),
        inset 0 0 60px rgba(136, 192, 208, 0.03);
    width: 100%;
    max-width: 950px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 10;
    animation: terminal-materialize 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.terminal::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(
        135deg,
        var(--nord8) 0%,
        var(--nord10) 25%,
        var(--nord15) 50%,
        var(--nord10) 75%,
        var(--nord8) 100%
    );
    border-radius: 12px;
    z-index: -1;
    opacity: 0.3;
    animation: border-flow 8s linear infinite, frost-shimmer 6s ease-in-out infinite;
}

@keyframes border-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes terminal-materialize {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

/* ═══════════════════════════════════════════════════════
   TERMINAL HEADER - Runic Crown
   ═══════════════════════════════════════════════════════ */

.terminal-header {
    background: linear-gradient(
        135deg,
        var(--nord0) 0%,
        var(--nord1) 50%,
        var(--nord0) 100%
    );
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--nord10);
    box-shadow: 
        0 4px 20px var(--shadow-strong),
        inset 0 1px 0 rgba(136, 192, 208, 0.1);
    flex-shrink: 0;
    position: relative;
}

.terminal-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--nord8) 50%,
        transparent 100%
    );
    animation: header-shimmer 3s ease-in-out infinite;
}

@keyframes header-shimmer {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.terminal-title {
    font-family: 'Monaco', 'Consolas', monospace;
    font-weight: 700;
    color: var(--nord13);
    font-size: 14px;
    text-shadow: 
        0 0 10px rgba(235, 203, 139, 0.6),
        0 0 20px rgba(235, 203, 139, 0.3);
    letter-spacing: 1px;
    animation: title-pulse 4s ease-in-out infinite;
}

@keyframes title-pulse {
    0%, 100% {
        text-shadow: 
            0 0 10px rgba(235, 203, 139, 0.6),
            0 0 20px rgba(235, 203, 139, 0.3);
    }
    50% {
        text-shadow: 
            0 0 15px rgba(235, 203, 139, 0.8),
            0 0 30px rgba(235, 203, 139, 0.4),
            0 0 45px rgba(235, 203, 139, 0.2);
    }
}

.terminal-buttons {
    display: flex;
    gap: 10px;
}

.terminal-buttons span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.terminal-buttons span::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.terminal-buttons span:hover {
    transform: scale(1.2) rotate(90deg);
}

.terminal-buttons span:hover::before {
    width: 80%;
    height: 80%;
}

.btn-close {
    background: radial-gradient(circle, var(--nord11) 0%, #a54e56 100%);
    box-shadow: 0 0 15px rgba(191, 97, 106, 0.6);
}

.btn-minimize {
    background: radial-gradient(circle, var(--nord13) 0%, #d4b171 100%);
    box-shadow: 0 0 15px rgba(235, 203, 139, 0.6);
}

.btn-maximize {
    background: radial-gradient(circle, var(--nord14) 0%, #8fa978 100%);
    box-shadow: 0 0 15px rgba(163, 190, 140, 0.6);
}

/* ═══════════════════════════════════════════════════════
   TERMINAL BODY - Sacred Scroll
   ═══════════════════════════════════════════════════════ */

.terminal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    background: var(--nord0);
    min-height: 0;
    line-height: 1.7;
    font-size: 14px;
    box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.4);
    position: relative;
}

/* Frost Pattern Overlay */
.terminal-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(136, 192, 208, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(163, 190, 140, 0.02) 0%, transparent 50%);
    pointer-events: none;
}

/* Nordic Scrollbar */
.terminal-body::-webkit-scrollbar {
    width: 14px;
}

.terminal-body::-webkit-scrollbar-track {
    background: var(--nord1);
    border-left: 1px solid var(--nord3);
    box-shadow: inset 2px 0 4px rgba(0, 0, 0, 0.3);
}

.terminal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        var(--nord10) 0%,
        var(--nord8) 50%,
        var(--nord10) 100%
    );
    border-radius: 3px;
    border: 2px solid var(--nord1);
    box-shadow: 0 0 10px var(--glow-ice);
    transition: all 0.3s ease;
}

.terminal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        180deg,
        var(--nord8) 0%,
        var(--nord7) 50%,
        var(--nord8) 100%
    );
    box-shadow: 0 0 20px var(--glow-ice);
}

/* ═══════════════════════════════════════════════════════
   ASCII ART - Runic Inscription
   ═══════════════════════════════════════════════════════ */

.ascii-art {
    font-family: 'Monaco', 'Consolas', monospace;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.4;
    color: var(--nord8);
    margin: 2rem auto;
    padding: 1rem 0;
    white-space: pre;
    text-shadow: 
        0 0 15px var(--glow-ice),
        0 0 30px var(--glow-ice);
    animation: rune-inscription 5s ease-in-out infinite;
    letter-spacing: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    overflow-x: auto;
}

@keyframes rune-inscription {
    0%, 100% {
        text-shadow: 
            0 0 15px var(--glow-ice),
            0 0 30px var(--glow-ice);
        filter: brightness(1);
    }
    50% {
        text-shadow: 
            0 0 25px var(--glow-ice),
            0 0 50px var(--glow-ice),
            0 0 75px rgba(136, 192, 208, 0.3);
        filter: brightness(1.2);
    }
}

/* ═══════════════════════════════════════════════════════
   OUTPUT & COMMANDS
   ═══════════════════════════════════════════════════════ */

.output {
    margin: 20px 0;
    white-space: pre-wrap;
}

.output p {
    margin: 2px 0;
    opacity: 0;
    animation: text-materialize 0.4s ease-out forwards;
}

.output p:nth-child(1) { animation-delay: 0.1s; }
.output p:nth-child(2) { animation-delay: 0.2s; }
.output p:nth-child(3) { animation-delay: 0.3s; }
.output p:nth-child(4) { animation-delay: 0.4s; }
.output p:nth-child(5) { animation-delay: 0.5s; }

@keyframes text-materialize {
    from {
        opacity: 0;
        transform: translateX(-10px);
        filter: blur(2px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
        filter: blur(0);
    }
}

.command-history {
    margin: 12px 0;
}

.user-command {
    display: flex;
    gap: 12px;
    margin: 8px 0;
    align-items: baseline;
}

/* ═══════════════════════════════════════════════════════
   PROMPT - Golden Rune
   ═══════════════════════════════════════════════════════ */

.prompt {
    color: var(--nord13);
    font-weight: 700;
    font-family: 'Monaco', 'Consolas', monospace;
    text-shadow: 
        0 0 10px rgba(235, 203, 139, 0.6),
        0 0 20px rgba(235, 203, 139, 0.3);
    animation: prompt-breathe 3s ease-in-out infinite;
}

@keyframes prompt-breathe {
    0%, 100% {
        opacity: 1;
        text-shadow: 
            0 0 10px rgba(235, 203, 139, 0.6),
            0 0 20px rgba(235, 203, 139, 0.3);
    }
    50% {
        opacity: 0.85;
        text-shadow: 
            0 0 15px rgba(235, 203, 139, 0.8),
            0 0 30px rgba(235, 203, 139, 0.4);
    }
}

.command {
    color: var(--nord6);
    text-shadow: 0 0 5px rgba(236, 239, 244, 0.2);
}

/* ═══════════════════════════════════════════════════════
   COMMAND OUTPUT
   ═══════════════════════════════════════════════════════ */

.command-output {
    margin-left: 24px;
    margin-bottom: 12px;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    line-height: 1.5;
    padding-left: 12px;
    border-left: 3px solid var(--nord10);
    box-shadow: -2px 0 8px rgba(94, 129, 172, 0.2);
}

/* ═══════════════════════════════════════════════════════
   TEXT STYLING - Elemental Colors
   ═══════════════════════════════════════════════════════ */

.dim {
    color: var(--nord3);
    font-style: italic;
    opacity: 0.7;
}

.highlight {
    color: var(--nord13);
    font-weight: 700;
    text-shadow: 
        0 0 12px rgba(235, 203, 139, 0.7),
        0 0 24px rgba(235, 203, 139, 0.4);
    animation: highlight-flare 2.5s ease-in-out infinite;
}

@keyframes highlight-flare {
    0%, 100% {
        text-shadow: 
            0 0 12px rgba(235, 203, 139, 0.7),
            0 0 24px rgba(235, 203, 139, 0.4);
    }
    50% {
        text-shadow: 
            0 0 18px rgba(235, 203, 139, 0.9),
            0 0 36px rgba(235, 203, 139, 0.6),
            0 0 54px rgba(235, 203, 139, 0.3);
    }
}

.success {
    color: var(--nord14);
    font-weight: 500;
    text-shadow: 0 0 8px rgba(163, 190, 140, 0.5);
}

.error {
    color: var(--nord11);
    font-weight: 500;
    text-shadow: 0 0 10px rgba(191, 97, 106, 0.6);
    animation: error-pulse 0.5s ease-in-out;
}

@keyframes error-pulse {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.encrypted-text {
    color: var(--nord15);
    font-family: 'Monaco', 'Consolas', monospace;
    font-style: italic;
    letter-spacing: 1px;
    word-break: break-all;
    text-shadow: 0 0 10px rgba(180, 142, 173, 0.6);
    animation: encryption-glitch 4s ease-in-out infinite;
}

@keyframes encryption-glitch {
    0%, 90%, 100% {
        transform: translateX(0);
        opacity: 1;
    }
    92% {
        transform: translateX(-3px);
        opacity: 0.8;
    }
    94% {
        transform: translateX(3px);
        opacity: 0.9;
    }
    96% {
        transform: translateX(-2px);
        opacity: 0.85;
    }
    98% {
        transform: translateX(2px);
        opacity: 0.95;
    }
}

.encrypted {
    color: var(--nord11);
    font-weight: 500;
    text-shadow: 0 0 8px rgba(191, 97, 106, 0.6);
    animation: encrypted-shimmer 2s ease-in-out infinite;
}

@keyframes encrypted-shimmer {
    0%, 100% {
        opacity: 1;
        filter: brightness(1);
    }
    50% {
        opacity: 0.7;
        filter: brightness(1.3);
    }
}

.file {
    color: var(--nord4);
}

.dir {
    color: var(--nord10);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(94, 129, 172, 0.5);
}

.hidden {
    color: var(--nord3);
    opacity: 0.4;
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════
   TERMINAL INPUT - Völva's Voice
   ═══════════════════════════════════════════════════════ */

.terminal-input-area {
    padding: 14px 20px;
    background: linear-gradient(
        135deg,
        var(--nord0) 0%,
        var(--nord1) 100%
    );
    border-top: 2px solid var(--nord10);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    box-shadow: 
        0 -4px 20px var(--shadow-strong),
        inset 0 1px 0 rgba(136, 192, 208, 0.1);
    position: relative;
}

.terminal-input-area::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--nord8) 50%,
        transparent 100%
    );
    animation: input-shimmer 3s ease-in-out infinite;
}

@keyframes input-shimmer {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--nord6);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    caret-color: var(--nord8);
    text-shadow: 0 0 5px rgba(236, 239, 244, 0.3);
}

.terminal-input::selection {
    background: var(--nord8);
    color: var(--nord0);
}

/* Runic Cursor Effect */
.terminal-input::after {
    content: '᛫';
    color: var(--nord8);
    font-weight: 700;
    margin-left: 3px;
    animation: rune-cursor-blink 1.2s ease-in-out infinite;
    text-shadow: 
        0 0 10px var(--glow-ice),
        0 0 20px var(--glow-ice);
}

@keyframes rune-cursor-blink {
    0%, 45% {
        opacity: 1;
        text-shadow: 
            0 0 10px var(--glow-ice),
            0 0 20px var(--glow-ice);
    }
    50%, 95% {
        opacity: 0;
        text-shadow: none;
    }
    100% {
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════════════
   RUNIC DIVIDERS
   ═══════════════════════════════════════════════════════ */

.runic-divider {
    text-align: center;
    color: var(--nord10);
    margin: var(--spacing-md) 0;
    letter-spacing: 8px;
    font-size: 18px;
    opacity: 0.6;
    text-shadow: 0 0 10px var(--glow-ice);
}

.runic-divider::before {
    content: '᛫᛫᛫';
}

.runic-divider::after {
    content: '᛫᛫᛫';
}

/* ═══════════════════════════════════════════════════════
   MATRIX CANVAS - Ancient Magic
   ═══════════════════════════════════════════════════════ */

#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
    opacity: 0.6;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE - Mobile Vikings
   ═══════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .terminal {
        height: 92vh;
        max-width: 100%;
    }
    
    .terminal-body {
        font-size: 13px;
        padding: 16px;
    }
    
    .ascii-art {
        font-size: 10px;
    }
    
    .boot-logo {
        font-size: 7px;
    }
    
    .boot-sequence {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .terminal {
        height: 95vh;
        border-radius: 8px;
    }
    
    .terminal-body {
        font-size: 12px;
        padding: 12px;
    }
    
    .terminal-input {
        font-size: 13px;
    }
    
    .ascii-art {
        font-size: 8px;
    }
}

/* ═══════════════════════════════════════════════════════
   ACCESSIBILITY - All Warriors Welcome
   ═══════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --nord4: #ffffff;
        --nord8: #00ffff;
        --nord13: #ffff00;
    }
}

/* ═══════════════════════════════════════════════════════
   END OF NORDIC WINTER TERMINAL
   
   "Ég sé í myrkri, en birtan kemur"
   "I see in darkness, but light comes"
   
   "Völvan veit, en þú verður að finna"
   "The seeress knows, but you must discover"
   ═══════════════════════════════════════════════════════ */