/* ==========================================
   DAMNSCOUT PORTFOLIO
   Cassette Futurism Aesthetic
   ========================================== */

/* CSS Custom Properties */
:root {
    /* Core palette - Terminal Interface */
    --bg-deep: #0a0a0f;
    --bg-panel: #12121a;
    --bg-card: #1a1a24;
    --bg-elevated: #22222e;

    /* Terminal greens */
    --terminal-green: #00ff88;
    --terminal-green-dim: #00cc6a;
    --terminal-green-glow: rgba(0, 255, 136, 0.3);

    /* Amber accents */
    --amber: #ffd700;
    --amber-dim: #b8960f;
    --amber-glow: rgba(255, 215, 0, 0.3);

    /* Accent colors */
    --accent-red: #ff4757;
    --accent-blue: #5f9dff;
    --accent-purple: #a855f7;
    --accent-cyan: #22d3ee;
    --accent-pink: #f472b6;
    --accent-orange: #fb923c;
    --accent-lime: #a3e635;
    --accent-teal: #2dd4bf;
    --accent-indigo: #818cf8;
    --accent-rose: #fb7185;
    --accent-yellow: #facc15;
    --accent-emerald: #34d399;
    --accent-violet: #c084fc;
    --accent-slate: #94a3b8;

    /* Text hierarchy */
    --text-primary: #e8e8f0;
    --text-secondary: #9898a8;
    --text-muted: #5a5a6e;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(0, 255, 136, 0.2);

    /* Typography */
    --font-display: 'JetBrains Mono', monospace;
    --font-pixel: 'Press Start 2P', monospace;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-xxl: 5rem;

    /* Animation */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--terminal-green-dim) var(--bg-deep);
}

body {
    font-family: var(--font-mono);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-deep);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Scanlines effect */
.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    opacity: 0.3;
}

/* Vignette effect */
.vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
    background: radial-gradient(
        ellipse at center,
        transparent 40%,
        rgba(0, 0, 0, 0.6) 100%
    );
}

/* Main container */
.terminal-interface {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-lg);
    position: relative;
    z-index: 1;
}

/* ==========================================
   HEADER
   ========================================== */
.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xxl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: var(--space-lg);
}

.title-frame {
    position: relative;
    padding: var(--space-lg) var(--space-xl);
    background: linear-gradient(135deg, var(--bg-panel) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border-accent);
}

.corner {
    position: absolute;
    width: 12px;
    height: 12px;
    border-color: var(--terminal-green);
    border-style: solid;
}

.corner-tl { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.corner-tr { top: -1px; right: -1px; border-width: 2px 2px 0 0; }
.corner-bl { bottom: -1px; left: -1px; border-width: 0 0 2px 2px; }
.corner-br { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

.system-name {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: 0.05em;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-sm);
}

.name-primary {
    color: var(--text-primary);
    text-shadow: 0 0 30px var(--terminal-green-glow);
}

/* Header home link */
.home-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s var(--ease-out-expo);
}

.home-link:hover {
    color: var(--terminal-green);
}

.name-alias {
    font-family: var(--font-mono);
    font-size: 0.5em;
    color: var(--terminal-green);
    font-weight: 400;
}

.system-tags {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: var(--space-sm);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.separator {
    color: var(--terminal-green);
    margin: 0 var(--space-xs);
}

/* Navigation Controls */
.nav-controls {
    display: flex;
    gap: var(--space-md);
}

.nav-button {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-panel);
    border: 2px solid var(--border-subtle);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s var(--ease-out-expo);
}

.nav-button svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s var(--ease-out-expo);
}

.nav-button:hover {
    background: var(--bg-elevated);
    color: var(--terminal-green);
    border-color: var(--terminal-green);
    box-shadow: 0 0 20px var(--terminal-green-glow);
}

.nav-button:hover svg {
    transform: scale(1.1);
}

.nav-button[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    font-size: 0.625rem;
    font-family: var(--font-pixel);
    color: var(--terminal-green);
    white-space: nowrap;
    opacity: 0;
    transition: all 0.3s var(--ease-out-expo);
}

.nav-button:hover[data-tooltip]::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================
   CONTENT COLUMNS (Single CRT Monitor)
   ========================================== */
.content-columns {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-xxl);
}

.content-columns .crt-monitor {
    width: 100%;
    max-width: 700px;
}

/* 4:3 aspect ratio for the screen */
.crt-screen-frame {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.crt-view {
    flex: 1;
    overflow-y: auto;
}

/* Section navigation tabs */
.section-nav {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid rgba(0, 255, 136, 0.2);
}

.section-nav-tab {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: rgba(0, 255, 136, 0.5);
    text-decoration: none;
    padding: var(--space-xs) var(--space-sm);
    transition: all 0.15s ease;
    cursor: pointer;
}

.section-nav-tab:hover {
    color: var(--terminal-green);
    text-shadow: 0 0 6px var(--terminal-green-glow);
}

.section-nav-tab.active {
    color: var(--terminal-green);
    text-shadow: 0 0 4px var(--terminal-green-glow);
    position: relative;
}

.section-nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--terminal-green);
    box-shadow: 0 0 4px var(--terminal-green);
}

.section-nav-divider {
    color: rgba(0, 255, 136, 0.3);
    font-size: 0.75rem;
}

/* View switching */
.crt-view {
    display: none;
}

.crt-view.active {
    display: block;
}

/* View fade-in animation when switching */
@keyframes viewFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply fade animation on view switch */
.crt-view.active {
    animation: viewFadeIn 0.3s ease-out;
}

/* ==========================================
   CRT MONITOR STYLING
   ========================================== */
.crt-monitor {
    --plastic-cream: #d8d4c4;
    --plastic-light: #e5e1d1;
    --plastic-dark: #c5c1b1;
    --plastic-shadow: #a8a498;
    --plastic-edge: #b8b4a4;
    --screen-bezel: #2a2a28;
}

.crt-bezel {
    position: relative;
    background:
        /* Subtle plastic texture */
        linear-gradient(180deg,
            var(--plastic-light) 0%,
            var(--plastic-cream) 3%,
            var(--plastic-cream) 50%,
            var(--plastic-dark) 97%,
            var(--plastic-shadow) 100%
        );
    border-radius: 16px 16px 0 0;
    padding: 20px;
    border: 3px solid var(--plastic-shadow);
    border-bottom: none;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1),
        inset 2px 0 0 rgba(255, 255, 255, 0.2),
        inset -2px 0 0 rgba(0, 0, 0, 0.05),
        0 8px 24px rgba(0, 0, 0, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.2);
    overflow: visible;
}

.crt-bezel-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px 12px;
}

.crt-brand {
    font-family: 'Arial Black', sans-serif;
    font-size: 11px;
    font-weight: 900;
    color: #7a7868;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.crt-model {
    font-family: 'Arial', sans-serif;
    font-size: 9px;
    font-weight: bold;
    color: #8a8878;
    letter-spacing: 1px;
}

.crt-screen-frame {
    background: var(--screen-bezel);
    border-radius: 10px;
    padding: 20px;
    border: 4px solid #1a1a18;
    box-shadow:
        inset 0 0 40px rgba(0, 0, 0, 0.9),
        inset 0 4px 8px rgba(0, 0, 0, 0.6),
        0 -2px 0 rgba(255, 255, 255, 0.1),
        0 2px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.crt-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    padding: 16px 8px 4px;
}

/* Orange rotary knob */
.crt-dial {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 35%,
            #ff9544 0%,
            #e07020 40%,
            #c05a10 70%,
            #a04800 100%
        );
    border: 3px solid #803800;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3),
        0 3px 6px rgba(0, 0, 0, 0.4);
    position: relative;
}

/* Knob grip ridges */
.crt-dial::before {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background:
        repeating-conic-gradient(
            from 0deg,
            transparent 0deg,
            transparent 15deg,
            rgba(0, 0, 0, 0.15) 15deg,
            rgba(0, 0, 0, 0.15) 30deg
        );
}

/* Knob pointer */
.crt-dial::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 8px;
    background: #401800;
    border-radius: 2px;
}

/* View selection buttons */
.crt-view-buttons {
    display: flex;
    gap: 12px;
    margin-right: auto;
}

.crt-view-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

/* Membrane key button */
.crt-view-btn .btn-cap {
    width: 60px;
    height: 16px;
    border-radius: 2px;
    background: linear-gradient(180deg,
        #4a4a48 0%,
        #3a3a38 30%,
        #2a2a28 100%
    );
    border: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2),
        0 1px 0 #1a1a18,
        0 2px 0 #0a0a08;
    transition: all 0.03s ease;
}

.crt-view-btn:hover .btn-cap {
    background: linear-gradient(180deg,
        #555553 0%,
        #454543 30%,
        #353533 100%
    );
}

.crt-view-btn:active .btn-cap {
    transform: translateY(2px);
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.3),
        0 0 0 #1a1a18;
}

/* LED indicator below button */
.crt-view-btn .btn-led {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #222;
    border: 1px solid #1a1a18;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
    transition: all 0.1s ease;
}

.crt-view-btn.active .btn-led {
    background: var(--terminal-green);
    border-color: #1a5a28;
    box-shadow:
        0 0 4px var(--terminal-green),
        0 0 8px var(--terminal-green-glow);
}

/* Power button */
.crt-button.crt-power {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    position: relative;
    background:
        linear-gradient(180deg,
            #4a4a48 0%,
            #3a3a38 50%,
            #2a2a28 100%
        );
    border: 2px solid #1a1a18;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3),
        0 3px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.crt-button.crt-power:active {
    transform: scale(0.92);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.4);
}

.crt-button.crt-power::before {
    display: none;
}

/* Power LED */
.power-led {
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--terminal-green);
    border-radius: 50%;
    border: 1px solid #1a5a28;
    box-shadow:
        0 0 6px var(--terminal-green),
        0 0 12px var(--terminal-green-glow);
    animation: ledPulse 2s ease-in-out infinite;
}

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

/* CRT Power Off State */
.crt-monitor.power-off .crt-screen-frame {
    background: #0a0a08;
}

.crt-monitor.power-off .crt-screen-frame > * {
    opacity: 0;
    visibility: hidden;
}

.crt-monitor.power-off .power-led {
    background: #333;
    box-shadow: none;
    animation: none;
}

.crt-monitor.power-off .crt-button.crt-power {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.4);
}

/* CRT Turn Off Animation Overlay */
.crt-poweroff-effect {
    position: absolute;
    inset: 0;
    background: #0a0a08;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
}

.crt-poweroff-effect.active {
    opacity: 1;
    pointer-events: auto;
}

.crt-poweroff-line {
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(200, 255, 200, 0.15) 0%, transparent 70%);
    position: relative;
}

.crt-poweroff-line::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #aaffaa;
    box-shadow:
        0 0 20px rgba(170, 255, 170, 0.8),
        0 0 40px rgba(170, 255, 170, 0.4),
        0 0 60px rgba(170, 255, 170, 0.2);
    border-radius: 50%;
}

/* Turn off animation */
.crt-monitor.turning-off .crt-poweroff-effect {
    opacity: 1;
}

.crt-monitor.turning-off .crt-poweroff-line::before {
    animation: crtTurnOff 1s ease-in forwards;
}

.crt-monitor.turning-off .crt-screen-frame > *:not(.crt-poweroff-effect):not(.crt-boot-screen) {
    animation: crtContentFade 0.15s ease-out forwards;
}

/* Ensure all nested elements stay hidden during turn-off */
.crt-monitor.turning-off .crt-screen-frame *,
.crt-monitor.turning-off .crt-screen-frame a,
.crt-monitor.turning-off .crt-screen-frame .read-more,
.crt-monitor.turning-off .crt-screen-frame .view-all-link,
.crt-monitor.turning-off .section-nav,
.crt-monitor.turning-off .section-nav-tab {
    animation: crtContentFade 0.15s ease-out forwards !important;
    transition: none !important;
}

@keyframes crtTurnOff {
    0% {
        width: 100%;
        height: 100%;
        opacity: 1;
    }
    40% {
        width: 100%;
        height: 3px;
        opacity: 1;
    }
    70% {
        width: 80px;
        height: 3px;
        opacity: 1;
    }
    90% {
        width: 8px;
        height: 8px;
        opacity: 1;
    }
    100% {
        width: 0;
        height: 0;
        opacity: 0;
    }
}

@keyframes crtContentFade {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Turn on animation */
.crt-monitor.turning-on .crt-poweroff-effect {
    opacity: 1;
}

.crt-monitor.turning-on .crt-poweroff-line::before {
    animation: crtTurnOn 0.5s ease-out forwards;
}

.crt-monitor.turning-on .crt-screen-frame > *:not(.crt-poweroff-effect):not(.crt-boot-screen) {
    opacity: 0 !important;
    visibility: hidden;
}

/* Keep content hidden during boot */
.crt-monitor.booting .crt-screen-frame > *:not(.crt-poweroff-effect):not(.crt-boot-screen),
.crt-monitor.booting .section-nav {
    opacity: 0 !important;
    visibility: hidden;
}

@keyframes crtTurnOn {
    0% {
        width: 0;
        height: 0;
        opacity: 0;
    }
    20% {
        width: 8px;
        height: 8px;
        opacity: 1;
    }
    50% {
        width: 80px;
        height: 3px;
        opacity: 1;
    }
    80% {
        width: 100%;
        height: 3px;
        opacity: 1;
    }
    100% {
        width: 100%;
        height: 100%;
        opacity: 0;
    }
}

@keyframes crtContentAppear {
    0% {
        opacity: 0;
        filter: brightness(2);
    }
    100% {
        opacity: 1;
        filter: brightness(1);
    }
}

/* Boot sequence screen */
.crt-boot-screen {
    position: absolute;
    inset: 0;
    background: #0a0a08;
    z-index: 50;
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    line-height: 1.5;
    color: #33ff66;
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.crt-boot-screen.active {
    display: flex;
}

.crt-boot-screen .boot-line {
    opacity: 0;
    white-space: nowrap;
    text-shadow: 0 0 4px rgba(51, 255, 102, 0.5);
}

.crt-boot-screen .boot-line.visible {
    opacity: 1;
}

.crt-boot-screen .boot-line.typing {
    overflow: hidden;
    border-right: 2px solid #33ff66;
    animation: bootCursor 0.5s step-end infinite;
}

.crt-boot-screen .boot-header {
    color: #ffcc00;
    font-weight: bold;
    margin-bottom: 8px;
}

.crt-boot-screen .boot-success {
    color: #33ff66;
}

.crt-boot-screen .boot-info {
    color: #888;
}

.crt-boot-screen .boot-warning {
    color: #ffcc00;
}

.crt-boot-screen .boot-progress {
    color: #33ff66;
    font-family: monospace;
}

.crt-boot-screen .boot-logo {
    color: #33ff66;
    font-size: 10px;
    line-height: 1.2;
    margin: 8px 0;
}

@keyframes bootCursor {
    0%, 100% { border-color: #33ff66; }
    50% { border-color: transparent; }
}

/* Vent slots */
.crt-bezel::before {
    content: '';
    position: absolute;
    left: 20px;
    bottom: 8px;
    width: 60px;
    height: 8px;
    background:
        repeating-linear-gradient(
            90deg,
            var(--plastic-shadow) 0px,
            var(--plastic-shadow) 3px,
            transparent 3px,
            transparent 6px
        );
    border-radius: 1px;
}

/* Base Unit - Full Width Retro Computer Style */
.crt-base-unit {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.base-top {
    height: 40px;
    background: linear-gradient(180deg,
        var(--plastic-shadow) 0%,
        var(--plastic-dark) 5%,
        var(--plastic-cream) 15%,
        var(--plastic-light) 50%,
        var(--plastic-cream) 85%,
        var(--plastic-dark) 95%,
        var(--plastic-shadow) 100%
    );
    border: 3px solid var(--plastic-shadow);
    border-top: none;
    border-radius: 0 0 8px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Floppy Disk Drive */
.disk-drive {
    display: flex;
    align-items: center;
    gap: 10px;
}

.disk-slot {
    width: 90px;
    height: 10px;
    background: linear-gradient(180deg,
        #1a1a18 0%,
        #2a2a28 50%,
        #1a1a18 100%
    );
    border-radius: 1px;
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.8),
        0 1px 0 rgba(255, 255, 255, 0.2);
}

.disk-led {
    width: 6px;
    height: 6px;
    background: #2a2a28;
    border-radius: 50%;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

.disk-led.active {
    background: #ff6b35;
    box-shadow:
        0 0 4px #ff6b35,
        0 0 8px rgba(255, 107, 53, 0.5);
}

/* Ventilation Grills */
.base-vents {
    display: flex;
    gap: 4px;
}

.base-vents span {
    width: 3px;
    height: 20px;
    background: linear-gradient(180deg,
        var(--plastic-shadow) 0%,
        #2a2a28 20%,
        #1a1a18 50%,
        #2a2a28 80%,
        var(--plastic-shadow) 100%
    );
    border-radius: 1px;
}

/* Responsive - stack on mobile */
@media (max-width: 1023px) {
    .crt-controls {
        justify-content: center;
    }

    .crt-bezel {
        padding: 16px;
    }

    .base-top {
        height: 32px;
        padding: 0 12px;
    }

    .disk-slot {
        width: 60px;
        height: 8px;
    }

    .base-vents span {
        width: 2px;
        height: 14px;
    }
}

/* Sticky Note */
.sticky-note {
    position: absolute;
    bottom: -60px;
    right: 40px;
    width: 90px;
    height: 80px;
    background: linear-gradient(135deg, #ffef82 0%, #ffe566 50%, #ffd633 100%);
    padding: 8px 10px;
    transform: rotate(3deg);
    box-shadow:
        2px 3px 8px rgba(0, 0, 0, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 10;
}

.sticky-note::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(180deg, rgba(0,0,0,0.08) 0%, transparent 100%);
}

.sticky-note:hover {
    transform: rotate(1deg) scale(1.05);
    box-shadow:
        3px 5px 12px rgba(0, 0, 0, 0.35),
        inset 0 -2px 4px rgba(0, 0, 0, 0.05);
}

.sticky-text {
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
    text-align: center;
}

.sticky-text:first-child {
    font-size: 1rem;
    color: #2a2a4e;
}

/* Position sticky note relative to base unit */
.crt-base-unit {
    position: relative;
}

@media (max-width: 768px) {
    .sticky-note {
        right: 20px;
        bottom: -50px;
        width: 75px;
        height: 65px;
        padding: 6px 8px;
    }

    .sticky-text {
        font-size: 0.95rem;
    }

    .sticky-text:first-child {
        font-size: 0.85rem;
    }
}

/* ==========================================
   SECTION COMMON STYLES - CRT TERMINAL AESTHETIC
   ========================================== */

/* CRT screen internal styling */
.crt-screen-frame {
    color: var(--terminal-green);
    text-shadow: 0 0 2px var(--terminal-green-glow);
}

.section-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--terminal-green);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid rgba(0, 255, 136, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.section-title::before {
    content: '>';
    color: var(--terminal-green);
}

.title-icon {
    color: var(--terminal-green);
    font-size: 0.625rem;
    animation: blink 1s step-end infinite;
}

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

.title-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(0, 255, 136, 0.3), transparent);
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--terminal-green);
    text-decoration: none;
    margin-top: var(--space-sm);
    padding: var(--space-xs) 0;
    transition: all 0.3s var(--ease-out-expo);
    text-shadow: 0 0 4px var(--terminal-green-glow);
}

.view-all-link::before {
    content: '$';
    opacity: 0.5;
}

.view-all-link:hover {
    gap: var(--space-md);
    text-shadow: 0 0 10px var(--terminal-green-glow);
}

.arrow {
    transition: transform 0.3s var(--ease-out-expo);
}

.view-all-link:hover .arrow {
    transform: translateX(4px);
}

/* ==========================================
   PROJECTS PANEL - TERMINAL FILE LISTING
   ========================================== */
#projects > h2,
#logs > h2,
#network > h2,
#terminal > h2 {
    margin-bottom: var(--space-sm);
}

.projects-panel {
    font-family: var(--font-mono);
}

.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.project-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-xs);
    transition: all 0.15s ease;
    position: relative;
    border: none;
    background: transparent;
    border-left: 2px solid transparent;
}

.project-card::before {
    display: none;
}

.project-card:hover {
    background: rgba(0, 255, 136, 0.08);
    border-left-color: var(--terminal-green);
    transform: none;
}

.project-card[data-status="active"] {
    border-left-color: var(--amber);
}

.project-card[data-status="active"]:hover {
    background: rgba(255, 215, 0, 0.08);
}

.project-status {
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding-right: var(--space-xs);
}

.status-icon {
    font-size: 0.5rem;
    color: var(--terminal-green);
}

.project-card[data-status="active"] .status-icon {
    color: var(--amber);
    animation: blink 1s step-end infinite;
}

.project-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.project-title {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--terminal-green);
    text-shadow: 0 0 4px var(--terminal-green-glow);
}

.project-card:hover .project-title {
    text-shadow: 0 0 8px var(--terminal-green-glow);
}

.project-description {
    font-size: 0.6875rem;
    color: rgba(0, 255, 136, 0.6);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.project-tags {
    display: none;
}

.tag {
    font-size: 0.5625rem;
    font-family: var(--font-mono);
    color: var(--terminal-green);
    background: transparent;
    padding: 0;
    border: none;
    text-transform: lowercase;
    letter-spacing: 0;
}

.tag::before {
    content: '#';
    opacity: 0.5;
}

.project-link {
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0, 255, 136, 0.4);
    transition: all 0.15s ease;
    align-self: center;
    padding-left: var(--space-sm);
}

.project-link svg {
    width: 14px;
    height: 14px;
}

.project-link:hover {
    color: var(--terminal-green);
    text-shadow: 0 0 6px var(--terminal-green-glow);
    transform: none;
}

/* ==========================================
   LOGS PANEL - SYSTEM LOG TERMINAL
   ========================================== */
.logs-panel {
    font-family: var(--font-mono);
}

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

.log-entry {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-xs);
    border-bottom: none;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 2px solid transparent;
}

.log-entry:hover {
    background: rgba(0, 255, 136, 0.08);
    border-left-color: var(--terminal-green);
}

.log-entry:last-child {
    border-bottom: none;
    padding-bottom: var(--space-sm);
}

.entry-date {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    padding: 0;
    background: transparent;
    border: none;
    font-size: 0.625rem;
    color: rgba(0, 255, 136, 0.5);
    min-width: 70px;
}

.entry-date::before {
    content: '[';
}

.entry-date::after {
    content: ']';
}

.date-day {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 400;
    color: rgba(0, 255, 136, 0.5);
    line-height: 1;
}

.date-month {
    font-size: 0.625rem;
    color: rgba(0, 255, 136, 0.5);
    letter-spacing: 0;
    margin-top: 0;
    text-transform: uppercase;
}

.entry-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.entry-title {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--terminal-green);
    transition: text-shadow 0.15s ease;
    text-shadow: 0 0 4px var(--terminal-green-glow);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.log-entry:hover .entry-title {
    color: var(--terminal-green);
    text-shadow: 0 0 8px var(--terminal-green-glow);
}

.entry-excerpt {
    font-size: 0.6875rem;
    color: rgba(0, 255, 136, 0.5);
    font-style: normal;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.entry-excerpt::before {
    content: '// ';
    opacity: 0.5;
}

.read-more {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    color: var(--terminal-green);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    margin-top: 2px;
    transition: all 0.15s ease;
    opacity: 0.7;
    text-shadow: 0 0 4px var(--terminal-green-glow);
}

.read-more::before {
    content: '$';
    opacity: 0.5;
}

.read-more::after {
    content: ' _';
    animation: blink 1s step-end infinite;
}

.log-entry:hover .read-more {
    opacity: 1;
    text-shadow: 0 0 8px var(--terminal-green-glow);
}

.read-more:hover::after {
    content: ' →';
    animation: none;
}

/* ==========================================
   NETWORK PANEL (Inside CRT Monitor)
   ========================================== */
.network-panel.crt-view {
    padding: var(--space-md);
}

.network-panel .network-subtitle {
    font-size: 0.75rem;
    color: var(--terminal-green);
    opacity: 0.7;
    margin-bottom: var(--space-md);
}

.network-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.network-port {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(0, 255, 136, 0.02);
    border: 1px solid rgba(0, 255, 136, 0.15);
    text-decoration: none;
    color: var(--terminal-green);
    opacity: 0.5;
    transition: all 0.2s var(--ease-out-expo);
}

.network-port:hover {
    background: rgba(0, 255, 136, 0.15);
    border-color: var(--terminal-green);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
    opacity: 1;
    animation: crt-flicker 0.3s ease-out;
}

@keyframes crt-flicker {
    0% {
        opacity: 0.5;
        filter: brightness(1);
        transform: scaleY(1);
    }
    15% {
        opacity: 1;
        filter: brightness(1.8);
        transform: scaleY(1.02);
    }
    30% {
        filter: brightness(0.9);
        transform: scaleY(0.99);
    }
    50% {
        filter: brightness(1.4);
        transform: scaleY(1.01);
    }
    70% {
        filter: brightness(1.1);
    }
    100% {
        opacity: 1;
        filter: brightness(1);
        transform: scaleY(1);
    }
}

.port-icon {
    width: 32px;
    height: 32px;
    transition: all 0.2s var(--ease-out-expo);
}

.network-port:hover .port-icon {
    filter: drop-shadow(0 0 4px var(--terminal-green-glow));
}

.port-label {
    font-size: 0.625rem;
    font-family: var(--font-pixel);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ==========================================
   TERMINAL PANEL (Inside CRT Monitor)
   ========================================== */
.terminal-panel.crt-view {
    padding: var(--space-md);
    flex-direction: column;
}

.terminal-panel.crt-view.active {
    display: flex;
}

.terminal-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: transparent;
    padding: 0;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    min-height: 200px;
    overflow: hidden;
    cursor: text;
}

.terminal-container:focus {
    outline: none;
}

.terminal-output {
    flex: 1;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--terminal-green);
    text-shadow: 0 0 2px var(--terminal-green-glow);
    line-height: 1.5;
}

.terminal-output .output-line {
    margin-bottom: 2px;
}

.terminal-output .output-line.error {
    color: var(--error);
    text-shadow: 0 0 4px rgba(255, 68, 68, 0.6);
}

.terminal-output .output-line.system {
    color: var(--terminal-green);
    opacity: 0.7;
}

.terminal-output .output-line.directory {
    color: #5f9dff;
    text-shadow: 0 0 4px rgba(95, 157, 255, 0.6);
}

.terminal-input-line {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-top: var(--space-xs);
}

.terminal-prompt-symbol {
    color: var(--terminal-green);
    text-shadow: 0 0 2px var(--terminal-green-glow);
    margin-right: var(--space-xs);
    white-space: nowrap;
}

.terminal-input {
    color: var(--terminal-green);
    text-shadow: 0 0 2px var(--terminal-green-glow);
    white-space: pre;
}

.terminal-cursor {
    color: var(--terminal-green);
    text-shadow: 0 0 4px var(--terminal-green-glow);
    animation: blink 1s step-end infinite;
}

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

.terminal-container:not(:focus) .terminal-cursor {
    opacity: 0.3;
    animation: none;
}

/* D.A.M.N. mode styling */
.terminal-container.damn-mode .terminal-cursor {
    background: var(--terminal-green);
    color: var(--bg-primary);
    text-shadow: none;
    padding: 0 2px;
}

/* ==========================================
   FOOTER
   ========================================== */
.terminal-footer {
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border-subtle);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.copyright {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.terminal-prompt {
    color: var(--terminal-green);
}

.pulse-icon {
    color: var(--terminal-green);
    animation: pulse 1.5s ease-in-out infinite;
}

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

.version {
    font-size: 0.75rem;
    font-family: var(--font-pixel);
    color: var(--text-muted);
}

.version a,
.version a:visited {
    color: var(--terminal-green);
    text-decoration: none;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.version a:hover {
    color: var(--terminal-green);
    text-shadow: 0 0 8px var(--terminal-green-glow);
}

/* ==========================================
   BACK LINKS - MATRIX STYLE
   ========================================== */
.back-link,
.back-to-log {
    display: inline-block;
    position: relative;
    color: var(--terminal-green);
    text-decoration: none;
    font-size: 0.9rem;
    font-family: 'JetBrains Mono', monospace;
    padding: 0.5rem 1rem;
    border: 1px solid var(--terminal-green);
    background: rgba(0, 255, 136, 0.05);
    text-shadow:
        0 0 4px var(--terminal-green),
        0 0 8px var(--terminal-green-glow),
        0 0 16px var(--terminal-green-glow);
    box-shadow:
        0 0 4px var(--terminal-green-glow),
        inset 0 0 8px rgba(0, 255, 136, 0.1);
    transition: all 0.3s var(--ease-out-expo);
    overflow: hidden;
}

.back-link::before,
.back-to-log::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 255, 136, 0.2),
        transparent
    );
    transition: left 0.5s var(--ease-out-expo);
}

.back-link:hover,
.back-to-log:hover {
    background: rgba(0, 255, 136, 0.15);
    box-shadow:
        0 0 8px var(--terminal-green),
        0 0 16px var(--terminal-green-glow),
        inset 0 0 12px rgba(0, 255, 136, 0.2);
    text-shadow:
        0 0 8px var(--terminal-green),
        0 0 16px var(--terminal-green-glow),
        0 0 24px var(--terminal-green-glow);
    animation: matrixGlitch 0.3s ease-out;
}

.back-link:hover::before,
.back-to-log:hover::before {
    left: 100%;
}

@keyframes matrixGlitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 1px); }
    40% { transform: translate(2px, -1px); }
    60% { transform: translate(-1px, -1px); }
    80% { transform: translate(1px, 1px); }
}

.footer-decoration {
    margin-top: var(--space-lg);
}

.pixel-border {
    display: block;
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        var(--terminal-green) 0px,
        var(--terminal-green) 4px,
        transparent 4px,
        transparent 8px
    );
    opacity: 0.3;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .terminal-interface {
        padding: var(--space-md);
    }

    .terminal-header {
        justify-content: center;
        text-align: center;
    }

    .title-frame {
        padding: var(--space-md) var(--space-lg);
    }

    .system-name {
        flex-direction: column;
        gap: var(--space-xs);
    }

    .project-card {
        grid-template-columns: auto 1fr auto;
    }

    .log-entry {
        grid-template-columns: auto 1fr;
    }

    .entry-date {
        min-width: 60px;
    }

    .network-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================
   ANIMATIONS ON LOAD
   ========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.terminal-header,
.content-columns {
    animation: fadeInUp 0.8s var(--ease-out-expo) both;
}

.terminal-header { animation-delay: 0.1s; }
.content-columns { animation-delay: 0.2s; }
