:root {
    --bg: #f6f0e0;
    --bg-grid: #e5d9c4;
    --side: #5d4037;
    --font-name: #2d241e;
    --font-sides: #7d584c;
    --ink: #1a1a1a;
    --ink-mid: #4e342e;
    --ink-soft: #8d6e63;
    --accent: #6b705c;
    --accent-light: rgba(107, 112, 92, 0.1);
    --accent-border: rgba(93, 64, 55, 0.2);
    --glass-shadow: rgba(93, 64, 55, 0.1);
    --surface: #ffffff;
    --dark: #2d241e;
    --dark-mid: #3e2723;
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --header-h: 64px;
    --max-w: 1100px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --section-pad: 5vh 2rem;
    --glass-bg: rgba(255, 255, 255, 0.18);
    --glass-border: rgba(255, 255, 255, 0.45);
    --radius: 24px;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
    background-color: var(--bg);
    font-family: var(--font-body);
    color: var(--ink);
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-size: 20vh 20vh;
    background-image:
        linear-gradient(to right, var(--bg-grid) 1px, transparent 1px),
        linear-gradient(to bottom, var(--bg-grid) 1px, transparent 1px);
    pointer-events: none;
}

/*  HEADER  */
header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    height: var(--header-h);
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

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

.logo {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--ink-mid);
}

nav ul { display: flex; gap: 1rem; list-style: none; }
nav ul li a { text-decoration: none; color: var(--ink-mid); font-size: 0.9rem; }
nav ul li a:hover { border-bottom: solid 2px var(--ink-mid); }

/*  HOME SECTION  */
#home {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#home-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    text-align: center;
    padding: 2rem;
    padding-top: var(--header-h);
}

.glass-card {
    background: var(--glass-bg);
    /* blur: unified value across standard and webkit prefix */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    max-width: 80vw;
    border: solid 1px var(--glass-border);
    border-radius: var(--radius);
    box-shadow: 0px 10px 30px var(--glass-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.name-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem;
    width: 100%;
}

.salute, #typeWrite, #cursor {
    font-family: var(--font-display);
    color: var(--font-sides);
    font-weight: 300;
    font-size: clamp(1.3rem, 4vw, 2.5rem);
}

#role {
    font-family: var(--font-display);
    font-weight: 100;
    font-size: clamp(0.7rem, 2vw, 1.3rem);
}

#fullname {
    color: var(--font-name);
    text-transform: uppercase;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: clamp(1rem, 4.5vw, 5rem);
    line-height: 1.1;
    white-space: nowrap;
}

#tech-box {
    background-color: var(--font-sides);
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    border-radius: 0 0 var(--radius) var(--radius);
    padding-left: 2rem;
    color: var(--bg-grid);
    font-size: 0.9rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

#tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    align-content: center;
    padding: 0.75rem 2rem 0.75rem 0;
    transition: opacity 0.2s ease;
    min-height: 4rem;
}

.tech-pill {
    background: var(--bg-grid);
    border: 1px solid var(--accent-border);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--font-sides);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.tech-pill:hover { transform: translateY(-4px); box-shadow: 0 6px 16px var(--glass-shadow); }

#cursor { animation: blink 1s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Social sidebar */
#social {
    position: absolute;
    top: 25%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 25px;
    font-size: 1.5rem;
    z-index: 10;
    padding: 0 20px;
    left: 0;
    background-color: var(--side);
    border-radius: 0 25px 25px 0;
}

#address {
    position: absolute;
    bottom: 25%;
    transform: translateY(+50%);
    display: flex;
    flex-direction: column;
    gap: 25px;
    font-size: 1.5rem;
    z-index: 10;
    padding: 0 20px;
    right: 0;
    background-color: var(--side);
    border-radius: 25px 0 0 25px;
}

#social i, #address i { color: white; cursor: pointer; transition: transform 0.2s ease; }
#social i:hover, #address i:hover { transform: scale(1.15); }

.contact-item { display: flex; align-items: center; justify-content: flex-end; text-decoration: none; }

.contact-item .info {
    font-size: 1rem;
    font-family: inherit;
    color: #ffffff;
    max-width: 0;
    opacity: 0;
    white-space: nowrap;
    overflow: hidden;
    transition: all 0.4s ease;
}

#address:hover .info { max-width: 250px; opacity: 1; padding-left: .5rem; }

/* block: default icon display and spacing */
.fa-brands, .fa-solid { display: block; padding: 20px 0 20px 5px; }
/* sidebar: force white color only inside social/address panels */
#social .fa-brands, #social .fa-solid,
#address .fa-brands, #address .fa-solid { color: #ffffff; }
#linkedin, #github { text-decoration: none; }

#scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--ink-soft);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    animation: scrollBounce 2s ease-in-out infinite;
}

#scroll-hint i { color: var(--ink-soft); font-size: 0.85rem; padding: 0; display: block; }

@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(6px); }
}

/*  SHARED SECTION STYLES  */
section {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--section-pad);
    padding-top: calc(var(--header-h) + 2rem);
}

#home { min-height: 100vh; min-height: 100dvh; padding: 0; }

.section-wrapper {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
}

.glass-section {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px var(--glass-shadow);
    padding: 2.5rem 2.5rem 2rem;
    width: 100%;
}

.section-header {
    margin-bottom: 2rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    color: var(--font-name);
    font-weight: 400;
    margin-bottom: 0.4rem;
}

.section-line {
    height: 3px;
    width: 60px;
    background: var(--side);
    border-radius: 99px;
    margin-bottom: 0.5rem;
}

.section-sub {
    font-size: 0.82rem;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/*  ABOUT ─ */
#about-body {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

#summary p {
    color: var(--ink-mid);
    font-size: clamp(0.92rem, 1.8vw, 1.05rem);
    line-height: 1.8;
    margin-bottom: 1rem;
}

#summary p:last-child { margin-bottom: 0; }


/*  SKILLS  */

.skill-item {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem 1rem;
    padding-bottom: 1rem;
    padding-top: 1rem;
    border-bottom: 1px solid rgba(128, 76, 55, 0.12);
}

.skill-item:last-child { border-bottom: none; padding-bottom: 0; }

.skill-head {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--side);
    font-weight: 700;
    min-width: 130px;
}

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

.skill-pill {
    background: rgba(255,255,255,0.5);
    border: 1px solid var(--accent-border);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--ink-mid);
    transition: background 0.2s, transform 0.2s;
}

.skill-pill:hover { background: rgba(128,76,55,0.1); transform: translateY(-2px); }

/*  WORK EXPERIENCE  */
#work {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.work-item {
    position: relative;
    padding: 1.5rem 0 1.5rem 1.5rem;
    border-left: 2px solid var(--accent-border);
    margin-left: 8px;
    transition: border-color 0.2s;
}

.work-item::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 1.75rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--side);
    border: 2px solid var(--bg);
    transition: transform 0.2s;
}

.work-item:hover::before { transform: scale(1.3); }
.work-item:hover { border-color: var(--side); }

.work-item:last-child { border-left: 2px dashed var(--accent-border); }

.work-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.work-company {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--font-name);
}

.work-position {
    font-size: 0.9rem;
    color: var(--side);
    font-weight: 500;
    margin-top: 2px;
}

.work-right { text-align: right; }

.work-duration {
    font-size: 0.8rem;
    color: var(--ink-soft);
    font-weight: 500;
}

.work-location {
    font-size: 0.75rem;
    color: var(--ink-soft);
    margin-top: 3px;
}

.work-location i { font-size: 0.7rem; }

.work-bullets {
    margin: 0.5rem 0 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.work-bullets li {
    font-size: 0.88rem;
    color: var(--ink-mid);
    line-height: 1.6;
}

.work-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 0.5rem;
}

/*  PROJECTS CAROUSEL ─ */
#projects-carousel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#carousel-track-wrap {
    flex: 1;
    overflow: hidden;
}

#carousel-track {
    display: grid;
    gap: 1rem;
    transition: opacity 0.2s ease;
}

.git-card {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
    min-height: 140px;
}

.git-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px var(--glass-shadow);
}

.git-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.git-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--font-name);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.git-lang {
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(128,76,55,0.12);
    color: var(--side);
    border-radius: 99px;
    padding: 2px 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.git-desc {
    font-size: 0.82rem;
    color: var(--ink-soft);
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.git-card-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: auto;
    flex-wrap: wrap;
}

.git-stat {
    font-size: 0.75rem;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    gap: 4px;
}

.git-stat i { font-size: 0.7rem; }

.git-link {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--side);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s;
}

.git-link:hover { gap: 7px; }

.carousel-btn {
    background: rgba(255,255,255,0.5);
    border: 1px solid var(--accent-border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--side);
    font-size: 0.8rem;
    transition: background 0.2s, transform 0.2s, opacity 0.2s;
}

.carousel-btn:hover { background: rgba(128,76,55,0.12); transform: scale(1.08); }

#carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
}

.dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent-border);
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    padding: 0;
}

.dot.active { background: var(--side); transform: scale(1.3); }

.projects-status {
    color: var(--ink-soft);
    font-size: 0.9rem;
    text-align: center;
    padding: 2rem 0;
}

/*  EDUCATION  */
#education {
    display: flex;
    flex-direction: row;
    gap: 1.25rem;
}

.edu-item {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding: 1.25rem;
    background: rgba(255,255,255,0.35);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: transform 0.2s;
}

.edu-item:hover { transform: translateY(-3px); }

.edu-icon {
    width: 44px;
    height: 44px;
    background: var(--side);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.edu-icon i { color: white; font-size: 1rem; padding: 0; }

.edu-degree {
    font-weight: 600;
    font-size: 1rem;
    color: var(--font-name);
    line-height: 1.3;
}

.edu-inst {
    font-size: 0.85rem;
    color: var(--ink-mid);
    margin-top: 0.2rem;
}

.edu-gpa {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(128,76,55,0.1);
    color: var(--side);
    border-radius: 99px;
    padding: 2px 10px;
}

/*  CERTIFICATES  */
#cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.cert-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.25rem;
    background: rgba(255,255,255,0.35);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cert-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px var(--glass-shadow);
}

.cert-icon {
    width: 44px;
    height: 44px;
    background: var(--side);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cert-icon i { color: white; font-size: 1rem; padding: 0; }

.cert-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.cert-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--font-name);
    line-height: 1.3;
}

.cert-issuer {
    font-size: 0.78rem;
    color: var(--ink-soft);
}

.cert-date {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(128,76,55,0.1);
    color: var(--side);
    border-radius: 99px;
    padding: 2px 8px;
    width: fit-content;
}

@media (max-width: 768px) {

#education {
    flex-direction: column;
}
    #cert-grid { grid-template-columns: 1fr; }
}
#contact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.contact-card {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: rgba(255,255,255,0.35);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    cursor: default;
}

a.contact-card { cursor: pointer; }

.contact-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px var(--glass-shadow);
}

.contact-card--location {
    grid-column: 1 / -1;
}

.contact-card-icon {
    width: 44px;
    height: 44px;
    background: var(--side);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-card-icon i { color: white; font-size: 1rem; padding: 0; }

.contact-card-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.contact-card-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-soft);
    font-weight: 600;
}

.contact-card-value {
    font-size: 0.9rem;
    color: var(--font-name);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/*  EDUCATION BLOCK (inside About) ── */
.edu-block {
    margin-top: 0.5rem;
}

.sub-section-title {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    color: var(--font-name);
    font-weight: 400;
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--accent-border);
}

/*  HAMBURGER  */
.hamburger { display: none; cursor: pointer; font-size: 1.2rem; position: relative; z-index: 1001; }
.fa-x { display: none; }
.header-container.menu-open .fa-bars { display: none; }
.header-container.menu-open .fa-x { display: block; }

/*  RESPONSIVE ── */
@media (max-width: 768px) {
    :root { --section-pad: 4vh 1rem; }

    section { padding-top: calc(var(--header-h) + 1.5rem); }

    .glass-section { padding: 1.5rem 1.25rem; }

    #tech { min-height: 4rem; gap: 4px; }
    #tech-box { flex-direction: column; padding-left: 0; padding: 0.5rem; }
    .tech-pill { padding: 3px 7px; font-size: 0.72rem; }

    nav {
        position: fixed;
        top: var(--header-h);
        left: 0;
        height: calc(100vh - var(--header-h));
        height: calc(100dvh - var(--header-h));
        background-color: rgba(246, 240, 224, 0.97);
        backdrop-filter: blur(12px);
        width: 100%;
        display: flex;
        flex-direction: column;
        transform: translateX(100%);
        transition: transform 0.3s var(--ease);
        z-index: 999;
    }

    nav.nav-active { transform: translateX(0); }
    nav ul { display: flex; flex-direction: column; padding: 2rem; }
    nav ul li { padding: 1.2rem 0; font-size: 1.3rem; border-bottom: 1px solid var(--accent-border); }
    nav ul li:last-child { border-bottom: none; }

    .hamburger { display: block; }

    #address {
        top: auto;
        bottom: 8vh;
        bottom: 8dvh;
        transform: none;
        flex-direction: column;
        gap: 5px;
    }

    .contact-item .info { font-size: 0.75rem; }
    #address i:hover, #social i:hover { transform: scale(1.1); }

    #social {
        top: calc(var(--header-h) + 8dvh);
        bottom: auto;
        transform: none;
        flex-direction: column;
        gap: 5px;
    }

    #social i, #address i { font-size: 1rem; }
    .fa-brands, .fa-solid { padding: 12px 0 12px 5px; }

    .work-header { flex-direction: column; gap: 0.25rem; }
    .work-right { text-align: left; }

    .carousel-btn { width: 32px; height: 32px; font-size: 0.7rem; }

    .edu-item { flex-direction: row; gap: 0.75rem; }
    .edu-icon { width: 36px; height: 36px; }

    /* Contact grid → single column on mobile */
    #contact-grid { grid-template-columns: 1fr; }
    .contact-card--location { grid-column: 1; }
    .contact-card-value { font-size: 0.82rem; }

    /* collapse: info hidden by default on mobile, toggled via JS on tap */
    #address .info { max-width: 0; opacity: 0; padding-left: 0; }
    #address.expanded .info { max-width: 200px; opacity: 1; padding-left: 0.4rem; }
}

@media (max-width: 480px) {
    .glass-card { max-width: 92vw; }
    #tech-box { font-size: 0.8rem; }
}

@media (min-width: 769px) {
    .hamburger { display: none; }
}