:root {
    /* --- Base Palette: "Earth" --- */
    --bg-color: #261F1A;        /* Deep Brown Background */
    --card-color: #3E322B;      /* Lighter Brown Card Background */
    --text-primary: #FFF8F0;    /* Off-White - Headlines */
    --text-secondary: #FFEFE0;  /* Lighter Off-White - General Text */
    --accent-color: #FF9800;    /* Orange Accent - CTA/Borders/Highlight */
    --text-bg-color: #261F1A;   /* Text color for on-accent buttons (Matches BG) */

    /* Universal dark shadow */
    --shadow: 0 20px 60px -10px rgba(0, 0, 0, .7), 0 4px 20px -8px rgba(0, 0, 0, .7);
}

/* 

/* --- Skill Cloud --- */
#skill-cloud-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    perspective: 1000px;
}

/* Ensure the hidden class properly hides the container */
#skill-cloud-container.hidden {
    display: none;
}

.skill-cloud {
    position: relative;
    width: 450px; /* Increased size for more space */
    height: 450px;
    transform-style: preserve-3d;
    /* Add a slow rotation to the whole cloud */
    animation: cloud-rotate 120s linear infinite;
}

.skill-tag {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-style: preserve-3d; /* Allow inner span to be transformed in 3D */
    /* Prevent tags from being selected */
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10+ */
    user-select: none;
    font-family: 'Chivo Mono', monospace;
    font-size: 1.1rem;
    color: var(--text-secondary);
    cursor: default;
}

.skill-tag-text {
    display: block;
    opacity: 0.8;
    transition: color 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    /* This transform will keep the text facing forward, countering the parent's rotation */
    animation: text-unrotate 120s linear infinite;
}

.skill-tag:hover {
    color: var(--accent-color);
    opacity: 1;
    /* On hover, stop the drift animation and reset to the base position, slightly scaled up for focus */
    animation: none;
    transform: translate3d(var(--x), var(--y), var(--z)) scale(1.1);
    z-index: 10; /* Bring hovered tag to the front */
}

.skill-tag:hover .skill-tag-text {
    color: var(--accent-color);
    opacity: 1;
}

/* Keyframe for the whole cloud rotation */
@keyframes cloud-rotate {
    from { transform: rotateY(0deg) rotateX(0deg); }
    to { transform: rotateY(360deg) rotateX(360deg); }
}

/* New keyframe to make the text always face the camera */
@keyframes text-unrotate {
    from { transform: rotateY(0deg) rotateX(0deg); }
    to { transform: rotateY(-360deg) rotateX(-360deg); }
}

/* Keyframe for individual skill drifting movement */
@keyframes skill-drift {
    0% { transform: translate3d(var(--x), var(--y), var(--z)) scale(1); }
    50% { transform: translate3d(calc(var(--x) * 1.2), calc(var(--y) * 1.2), calc(var(--z) * 1.2)) scale(1.1); }
    100% { transform: translate3d(var(--x), var(--y), var(--z)) scale(1); }
}

/* Skill Definition Tooltip */
.skill-definition-tooltip {
    position: absolute;
    bottom: -4rem; /* Position below the cloud */
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 500px;
    padding: 1rem;
    background-color: var(--card-color);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    color: var(--text-secondary);
    text-align: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 20;
}

.fallback-skill {
    font-family: 'Chivo Mono', monospace;
    font-size: 1.1rem;
    color: var(--text-secondary);
    background-color: var(--card-color);
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
}

html, body {
    overflow-x: hidden; /* Prevent horizontal scroll from absolute elements */
}

body {
    font-family: 'Chivo Mono', monospace;
    background-color: var(--bg-color);
    color: var(--text-secondary);
    position: relative; /* For absolute positioning context */
    transition: background-color 0.3s ease, color 0.3s ease; /* Keep transitions for potential future use */
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'DM Serif Display', serif;
    color: var(--text-primary);
}

.accent-text {
    color: var(--accent-color);
}

.accent-bg {
    background-color: var(--accent-color);
}

.accent-border {
    border-color: var(--accent-color);
}

.text-bg-color {
    color: var(--text-bg-color);
}

/* Side Bars */
.side-bar {
    top: 20rem; /* 320px -- Aligns with hero text */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Align from the top */
    height: auto; /* Auto height */
    width: 150px;
    z-index: 50; /* Ensure sidebars are clickable */
}

.side-bar-left {
    /* This sidebar is now empty */
    position: fixed; /* Stays in place on scroll */
    left: 0;
}

.side-bar-right {
    position: fixed; /* Stays in place on scroll */
    right: 0;
}

.side-bar ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem; /* 24px */
    list-style: none; /* Ensure no bullets */
    padding: 0;
    margin: 0;
}

.side-bar li a svg {
    width: 24px;
    height: 24px;
    fill: var(--text-secondary);
    transition: all 0.3s ease;
}

.side-bar li a:hover svg {
    fill: var(--accent-color);
    transform: translateY(-3px);
}

/* Left line REMOVED */

.email-link {
    font-family: 'Chivo Mono', monospace;
    color: var(--text-secondary);
    letter-spacing: 1px;
    font-size: 0.875rem; /* 14px */
    transition: all 0.3s ease;
}
.email-link:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
}

.side-bar-right .email-link {
    writing-mode: vertical-lr; /* Rotate text */
    text-orientation: mixed;    /* Keep characters upright */
    transform: rotate(180deg);  /* Rotate the entire text string */
    margin-bottom: 0;           /* Remove bottom margin for vertical alignment */
    margin-left: 1.5rem;        /* Adjust margin for vertical layout */
    margin-right: 1.5rem;
}

.side-bar-right::after {
    content: "";
    display: block;
    width: 1px;
    height: 150px; /* Length of the line */
    margin-top: 1.5rem;
    background-color: var(--text-secondary);
}

@media (max-width: 1024px) { /* Hide on tablets and phones */
    .side-bar {
        display: none;
    }
}

/* Contact Section Social Links */
.contact-socials {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem; /* 24px */
    margin-top: 2rem; /* Space above the icons */
}
.contact-socials a svg {
    width: 28px; /* Slightly larger */
    height: 28px;
    fill: var(--text-secondary);
    transition: all 0.3s ease;
}
.contact-socials a:hover svg {
    fill: var(--accent-color);
    transform: translateY(-3px);
}


/* Header Nav */
nav a {
    font-family: 'Chivo Mono', monospace;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--accent-color);
}

/* Header & Navigation Bar */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99;
    padding: 1.5rem 2rem; /* Consistent padding */
    transition: background-color 0.3s ease-in-out, backdrop-filter 0.3s ease-in-out;
}

header.scrolled {
    background-color: rgba(62, 50, 43, 0.85); /* var(--card-color) with opacity */
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

/* Adjust main content padding to avoid overlap with fixed header */
#main-content {
    padding-top: 100px; /* Provides space for the fixed header */
}

/* Logo Styling */
.logo a {
    display: block;
    transition: transform 0.3s ease;
}

.logo a:hover {
    transform: scale(1.05);
}

.logo svg {
    height: 32px; /* Adjust size as needed */
    width: auto;
}
.logo .logo-fill {
    fill: var(--text-primary);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(11, 11, 11, 0.6);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}


/* Mobile Menu */
.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: -100%; /* Start off-screen */
    width: 75%;
    max-width: 300px;
    height: 100vh;
    background-color: rgba(62, 50, 43, 0.95); /* var(--card-color) with opacity */
    backdrop-filter: blur(10px);
    z-index: 100;
    transition: right 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: -10px 0 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.mobile-menu-panel.is-open {
    right: 0; /* Slide in */
}

.mobile-menu-link {
    font-family: 'Chivo Mono', monospace;
    color: var(--text-secondary);
    font-size: 1.125rem; /* 18px */
    padding: 0.75rem 1rem;
    display: block;
    text-align: left;
    transition: color 0.3s ease, background-color 0.3s ease;
    width: 100%;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 6px;
}

.mobile-menu-link:hover {
    color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.05);
}

.mobile-menu-socials {
    display: flex;
    justify-content: center;
    gap: 1.5rem; /* 24px */
}

.mobile-menu-socials a svg {
    width: 24px;
    height: 24px;
    fill: var(--text-secondary);
    transition: fill 0.3s ease, transform 0.3s ease;
}

.mobile-menu-socials a:hover svg {
    fill: var(--accent-color);
    transform: scale(1.1);
}

.mobile-menu-email {
    font-family: 'Chivo Mono', monospace;
    color: var(--text-secondary);
    font-size: 0.875rem; /* 14px */
    opacity: 0.8;
    transition: color 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-email:hover {
    color: var(--accent-color);
    opacity: 1;
}



/* Base Card Style */
.styled-card {
    background-color: var(--card-color);
    box-shadow: var(--shadow);
    border-radius: 0.5rem; /* 8px */
    transition: all 0.3s ease;
}

/* Project Card */
.project-card {
    background-color: var(--card-color);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

/* Zoom animation on text */
.project-card h3, .project-card p,
.achievement-card h4, .achievement-card p {
    transition: transform 0.3s ease;
}

.project-card:hover h3, .project-card:hover p,
.achievement-card:hover h4, .achievement-card:hover p {
    transform: scale(1.03);
}

/* Achievement Card */
.achievement-card {
    position: relative;
    overflow: hidden;
    /* background-image is now removed in favor of gradients on the ::before pseudo-element */
    box-shadow: var(--shadow);
    border-radius: 0.5rem;
    background-color: var(--card-color); /* Default background */
    transition: transform 0.3s ease;
}

.achievement-card:hover {
    transform: translateY(-5px);
}

.achievement-card-content {
    position: relative;
    z-index: 2;
}

/* Main CTA Button */
.cta-btn {
    background-color: var(--accent-color);
    color: var(--text-bg-color);
    border: 1px solid var(--accent-color);
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    border-radius: 4px;
}
.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 60px -10px rgba(0,0,0,.8), 0 8px 25px -8px rgba(0,0,0,.8);
}

/* Terminal Contact Form */
#contact-form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(11, 11, 11, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100; /* Highest z-index */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    /* Animation */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#contact-form-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.terminal-window {
    width: 100%;
    max-width: 700px;
    background-color: #010101;
    border: 1px solid var(--text-secondary);
    border-radius: 8px;
    box-shadow: var(--shadow);
    /* Animation */
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

#contact-form-overlay.is-visible .terminal-window {
    transform: scale(1);
}

.terminal-header {
    background-color: #333;
    padding: 0.75rem;
    border-top-left-radius: 7px;
    border-top-right-radius: 7px;
    display: flex;
    align-items: center;
    position: relative;
}

.terminal-controls {
    display: flex;
    gap: 0.5rem;
}
.terminal-control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.terminal-control.close { background-color: #FF5F56; }
.terminal-control.min { background-color: #FFBD2E; }
.terminal-control.max { background-color: #27C93F; }

.terminal-title {
    color: #eee;
    font-family: 'Chivo Mono', monospace;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.terminal-body {
    padding: 1.5rem;
    font-family: 'Chivo Mono', monospace;
    color: #4AF626; /* Terminal green */
    height: 450px;
    overflow-y: auto;
}

.terminal-prompt {
    color: var(--accent-color); /* Use accent color for prompt */
}

/* Smooth fade-in for form */
.terminal-form {
    opacity: 0;
    transition: opacity 0.5s ease 0.2s; /* Fade-in with a slight delay */
}
.terminal-form.is-visible {
    opacity: 1;
}


/* Blinking cursor for typing animation */
.typing-cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background-color: #4AF626;
    animation: blink 1s infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.terminal-form .form-group {
    margin-bottom: 1rem;
}

.terminal-form label {
    display: block;
    margin-bottom: 0.5rem;
}

.terminal-form input,
.terminal-form textarea {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid #4AF626;
    color: #F5F5F5;
    padding: 0.5rem 0.75rem;
    width: 100%;
    border-radius: 4px;
    font-family: 'Chivo Mono', monospace;
}
.terminal-form input:focus,
.terminal-form textarea:focus {
    outline: none;
    box-shadow: 0 0 10px #4AF626;
}

.terminal-form textarea {
    min-height: 120px;
}

.terminal-btn {
    background-color: transparent;
    border: 1px solid #4AF626;
    color: #4AF626;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.terminal-btn:hover {
    background-color: #4AF626;
    color: #010101;
}

.terminal-btn.go-back {
    border-color: #FF5F56;
    color: #FF5F56;
    margin-right: 0.5rem;
}
.terminal-btn.go-back:hover {
    background-color: #FF5F56;
    color: #010101;
}

/* --- Download Links --- */
#download-links a {
    color: var(--text-secondary);
    text-decoration: underline;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}
#download-links a:hover {
    color: var(--accent-color);
}

/* === New Structured Skills Design === */
.skill-category-card {
    background-color: rgba(62, 50, 43, 0.5); /* var(--card-color) with opacity */
    border-radius: 0.75rem; /* 12px */
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 152, 0, 0.1); /* Faint accent border */
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.skill-category-title {
    font-size: 1.5rem; /* 24px */
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 152, 0, 0.2);
    color: var(--text-primary);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.skill-card {
    background-color: var(--bg-color);
    border-radius: 0.5rem; /* 8px */
    padding: 1rem;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    border: 1px solid transparent;
    cursor: default;
}

.skill-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    border-color: rgba(255, 152, 0, 0.5);
}

.skill-card-name {
    font-family: 'Chivo Mono', monospace;
    font-weight: 500;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.75rem;
}

.skill-card-proficiency-bg {
    width: 100%;
    height: 6px;
    background-color: rgba(0,0,0,0.3);
    border-radius: 3px;
    overflow: hidden;
}

.skill-card-proficiency-fg {
    height: 100%;
    background-color: var(--accent-color);
    border-radius: 3px;
    transition: width 0.5s ease-in-out;
}

.skill-notes-tooltip {
    position: fixed;
    background-color: var(--card-color);
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    max-width: 350px;
    border: 1px solid var(--accent-color);
    box-shadow: var(--shadow);
    z-index: 110; /* Above everything else */
    pointer-events: none; /* Don't let the tooltip block mouse events */
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -100%); /* Position above the cursor */
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.skill-notes-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
}
/* === End New Styles === */
