/* =========================================
   CSS VARIABLES (DESIGN SYSTEM)
   ========================================= */
:root {
    /* Fonts */
    --font-main: 'Inter', sans-serif;

    /* Base spacing */
    --max-width: 1100px;
    --nav-height: 80px;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
:root[data-theme="light"] {
    --bg-color: #f8fafc;
    --surface-color: rgba(255, 255, 255, 0.8);
    --surface-solid: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --border-color: rgba(0, 0, 0, 0.06);

    /* Accents - Subtle Ocean */
    --accent-1: #3b82f6;
    --accent-2: #0ea5e9;
    --primary-gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2));

    --shadow-color: rgba(0, 0, 0, 0.05);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-highlight: rgba(255, 255, 255, 1);

    --hero-cursor: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='12' width='12' height='4' fill='%233b82f6'/%3E%3C/svg%3E") 0 12, auto;
}

/* Dark Theme Variables (Default) */
:root[data-theme="dark"] {
    --bg-color: #0e1115;
    /* Soft charcoal */
    --surface-color: rgba(20, 24, 28, 0.8);
    /* Refined glass surface */
    --surface-solid: #15191e;
    --text-primary: #e2e8f0;
    /* Soft slate white */
    --text-secondary: #94a3b8;
    /* Muted readable slate */
    --border-color: rgba(255, 255, 255, 0.08);
    /* Clean minimalist border */

    /* Accents - Subtle Mint/Terminal */
    --accent-1: #4ade80;
    /* Soft mint green */
    --accent-2: #2dd4bf;
    /* Faint teal for a subtle blend */
    --primary-gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2));

    --shadow-color: rgba(0, 0, 0, 0.3);
    /* Neutral shadows */
    --glass-border: rgba(74, 222, 128, 0.15);
    /* Very faint mint rims */
    --glass-highlight: rgba(74, 222, 128, 0.08);
    /* Barely there highlight */

    --hero-cursor: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='12' width='12' height='4' fill='%234ade80'/%3E%3C/svg%3E") 0 12, auto;
}

/* =========================================
   GLOBAL STYLES & RESETS
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

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

::-moz-selection {
    background: var(--accent-1);
    color: var(--bg-color);
}

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

.about ::-moz-selection {
    background: var(--accent-2);
    color: var(--bg-color);
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
    user-select: none;
    /* Disable text selection globally */
    -webkit-user-select: none;
}

#about,
#about * {
    user-select: text;
    /* Re-enable selection for the about section */
    -webkit-user-select: text;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    font-weight: 800;
    line-height: 1.2;
}

p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: var(--accent-1);
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 100px 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* =========================================
   UTILITIES
   ========================================= */
.text-center {
    text-align: center;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.5;
    box-sizing: border-box;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--bg-color) !important;
    box-shadow: 0 4px 15px var(--shadow-color);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-color);
    opacity: 0.9;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent-1);
    color: var(--accent-1) !important;
}

.btn-outline:hover {
    background: var(--accent-1);
    color: var(--bg-color) !important;
    transform: translateY(-2px);
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.glass-card {
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-highlight);
    border-left: 1px solid var(--glass-highlight);
    border-radius: 16px;
    box-shadow: 0 8px 32px var(--shadow-color);
}

/* =========================================
   TYPOGRAPHY
   ========================================= */
.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

/* =========================================
   NAVIGATION
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: transparent;
    transition: var(--transition);
    z-index: 1000;
}

.navbar.scrolled {
    background: var(--surface-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 30px var(--shadow-color);
}

.nav-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-link {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 100%;
}

.nav-link:hover {
    color: var(--accent-1);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

#theme-toggle:hover {
    background: var(--surface-color);
    color: var(--accent-1);
    transform: rotate(15deg);
}

.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 3px;
    transition: var(--transition);
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    position: relative;
    padding-top: var(--nav-height);
    overflow: hidden;
    cursor: var(--hero-cursor);
}

.hero p,
.hero h1,
.hero h2,
.hero .greeting,
.hero .name,
.hero .role,
.hero .summary,
.hero .hero-bg-animated {
    cursor: var(--hero-cursor);
}

.hero-bg-animated {
    position: absolute;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 140%;
    z-index: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, 0.25) 1.5px, transparent 1.5px);
    background-size: 35px 35px;
    opacity: 1;
    animation: panGridBg 50s linear infinite;
    -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    /* Smooth 3D tilt transition */
    transition: transform 0.1s linear;
}

.hero-bg-animated::before,
.hero-bg-animated::after {
    content: '';
    position: absolute;
    width: 60vmax;
    height: 60vmax;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-1) 0%, transparent 60%);
    opacity: 0.45;
    animation: floatOrb 25s infinite ease-in-out alternate;
    pointer-events: none;
}

.hero-bg-animated::before {
    top: -10vmax;
    left: -10vmax;
}

.hero-bg-animated::after {
    bottom: -10vmax;
    right: -10vmax;
    animation-delay: -12s;
    animation-direction: alternate-reverse;
}

@keyframes panGridBg {
    0% {
        background-position: 0px 0px;
    }

    100% {
        background-position: -350px -350px;
    }
}

@keyframes floatOrb {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(15vw, 15vh) scale(1.1);
    }

    100% {
        transform: translate(-10vw, 25vh) scale(0.9);
    }
}

/* =========================================
   LIGHT THEME HERO BACKGROUND
   ========================================= */
[data-theme="light"] .hero-bg-animated {
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.12) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: panGridLight 40s linear infinite;
    opacity: 1;
}

[data-theme="light"] .hero-bg-animated::before,
[data-theme="light"] .hero-bg-animated::after {
    border-radius: 15%;
    /* Creates a geometric modern box/squircle shape */
    opacity: 1;
}

[data-theme="light"] .hero-bg-animated::before {
    animation: rotateWireframe 40s infinite linear;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(14, 165, 233, 0.1));
    border: 2px solid rgba(59, 130, 246, 0.3);
    box-shadow: inset 0 0 50px rgba(14, 165, 233, 0.15), 0 0 50px rgba(59, 130, 246, 0.15);
}

[data-theme="light"] .hero-bg-animated::after {
    animation: rotateWireframe 60s infinite linear reverse;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(16, 185, 129, 0.1));
    border: 2px solid rgba(14, 165, 233, 0.3);
    box-shadow: inset 0 0 50px rgba(16, 185, 129, 0.15), 0 0 50px rgba(14, 165, 233, 0.15);
}

@keyframes panGridLight {
    0% {
        background-position: 0px 0px;
    }

    100% {
        background-position: -500px -500px;
    }
}

@keyframes rotateWireframe {
    0% {
        transform: rotate(0deg) scale(1.2);
    }

    50% {
        transform: rotate(180deg) scale(0.8);
    }

    100% {
        transform: rotate(360deg) scale(1.2);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.hero-text {
    flex: 1;
    min-width: 0;
    max-width: 600px;
    width: 100%;
}

.hero-image {
    flex-shrink: 0;
    width: 500px;
    max-width: 100%;
    display: flex;
    justify-content: center;
}

.greeting {
    color: var(--accent-1);
    font-family: monospace;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.name {
    font-size: clamp(36px, 7vw, 72px);
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: block;
    line-height: 1.1;
    white-space: nowrap;
}

.text-highlight {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    font-weight: inherit;
}

.role {
    font-size: clamp(30px, 5vw, 60px);
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    white-space: normal;
    min-height: auto;
    line-height: 1.3;
}

.summary {
    font-size: clamp(1rem, 2vw, 1.25rem);
    max-width: 540px;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.hero-cta {
    display: flex;
    gap: 1.5rem;
}

/* =========================================
   TERMINAL MODULE
   ========================================= */
.terminal-wrapper {
    position: relative;
    width: 500px;
    height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
}

.terminal {
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 20px 40px var(--shadow-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    cursor: pointer;
}

.terminal-header {
    height: 40px;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    position: relative;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
    position: z-index;
    z-index: 2;
}

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

.terminal-dot.close {
    background-color: var(--text-secondary);
    opacity: 0.5;
}

.terminal-dot.minimize {
    background-color: var(--text-secondary);
    opacity: 0.5;
}

.terminal-dot.maximize {
    background-color: var(--text-secondary);
    opacity: 0.5;
}

.terminal-title {
    position: absolute;
    width: 100%;
    text-align: center;
    left: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 1;
}

.terminal-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.terminal-body::-webkit-scrollbar {
    width: 6px;
}

.terminal-body::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

.terminal-output p {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.terminal-output .highlight {
    color: var(--accent-1);
    font-weight: bold;
}

.terminal-output .error {
    color: #ff5f56;
}

.terminal-output .help-title {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--accent-1);
    font-weight: 700;
}

.terminal-output .help-line {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 0.6rem;
    align-items: baseline;
    margin-bottom: 0.15rem;
}

.terminal-output .help-cmd {
    color: var(--text-primary);
    font-weight: 700;
}

.terminal-output .help-desc {
    color: var(--text-secondary);
}

.terminal-input-line {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
}

.terminal-input-line .prompt {
    color: var(--text-primary);
    margin-right: 0.5rem;
    white-space: nowrap;
    font-weight: 600;
}

.term-user {
    color: #27c93f;
    /* Terminal Green */
}

.term-path,
.term-dir {
    color: #3b82f6;
    /* Terminal Blue */
}

.term-cmd {
    color: var(--text-primary);
    font-weight: normal;
}

#terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: inherit;
    padding: 0;
    caret-color: var(--accent-1);
}

/* =========================================
   ABOUT SECTION
   ========================================= */
.about-grid {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    margin-bottom: 1.5rem;
}

/* =========================================
   RUBIK'S CUBE CONTAINER (THREE.JS)
   ========================================= */
.about-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 250px;
}

#three-cube-container {
    width: 350px;
    height: 350px;
    cursor: grab;
    touch-action: none;
}

#three-cube-container:active {
    cursor: grabbing;
}

@media (max-width: 768px) {
    .about-visual {
        display: none;
    }

    #three-cube-container {
        display: none;
    }

}

/* =========================================
   SKILLS SECTION
   ========================================= */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3rem;
    padding: 1rem 0;
}

.skill-card {
    flex: 0 1 calc(33.333% - 2rem);
    min-width: 220px;
    height: 250px;
    perspective: 1000px;
    cursor: default;
}

.skill-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

/* Direction-aware inner flips */
.skill-card.is-hovered.dir-top .skill-card-inner {
    transform: rotateX(-180deg);
}

.skill-card.is-hovered.dir-bottom .skill-card-inner {
    transform: rotateX(180deg);
}

.skill-card.is-hovered.dir-right .skill-card-inner {
    transform: rotateY(-180deg);
}

.skill-card.is-hovered.dir-left .skill-card-inner {
    transform: rotateY(180deg);
}

.skill-card-front,
.skill-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    border-radius: 16px;
}

.skill-card-front i {
    font-size: 4rem;
    color: var(--accent-1);
    margin-bottom: 1rem;
    transition: transform 0.3s;
}

.skill-card-front span {
    font-weight: 600;
    font-size: 1.2rem;
}

.skill-card-back {
    transform: rotateY(180deg);
    /* Default fallback */
    border: 1px solid var(--accent-1);
    background: var(--surface-color);
}

/* Ensure the back face is oriented correctly relative to the flip axis */
.skill-card.dir-top .skill-card-back,
.skill-card.dir-bottom .skill-card-back {
    transform: rotateX(180deg);
}

.skill-card.dir-left .skill-card-back,
.skill-card.dir-right .skill-card-back {
    transform: rotateY(180deg);
}

.skill-card-back p {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.6;
}

.skill-card:hover .skill-card-front i {
    transform: scale(1.1);
}

/* =========================================
   PROJECTS SECTION
   ========================================= */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    display: flex;
    flex-direction: row;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    padding: 2rem;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 45px var(--shadow-color);
    border-color: var(--accent-1);
}

.project-card:hover .project-title {
    color: var(--accent-1);
}

.project-header>i {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .project-header>i {
    transform: scale(1.15) rotate(-5deg);
    color: var(--accent-2);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover::before {
    opacity: 1;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.project-icon {
    font-size: 2.5rem;
    color: var(--accent-1);
}

.project-links a {
    color: var(--text-secondary);
    font-size: 1.25rem;
    margin-left: 1rem;
}

.project-links a:hover {
    color: var(--accent-1);
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.project-card:hover .project-title {
    color: var(--accent-1);
}

.project-desc {
    font-size: 1rem;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.project-download {
    margin-top: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
}

/* =========================================
   CONTACT SECTION
   ========================================= */
.contact {
    min-height: 80vh;
}

.contact .section-title::after {
    left: 50%;
    transform: translateX(-50%);
}

.contact-subtitle {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 3rem auto;
}

.contact {
    align-items: center;
}

.footer-socials {
    margin-top: 1.5rem;
    display: flex;
    gap: 1.2rem;
}

.footer-socials a {
    color: var(--text-secondary);
    font-size: 1.1rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface-color);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.footer-socials a:hover {
    color: var(--bg-color) !important;
    background: var(--accent-1);
    transform: translateY(-4px) scale(1.1);
    border-color: var(--accent-1);
    box-shadow: 0 10px 20px rgba(74, 222, 128, 0.2);
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
    position: relative;
    padding: 5rem 0 2rem 0;
    margin-top: 5rem;
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-1));
    background-size: 200% auto;
    opacity: 0.8;
    animation: shimmerBorder 4s linear infinite;
}

@keyframes shimmerBorder {
    100% {
        background-position: 200% center;
    }
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 3rem;
    margin-bottom: 2rem;
}

.footer-brand .footer-logo {
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 1.8rem;
    transition: var(--transition);
}

.footer-brand .footer-logo:hover {
    transform: scale(1.05);
    text-shadow: 0 0 15px rgba(39, 201, 63, 0.4);
}

.footer-tagline {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 320px;
    line-height: 1.6;
    margin: 0;
    transition: var(--transition);
}

.footer-brand:hover .footer-tagline {
    color: var(--text-primary);
}

.footer-credits {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.footer-credits .credit-item {
    margin: 0 0 0.8rem 0;
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s;
    cursor: default;
}

.footer-credits .credit-item:hover {
    transform: translateX(-8px);
    color: var(--text-primary);
}

.footer-credits .credit-item:hover .text-highlight {
    filter: drop-shadow(0 0 8px rgba(74, 222, 128, 0.5));
}

.footer-credits .credit-item:last-child {
    margin-bottom: 0;
}

.footer-bottom {
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0.8;
    transition: var(--transition);
    display: inline-block;
    cursor: pointer;
}

.footer-bottom p:hover {
    opacity: 1;
    color: var(--accent-1);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .footer-grid {
        flex-direction: column;
        text-align: center;
        gap: 2.5rem;
        padding-bottom: 2.5rem;
    }

    .footer-credits {
        align-items: center;
    }

    .footer-credits .credit-item:hover {
        transform: translateY(-3px);
    }

    .footer-brand .footer-tagline {
        margin: 0 auto;
    }
}

/* =========================================
   ANIMATIONS (For Script.js Observers)
   ========================================= */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease forwards;
}

.fade-in-delay {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease 0.4s forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.reveal {
    opacity: 0;
    --reveal-translate-x: 0;
    --reveal-translate-y: 50px;
    --reveal-scale: 1;
    transform: translate(var(--reveal-translate-x), var(--reveal-translate-y)) scale(var(--reveal-scale));
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

.reveal.fade-left {
    --reveal-translate-x: -50px;
    --reveal-translate-y: 0;
}

.reveal.fade-right {
    --reveal-translate-x: 50px;
    --reveal-translate-y: 0;
}

.reveal.scale-up {
    --reveal-scale: 0.8;
    --reveal-translate-y: 20px;
}

/* =========================================
   MEDIA QUERIES (RESPONSIVE)
   ========================================= */
@media (max-width: 992px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
        padding-top: 2rem;
    }

    .hero-text {
        align-items: center;
        display: flex;
        flex-direction: column;
    }

    .hero-cta {
        justify-content: center;
    }

    .image-wrapper {
        width: 300px;
        height: 300px;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
        z-index: 1001;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--surface-solid);
        border-left: 1px solid var(--border-color);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.4s ease-in-out;
        z-index: 1000;
        box-shadow: -10px 0 30px var(--shadow-color);
    }

    .nav-links.nav-active {
        right: 0;
    }

    .nav-link {
        font-size: 1.5rem;
    }

    .hamburger.toggle span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .hamburger.toggle span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.toggle span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .section-title {
        font-size: 2rem;
    }

    .name {
        font-size: 2.5rem;
        line-height: 1.15;
        margin-bottom: 0.5rem;
        white-space: nowrap;
    }

    .role {
        font-size: 1.3rem;
        white-space: normal;
        word-break: break-word;
        margin-bottom: 1.5rem;
        line-height: 1.3;
    }

    .greeting {
        font-size: 0.95rem;
    }

    .summary {
        font-size: 1rem;
    }

    .section {
        padding: 60px 0;
    }

    .container {
        padding: 0 1.5rem;
    }

    .skills-grid {
        gap: 1.2rem;
    }
}

/* =========================================
   TYPEWRITER EFFECT
   ========================================= */
.typewriter {
    font-family: monospace;
    color: #27c93f;
    /* Terminal Green */
    font-size: clamp(1.1rem, 3vw, 2rem);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .typewriter {
        font-size: clamp(1rem, 2.8vw, 1.6rem);
    }
}

.cursor {
    display: inline-block;
    color: var(--accent-1);
    /* Dynamic Theme Accent */
    font-size: clamp(1.1rem, 3vw, 2rem);
    font-weight: 600;
    vertical-align: middle;
    margin-left: 2px;
    animation: blink 1s step-end infinite;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .cursor {
        font-size: clamp(1rem, 2.8vw, 1.6rem);
    }
}

.cursor.typing {
    animation: none;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* =========================================
   MOBILE TERMINAL RESPONSIVENESS
   ========================================= */
.terminal-trigger {
    display: none;
}

@media (max-width: 992px) {
    .terminal-trigger {
        display: inline-block;
    }

    .terminal-wrapper:not(.visible-on-mobile) {
        display: none !important;
    }

    .terminal-wrapper.visible-on-mobile {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw !important;
        height: 100vh !important;
        margin: 0;
        padding: 1rem;
        background: rgba(0, 0, 0, 0.75);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        z-index: 9999;
        align-items: center;
        justify-content: center;
        animation: fadeIn 0.3s ease forwards;
    }

    .terminal-wrapper.visible-on-mobile .terminal {
        width: 100%;
        height: auto;
        max-height: 85vh;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    }

    /* Fix containing block trapping for fixed position */
    .hero-image {
        transform: none !important;
        animation: none !important;
        transition: none !important;
        width: 100%;
        display: none;
    }

    .hero-cta {
        flex-wrap: wrap;
        /* Ensure buttons don't overlap */
    }
}

/* =========================================
   CLI MODE THEME
   ========================================= */
[data-cli-mode="true"] {
    --bg-color: #000000;
    --surface-color: rgba(0, 20, 0, 0.9);
    --surface-solid: #001a00;
    --text-primary: #00ff00;
    --text-secondary: #00cc00;
    --border-color: rgba(0, 255, 0, 0.3);
    --accent-1: #00ff00;
    --accent-2: #00ff00;
    --primary-gradient: linear-gradient(135deg, #00ff00, #00cc00);
    --shadow-color: rgba(0, 255, 0, 0.1);
    --glass-border: rgba(0, 255, 0, 0.2);
    --glass-highlight: rgba(0, 255, 0, 0.1);
}

[data-cli-mode="true"] body {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.05em;
}

[data-cli-mode="true"] * {
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

[data-cli-mode="true"] h1,
[data-cli-mode="true"] h2,
[data-cli-mode="true"] h3 {
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

[data-cli-mode="true"] .glass-card {
    background: rgba(0, 20, 0, 0.8);
    border: 2px solid rgba(0, 255, 0, 0.3);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2), inset 0 0 10px rgba(0, 255, 0, 0.05);
}

[data-cli-mode="true"] .btn-primary {
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid #00ff00;
    color: #00ff00 !important;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3), inset 0 0 10px rgba(0, 255, 0, 0.1);
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.8);
}

[data-cli-mode="true"] .btn-primary:hover {
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.6), inset 0 0 20px rgba(0, 255, 0, 0.2);
    background: rgba(0, 255, 0, 0.2);
}

[data-cli-mode="true"] .terminal {
    background: #000000;
    border: 3px solid #00ff00;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.4);
}

[data-cli-mode="true"] .terminal-header {
    background: rgba(0, 20, 0, 0.8);
    border-bottom: 2px solid #00ff00;
}

[data-cli-mode="true"] .terminal-body {
    background: #000000;
}

[data-cli-mode="true"] .navbar.scrolled {
    background: rgba(0, 20, 0, 0.95);
    border-bottom: 2px solid rgba(0, 255, 0, 0.3);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
}

[data-cli-mode="true"] .section-title::after {
    background: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

[data-cli-mode="true"] .name {
    font-size: clamp(28px, 5vw, 52px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

[data-cli-mode="true"] .role {
    font-size: clamp(18px, 3.5vw, 40px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    min-height: auto;
}

[data-cli-mode="true"] .summary {
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

/* CLI Mode with Light Theme */
[data-cli-mode="true"][data-theme="light"] {
    --bg-color: #e8f5e9;
    --surface-color: rgba(200, 255, 200, 0.9);
    --surface-solid: #d4edda;
    --text-primary: #1b5e20;
    --text-secondary: #2e7d32;
    --border-color: rgba(27, 94, 32, 0.3);
    --accent-1: #00a000;
    --accent-2: #00a000;
    --primary-gradient: linear-gradient(135deg, #00a000, #007700);
    --shadow-color: rgba(27, 94, 32, 0.15);
    --glass-border: rgba(0, 160, 0, 0.3);
    --glass-highlight: rgba(0, 160, 0, 0.2);
}

[data-cli-mode="true"][data-theme="light"] * {
    text-shadow: 0 0 8px rgba(0, 160, 0, 0.3);
}

[data-cli-mode="true"][data-theme="light"] .glass-card {
    background: rgba(212, 237, 218, 0.95);
    border: 2px solid rgba(0, 160, 0, 0.4);
    box-shadow: 0 0 20px rgba(0, 160, 0, 0.15), inset 0 0 10px rgba(0, 160, 0, 0.08);
}

[data-cli-mode="true"][data-theme="light"] .btn-primary {
    background: rgba(0, 160, 0, 0.15);
    border: 2px solid #00a000;
    color: #1b5e20 !important;
    box-shadow: 0 0 15px rgba(0, 160, 0, 0.2), inset 0 0 10px rgba(0, 160, 0, 0.08);
    text-shadow: 0 0 3px rgba(0, 160, 0, 0.4);
}

[data-cli-mode="true"][data-theme="light"] .btn-primary:hover {
    box-shadow: 0 0 30px rgba(0, 160, 0, 0.3), inset 0 0 20px rgba(0, 160, 0, 0.15);
    background: rgba(0, 160, 0, 0.25);
}

[data-cli-mode="true"][data-theme="light"] .terminal {
    background: #f1f8f6;
    border: 3px solid #00a000;
    box-shadow: 0 0 30px rgba(0, 160, 0, 0.25);
}

[data-cli-mode="true"][data-theme="light"] .terminal-header {
    background: rgba(200, 255, 200, 0.95);
    border-bottom: 2px solid #00a000;
}

[data-cli-mode="true"][data-theme="light"] .terminal-body {
    background: #f1f8f6;
    color: #1b5e20;
}

[data-cli-mode="true"][data-theme="light"] .terminal-body p {
    color: #1b5e20;
}

[data-cli-mode="true"][data-theme="light"] .navbar.scrolled {
    background: rgba(212, 237, 218, 0.95);
    border-bottom: 2px solid rgba(0, 160, 0, 0.3);
    box-shadow: 0 0 20px rgba(0, 160, 0, 0.15);
}

[data-cli-mode="true"][data-theme="light"] .section-title::after {
    background: #00a000;
    box-shadow: 0 0 10px rgba(0, 160, 0, 0.3);
}

[data-cli-mode="true"][data-theme="light"] .highlight {
    color: #1b5e20;
}

[data-cli-mode="true"][data-theme="light"] .name {
    font-size: clamp(28px, 5vw, 52px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

[data-cli-mode="true"][data-theme="light"] .role {
    font-size: clamp(18px, 3.5vw, 40px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    min-height: auto;
}

[data-cli-mode="true"][data-theme="light"] .summary {
    font-size: clamp(0.9rem, 1.5vw, 1rem);
}

/* CLI Mode Typewriter Sizing */
[data-cli-mode="true"] .typewriter {
    font-size: clamp(0.85rem, 1.8vw, 1.3rem);
}

[data-cli-mode="true"] .cursor {
    font-size: clamp(0.85rem, 1.8vw, 1.3rem);
}

@media (max-width: 768px) {
    [data-cli-mode="true"] .typewriter {
        font-size: clamp(0.8rem, 1.6vw, 1rem);
    }

    [data-cli-mode="true"] .cursor {
        font-size: clamp(0.8rem, 1.6vw, 1rem);
    }
}