/* =========================================================
   Tokens
   ========================================================= */
:root{
    --bg:#0d1117;
    --bg-soft:#010409;
    --panel:#161b22;
    --panel-alt:#1c2333;
    --border:#30363d;
    --text:#e6edf3;
    --muted:#8b949e;

    --accent:#ffa657;      /* amber   */
    --accent-2:#7ee787;    /* green   */
    --accent-3:#79c0ff;    /* blue    */
    --danger:#ff7b72;      /* red     */

    --font-display:'JetBrains Mono', monospace;
    --font-body:'Inter', sans-serif;

    --radius:14px;
}

.light{
    --bg:#f6f8fa;
    --bg-soft:#ffffff;
    --panel:#ffffff;
    --panel-alt:#eef1f4;
    --border:#d0d7de;
    --text:#1f2328;
    --muted:#57606a;

    --accent:#c9650a;
    --accent-2:#1a7f37;
    --accent-3:#0969da;
    --danger:#cf222e;
}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    scroll-behavior:smooth;
    font-family:var(--font-body);
}

body{
    background:var(--bg);
    color:var(--text);
    overflow-x:hidden;
    transition:background .4s ease, color .4s ease;
}

/* Animated background glow */
body::before{
    content:'';
    position:fixed;
    width:500px;
    height:500px;
    background:var(--accent);
    filter:blur(180px);
    top:-150px;
    left:-150px;
    opacity:.14;
    z-index:-2;
}

body::after{
    content:'';
    position:fixed;
    width:500px;
    height:500px;
    background:var(--accent-3);
    filter:blur(180px);
    bottom:-150px;
    right:-150px;
    opacity:.14;
    z-index:-2;
}

/* =========================================================
   Header / tab bar
   ========================================================= */
header{
    position:fixed;
    top:0;
    width:100%;
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:16px 8%;
    backdrop-filter:blur(15px);
    background:rgba(13,17,23,.75);
    border-bottom:1px solid var(--border);
    z-index:1000;
    transition:background .4s ease;
}

.light header{
    background:rgba(255,255,255,.75);
}

.logo{
    font-family:var(--font-display);
    font-size:20px;
    font-weight:700;
    color:var(--text);
    white-space:nowrap;
}

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

nav{
    display:flex;
    gap:4px;
    background:var(--panel);
    border:1px solid var(--border);
    border-radius:10px;
    padding:4px;
}

nav a{
    font-family:var(--font-display);
    font-size:13px;
    color:var(--muted);
    text-decoration:none;
    padding:8px 14px;
    border-radius:7px;
    transition:.25s;
    white-space:nowrap;
}

nav a .ext{
    color:var(--muted);
    opacity:.6;
}

nav a:hover{
    color:var(--text);
    background:var(--panel-alt);
}

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

nav a.active .ext{
    color:var(--bg);
    opacity:.7;
}

.header-controls{
    display:flex;
    align-items:center;
    gap:12px;
}

#themeBtn{
    width:40px;
    height:40px;
    border:1px solid var(--border);
    border-radius:50%;
    cursor:pointer;
    font-size:16px;
    background:var(--panel);
    color:var(--text);
    transition:.3s;
}

#themeBtn:hover{
    border-color:var(--accent);
}

#menuBtn{
    display:none;
    width:40px;
    height:40px;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--panel);
    cursor:pointer;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:5px;
}

#menuBtn span{
    width:18px;
    height:2px;
    background:var(--text);
    transition:.3s;
}

#menuBtn.open span:nth-child(1){transform:translateY(7px) rotate(45deg);}
#menuBtn.open span:nth-child(2){opacity:0;}
#menuBtn.open span:nth-child(3){transform:translateY(-7px) rotate(-45deg);}

/* =========================================================
   Hero
   ========================================================= */
.hero{
    min-height:100vh;
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:140px 8% 100px;
    gap:60px;
}

.hero-text{
    flex:1.1;
}

.eyebrow{
    font-family:var(--font-display);
    color:var(--accent-2);
    font-size:14px;
    margin-bottom:14px;
}

.hero-desc{
    line-height:1.8;
    max-width:560px;
    color:var(--muted);
    margin-top:22px;
}

/* --- editor window shared chrome --- */
.editor-window{
    background:var(--panel);
    border:1px solid var(--border);
    border-radius:var(--radius);
    overflow:hidden;
    box-shadow:0 20px 50px rgba(0,0,0,.35);
}

.editor-titlebar{
    display:flex;
    align-items:center;
    gap:14px;
    padding:12px 16px;
    background:var(--panel-alt);
    border-bottom:1px solid var(--border);
}

.dots{
    display:flex;
    gap:7px;
}

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

.dot.red{background:var(--danger);}
.dot.yellow{background:var(--accent);}
.dot.green{background:var(--accent-2);}

.filename{
    font-family:var(--font-display);
    font-size:12.5px;
    color:var(--muted);
}

.code-body{
    padding:22px 20px;
    overflow-x:auto;
    font-family:var(--font-display);
    font-size:14.5px;
    line-height:2;
}

.code-body .ln{
    display:inline-block;
    width:22px;
    color:var(--muted);
    opacity:.5;
    user-select:none;
}

.tok-kw{color:var(--accent-3);}
.tok-var{color:var(--text);}
.tok-str{color:var(--accent-2);}
.tok-punc{color:var(--muted);}
.tok-cursor{
    color:var(--accent);
    animation:blink 1s step-end infinite;
}

@keyframes blink{
    50%{opacity:0;}
}

#typing{color:var(--accent-2);}

.buttons{
    margin-top:32px;
}

.btn,
.btn2{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:13px 26px;
    border-radius:10px;
    text-decoration:none;
    font-family:var(--font-display);
    font-size:14px;
    font-weight:600;
    transition:.35s;
    margin-right:15px;
}

.btn .prompt,
.btn2 .prompt{
    opacity:.7;
}

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

.btn:hover{
    transform:translateY(-4px);
    box-shadow:0 10px 30px rgba(255,166,87,.35);
}

.btn2{
    border:1px solid var(--border);
    color:var(--text);
    background:var(--panel);
}

.btn2:hover{
    border-color:var(--accent-3);
    color:var(--accent-3);
    transform:translateY(-4px);
}

/* --- hero image / preview window --- */
.hero-image{
    flex:1;
    display:flex;
    justify-content:center;
}

.preview-window{
    width:340px;
    animation:floating 5s ease-in-out infinite;
}

.card3d{
    width:100%;
    height:400px;
    transform-style:preserve-3d;
    transition:.5s;
}

.card3d img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}

/* =========================================================
   Sections
   ========================================================= */
section{
    padding:110px 8%;
}

.title{
    text-align:center;
    font-family:var(--font-display);
    font-size:30px;
    color:var(--text);
    margin-bottom:50px;
}

.title .comment{
    color:var(--muted);
    margin-right:4px;
}

.title .ext-title{
    color:var(--accent);
}

.glass{
    background:var(--panel);
    border:1px solid var(--border);
    border-radius:var(--radius);
    padding:35px;
    line-height:1.8;
    color:var(--muted);
}

.code-comment-block{
    max-width:820px;
    margin:0 auto;
}

/* --- cards --- */
.cards{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
    gap:25px;
}

.card{
    background:var(--panel);
    border:1px solid var(--border);
    border-radius:var(--radius);
    padding:30px;
    transition:.35s;
}

.card:hover{
    transform:translateY(-10px);
    border-color:var(--accent-3);
}

/* =========================================================
   Experience — git log
   ========================================================= */
.git-log{
    max-width:820px;
    margin:0 auto;
}

.commit{
    position:relative;
    padding-left:40px;
    padding-bottom:50px;
}

.commit:last-child{
    padding-bottom:0;
}

.commit-line{
    position:absolute;
    left:9px;
    top:22px;
    bottom:-28px;
    width:2px;
    background:var(--border);
}

.commit:last-child .commit-line{
    display:none;
}

.commit-dot{
    position:absolute;
    left:2px;
    top:6px;
    width:16px;
    height:16px;
    border-radius:50%;
    background:var(--accent-2);
    border:3px solid var(--bg);
    box-shadow:0 0 0 1px var(--border);
}

.commit-body{
    background:var(--panel);
    border:1px solid var(--border);
    border-radius:var(--radius);
    padding:24px 26px;
}

.commit-meta{
    display:flex;
    align-items:center;
    gap:14px;
    margin-bottom:10px;
    font-family:var(--font-display);
    font-size:12.5px;
}

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

.date{
    color:var(--muted);
}

.commit-body h3{
    font-size:19px;
    margin-bottom:4px;
}

.commit-body h4{
    font-weight:500;
    color:var(--accent-3);
    font-size:14px;
    margin-bottom:14px;
}

.commit-body ul{
    color:var(--muted);
    padding-left:20px;
    line-height:1.9;
    font-size:14.5px;
}

/* =========================================================
   Skills — json panel
   ========================================================= */
.skills-panel{
    max-width:900px;
    margin:0 auto;
}

.skill-group{
    margin-bottom:26px;
}

.skill-group:last-child{
    margin-bottom:0;
}

.skill-key{
    font-family:var(--font-display);
    color:var(--accent);
    margin-bottom:14px;
    font-size:14px;
}

.skill-key.accent-2{color:var(--accent-2);}
.skill-key.accent-3{color:var(--accent-3);}

.skill-box{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
}

.skill-box span{
    padding:10px 18px;
    border-radius:8px;
    background:var(--panel-alt);
    border:1px solid var(--border);
    color:var(--text);
    font-family:var(--font-display);
    font-size:13px;
    transition:.25s;
}

.skill-box span:hover{
    border-color:var(--accent);
    transform:translateY(-3px);
}

.skill-box.group-2 span:hover{border-color:var(--accent-2);}
.skill-box.group-3 span:hover{border-color:var(--accent-3);}

/* =========================================================
   Projects — repo cards
   ========================================================= */
.repo-card{
    position:relative;
    padding-top:34px;
    overflow:hidden;
}

.repo-bar{
    position:absolute;
    top:0;
    left:0;
    right:0;
    height:5px;
}

.repo-bar.backend{background:var(--accent);}
.repo-bar.frontend{background:var(--accent-3);}
.repo-bar.tools{background:var(--accent-2);}

.repo-card h3{
    font-size:18px;
    margin-bottom:12px;
}

.repo-desc{
    color:var(--muted);
    line-height:1.7;
    font-size:14.5px;
    margin-bottom:16px;
}

.repo-stack{
    font-family:var(--font-display);
    font-size:12.5px;
    color:var(--accent-3);
}

/* =========================================================
   Contact
   ========================================================= */
.contact-window{
    max-width:700px;
    margin:0 auto;
}

form{
    padding:30px 26px 26px;
    display:flex;
    flex-direction:column;
    gap:16px;
}

form label{
    font-family:var(--font-display);
    font-size:12px;
    color:var(--accent-3);
    margin-bottom:-8px;
}

form input,
form textarea{
    width:100%;
    padding:14px 16px;
    border:1px solid var(--border);
    outline:none;
    border-radius:10px;
    background:var(--panel-alt);
    color:var(--text);
    font-size:15px;
    font-family:var(--font-body);
}

form textarea{
    min-height:150px;
    resize:vertical;
}

form button{
    padding:15px;
    border:none;
    border-radius:10px;
    background:var(--accent);
    color:var(--bg-soft);
    font-family:var(--font-display);
    font-size:15px;
    font-weight:600;
    cursor:pointer;
    transition:.3s;
    margin-top:6px;
}

form button:hover{
    transform:translateY(-3px);
    box-shadow:0 10px 30px rgba(255,166,87,.3);
}

form button.loading{
    opacity:.7;
    cursor:not-allowed;
    transform:none;
}

#contact-form input:focus,
#contact-form textarea:focus{
    border-color:var(--accent-3);
    box-shadow:0 0 0 3px rgba(121,192,255,.15);
}

#contact-form input::placeholder,
#contact-form textarea::placeholder{
    color:var(--muted);
}

#status{
    margin-top:6px;
    text-align:center;
    font-size:14px;
    font-weight:600;
    color:var(--accent-2);
    min-height:18px;
}

/* =========================================================
   Footer — status bar
   ========================================================= */
footer{
    display:flex;
    justify-content:space-between;
    align-items:center;
    flex-wrap:wrap;
    gap:10px;
    padding:16px 8%;
    background:var(--panel);
    border-top:1px solid var(--border);
    font-family:var(--font-display);
    font-size:12.5px;
    color:var(--muted);
}

.status-left{
    display:flex;
    align-items:center;
    gap:10px;
}

.branch{
    color:var(--accent-2);
}

.dot-sep{
    opacity:.5;
}

/* =========================================================
   Motion
   ========================================================= */
@keyframes floating{
    0%{transform:translateY(0px);}
    50%{transform:translateY(-14px);}
    100%{transform:translateY(0px);}
}

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

section{
    animation:fadeUp .9s ease;
}

@media (prefers-reduced-motion:reduce){
    *{animation:none !important; transition:none !important;}
}

/* Custom cursor */
.cursor{
    position:fixed;
    width:18px;
    height:18px;
    border-radius:50%;
    background:var(--accent);
    pointer-events:none;
    mix-blend-mode:difference;
    transform:translate(-50%,-50%);
    transition:.08s;
    z-index:9999;
}

/* Scrollbar */
::-webkit-scrollbar{width:10px;}
::-webkit-scrollbar-track{background:var(--bg-soft);}
::-webkit-scrollbar-thumb{background:var(--accent); border-radius:10px;}

/* =========================================================
   Responsive
   ========================================================= */
@media(max-width:992px){

    nav{
        position:fixed;
        top:74px;
        right:8%;
        left:8%;
        flex-direction:column;
        background:var(--panel);
        border:1px solid var(--border);
        padding:10px;
        display:none;
        gap:6px;
    }

    nav.open{
        display:flex;
    }

    nav a{
        text-align:left;
        padding:12px 14px;
    }

    #menuBtn{
        display:flex;
    }

    .hero{
        flex-direction:column-reverse;
        text-align:left;
        padding-top:150px;
    }

    .preview-window{
        width:100%;
        max-width:340px;
        margin:0 auto 10px;
    }
}

@media(max-width:600px){

    header{
        padding:14px 6%;
    }

    section{
        padding:80px 6%;
    }

    .title{
        font-size:24px;
    }

    .btn,
    .btn2{
        display:flex;
        justify-content:center;
        margin:0 0 14px 0;
    }

    .buttons{
        display:flex;
        flex-direction:column;
    }

    .logo{
        font-size:16px;
    }

    .code-body{
        font-size:12.5px;
    }

    footer{
        flex-direction:column;
        text-align:center;
    }
}
