:root {
    --bg-color: #000814;
    --card-bg: rgba(10, 25, 47, 0.65);
    --text-color: #e0e6ed;
    --secondary-text: #94a3b8;
    --accent-color: #3a86ff;
    --command-color: #50c8ff;
    --link-color: #4cc9f0;
    --border-color: rgba(58, 134, 255, 0.3);
    --card-hover: rgba(58, 134, 255, 0.15);
    --footer-bg: rgba(0, 0, 0, 0.4);
    --terminal-bar-bg: rgba(0, 0, 0, 0.3);
    --btn-bg: rgba(255, 255, 255, 0.05);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "JetBrains Mono", monospace;
    background: radial-gradient(circle at top, #001d3d, #000814 60%);
    color: var(--text-color);
    line-height: 1.6;
    transition: background 0.3s ease;
}

body.light {
    --bg-color: #f5f7fa;
    --card-bg: rgba(255, 255, 255, 0.7);
    --text-color: #1d3557;
    --secondary-text: #457b9d;
    --accent-color: #3a86ff;
    --command-color: #0056b3;
    --link-color: #0056b3;
    --border-color: rgba(58, 134, 255, 0.2);
    --card-hover: rgba(58, 134, 255, 0.08);
    --footer-bg: rgba(255, 255, 255, 0.3);
    --terminal-bar-bg: rgba(230, 233, 240, 0.9);
    --btn-bg: #ffffff;
    background: radial-gradient(circle at top, #e0e7ff, #f5f7fa 60%);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-left: 1px solid var(--border-color);
}

body.light ::-webkit-scrollbar-track {
    background: #f5f7fa;
    border-left: 1px solid rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
    background: var(--btn-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

body.light ::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border: 1px solid #e5e7eb;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
}

a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--link-color);
    padding-bottom: 1px;
    font-weight: 600;
    transition: all 0.2s ease;
}

a:hover {
    color: #ffffff;
    border-bottom: 1px solid #ffffff;
    background: transparent;
}

body.light a:hover {
    color: #000000;
    border-bottom: 1px solid #000000;
}

.clean-link {
    border-bottom: none !important;
}

.clean-link:hover {
    border-bottom: none !important;
}

body::after {
    content: " ";
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.05) 50%);
    background-size: 100% 4px;
    z-index: 100;
    pointer-events: none;
    opacity: 0.1;
}

#background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.container {
    max-width: 1000px;
    margin: 40px auto;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    border-radius: 12px;
    position: relative;
}

.sticky-header-container {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 150;
    background: var(--card-bg);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-bottom: 1px dashed var(--border-color);
    margin-top: -1px;
}

.terminal-bar {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: var(--terminal-bar-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.terminal-controls {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

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

.red {
    background: #ff5f56;
}

.yellow {
    background: #ffbd2e;
}

.green {
    background: #27c93f;
}

.terminal-bar-title {
    margin-left: 20px;
    font-size: 0.85em;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.terminal-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-switch-wrapper {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.theme-switch-wrapper input {
    display: none;
}

.theme-slider {
    position: relative;
    width: 56px;
    height: 30px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 3px;
    transition: background 0.3s ease;
}

body.light .theme-slider {
    background: rgba(0, 0, 0, 0.05);
}

.icons-container {
    position: absolute;
    inset: 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5px;
    z-index: 2;
    pointer-events: none;
}

.theme-slider .icon {
    width: 14px;
    height: 14px;
    transition: color 0.3s ease, opacity 0.3s ease;
}

.moon-icon {
    color: #ffffff;
    opacity: 1;
}

.sun-icon {
    color: var(--text-color);
    opacity: 0.4;
}

.slider-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: var(--accent-color);
    border-radius: 50%;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.theme-switch-wrapper input:checked + .theme-slider .slider-knob {
    transform: translateX(24px);
}

.theme-switch-wrapper input:checked + .theme-slider .moon-icon {
    opacity: 0.4;
    color: var(--text-color);
}

.theme-switch-wrapper input:checked + .theme-slider .sun-icon {
    opacity: 1;
    color: #ffffff;
}

header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 30px 40px;
    border-bottom: 1px dashed var(--border-color);
    flex-wrap: nowrap;
}

.header-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    min-width: 0;
    flex: 0 1 auto;
}

header h1 {
    margin: 0;
    font-size: clamp(1.1rem, 4.5vw, 2.2em);
    white-space: nowrap;
}

.subtitle {
    display: flex;
    flex-direction: column;
    margin: 5px 0 12px 0;
    line-height: 1.4;
    font-weight: 400;
}

.subtitle span {
    display: block;
    font-size: clamp(0.65rem, 2.2vw, 1rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-photo {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 3px solid var(--accent-color);
    box-shadow: 0 0 20px rgba(58, 134, 255, 0.3);
    object-fit: cover;
    transition: 0.4s;
    flex-shrink: 0;
}

.profile-photo:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px 5px var(--accent-color);
    border-color: var(--accent-color);
}

.contact-icons {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
    margin-top: 5px;
}

.contact-icons img {
    width: 24px;
    height: 24px;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.contact-icons a:hover img {
    transform: scale(1.5) rotate(5deg);
    filter: drop-shadow(0 0 10px var(--accent-color)) !important;
}

.header-icon {
    width: 24px;
    height: 24px;
    filter: invert(1);
    transition: transform 0.2s ease, filter 0.2s ease;
}

body.light .header-icon {
    filter: invert(0);
}

.contact-icons a:hover .header-icon {
    filter: invert(1) drop-shadow(0 0 10px var(--accent-color)) !important;
}

body.light .contact-icons a:hover .header-icon {
    filter: invert(0) drop-shadow(0 0 10px var(--accent-color)) !important;
}

.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 15px 25px;
    background: rgba(58, 134, 255, 0.1);
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    color: var(--accent-color);
    font-weight: bold;
}

.hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--accent-color);
    transition: 0.3s;
}

.tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px;
}

.tab {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 8px 18px;
    cursor: pointer;
    font-family: inherit;
    transition: 0.3s;
    opacity: 0.6;
    font-weight: 600;
    position: relative;
    text-decoration: none !important;
    border-bottom: none !important;
}

.tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.tab:hover,
.tab.active {
    opacity: 1;
    color: var(--text-color);
    border-bottom: none !important;
}

.tab:hover::after,
.tab.active::after {
    width: 80%;
}

main {
    padding: 30px;
    min-height: 450px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.command-line {
    color: var(--command-color);
    margin-bottom: 20px;
    font-size: 1.1em;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: none;
}

.section-divider {
    border: none;
    border-top: 1px dashed var(--border-color);
    margin: 40px 0;
    opacity: 0.7;
}

.typewriter {
    opacity: 0;
    overflow: hidden;
    animation: fadeIn 0.5s forwards;
    animation-delay: var(--delay);
    margin-bottom: 10px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(5px);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 4px solid var(--accent-color);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 8px;
    display: block;
}

.card-subtitle {
    font-size: 0.75rem;
    color: var(--command-color);
    margin: 0 0 12px 0;
    font-family: 'JetBrains Mono', monospace;
}

.card:hover {
    background: var(--card-hover);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: var(--accent-color);
}

.card h3 {
    margin-top: 0;
    font-size: 1.1em;
    border-bottom: 1px solid rgba(58, 134, 255, 0.15);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.industry-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 90px;
    font-size: 4.5rem;
    opacity: 0.6;
    transition: all .25s ease;
    user-select: none;
}

.card:hover .industry-icon {
    opacity: 1;
    transform: scale(1.08);
}

.domain-desc {
    text-align: center;
    margin-top: 0.5rem;
    line-height: 1.5;
    font-size: 0.95em;
    color: var(--text-color);
}

.domain-desc-edu {
    text-align: left;
    margin-top: 0.5rem;
    line-height: 1.5;
}

.company {
    font-weight: 600;
    color: var(--secondary-text);
    margin-bottom: 10px;
}

.date {
    float: right;
    font-size: 0.85em;
    opacity: 0.7;
}

#experience ul {
    list-style: none;
    padding-left: 0;
}

#experience ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 0.95em;
}

#experience ul li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

main ul li {
    position: relative;
    padding-left: 0;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tag {
    background: rgba(58, 134, 255, 0.1);
    border: 1px solid var(--accent-color);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--accent-color);
    color: #fff;
    transform: translateY(-2px);
}

.portfolio-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    margin-top: 20px;
    padding: 0 10px;
}

.portfolio-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    flex: 0 1 calc(33.333% - 25px);
    min-width: 280px;
    max-width: 400px;
}

.portfolio-link {
    text-decoration: none !important;
    border-bottom: none !important;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.portfolio-link:hover {
    border-bottom: none !important;
}

.image-wrapper {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-bottom: 2px solid var(--border-color);
    background-color: #0f172a;
    flex-shrink: 0;
    margin-top: 0;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(58, 134, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-overlay span {
    color: white;
    font-weight: bold;
    border: 2px solid white;
    padding: 8px 16px;
    border-radius: 4px;
}

.portfolio-item:hover {
    transform: translateY(-8px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px -10px var(--accent-color);
}

.portfolio-item:hover .image-wrapper img {
    transform: scale(1.1);
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-info {
    padding: 15px !important;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.portfolio-info h3 {
    margin: 0 0 5px 0 !important;
    font-size: 0.95em !important;
    color: var(--accent-color) !important;
    min-height: auto;
    display: flex;
    align-items: center;
}

.portfolio-info .domain-desc {
    font-size: 0.85em !important;
    line-height: 1.4 !important;
    color: var(--text-color) !important;
    margin: 0 !important;
    flex-grow: 1;
    text-align: left;
}

.lang-list {
    list-style: none !important;
    padding-left: 0 !important;
}

.lang-list li::before {
    content: "" !important;
    padding-left: 0 !important;
}

.cursor-line {
    margin-top: 30px;
    font-size: 1.2em;
    border-top: 1px dashed var(--border-color);
    padding-top: 20px;
}

.blink {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.terminal-footer {
    background: var(--footer-bg);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 15px 30px;
    font-size: 0.75rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.status-group {
    display: flex;
    gap: 20px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--secondary-text);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #27c93f;
    border-radius: 50%;
    box-shadow: 0 0 8px #27c93f;
}

.copyright {
    justify-self: center;
    color: var(--secondary-text);
}

.footer-links {
    display: flex;
    gap: 15px;
    justify-self: end;
}

.footer-links a {
    color: var(--link-color) !important;
    border: none !important;
    text-decoration: underline;
}

#backToTop {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    width: 50px;
    height: 50px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #001d3d; 
    color: #3a86ff;
    border: 2px solid #3a86ff;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#backToTop:hover {
    background: #3a86ff;
    color: #ffffff;
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(58, 134, 255, 0.4);
}

@media (max-width: 960px) {
    .sticky-header-container {
        position: -webkit-sticky;
        position: sticky;
        top: 0;
        z-index: 200;
        background: var(--card-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border-color);
    }

    .mobile-menu-toggle {
        display: flex;
        position: relative;
        bottom: auto;
        right: auto;
        width: 100%;
        height: auto;
        padding: 15px 25px;
        border-radius: 0;
        background: rgba(58, 134, 255, 0.05);
        box-shadow: none;
        z-index: auto;
    }

    .mobile-menu-toggle span:not(.hamburger) {
        display: inline-block;
    }

    .hamburger {
        gap: 4px;
    }

    .hamburger span {
        width: 20px;
        height: 2px;
    }

    .tabs {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        bottom: auto;
        padding: 10px 0;
        gap: 0;
        z-index: 199;
        background: rgba(10, 25, 47, 0.98);
        backdrop-filter: blur(15px);
        border: none;
        border-bottom: 1px solid var(--border-color);
        border-radius: 0;
        box-shadow: 0 15px 25px rgba(0, 0, 0, 0.6);
    }

    body.light .tabs {
        background: rgba(245, 247, 250, 0.98);
        box-shadow: 0 15px 25px rgba(0, 0, 0, 0.15);
    }

    .tabs.active {
        display: flex;
    }

    .tab {
        width: 100%;
        text-align: left;
        padding: 14px 25px;
        opacity: 0.8;
        transition: all 0.3s ease;
    }

    .tab::after {
        left: 25px;
        transform: none;
        bottom: 8px;
    }

    .tab:hover::after,
    .tab.active::after {
        width: 25px;
    }

    .tab:hover {
        background: rgba(58, 134, 255, 0.08);
        padding-left: 30px;
        opacity: 1;
    }

    .container {
        margin: 10px;
    }

    header {
        flex-direction: row;
        justify-content: center;
        text-align: left;
        padding: 20px 15px;
        gap: 15px;
        flex-wrap: nowrap;
    }

    .header-info {
        align-items: flex-start;
        text-align: left;
        flex: 0 1 auto;
        min-width: 0;
    }

    header h1 {
        white-space: normal;
        word-break: break-word;
    }

    .subtitle span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: clip;
    }

    .profile-photo {
        width: 88px;
        height: 88px;
    }

    .contact-icons {
        justify-content: flex-start;
        margin-top: 5px;
    }

    .terminal-bar-title {
        display: none;
    }

    .date {
        float: none;
        display: block;
        margin-top: 5px;
        font-size: 0.8em;
    }

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

    .footer-content {
        display: flex;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    #backToTop {
        bottom: 25px;
        right: 25px;
    }
}

:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
    border-radius: 4px;
}

body.light a {
    color: #004a99;
    font-weight: 700;
}

.secondary-text, .company, .date, .copyright {
    color: var(--secondary-text);
    filter: brightness(0.9);
}

button, .tab, .theme-switch-wrapper, .mobile-menu-toggle {
    cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.portfolio-carousel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.carousel-viewport {
    width: 100%;
    max-width: 1000px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 45px 20px 45px;
    margin: 0 auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--bg-color);
}

.carousel-viewport::-webkit-scrollbar {
    height: 8px;
}

.carousel-viewport::-webkit-scrollbar-track {
    background: var(--bg-color);
}

.carousel-viewport::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

.portfolio-grid.carousel-track {
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    margin-top: 0;
    padding: 0;
    width: max-content;
}

.carousel-slide {
    flex: 0 0 300px;
    width: 300px;
    display: flex;
    justify-content: center;
    box-sizing: border-box;
}

.carousel-slide .portfolio-item {
    width: 100%;
    flex: 1 1 auto;
    max-width: none;
}

.carousel-dots {
    display: none !important;
}

.carousel-btn {
    position: absolute;
    top: 45%;
    transform: translateY(-50%);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--accent-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.carousel-btn:hover {
    background: var(--accent-color);
    color: #fff;
    box-shadow: 0 0 15px var(--accent-color);
}

.prev-btn {
    left: 4px;
}

.next-btn {
    right: 4px;
}

@media (max-width: 768px) {
    .portfolio-carousel {
        padding: 0;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .carousel-viewport {
        padding: 10px 10px 20px 10px;
        width: 100%;
    }

    .carousel-slide {
        flex: 0 0 calc(100vw - 48px);
        width: calc(100vw - 48px);
        max-width: 320px;
    }

    .image-wrapper {
        height: 160px;
    }

    .portfolio-info {
        padding: 12px !important;
    }

    .portfolio-info h3 {
        font-size: 0.9em !important;
        margin-bottom: 6px !important;
    }

    .portfolio-info .domain-desc {
        font-size: 0.8em !important;
        line-height: 1.4 !important;
    }

    .carousel-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .prev-btn {
        left: 2px;
    }

    .next-btn {
        right: 2px;
    }
}

main, .card, .portfolio-info {
    line-height: 1.7;
}

.container, .card, .portfolio-item {
    backdrop-filter: blur(18px) saturate(190%);
    -webkit-backdrop-filter: blur(18px) saturate(190%);
}

.card:hover, .portfolio-item:hover {
    box-shadow: 0 12px 35px -8px rgba(58, 134, 255, 0.25);
    border-color: var(--accent-color);
}

.command-line::after {
    content: "█";
    display: inline-block;
    margin-left: 4px;
    color: var(--command-color);
    font-weight: bold;
    animation: smoothCursorBlink 1.75s ease-in-out infinite;
}

@keyframes smoothCursorBlink {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.tag {
    background: rgba(58, 134, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
}

/* Header Terminal Label & Layout Rules */
.header-info .identity-group {
    margin-bottom: 0;
}

.header-info .roles-group {
    margin-top: 15px;
}

.header-info .section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Theme-adaptive exact colors matching "View PDF" */
body:not(.light) .header-info .section-label {
    color: rgb(76, 201, 240);
}

body.light .header-info .section-label {
    color: rgb(0, 86, 179);
}

/* Container and text handling to prevent clipping */
.header-info .subtitle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
}

.header-info .subtitle span {
    display: block;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Responsive mobile sizing adjustments */
@media (max-width: 768px) {
    header {
        padding: 1rem;
        box-sizing: border-box;
    }

    .header-info {
        max-width: 100%;
        min-width: 0; /* Prevents flex items from overflowing parent container */
        overflow: hidden;
    }

    .header-info h1 {
        font-size: 1.4rem;
    }

    .header-info .subtitle span {
        font-size: 0.75rem; /* Scaled down specifically for small screens so "(PSM II)" fits completely */
    }
}

/*Contact Section*/
/* Isolated contact section styling */
.contact-section {
    width: 100%;
    max-width: 800px;
    margin: 4rem auto;
    font-family: 'Courier New', Courier, monospace;
    padding: 0 1rem;
}

/* Base Terminal Window (Dark Mode Default) */
.contact-section .terminal-window {
    background: var(--card-bg, #0b0f19);
    border: 1px solid var(--border-color, #1e293b);
    border-radius: 10px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.contact-section .terminal-bar {
    background: var(--terminal-bar-bg, #111827);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color, #1e293b);
}

.contact-section .terminal-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.contact-section .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.contact-section .dot.red { background: #ef4444; }
.contact-section .dot.yellow { background: #f59e0b; }
.contact-section .dot.green { background: #10b981; }

.contact-section .terminal-title {
    color: #94a3b8;
    font-size: 0.85rem;
}

.contact-section .terminal-content {
    padding: 2rem;
}

.contact-section .terminal-comment {
    color: #94a3b8;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 1.75rem;
    border-left: 2px solid #334155;
    padding-left: 0.75rem;
}

.contact-section .terminal-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.contact-section .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.contact-section .form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.contact-section .prompt {
    color: #38bdf8;
    font-weight: bold;
}

.contact-section .label-text {
    color: #cbd5e1;
}

/* Input Styling */
.contact-section .terminal-input {
    background: #111827;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: #f8fafc;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    width: 100%;
    transition: all 0.2s ease;
    resize: vertical;
}

.contact-section .terminal-input:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.contact-section .terminal-input::placeholder {
    color: #64748b;
}

.contact-section .form-actions {
    margin-top: 1.5rem;
}

.contact-section .btn-terminal-submit {
    background: #1e293b;
    color: #f8fafc;
    border: 1px solid #334155;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.contact-section .btn-terminal-submit:hover {
    background: #38bdf8;
    color: #030712;
    border-color: #38bdf8;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.contact-section .btn-terminal-submit:hover .btn-prompt {
    color: #030712;
}

.contact-section .btn-terminal-submit .btn-prompt {
    color: #38bdf8;
}

/* Light Theme Adaptations (only applied when body.light is active) */
body.light .contact-section .terminal-window {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08);
}

body.light .contact-section .terminal-bar {
    background: #f1f5f9;
    border-bottom-color: #cbd5e1;
}

body.light .contact-section .terminal-title {
    color: #475569;
}

body.light .contact-section .terminal-comment {
    color: #1e293b;
    border-left-color: #0284c7;
    background: #f8fafc;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
}

body.light .contact-section .prompt {
    color: #0284c7;
    font-weight: 800;
}

/* Hard-forced dark and distinct labels on light theme */
body.light .contact-section .label-text {
    color: #000000 !important;
    font-weight: 900 !important;
    font-size: 1rem !important;
}

body.light .contact-section input.terminal-input,
body.light .contact-section textarea.terminal-input {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

body.light .contact-section input.terminal-input:focus,
body.light .contact-section textarea.terminal-input:focus {
    background-color: #ffffff !important;
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2) !important;
}

body.light .contact-section input.terminal-input::placeholder,
body.light .contact-section textarea.terminal-input::placeholder {
    color: #64748b !important;
}

body.light .contact-section .btn-terminal-submit {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

body.light .contact-section .btn-terminal-submit:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

body.light .contact-section .btn-terminal-submit .btn-prompt {
    color: #38bdf8;
}

body.light .contact-section .btn-terminal-submit:hover .btn-prompt {
    color: #ffffff;
}

/* Form Submission Status Message */
.form-status {
    margin: 1rem 0 0 0;
    font-size: 0.9rem;
    min-height: 1.2em;
    transition: color 0.2s ease;
}

.form-status.success {
    color: #10b981;
}

.form-status.error {
    color: #ef4444;
}

.btn-terminal-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Mobile responsiveness adjustments */
@media (max-width: 640px) {
    .contact-section {
        padding: 0 0.5rem;
        margin: 2rem auto;
    }
    
    .contact-section .terminal-content {
        padding: 1rem;
    }

    .contact-section .terminal-bar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .contact-section .terminal-title {
        font-size: 0.75rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
