/* 
   The Whimsical Coder Theme 
   Inspired by: cassie.codes
   Style: Playful, Bold, Character-driven
*/

/* 1. Variables & Design System */
:root {
    /* Colors */
    --bg-charcoal: #29272a;
    --bg-card: #1e1e1e;
    --text-white: #ececec;
    --text-muted: #a0a0a0;

    /* Pop Accents */
    --accent-green: #00ff9d;
    --accent-purple: #bd93f9;
    --accent-yellow: #ffeb3b;
    --accent-pink: #ff79c6;
    --accent-blue: #8be9fd;

    /* Fonts */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Space Mono', monospace;

    /* Spacing */
    --section-gap: 120px;

    /* UI Elements */
    --border-radius-lg: 12px;
    --border-radius-sm: 6px;
    --hard-shadow: 8px 8px 0px rgba(0, 0, 0, 0.4);
}

/* 2. Global Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-charcoal) !important;
    color: var(--text-white) !important;
    font-family: var(--font-body);
    line-height: 1.7;
    overflow-x: hidden;
    /* Subtle noise texture */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
}

a {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

/* 3. Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--text-white);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(3rem, 8vw, 5rem);
    letter-spacing: -0.03em;
    line-height: 1;
}

h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

/* Underline effect for H2 */
h2::after {
    content: '';
    display: block;
    width: 100%;
    height: 15px;
    background: var(--accent-purple);
    position: absolute;
    bottom: 5px;
    left: 0;
    z-index: -1;
    opacity: 0.7;
    transform: rotate(-1deg) skewX(-10deg);
}

h3 {
    font-size: 1.5rem;
    color: var(--text-white);
}

p {
    color: var(--text-muted);
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
    max-width: 70ch;
}

.text-highlight {
    color: var(--accent-green);
    font-family: var(--font-mono);
}

/* 4. Utility Components */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: var(--section-gap) 0;
}

/* Buttons */
.btn-fun {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--accent-green);
    color: var(--bg-charcoal);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: var(--border-radius-sm);
    box-shadow: 5px 5px 0px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
    border: 2px solid transparent;
}

.btn-fun:hover {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0px rgba(0, 0, 0, 0.5);
    background: #42ffb5;
    text-decoration: none;
    color: var(--bg-charcoal);
}

.btn-fun:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
}

.btn-outline-fun {
    background: transparent;
    border: 2px solid var(--accent-blue);
    color: #ffffff;
    box-shadow: none;
}

.btn-outline-fun:hover {
    background: var(--accent-blue);
    color: var(--bg-charcoal);
}

/* Browser Window Card */
.browser-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--hard-shadow);
    transition: transform 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.browser-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-purple);
}

.browser-header {
    background: #151515;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red {
    background: #ff5f56;
}

.dot.yellow {
    background: #ffbd2e;
}

.dot.green {
    background: #27c93f;
}

.browser-address-bar {
    background: rgba(255, 255, 255, 0.1);
    height: 10px;
    border-radius: 10px;
    flex-grow: 1;
    margin-left: 1rem;
    max-width: 200px;
}

.browser-content {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* 5. Navigation */
header {
    padding: 2rem 0;
    position: absolute;
    width: 100%;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-white);
}

.logo span {
    color: var(--accent-purple);
}

#menu {
    display: flex;
    gap: 2rem;
}

#menu li a {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-white);
    position: relative;
}

#menu li a::before {
    content: '<';
    margin-right: 5px;
    opacity: 0;
    color: var(--accent-green);
    transition: opacity 0.3s;
}

#menu li a::after {
    content: '/>';
    margin-left: 5px;
    opacity: 0;
    color: var(--accent-green);
    transition: opacity 0.3s;
}

#menu li a:hover::before,
#menu li a:hover::after {
    opacity: 1;
}

/* Mobile Menu Toggle */
#mobile-menu-open {
    display: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-white);
}

/* 6. Hero Section */
#lead {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
}

#lead .container {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
    align-items: center;
}

.hero-tag {
    display: inline-block;
    background: rgba(0, 255, 157, 0.1);
    color: var(--accent-green);
    font-family: var(--font-mono);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin-bottom: 2rem;
    border: 1px solid var(--accent-green);
}

.profile-container {
    position: relative;
}

/* Quirky Shape for Profile */
.profile-blob {
    width: 400px;
    height: 400px;
    background: url('../images/profile.jpg') no-repeat center center/cover;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: blob-bounce 8s ease-in-out infinite;
    border: 5px solid var(--text-white);
    box-shadow: var(--hard-shadow);
    z-index: 2;
    position: relative;
}

.blob-decoration {
    position: absolute;
    z-index: 1;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    filter: blur(40px);
    animation: float 6s ease-in-out infinite;
}

.blob-1 {
    background: var(--accent-purple);
    top: -20px;
    right: 0;
}

.blob-2 {
    background: var(--accent-green);
    bottom: -20px;
    left: 0;
    animation-delay: 1s;
}

/* 7. Experience & Projects */
.experience-grid,
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.card-role {
    font-family: var(--font-mono);
    color: var(--accent-blue);
    margin-bottom: 0.5rem;
    display: block;
    font-size: 0.9rem;
}

.card-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 1rem;
    display: block;
}

/* 8. Skills / About */
.skill-pill {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 50px;
    margin: 0 0.5rem 0.5rem 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    transition: 0.3s;
}

.skill-pill:hover {
    background: var(--text-white);
    color: var(--bg-charcoal);
    transform: scale(1.1) rotate(-2deg);
}

/* 9. Footer */
footer {
    padding: 4rem 0;
    text-align: center;
    border-top: 1px solid #333;
    margin-top: 6rem;
}

.social-icons a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    background: #333;
    border-radius: 50%;
    margin: 0 10px;
    font-size: 1.5rem;
    transition: 0.3s;
    color: var(--text-white);
}

.social-icons a:hover {
    background: var(--accent-purple);
    transform: translateY(-5px) rotate(10deg);
}

/* Animations */
@keyframes blob-bounce {
    0% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }

    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }

    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Responsive */
@media (max-width: 992px) {
    #lead .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-btn-group {
        justify-content: center;
    }

    .profile-blob {
        margin: 3rem auto;
        width: 300px;
        height: 300px;
    }
}

@media (max-width: 768px) {
    #menu {
        position: fixed;
        background: var(--bg-charcoal);
        top: 0;
        right: 0;
        height: 100vh;
        width: 80%;
        flex-direction: column;
        padding: 5rem 2rem;
        transform: translateX(100%);
        transition: 0.3s;
        border-left: 2px solid var(--accent-purple);
        box-shadow: -10px 0 50px rgba(0, 0, 0, 0.8);
        z-index: 1000;
    }

    header.active #menu,
    body.active #menu {
        transform: translateX(0);
    }

    #mobile-menu-open {
        display: block !important;
    }

    #mobile-menu-close {
        display: block !important;
        position: absolute;
        top: 2rem;
        right: 2rem;
        font-size: 2rem;
        cursor: pointer;
    }
}

/* Detail Modal Styles (Experience, Education, Projects) */
.detail-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(41, 39, 42, 0.95);
    /* Matches --bg-charcoal */
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
    overflow-y: auto;
    /* Allow scrolling if content is long */
}

.detail-modal-content {
    background: var(--bg-card);
    border: 2px solid var(--accent-purple);
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    /* Limit height to viewport */
    margin: 0;
    /* Remove auto margin in favor of flex centering */
    position: relative;
    box-shadow: 0 0 30px rgba(189, 147, 249, 0.2);
    animation: slideInUp 0.4s ease-out;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    /* Enable internal scrolling */
    scrollbar-width: thin;
    /* Firefox */
}

.detail-modal-content::-webkit-scrollbar {
    width: 8px;
}

.detail-modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.detail-modal-content::-webkit-scrollbar-thumb {
    background: var(--accent-purple);
    border-radius: 4px;
}

.detail-modal-header {
    background: rgba(29, 29, 29, 0.95);
    /* More solid background for sticky */
    backdrop-filter: blur(10px);
    border-radius: 18px 18px 0 0;
    /* Slightly less than parent to avoid aliasing */
    padding: 20px 30px;
    border-bottom: 2px solid var(--accent-purple);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

.detail-modal-header h2 {
    color: var(--text-white);
    margin: 0;
    font-size: 1.5rem;
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    gap: 15px;
}

.detail-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--accent-green);
    color: var(--accent-green);
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: bold;
}

.detail-close-btn:hover {
    background: var(--accent-green);
    color: var(--bg-charcoal);
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--accent-green);
}

.detail-modal-body {
    padding: 30px;
    color: var(--text-white);
}

.modal-section {
    margin-bottom: 25px;
}

.modal-section h3 {
    color: var(--accent-blue);
    font-size: 1.2rem;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-section ul {
    list-style-type: none;
    padding-left: 0;
}

.modal-section ul li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
    color: var(--text-muted);
}

.modal-section ul li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--accent-pink);
}

.modal-tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.modal-tech-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    color: var(--accent-yellow);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- Dynamic Data Styles --- */

/* Project Cards */
.project-card {
    min-height: 300px;
    /* Taller for content */
}

.project-card h3 {
    margin-bottom: 0.5rem;
    color: #fff;
}

.project-card p {
    font-size: 0.9rem;
    color: #ccc;
    flex-grow: 1;
    /* Pushes links to bottom */
}

.tech-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-blue);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-text {
    color: var(--accent-green);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.btn-text:hover {
    color: #fff;
    text-decoration: underline;
}

/* Skills Container */
.skill-category {
    margin-bottom: 1.5rem;
}

.skill-category h4 {
    color: #888;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.3rem;
    display: inline-block;
}

.skill-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Certifications */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.cert-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: transform 0.2s, background 0.2s;
}

.cert-card:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-2px);
}

.cert-icon {
    font-size: 1.5rem;
    color: var(--accent-purple);
    background: rgba(187, 134, 252, 0.1);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.cert-content h4 {
    margin: 0 0 0.3rem 0;
    font-size: 1rem;
    color: #fff;
}

.cert-issuer {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    color: #aaa;
}

.cert-link {
    font-size: 0.8rem;
    color: var(--accent-blue);
    text-decoration: none;
}

.cert-link:hover {
    text-decoration: underline;
}