/* --- Deep Blue Sea Theme Variables --- */
:root {
    --bg-color: #020c1b;
    --bg-deep: #0a192f;
    --card-bg: #112240;
    --text-color: #ccd6f6;
    --accent-color: #7fdbff;
    --accent-green: #57cbff;
    --accent-purple: #7fdbff;
    --ocean-light: #4fc3f7;
    --ocean-mid: #0288d1;
    --ocean-deep: #01579b;
    --gray: #8892b0;
    --border-color: #1e3a5f;
    --scrollbar-color: #1e3a5f;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-color) var(--bg-deep);
}
html::-webkit-scrollbar { width: 10px; }
html::-webkit-scrollbar-track {
    background: var(--bg-deep);
    border-radius: 10px;
}
html::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--scrollbar-color), var(--ocean-deep));
    border-radius: 10px;
    border: 2px solid var(--bg-deep);
    box-shadow: 0 0 6px rgba(79, 195, 247, 0.5);
}
html::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-color), var(--ocean-mid));
    box-shadow: 0 0 10px rgba(127, 219, 255, 0.8);
}

body {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: linear-gradient(180deg, #020c1b 0%, #0a192f 30%, #0d2847 60%, #0a192f 100%);
    color: var(--text-color);
    line-height: 1.6;
    padding: 0 20px;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- ASCII Wave Container --- */
.wave-container {
    position: fixed;
    inset: -50px;
    width: calc(100% + 100px);
    height: calc(100% + 100px);
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(circle at 50% 20%, rgba(79,195,247,0.08), transparent 40%),
        linear-gradient(
            180deg,
            #020c1b 0%,
            #061a33 50%,
            #020c1b 100%
        );
}

.wave-container::after {
    content:"";
    position:absolute;
    inset:0;
    background:
        linear-gradient(
            180deg,
            rgba(2,12,27,.2),
            transparent 40%,
            rgba(2,12,27,.5)
        );
    pointer-events:none;
}

.wave-canvas {
    position:absolute;
    top:-10%;
    left:-10%;
    width:120%;
    height:120%;
    font-family:'JetBrains Mono', monospace;
    font-size:18px;
    line-height:1;
    white-space:pre;
    color:var(--ocean-light);
    opacity:.15;
    transform:none;
    filter:
        drop-shadow(0 0 20px rgba(79,195,247,.7));
}

.wave-layer-1 {
    opacity: .22;
}

.wave-layer-2 {
    opacity: .12;
    color: var(--ocean-mid);
}

.wave-layer-3 {
    opacity: .07;
    color: var(--ocean-deep);
}

/* Bubbles effect */
.bubbles {
    position:absolute;
    inset:0;
}

.bubble {
    position:absolute;
    background:
        radial-gradient(
            circle,
            rgba(100,255,218,.25),
            transparent
        );
    border-radius:50%;
    animation:
        rise 14s infinite linear;
    opacity:.5;
}

@keyframes rise {
    from {
        transform:
            translateY(120vh)
            translateX(0)
            scale(.2);
    }
    to {
        transform:
            translateY(-20vh)
            translateX(80px)
            scale(1);
    }
}

/* --- Toggle UI Button --- */
#toggle-ui-btn {
    position: absolute;
    top: 20px;
    left: 0px;
    z-index: 999;
    background: transparent;
    border: none;
    color: var(--accent-color);
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s ease;
    text-shadow: 0 0 8px rgba(127, 219, 255, 0.5);
    font-weight: 600;
    letter-spacing: 0.3px;
}
#toggle-ui-btn::before {
    content: '> ';
    color: var(--accent-green);
}
#toggle-ui-btn:hover {
    opacity: 0.8;
    text-shadow: 0 0 14px rgba(127, 219, 255, 0.8);
}
#toggle-ui-btn.inactive {
    color: var(--gray);
    text-shadow: none;
}
#toggle-ui-btn.inactive::before {
    color: var(--gray);
}

/* --- Header (Terminal Style) --- */
header {
    text-align: center;
    padding: 60px 0 20px;
    position: relative;
    z-index: 10;
}
header::before {
    content: '// SOFTWARE & HARDWARE ENGINEER';
    display: block;
    color: var(--accent-green);
    font-size: 0.85rem;
    margin-bottom: 15px;
    opacity: 0.8;
    text-shadow: 0 0 20px rgba(87, 203, 255, 0.3);
}
header h1 {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: 2px;
    background: linear-gradient(90deg, var(--accent-color), var(--ocean-light), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(100, 255, 218, 0.3);
    animation: glow 3s ease-in-out infinite alternate;
    display: block;
    min-height: 3.5rem;
}
header p {
    color: var(--gray);
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
    font-size: 0.95rem;
    overflow: hidden;
    white-space: nowrap;
    display: block;
    min-height: 1.6rem;
}
@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}
@keyframes glow {
    from { filter: drop-shadow(0 0 5px rgba(100, 255, 218, 0.3)); }
    to { filter: drop-shadow(0 0 20px rgba(79, 195, 247, 0.5)); }
}
header p.typing::before,
header p.typed::before {
    content: '> ';
    color: var(--accent-green);
}

/* --- Filtering System (Code Tab Style) --- */
.filters {
    display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 50px;
    padding: 15px;
    position: relative;
    background: rgba(10, 22, 45, 0.55);
    backdrop-filter: blur(6px) saturate(130%);
    -webkit-backdrop-filter: blur(6px) saturate(130%);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    max-width: fit-content;
    margin-left: auto;
    margin-right: auto;
    animation: fadeIn 0.5s ease-in-out;
}
.filters::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 8px;
    background: rgba(4, 14, 30, 0.72);
}
.filter-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--gray);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 8px 20px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}
.filter-btn::before {
    content: './';
    opacity: 0;
    transition: opacity 0.3s ease;
    color: var(--accent-green);
}
.filter-btn:hover {
    color: var(--text-color);
    border-color: var(--accent-color);
    background: rgba(88, 166, 255, 0.05);
}
.filter-btn:hover::before {
    opacity: 1;
}
.filter-btn.active {
    background-color: rgba(88, 166, 255, 0.1);
    border-color: var(--accent-color);
    color: var(--accent-color);
    font-weight: 600;
}
.filter-btn.active::before {
    opacity: 1;
}

/* --- Portfolio Grid --- */
.portfolio-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px; max-width: 1100px; margin: 0 auto 80px auto;
}

/* --- Project Card Styling (Code Editor Style) --- */
.portfolio-item {
    position: relative;
    background: rgba(10, 22, 45, 0.55);
    backdrop-filter: blur(6px) saturate(130%);
    -webkit-backdrop-filter: blur(6px) saturate(130%);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    animation: fadeIn 0.5s ease-in-out;
    cursor: pointer;
    border: 1px solid var(--border-color);
}
.portfolio-item::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 8px;
    background: rgba(4, 14, 30, 0.72);
}
.portfolio-item > * {
    position: relative;
    z-index: 1;
}
.portfolio-item.hide { display: none; }
.portfolio-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--accent-color);
    border-color: var(--accent-color);
}

/* Make Image Act as a Button */
.portfolio-image {
    width: 100%; aspect-ratio: 4 / 3; overflow: hidden; position: relative; cursor: pointer;
    isolation: isolate;
}
.portfolio-image img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s ease;
}
.portfolio-image::before {
    content: '';
    position: absolute; inset: 0;
    background: #D7E7FF;
    mix-blend-mode: color;
    opacity: 1;
    transition: opacity 0.5s ease;
    z-index: 2;
    pointer-events: none;
}
.portfolio-image::after {
    content: 'View Details'; position: absolute; inset: 0;
    background: rgba(0,0,0,0.6); color: white; display: flex; align-items: center;
    justify-content: center; font-size: 1.2rem; font-weight: 600; opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}
.portfolio-item:hover .portfolio-image img {
    transform: scale(1.08);
}
.portfolio-item:hover .portfolio-image::before { opacity: 0; }
.portfolio-item:hover .portfolio-image::after { opacity: 1; }

.portfolio-content { padding: 24px; display: flex; flex-direction: column; flex-grow: 1; }
.portfolio-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--accent-color);
}
.portfolio-content h3::before {
    content: '# ';
    color: var(--accent-green);
    opacity: 0.7;
}
.portfolio-content p {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 0;
    line-height: 1.6;
}

/* --- MODAL (Popup Window) STYLES --- */
.modal-overlay {
    position: fixed; inset: 0;
    display: flex; justify-content: center; align-items: center;
    z-index: 1000; padding: 10px; opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
    background: rgba(2, 8, 18, 0.55);
    overflow-x: hidden;
}
.modal-overlay.show { opacity: 1; visibility: visible; }

.modal-content {
    width: 100%; max-width: 800px; max-height: 95vh;
    border-radius: 12px; overflow-y: auto; position: relative;
    transform: translateY(30px); transition: transform 0.4s ease; padding: 20px;
    isolation: isolate;
    background: rgba(10, 22, 45, 0.829);
    backdrop-filter: blur(6px) saturate(130%);
    -webkit-backdrop-filter: blur(6px) saturate(130%);
    border: 1px solid rgba(127, 219, 255, 0.15);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    overflow-x: hidden;
}

.modal-overlay.show .modal-content { transform: translateY(0); }

/* Close Button */
.close-modal {
    position: absolute; top: 20px; right: 25px; font-size: 2rem;
    color: var(--gray); cursor: pointer; background: none; border: none; transition: color 0.2s;
}
.close-modal:hover { color: white; }

/* Modal Interior Content */
#modal-title { font-size: 2rem; margin-bottom: 5px; }
#modal-category { color: var(--gray); text-transform: uppercase; font-size: 0.85rem; letter-spacing: 1px; margin-bottom: 30px; display: block; }

.modal-images {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px; margin-bottom: 30px;
}
.modal-images img { width: 100%; border-radius: 8px; aspect-ratio: 4/3; object-fit: cover; }

#modal-text { color: var(--text-color); margin-bottom: 30px; font-weight: 300; }
#modal-text p { margin-bottom: 15px; }

#modal-link {
    display: inline-block; color: var(--accent-color);
    text-decoration: none; font-weight: 600; font-size: 0.95rem;
    letter-spacing: 0.3px;
    text-shadow: 0 0 8px rgba(127, 219, 255, 0.5);
    transition: opacity 0.2s ease, text-shadow 0.2s ease;
}
#modal-link::before {
    content: '> ';
    color: var(--accent-green);
}
#modal-link:hover {
    opacity: 0.8;
    text-shadow: 0 0 14px rgba(127, 219, 255, 0.8);
}

/* Custom Scrollbar for Modal (deep-sea style) */
.modal-content {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-color) var(--bg-deep);
}
.modal-content::-webkit-scrollbar { width: 10px; }
.modal-content::-webkit-scrollbar-track {
    background: var(--bg-deep);
    border-radius: 10px;
}
.modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--scrollbar-color), var(--ocean-deep));
    border-radius: 10px;
    border: 2px solid var(--bg-deep);
    box-shadow: 0 0 6px rgba(79, 195, 247, 0.5);
}
.modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-color), var(--ocean-mid));
    box-shadow: 0 0 10px rgba(127, 219, 255, 0.8);
}

/* --- Footer (Terminal Style) --- */
footer {
    text-align: center;
    padding: 40px 0;
    color: var(--gray);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}
footer::before {
    content: '// EINXELD.WORK@GMAIL.COM';
    display: block;
    color: var(--accent-green);
    font-size: 0.75rem;
    margin-bottom: 10px;
    opacity: 0.6;
}

@keyframes fadeIn { 0% { opacity: 0; transform: scale(0.95); } 100% { opacity: 1; transform: scale(1); } }

