:root {
    --primary-color: #FFFFFF;
    --background-color: #000000;
    --glow-color: rgba(0, 255, 255, 0.7);
    --terminal-bg: #0d0d0d;
    --error-color: #ff5f56;
    /* Added for confidential section border */
}

body {
    background-color: var(--background-color);
    color: var(--primary-color);
    font-family: 'Space Mono', monospace;
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

.container {
    max-width: 800px;
    width: 80%;
    margin: 0 auto;
    padding: 2rem;
}

h2 {
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
    letter-spacing: 2px;
}

/* --- Hero Section (Full Screen Intro) --- */
#hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: var(--background-color);
    transition: height 0.8s cubic-bezier(0.76, 0, 0.24, 1);
}

#hero h1 {
    font-size: min(10vh, 10vw);
    margin: 0;
    transition: font-size 0.8s cubic-bezier(0.76, 0, 0.24, 1);
    text-align: center;
}

/* --- Scrolled State --- */
body.scrolled #hero {
    height: 120px;
}

body.scrolled #hero h1 {
    font-size: 2.5rem;
}

body.scrolled .scroll-indicator {
    opacity: 0;
}

#main-content {
    position: relative;
    z-index: 2;
    background: var(--background-color);
}

/* --- Card slide-in animations --- */
.scroll-animation {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    transform: translateY(50px);
}

.scroll-animation.visible {
    opacity: 1;
    transform: none;
}

section {
    margin-bottom: 6rem;
}

/* --- Glitch Effect --- */
.glitch {
    font-weight: 700;
    position: relative;
    text-shadow: 0 0 5px var(--glow-color), 0 0 10px var(--glow-color);
    animation: glitch-animation 5s infinite alternate;
}

.glitch:before,
.glitch:after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-color);
    overflow: hidden;
}

.glitch:before {
    left: 2px;
    text-shadow: -2px 0 red;
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.glitch:after {
    left: -2px;
    text-shadow: -2px 0 blue;
    animation: glitch-anim-2 2s infinite linear alternate-reverse;
}

@keyframes glitch-animation {
    0% {
        text-shadow: 0 0 5px var(--glow-color);
    }

    100% {
        text-shadow: 0 0 20px var(--glow-color), 0 0 30px var(--glow-color);
    }
}

@keyframes glitch-anim-1 {

    0%,
    100% {
        clip-path: inset(45% 0 56% 0);
    }

    25% {
        clip-path: inset(0 0 100% 0);
    }

    50% {
        clip-path: inset(80% 0 1% 0);
    }

    75% {
        clip-path: inset(50% 0 51% 0);
    }
}

@keyframes glitch-anim-2 {

    0%,
    100% {
        clip-path: inset(65% 0 36% 0);
    }

    25% {
        clip-path: inset(100% 0 0% 0);
    }

    50% {
        clip-path: inset(20% 0 81% 0);
    }

    75% {
        clip-path: inset(40% 0 41% 0);
    }
}

/* --- UPDATED: Apple-Style Showcase Section --- */
.showcase-wrapper {
    position: relative;
    margin-top: 2rem;
}

.showcase-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory; 
    -ms-overflow-style: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.showcase-container::-webkit-scrollbar {
    display: none;
}

.showcase-card {
    /* Each card takes up 80% of the container width */
    flex: 0 0 80%; 
    max-width: 250px;
    /* Snaps the card to the start of the container */
    scroll-snap-align: start; 
    scroll-snap-stop: always;
    height: 400px;
    background-color: #050505;
    border-radius: 50px;
    margin: 1.5rem;
    position: relative;
    border: 2px solid #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Aligns text to the top */
    padding: 1.5rem;
    box-sizing: border-box; /* Ensures padding is included in height/width */
    transition: border-color 0.3s ease;
    
    transition: transform 0.4s ease-out; /* For hover effect */
}


.showcase-card:hover {
    border-color: var(--glow-color);
    
    transform: scale(1.01); /* Subtle zoom on hover */
}

.showcase-card:last-child {
    margin-right: 0;
}

/* NEW: Image Styling */
.showcase-card img {
    border-radius: 50px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Fills the card without stretching */
    z-index: 0; /* Sits at the bottom */
}

/* NEW: Gradient Overlay for Text Readability */
.showcase-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0.8) 100%);
    z-index: 2; /* Sits above the image */
}

.card-content {
    position: relative; /* Must be relative */
    z-index: 3; /* Sits on top of the gradient and image */
}

.showcase-subtitle {
    margin: 0;
    color: #aaa;
    font-size: 0.7rem;
}

.showcase-card h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 0.5rem 0 0 0;
    line-height: 1.2;
}

.showcase-nav {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-right: 1rem;
}

.arrow-btn {
    background-color: #222;
    border: 1px solid #444;
    color: var(--primary-color);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: 0.5rem;
    transition: all 0.2s ease;
}

.arrow-btn:hover {
    background-color: var(--glow-color);
    color: var(--background-color);
    border-color: var(--glow-color);
}

/* --- Skills Grid --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.skills-grid span {
    background-color: #111;
    border: 1px solid #333;
    padding: 0.75rem;
    text-align: center;
    transition: all 0.3s ease;
}

.skills-grid span:hover {
    background-color: var(--primary-color);
    color: var(--background-color);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1);
}

/* --- Links --- */
nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
}

nav a {
    color: var(--primary-color);
    text-decoration: none;
    position: relative;
    padding: 5px 0;
    font-size: 1.1rem;
}

nav a:after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--glow-color);
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}

nav a:hover:after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* --- NEW: Contact Form Styles --- */
#contact .form-container {
    background-color: var(--terminal-bg);
    border: 1px solid #222;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.05);
    max-width: 600px;
    margin: 0 auto;
}

#contact label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: var(--primary-color);
}

#contact input,
#contact textarea {
    width: 100%;
    padding: 10px 15px;
    background-color: #1a1a1a;
    border: 1px solid #333;
    color: var(--primary-color);
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#contact input:focus,
#contact textarea:focus {
    border-color: var(--glow-color);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

#contact textarea {
    resize: vertical;
}

#submit-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: var(--background-color);
    border: none;
    font-family: 'Space Mono', monospace;
    text-transform: uppercase;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--primary-color);
}

#submit-btn:hover {
    background-color: transparent;
    color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

.status-message {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    font-weight: 700;
}

.status-message.success {
    color: #27c93f; /* Green color for success */
}

.status-message.error {
    color: var(--error-color); /* Red color for error */
}


/* --- NEW: Passcode and Confidential Section Styles --- */
.passcode-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

#passcode-input {
    flex-grow: 1;
    background-color: #111;
    border: 1px solid #333;
    color: var(--primary-color);
    padding: 10px 15px;
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    min-width: 200px;
}

#passcode-input:focus {
    border-color: var(--glow-color);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

#passcode-submit-btn {
    background-color: var(--primary-color);
    color: var(--background-color);
    border: 1px solid var(--primary-color);
    padding: 10px 20px;
    font-family: 'Space Mono', monospace;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

#passcode-submit-btn:hover {
    background-color: transparent;
    color: var(--primary-color);
}

#confidential-content-wrapper {
    /* Use a different color to distinguish */
    display: none;
}

#confidential-content-wrapper.visible {
    display: block;
    /* Becomes visible when content is loaded */
}

/* --- Scroll Down Indicator --- */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.scroll-indicator span {
    margin-bottom: 10px;
    letter-spacing: 2px;
    font-size: 0.8rem;
}

.scroll-indicator .arrow {
    width: 2px;
    height: 40px;
    background: var(--primary-color);
    position: relative;
    animation: scroll-anim 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scroll-anim {
    0% {
        height: 0;
        top: 0;
    }

    50% {
        height: 40px;
        top: 0;
    }

    100% {
        height: 0;
        top: 40px;
    }
}

/* --- Terminal Button --- */
#open-terminal-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: var(--background-color);
    border: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.2);
}

#open-terminal-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 255, 255, 0.4);
}

#open-terminal-btn svg {
    width: 32px;
    height: 32px;
}

/* --- Terminal Overlay --- */
#terminal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    opacity: 1;
    transition: opacity 0.3s ease;
}

#terminal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.terminal-window {
    width: 90%;
    max-width: 700px;
    height: 80%;
    max-height: 500px;
    background-color: var(--terminal-bg);
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: scale(1);
    transition: transform 0.3s ease;
}

#terminal-overlay.hidden .terminal-window {
    transform: scale(0.95);
}

.terminal-header {
    background-color: #1a1a1a;
    padding: 8px 12px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    display: flex;
    align-items: center;
    color: #bbb;
    font-size: 0.9rem;
}

.terminal-buttons {
    display: flex;
}

.term-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.term-btn.close {
    background-color: #ff5f56;
    cursor: pointer;
}

.term-btn.min {
    background-color: #ffbd2e;
}

.term-btn.max {
    background-color: #27c93f;
}

.terminal-header span {
    margin-left: auto;
}

.terminal-body {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
}

.terminal-body,
#terminal-input {
    font-family: 'Space Mono', monospace;
    color: var(--primary-color);
    background: transparent;
    border: none;
}

#terminal-output .terminal-line {
    white-space: pre-wrap;
    word-break: break-all;
}

#terminal-output .terminal-line.command {
    color: #8cb4ff;
}

#terminal-output .terminal-line.error {
    color: var(--error-color);
}

#terminal-output .terminal-line.system {
    color: #e0e0e0;
    font-style: italic;
}

.terminal-input-line {
    display: flex;
}

.prompt {
    margin-right: 8px;
    color: var(--glow-color);
}

#terminal-input {
    flex-grow: 1;
    outline: none;
    padding: 0;
    font-size: 1rem;
}

/* --- Projects Section --- */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Single column on small screens */
    gap: 2.5rem;
}

.project-card {
    background-color: #080808;
    border: 1px solid #222;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Ensures child elements don't bleed out */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.1);
}

.project-image img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 9;
    /* Modern way to maintain aspect ratio */
    object-fit: cover;
    /* Ensures image covers the area */
    border-bottom: 1px solid #333;
}

.project-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    /* Allows content to fill space */
}

.project-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.project-description {
    margin: 0 0 1.5rem 0;
    color: #ccc;
    flex-grow: 1;
    /* Pushes links to the bottom */
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.project-tech span {
    background-color: #1a1a1a;
    color: var(--glow-color);
    padding: 5px 10px;
    font-size: 0.8rem;
    border-radius: 4px;
    font-weight: 700;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 16px;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.project-link:hover {
    background-color: var(--primary-color);
    color: var(--background-color);
}

/* --- Responsive Grid for Projects --- */
@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Two columns on larger screens */
    }
}