:root {
    --bg: AliceBlue;
    --bg2: SkyBlue;
    --bg3: CornflowerBlue;
    --surface: Azure;
    --border: #637a99;
    --border2: #365173;
    --ink: #1b1c19;
    --ink2: #383b35;
    --ink3: #686b62;
    --muted: #96988f;
    --accent: #0E8C7F;
    --accent2: #0B7065;
    --accent-lt: #e9f1ec;
    --gold: #ee6c4d;
    --gold-lt: #f4a694;
    --red: #873b30;
    --sidebar-w: 300px;
    --r: 12px;
    --r-lg: 20px;
    --sh: 0 2px 12px rgba(28, 26, 22, .07);
    --sh-md: 0 6px 28px rgba(28, 26, 22, .10);
    --sh-lg: 0 16px 56px rgba(28, 26, 22, .13);
    --t: .36s cubic-bezier(.4, 0, .2, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

@font-face {
    font-family: 'DMSerif';
    src: url('../webfonts/DMSerifDisplay-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'DMSans';
    src: url('../webfonts/DMSans-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'DMMono';
    src: url('../webfonts/DMMono-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}


html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%
}

body {
    font-family: 'DMSans', sans-serif;
    background: var(--bg);
    color: var(--ink);
    overflow-x: hidden;
    line-height: 1
}

a {
    text-decoration: none;
    color: var(--ink);
}

/* scrollbar */
::-webkit-scrollbar {
    width: 5px
}

::-webkit-scrollbar-track {
    background: var(--bg2)
}

::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: 10px
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent)
}

/* ═══════════ SIDEBAR ═══════════ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
}

/* scroll progress bar */
.sb-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 0%;
    background: linear-gradient(180deg, var(--accent), var(--gold));
    border-radius: 0 2px 2px 0;
    transition: height .08s linear;
    z-index: 5
}

.sb-top {
    padding: 34px 22px 22px;
    border-bottom: 1px solid var(--border);
    text-align: center
}

.sb-avatar-ring {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 14px
}

.sb-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid var(--accent);
    box-shadow: 0 0 0 7px var(--accent-lt);
    display: block;
    transition: transform var(--t), box-shadow var(--t)
}

.sb-avatar:hover {
    transform: scale(1.07);
    box-shadow: 0 0 0 10px rgba(42, 92, 69, .12), 0 8px 28px rgba(42, 92, 69, .18)
}

.sb-dot {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 13px;
    height: 13px;
    background: green;
    border-radius: 50%;
    border: 2px solid var(--surface);
    animation: blink 2.5s ease infinite
}

@keyframes blink {

    0%, 100% {
        opacity: 1
    }

    50% {
        opacity: .35
    }
}

.sb-name {
    font-family: 'DMSerif', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
    margin-bottom: 4px
}

.sb-role {
    font-size: .67rem;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px
}

/* nav */
nav {
    flex: 1;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px
}

nav > span {
    font-size: .58rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    padding: 8px 8px 5px
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 11px;
    border-radius: 9px;
    color: var(--ink3);
    text-decoration: none;
    font-size: .83rem;
    font-weight: 500;
    transition: all var(--t);
    position: relative;
    overflow: hidden
}

.nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-lt);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--t);
    border-radius: 9px
}

.nav-link:hover::before,
.nav-link.active::before {
    transform: scaleX(1)
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent)
}

.nav-link.active {
    font-weight: 600
}

.nav-link i {
    width: 15px;
    text-align: center;
    font-size: .76rem;
    position: relative;
    z-index: 1
}

.nav-link span {
    position: relative;
    z-index: 1
}

.nav-bar {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--accent);
    border-radius: 3px 0 0 3px;
    transition: height var(--t);
    z-index: 1
}

.nav-link.active .nav-bar {
    height: 60%
}

/* sidebar bottom */
.sb-bottom {
    padding: 16px 22px 24px;
    border-top: 1px solid var(--border)
}

.sb-quote {
    font-family: 'DMMono', monospace;
    font-size: .8rem;
    color: var(--ink);
    line-height: 1.6;
    border-left: 2px solid var(--border2);
    padding-left: 10px
}

/* ═══════════ TOPBAR MOBILE ═══════════ */
#topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    z-index: 200
}

#topbar span {
    font-family: 'DMSerif', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink)
}

#topbar button {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: none;
    color: var(--ink2);
    font-size: .95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center
}

#drawer {
    position: fixed;
    inset: 0;
    z-index: 300;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s linear .35s
}

#drawer.open {
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s
}

.drawer-bg {
    position: absolute;
    inset: 0;
    background: rgba(28, 26, 22, .45);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity .35s ease
}

#drawer.open .drawer-bg {
    opacity: 1
}

.drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 256px;
    height: 100%;
    background: var(--surface);
    padding: 62px 18px 32px;
    overflow-y: auto;
    box-shadow: -8px 0 40px rgba(28, 26, 22, .14);
    display: flex;
    flex-direction: column;
    gap: 2px;
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.4, 0, .2, 1)
}

#drawer.open .drawer-panel {
    transform: translateX(0)
}

@media (prefers-reduced-motion: reduce) {

    .drawer-bg,
    .drawer-panel {
        transition: none
    }
}

.drawer-close {
    position: absolute;
    top: 10px;
    right: 14px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: none;
    color: var(--ink3);
    cursor: pointer;
    font-size: .95rem;
    display: flex;
    align-items: center;
    justify-content: center
}

/* ═══════════ MAIN ═══════════ */
main {
    margin-left: var(--sidebar-w);
    min-height: 100vh
}

section[id] {
    scroll-margin-top: 0
}

section {
    padding: 96px 68px;
    position: relative
}

/* alternating bg */
#myself,
#skills,
#certifications {
    background: var(--bg)
}

#about,
#projects,
#contact {
    background: var(--surface)
}

/* ═══════════ SECTION HEADER ═══════════ */
.sec-head {
    margin-bottom: 30px;
}

.sec-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: 'DMMono', monospace;
    font-size: .7rem;
    color: var(--accent);
    letter-spacing: .12em;
    margin-bottom: 11px;
    font-weight: 500
}

.sec-label::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 1px;
    background: var(--accent)
}

.sec-title {
    font-family: 'DMSerif', serif;
    font-size: clamp(1.9rem, 3.5vw, 2.9rem);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.08
}

.sec-title em {
    font-style: italic;
    color: var(--accent)
}

.sec-sub {
    margin-top: 10px;
    font-size: .9rem;
    color: var(--ink3);
    line-height: 1.75;
    max-width: 500px;
    font-weight: 400
}

/* ═══════════ HERO ═══════════ */
#myself {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden
}

/* topo grid bg */
.topo-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .055;
    background-image: repeating-linear-gradient(0deg, transparent, transparent 47px, var(--accent) 47px, var(--accent) 48px), repeating-linear-gradient(90deg, transparent, transparent 47px, var(--accent) 47px, var(--accent) 48px);
    animation: topoMove 20s linear infinite
}

@keyframes topoMove {
    0% {
        background-position: 0 0, 0 0
    }

    100% {
        background-position: 48px 48px, 48px 48px
    }
}

.inner-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 60px;
    align-items: center;
    max-width: 920px
}

/* animated name */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(22px)
    }

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

@keyframes fadeLeft {
    from {
        opacity: 0;
        transform: translateX(28px)
    }

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

/* Animated letter name */
#name {
    font-family: 'DMSerif', serif;
    font-size: clamp(2.8rem, 5vw, 4.9rem);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.04;
    margin-bottom: 7px
}

#name .word {
    display: inline-block;
    white-space: nowrap
}

#name .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px);
    animation: charUp .6s ease forwards
}

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

.divider {
    content: '';
    flex: 1;
    max-width: 170px;
    height: 1.5px;
    background: linear-gradient(90deg, var(--accent), transparent);
    color: var(--accent);
    margin-bottom: 26px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeUp .9s .55s ease both;
}

.desc {
    font-size: .95rem;
    color: var(--ink3);
    line-height: 1.88;
    max-width: 560px;
    margin-bottom: 14px;
    animation: fadeUp .9s .68s ease both;
    font-weight: 400
}

.desc2 {
    font-size: .87rem;
    color: var(--muted);
    line-height: 1.82;
    max-width: 540px;
    margin-bottom: 14px;
    animation: fadeUp .9s .78s ease both;
    font-weight: 400
}

.contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 35px;
    animation: fadeUp .9s .96s ease both
}

.contacts a {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink3);
    font-size: .84rem;
    text-decoration: none;
    transition: all var(--t);
    box-shadow: var(--sh)
}

.contacts a:hover {
    background: var(--accent-lt);
    border-color: rgba(42, 92, 69, .22);
    color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--sh-md)
}

.stats {
    display: flex;
    gap: 30px;
    padding-top: 20px;
    animation: fadeUp .9s 1.05s ease both;
    flex-wrap: wrap;
}

.stat-n {
    font-family: 'DMSerif', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    text-decoration-line: underline;
    text-decoration-color: var(--accent);
}

.stat-l {
    font-family: 'DMMono', monospace;
    font-size: .75rem;
    color: var(--muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-top: 4px
}





.portrait-m {
    display: none;
    animation: fadeLeft .9s .45s ease both;
    position: relative;
    width: 170px;
    height: 200px
}

.portrait-mf1 {
    position: absolute;
    inset: 0;
    border-radius: 15px 70px 15px 15px;
    border: 2px solid var(--accent);
    transform: translate(10px, 10px);
    opacity: .28
}

.portrait-mf2 {
    position: absolute;
    inset: 0;
    border-radius: 15px 70px 15px 15px;
    border: 1px solid var(--gold);
    transform: translate(-7px, -7px);
    opacity: .18
}

.portrait-m img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px 70px 15px 15px;
    box-shadow: var(--sh-lg);
    z-index: 1;
    display: block
}



.a-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 28px
}

.a-tab {
    padding: 8px 15px;
    border-radius: 50px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--ink3);
    font-size: .81rem;
    font-weight: 600;
    /*font-family: 'Outfit', sans-serif;*/
    cursor: pointer;
    transition: all var(--t)
}

.a-tab.active,
.a-tab:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 4px 16px rgba(42, 92, 69, .24)
}

.info-label {
    font-family: 'DMSerif', serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink2);
    margin-bottom: 5px;
    margin-top: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border)
}

/* desktop image */
.portrait-d {
    animation: fadeLeft .9s .45s ease both;
    position: relative;
    width: 215px;
    height: 268px
}

.portrait-df1 {
    position: absolute;
    inset: 0;
    border-radius: 20px 20px 80px 20px;
    border: 2px solid var(--accent);
    transform: translate(10px, 10px);
    opacity: .28
}

.portrait-df2 {
    position: absolute;
    inset: 0;
    border-radius: 20px 20px 80px 20px;
    border: 1px solid var(--gold);
    transform: translate(-7px, -7px);
    opacity: .18
}

.portrait-d img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px 20px 80px 20px;
    box-shadow: var(--sh-lg);
    z-index: 1;
    display: block
}

/* ═══════════ ABOUT ═══════════ */

.info-cards {
    display: none;
    animation: panelIn .38s ease both;
    gap: 12px
}

.info-cards.active {
    display: flex;
    flex-direction: column;
}

.info-card {
    padding: 10px 18px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r);
    display: flex;
    align-items: flex-start;
    gap: 13px;
    transition: all var(--t);
    position: relative;
    overflow: hidden;
    cursor: default
}

.info-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform var(--t)
}

.info-card:hover {
    border-color: rgba(42, 92, 69, .2);
    box-shadow: var(--sh)
}

.info-card:hover::before {
    transform: scaleY(1)
}

.info-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--accent-lt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex: 0 0 auto
}

.info-lbl {
    font-size: .65rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 3px
}

.info-des {
    font-size: .7rem;
    letter-spacing: .13em;
    color: var(--muted);
    font-weight: 500;
    margin-bottom: 3px;
    padding-top: 3px;
    line-height: 1.4
}

.info-val {
    font-size: .86rem;
    color: var(--ink2);
    font-weight: 600;
    line-height: 1.4
}

.info-b {
    display: inline-block;
    margin-top: 5px;
    padding: 6px 10px;
    border-radius: 50px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--ink3);
    font-size: .81rem;
    font-weight: 600;
    font-family: 'DMSerif', serif;
    letter-spacing: .1em;
    cursor: pointer;
    transition: all var(--t)
}

.info-b.active,
.info-b:hover {
    background: var(--accent2);
    border-color: var(--border2);
    color: #fff;
    box-shadow: 0 4px 16px rgba(42, 92, 69, .24)
}

.tab-label {
    display:none;
    font-family: 'DMSerif', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink2);
    margin-bottom: 5px;
    margin-top: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border2)
}
/* ═══════════ SKILLS ═══════════ */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 52px
}

.skills-col-h {
    font-family: 'DMSerif', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ink2);
    margin-bottom: 22px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border)
}

.skill-item {
    margin-bottom: 20px
}

.skill-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 7px
}

.skill-nm {
    line-height: 1.4;
    font-size: .83rem;
    font-weight: 600;
    color: var(--ink2)
}

.skill-pc {
    flex-shrink: 0;
    /*font-family: 'DMMono', monospace;*/
    font-size: .7rem;
    color: var(--accent);
    font-weight: 700
}

.skill-track {
    height: 6px;
    background: var(--bg2);
    border-radius: 50px;
    overflow: hidden
}

.skill-fill {
    height: 100%;
    border-radius: 50px;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    transition: width 1.3s cubic-bezier(.4, 0, .2, 1);
    position: relative;
    overflow: hidden
}

.skill-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 20px;
    background: rgba(255, 255, 255, .38);
    border-radius: 50px;
    animation: shimmer 2s ease infinite
}

@keyframes shimmer {

    0%,
    100% {
        opacity: 0
    }

    50% {
        opacity: 1
    }
}

.tools-h {
    font-family: 'DMSerif', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ink2);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border)
}

.tools-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px
}

.tool {
    line-height: 1.2;
    padding: 7px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: .77rem;
    color: var(--ink2);
    font-weight: 500;
    transition: all var(--t);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: default;
}

.tool i {
    font-size: .68rem
}

.tool:hover {
    background: var(--accent-lt);
    border-color: rgba(42, 92, 69, .2);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--sh)
}

/* ═══════════ PROJECTS ═══════════ */
.proj-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px
}

.proj-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: all var(--t);
    cursor: pointer;
    position: relative
}

.proj-card:hover {
    border-color: rgba(42, 92, 69, .24);
    transform: translateY(-6px);
    box-shadow: var(--sh-lg)
}

.proj-thumb-wrap {
    position: relative;
    height: 175px;
    overflow: hidden
}

.proj-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .65s ease;
    display: block
}

.proj-card:hover .proj-thumb {
    transform: scale(1.07)
}

.proj-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(28, 26, 22, .42), transparent 58%)
}

.proj-bdg {
    position: absolute;
    top: 11px;
    left: 11px;
    padding: 4px 11px;
    background: rgba(255, 255, 255, .93);
    backdrop-filter: blur(6px);
    border-radius: 50px;
    font-size: .65rem;
    /*font-family: 'DMMono', monospace;*/
    color: var(--accent);
    font-weight: 500;
    letter-spacing: .04em;
    border: 1px solid rgba(42, 92, 69, .12)
}

.proj-body {
    padding: 18px 20px 22px
}

.proj-title {
    font-family: 'DMSerif', serif;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 7px;
    line-height: 1.25
}

.proj-desc {
    font-size: .8rem;
    color: var(--ink3);
    line-height: 1.72;
    margin-bottom: 12px;
    font-weight: 400
}

.proj-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap
}

.proj-tag {
    padding: 3px 9px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: .67rem;
    color: var(--ink3)
}

.proj-arrow {
    position: absolute;
    bottom: 16px;
    right: 18px;
    width: 31px;
    height: 31px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    opacity: 0;
    transform: translate(4px, 4px);
    transition: all var(--t)
}

.proj-card:hover .proj-arrow {
    opacity: 1;
    transform: translate(0, 0)
}

/* ═══════════ CERTIFICATIONS ═══════════ */
.cert-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 28px
}

.c-tab {
    padding: 8px 15px;
    border-radius: 50px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--ink3);
    font-size: .81rem;
    font-weight: 600;
    /*font-family: 'DMSans', sans-serif;*/
    cursor: pointer;
    transition: all var(--t)
}

.c-tab.active,
.c-tab:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 4px 16px rgba(42, 92, 69, .24)
}

.c-but {
    margin-top: 10px;
    padding: 8px 20px;
    border-radius: 50px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--ink3);
    font-size: .81rem;
    font-weight: 600;
    /*font-family: 'DMSans', sans-serif;*/
    cursor: pointer;
    transition: all var(--t)
}

.c-but.active,
.c-but:hover {
    background: var(--accent2);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 4px 16px rgba(42, 92, 69, .24)
}

.c-panel {
    display: none;
    animation: panelIn .38s ease both
}

.c-panel.active {
    display: block
}

@keyframes panelIn {
    from {
        opacity: 0;
        transform: translateY(10px)
    }

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

.c-item {
    display: flex;
    gap: 18px;
    padding: 20px 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    margin-bottom: 12px;
    transition: all var(--t);
    align-items: flex-start
}

.c-item:hover {
    border-color: rgba(42, 92, 69, .2);
    box-shadow: var(--sh);
    transform: translateX(4px)
}

.c-icon {
    width: 46px;
    height: 46px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex: 0 0 auto
}

.c-icon.g {
    background: rgba(42, 92, 69, .08);
    color: var(--accent);
    border: 1px solid rgba(42, 92, 69, .12)
}

.c-icon.gl {
    background: rgba(160, 120, 40, .08);
    color: var(--gold);
    border: 1px solid rgba(160, 120, 40, .14)
}

.c-icon.r {
    background: rgba(122, 48, 32, .08);
    color: var(--red);
    border: 1px solid rgba(122, 48, 32, .12)
}

.c-body {
    min-width: 0
}

.c-name {
    font-size: .93rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 3px;
    line-height: 1.3
}

.c-org {
    font-size: .77rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 6px
}

.c-desc {
    font-size: .79rem;
    color: var(--ink3);
    line-height: 1.65;
    font-weight: 400
}

/* ═══════════ CONTACT ═══════════ */
.contact-grid {
    gap: 48px;
    align-items: start
}

.c-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px
}

.c-link {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    padding: 15px 17px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r);
    transition: all var(--t)
}

.c-link:hover {
    border-color: rgba(42, 92, 69, .24);
    transform: translateX(4px);
    box-shadow: var(--sh)
}

.c-link-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent-lt);
    border: 1px solid rgba(42, 92, 69, .14);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex: 0 0 auto;
    font-size: .88rem
}

.c-link-lbl {
    font-size: .65rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 2px
}

.c-link-text {
    min-width: 0
}

.c-link-val {
    font-family: 'DMMono', monospace;
    display: block;
    font-size: .86rem;
    line-height: 1.5;
    color: var(--ink2);
    font-weight: 500;
    text-decoration: none;
    overflow-wrap: anywhere
}

a.c-link-val:hover {
    color: var(--accent)
}



/* ═══════════ REVEAL ANIMATIONS ═══════════ */
.rv {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .65s ease, transform .65s ease
}

.rv.in {
    opacity: 1;
    transform: translateY(0)
}

.rv.d1 {
    transition-delay: .1s
}

.rv.d2 {
    transition-delay: .18s
}

.rv.d3 {
    transition-delay: .26s
}

.rv.d4 {
    transition-delay: .34s
}

.rv.d5 {
    transition-delay: .42s
}

.rv.d6 {
    transition-delay: .5s
}
/* ═══════════ MODAL ═══════════ */
.modal-bg {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(28, 26, 22, .48);
    backdrop-filter: blur(7px);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 22px
}

.modal-bg.open {
    display: flex
}

.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    width: 100%;
    max-width: 640px;
    max-height: 88vh;
    max-height: 88dvh;
    overflow-y: auto;
    animation: mIn .3s ease;
    box-shadow: var(--sh-lg)
}

@keyframes mIn {
    from {
        opacity: 0;
        transform: scale(.96)
    }

    to {
        opacity: 1;
        transform: scale(1)
    }
}

.m-img {
    width: 100%;
    height: 215px;
    object-fit: cover;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    display: block
}

.m-body {
    padding: 26px 28px 30px
}

.m-bdg {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent-lt);
    border: 1px solid rgba(42, 92, 69, .15);
    border-radius: 50px;
    font-size: .68rem;
    color: var(--accent);
    /*font-family: 'DMMono', monospace;*/
    letter-spacing: .08em;
    margin-bottom: 11px;
    font-weight: 500
}

.m-title {
    font-family: 'DMSerif', serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 13px;
    line-height: 1.2
}

.m-txt {
    font-size: .86rem;
    color: var(--ink3);
    line-height: 1.85;
    margin-bottom: 13px;
    font-weight: 400
}

.m-list {
    list-style: none;
    margin-bottom: 15px
}

.m-list li {
    font-size: .85rem;
    color: var(--ink3);
    line-height: 1.72;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 400
}

.m-list li::before {
    content: '→';
    color: var(--accent);
    flex: 0 0 auto
}

.m-list li:last-of-type {
    border-bottom: 0;
}

.m-meta {
    /*background: var(--bg);*/
    border-radius: 10px;
    padding: 14px 16px;
    font-size: .8rem;
    color: var(--ink3);
    line-height: 1.85;
    /*border: 1px solid var(--border);*/
    font-weight: 400
}

.m-meta strong {
    color: var(--accent);
}

.m-flex {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px
}

.m-imgwrap {
    position: relative
}

.m-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border2);
    border-radius: 50%;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center
}

.m-close:hover {
    background: var(--bg2)
}

.p-tab {
    padding: 5px 15px;
    border-radius: 50px;
    border: 1.5px solid var(--border);
    background: var(--accent);
    color: var(--ink3);
    font-size: .81rem;
    font-weight: 600;
    font-family: 'DMSerif', serif;
    letter-spacing: .1em;
    cursor: pointer;
    transition: all var(--t)
}

.p-tab.active,
.p-tab:hover {
    background: var(--accent2);
    border-color: var(--border2);
    color: #fff;
    box-shadow: 0 4px 16px rgba(42, 92, 69, .24)
}

.p-tab strong {
    color: var(--bg);
    font-weight: bold;
}

/* ═══════════ RESPONSIVE ═══════════ */
@media(max-width:1100px) {
    section {
        padding: 80px 44px
    }

    .inner-grid {
        gap: 38px
    }

    .portrait-d {
        width: 188px;
        height: 235px
    }
}

@media(max-width:980px) {
    html {
        scroll-padding-top: 56px
    }

    .sidebar {
        display: none
    }

    #topbar {
        display: flex
    }

    main {
        margin-left: 0;
        padding-top: 56px
    }

    #myself {
        min-height: calc(100vh - 56px);
        min-height: calc(100svh - 56px)
    }

    section {
        padding: 62px 40px
    }

    .inner-grid {
        grid-template-columns: 1fr
    }

    .portrait-d {
        display: none
    }

    .portrait-m {
        display: block
    }

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

@media(max-width:700px) {
    .proj-grid {
        grid-template-columns: 1fr
    }

    .c-links {
        grid-template-columns: 1fr
    }
}

@media(max-width:600px) {
    section {
        padding: 56px 20px
    }

    #name {
        font-size: 2.5rem
    }

    .stats {
        gap: 24px
    }

    .c-item {
        padding: 16px;
        gap: 14px
    }

    .m-body {
        padding: 22px 20px 24px
    }

    .m-img {
        height: 180px
    }
}

@media(max-width:360px) {
    #name {
        font-size: 2.2rem
    }

    .a-tab,
    .c-tab {
        padding: 8px 12px
    }
}

@media(prefers-reduced-motion:reduce) {
    html {
        scroll-behavior: auto
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important
    }

    #name .char {
        opacity: 1;
        transform: none
    }
}


.proj-card:focus-visible,
.a-tab:focus-visible,
.c-tab:focus-visible,
.c-but:focus-visible,
.p-tab:focus-visible,
.m-close:focus-visible,
#topbar button:focus-visible,
.drawer-close:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px
}
