/* =========================================
   1. FONTS & THEME VARIABLES
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&family=JetBrains+Mono&display=swap');

:root {
    --navy: #0f172a;        
    --dark-navy: #1e293b;   
    --sky: #cbd5e1;         
    --accent: #38bdf8;      
    --white: #f8fafc;
}

body[data-theme="light"] {
    --navy: #f8fafc;
    --dark-navy: #e2e8f0;
    --sky: #1e293b;
    --accent: #0369a1;
    --white: #ffffff;
}
body[data-theme="light"] {
    --white: #f8fafc;       /* Off-white to reduce glare */
    --dark-navy: #1e293b;   /* Slate Grey-Blue text */
    --contrast-color: #0369a1; /* Deep Professional Blue */
    --btn-background: linear-gradient(#0ea5e9, #0284c7); /* Solid Blue Gradient */
    
    background-color: var(--white);
    color: var(--dark-navy);
}

html{
    scroll-behavior: smooth;
}
/* =========================================
   2. GLOBAL LAYOUT (FIXES ALIGNMENT)
   ========================================= */


body {
    font-family: 'Inter', sans-serif !important;
    margin: 0;
    padding: 0;
    transition: 0.5s;
    height: 100%;
    width: 100%;
    /* This version keeps the 'navy' color for 70% of the page before fading */
    background: linear-gradient(var(--navy) 0%, var(--navy) 70%, var(--dark-navy) 100%);
    background-attachment: fixed; /* This keeps the background still while you scroll */
    color: var(--sky);
}
.container {
    padding: 0 10%;
    max-width: 1200px;
    margin: 0 auto; /* Centers the whole website */
}

/* =========================================
   3. NAVIGATION Menu(FIXES TOP BAR)
   ========================================= */
.topnav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4rem;
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topnav-name {
    font-family: 'Inter', sans-serif !important;
    font-weight: 700;
    margin-left: 2rem;
    color: var(--white) !important;
    text-decoration: none;
}

.topnav-menu a {
    margin: 0 1rem;
    color: var(--white) !important;
    text-decoration: none;
}

/* =========================================
   4. LOADING SCREEN 
   ========================================= */
.loading-animation {
    position: fixed;
    inset: 0;
    background-color: var(--dark-navy);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: loading-page 1s forwards;
    animation-delay: 0.8s;
}

@keyframes loading-page {
    0% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; z-index: -10; }
}


@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
body[data-theme="light"] .loading-animation{
    background-color: var(--sky);
}

.loading-animation-icon{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 1 !important;
    animation: loading-animation .75s;
}
/* =========================================
   5. CONTENT STYLING (PROFESSIONAL LOOK)
   ========================================= */
.container{
    padding: 0 150px;
    max-width: 1400px;
    margin: 0 auto;
}
.intro, .about-me, .contacts, .articles {
    padding: 60px 0;
    min-height: auto;
}

.about-me-title {
    font-size: clamp(32px, 5vw, 64px);
    color: var(--white);
    border-left: 6px solid var(--accent);
    padding-left: 20px;
    margin-bottom: 30px;
}

.about-me-text {
    font-size: 1.25rem;
    line-height: 1.8;
    max-width: 800px;
}

.about-me-title {
    border-left: 4px solid #38bdf8; /* Vertical accent line */
    padding-left: 15px;
}

::-webkit-scrollbar {
    width: .5rem;
}

::-webkit-scrollbar-track {
    box-shadow: inset 0 0 5px var(--dark-navy); 
    border-radius: 10px;
}
   
::-webkit-scrollbar-thumb {
    background: var(--sky);
    border-radius: 10px;
    transition: 1s;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--light-blue); 
}

.intro-title, .about-me-title{
    font-size: clamp(40px, 8vw, 80px);
    margin: 0.5rem 0;
    color: var(--light-blue);
}


.intro-btn{
    color: var(--dark-navy);
    background-image: var(--btn-background);
    border: 1px solid var(--contrast-color);
    border-radius: 6px;
    padding: 15px 20px;
    text-decoration: none;
    cursor: pointer;
    transition: 0.5s ;
    transition-timing-function: ease-out;
}
.contacts-link-btn, .intro-btn{
    text-decoration: none;
    background-image: #38bdf8;
    border: 1px solid var(--sky);
    color: var(--dark-navy);
    border-radius: 15px;
    padding: 1.25rem 1.5rem;
    font-size: 1.25rem;
    transition: .5s;
    transition-timing-function: ease-out;
    height: fit-content;
    height: -moz-fit-content;
    margin-top: 30px; 
    display: inline-block; 
}

/* Panels */
/* Container for the panels */
.panel-container {
    display: flex;
    gap: 30px;
    flex-wrap: wrap; /* Allows panels to stack on mobile */
    margin: 50px 0;
}

/* The individual card */
.panel-card {
    flex: 1;
    min-width: 300px;
    background: rgba(255, 255, 255, 0.03); /* Subtle dark-mode card background */
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.panel-card:hover {
    transform: translateY(-10px); /* Lift effect on hover */
}

/* Image area */
.panel-image img {
    width: 100%;
    height: 250px;
    object-fit: cover; /* Keeps image from stretching */
}

/* Content area inside card */
.panel-info {
    padding: 25px;
}

.panel-title {
    color:  #1e293b !important;;
    margin-bottom: 5px;
}

.panel-subtitle {
    color: var(--accent);
    margin-bottom: 15px;
    font-weight: 700;
}

.panel-text {
    font-size: 1rem;
    color:  #475569;;
    margin-bottom: 25px;
}

/* The button inside the panel */
.panel-btn {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid var(--sky);
    color: #1e293b;
    text-decoration: none;
    border-radius: 4px;
    transition: 0.3s;
}

.panel-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--navy);
}

.slider-wrapper {
    position: relative;
    width: 100%;
    margin: 50px 0;
}

.panel-container {
    display: flex;
    gap: 20px;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto; /* Allows swiping on mobile */
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory; /* Snaps exactly to the card */
    scrollbar-width: none; /* Hides scrollbar for clean look */
}

.panel-container::-webkit-scrollbar {
    display: none; /* Hides scrollbar on Chrome/Safari */
}

.panel-card {
    /* (100% - gap) / 2 = roughly 49% to show two panels */
    flex: 0 0 calc(50% - 10px); 
    scroll-snap-align: start;
}

/* The Next Button Styling */
.slider-btn {
    position: absolute;
    right: -25px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent);
    color: var(--navy);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* On mobile, show only one panel */
@media (max-width: 768px) {
    .panel-card {
        flex: 0 0 100%;
    }
    .slider-btn { display: none; } /* Use touch swiping on mobile */
}

/* Position the buttons on opposite sides */
.slider-btn.prev {
    left: -25px; /* Pushes it slightly outside the slider on the left */
    right: auto;
}

.slider-btn.next {
    right: -25px; /* Pushes it slightly outside on the right */
}

/* Ensure the wrapper doesn't cut off the buttons */
.slider-wrapper {
    position: relative;
    width: 100%;
    margin: 50px 0;
    padding: 0 10px; /* Adds a small buffer */
}
/* =========================================
   6. Social links  (WITH MOBILE OPTIMIZATION)
   ========================================= */
@media only screen and (min-width: 768px){
    .social-link, .email-link{
        bottom: 50%;
        width: 40px;
        position: fixed;
        z-index: 8;
        color: var(--contrast-color);
        transform: translate(0, 50%);
    }

    .social-link{
        left: 1rem;
    }
    .email-link{
        right: 1rem;
    }
    .email-link-flex{
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .email-link a{
        writing-mode: vertical-rl;
        margin: 1rem .5rem !important;
    }
    .email-link a:hover{
        color: #50b69e;
    }
    
    .social-link-item, .email-link a{
        margin: 1rem 0;
        display: block;
        text-decoration: none;
        color: var(--contrast-color);
        transition: .5s;
    }
    .social-link-item:hover, .email-link a:hover{
        color: #50b69e;
    }
    
    .social-link::before, .email-link .email-link-flex::before{
        content: "";
        background-color: var(--light-blue);
        width: 1px;
        height: 100vh;
        display: block;
        margin: 0 auto;
        opacity: .7;
    }
    
    .social-link::after, .email-link .email-link-flex::after{
        content: "";
        background-color: var(--light-blue);
        width: 1px;
        height: 100vh;
        display: block;
        margin: 0 auto;
        opacity: .7;
    }
    body[data-theme="light"] .social-link::before, body[data-theme="light"] .email-link .email-link-flex::before,
    body[data-theme="light"] .social-link::after, body[data-theme="light"] .email-link .email-link-flex::after{
        background-color: var(--sky);
    }
}

@media only screen and (max-width: 767px){
    .container{
        padding: 0 50px !important;
    }
    .topnav-ham{
        display: block !important;
    }
    .topnav-menu{
        position: fixed;
        top: 0;
        left: 0;
        width: 0vw;
        overflow: hidden;
        height: 100vh;
        transition: .8s;
        background-color: var(--dark-navy);
        z-index: 3;
    }
    .topnav-menu a:first-of-type{
        margin-top: calc(50vh - 6.6rem);
    }
    .topnav-menu a{
        text-align: center;
        font-size: 1.3rem;
        margin: 3rem;
        color: var(--contrast-color);
    }
    body[data-theme="light"] .topnav-menu a{
        color: var(--contrast-color);
    }
    .topnav-exit-menu{
        display: block !important;
        position: absolute;
        top: 20px;
        right: 20px;
        font-size: 2rem;
        cursor: pointer;
        color: var(--contrast-color);
    }
    .topnav-menu a{
        display: block;
    }
    .intro{
        min-height: calc(80vh - 16rem);
    }
    .article-preview, .article-content{
        width: 100%;
    }
    .article-content{
        margin: 0 -1rem;
        text-align: left;
        top: 0 !important;
        opacity: .5 !important;
        left: 0 !important;
    }
    .article-preview{
        opacity: .3;
    }
    .article-content-description{
        background: none;
        padding: 0;
        width: calc(100% - 2rem);
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    body[data-theme="light"] .article-content-description{
        background-color: transparent;
    }
    .article-svg{
        width: 1.25rem;
    }
    .article-box:nth-child(2n) .article-content{
        left: 2rem;
    }
    .social-link{
        display: grid;
        grid-template-columns: auto auto auto auto;
        margin: auto;
        max-width: 300px;
    }
    .social-link-item{
        color: var(--contrast-color);
        margin: 1rem auto;
        width: 2rem;
    }
    .email-link{
        display: none;
    }
    .site-setting{
        bottom: 25%;
        right: 1.2rem;
    }
}

@media only screen and (max-width: 520px){
    .container{
        padding: 0 25px !important;
    }
    .about-me{
        min-height: calc(140vh - 16rem);
    }
    .about-me-content{
        width: 100%;
    }
    .about-me-pp{
        padding: 40px;
        width: -webkit-fill-available;
        width: fill-available;
        width: -moz-available;
        z-index: -1;
    }
    .about-me-pp::before{
        margin: 60px !important;
        width: calc(100% - 80px);
        height: calc(100% - 80px);
        transform: translate(5px, 5px);
    }
    .about-me-pp:hover::before{
        transform: translate(1px, 1px);
    }
    .contacts-content{
        grid-template-columns: auto;
        margin-top: 0;
    }
    .contacts-content-text{
        font-size: 1rem;
    }
    .contacts-link-btn{
        max-width: 70%;
        margin: 1rem auto;
    }
    .modal-maximize-btn{
        display: none;
    }
    .terminal{
        width: -webkit-fill-available;
        width: -moz-available;
        width: fill-available;
        height: calc(100% - 4.1rem);
        margin: 0;
        padding: 2rem;
    }
    .terminal-row{
        font-size: .9rem;
    }
}

@media only screen and (max-width: 368px){
    .about-me{
        min-height: calc(120vh - 16rem);
    }
}