/* =========================================================
   BASE / RESET
   ========================================================= */
* {
    margin: 0;
    padding: 0;
    font-family: 'Titillium Web', 'Poppins', sans-serif;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #080808;
    color: #fff;
}

/* =========================================================
     LAYOUT CONTAINER
     ========================================================= */

/* Fluid container padding var for responsive tweaks */
:root {
    --container-pad: clamp(12px, 4vw, 10%);
}

/* Override container padding to use CSS var */
.container {
    padding: 10px var(--container-pad);
}

/* =========================================================
     NAV (FIXED TOP + LAYOUT)
     ========================================================= */
nav {
    position: fixed;
    /* keep navbar fixed on all pages */
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* base layout */
    gap: 16px;
    /* responsive spacing */
    padding: 16px var(--container-pad);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    z-index: 1000;
}

nav ul {
    margin-left: auto;
    display: flex;
    gap: clamp(12px, 2.5vw, 24px);
}

nav ul li {
    display: inline-block;
    list-style: none;
    margin: 10px 20px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    position: relative;
}

nav ul li a::after {
    content: '';
    width: 0%;
    height: 3px;
    background: #00d539;
    position: absolute;
    left: 0;
    bottom: -6px;
}

nav ul li a:hover::after {
    width: 100%;
    transition: 0.5s;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
}

/* Mobile dropdown attaches below fixed nav */
@media (max-width:768px) {
    nav ul {
        position: absolute;
        right: 0;
        top: 64px;
        background: rgba(0, 0, 0, 0.95);
        border-left: 1px solid rgba(255, 255, 255, .08);
        border-bottom: 1px solid rgba(255, 255, 255, .08);
        padding: 14px 18px;
        flex-direction: column;
        gap: 12px;
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease, transform .2s ease;
        z-index: 20;
    }

    nav ul.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-toggle {
        display: block;
    }
}

/* About section: photo left, text right */
#about .row {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
}

.about-col-1 {
    flex: 0 0 auto;
    margin-right: 2rem;
}

.about-col-2 {
    flex: 1;
    min-width: 300px;
}

/* ---------- Mobile polish for landing page (≤768px) ---------- */
@media (max-width: 768px) {

    /* make page padding even on mobile */
    .container {
        padding: 0 1.25rem;
    }

    /* Hero text */
    .header-content {
        margin-top: 24px;
        text-align: center;
        padding: 0;
        /* we already set container padding above */
    }

    .header-content p {
        margin-bottom: 8px;
    }

    .header-content h1 {
        margin-top: 8px;
    }

    /* About */
    #about .row {
        flex-direction: column;
        align-items: center;
    }

    .about-col-1 img {
        display: block;
        margin: 0 auto 1.5rem;
    }

    .about-col-2 {
        width: 100%;
        max-width: 540px;
        /* ↓ smaller than 680 so it doesn't look off-center */
        margin: 0 auto;
    }

    /* Keep tabs (skills / experience / education) behavior the same */
    .tab-titles {
        justify-content: space-between;
    }

    /* Section titles centered */
    #services .sub-title,
    #portfolio .sub-title,
    #contact .sub-title {
        text-align: center;
    }

    /* Services: 1-col */
    .services-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .services-list div {
        max-width: 540px;
        margin: 0 auto;
        border-radius: 14px;
    }

    /* Projects: 1-col */
    .work-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .work {
        max-width: 540px;
        margin: 0 auto;
    }

    /* Buttons centered */
    .btn {
        margin-left: auto;
        margin-right: auto;
    }

    /* Contact stacked */
    .contact-left,
    .contact-right {
        flex-basis: 100%;
        max-width: 540px;
        margin: 0 auto;
    }

    form input,
    form textarea {
        width: 100%;
    }
}

/* =========================================================
     HEADER (HOME HERO AREA)
     ========================================================= */
#header {
    width: 100%;
    height: 60vh;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
    /* space under fixed nav */
}

#header .container {
    position: relative;
    z-index: 1;
}

.header-content {
    margin-top: 10%;
    padding-left: 20px;
    font-size: 20px;
}

.header-content h1 {
    font-size: 55px;
    margin-top: 30px;
}

.header-content h1 span {
    color: #00d539;
}

/* Responsive header sizing */
@media (max-width:1024px) {
    #header {
        height: 70vh;
    }
}

@media (max-width:768px) {
    #header {
        height: 60vh;
    }
}

@media (max-width:480px) {
    .header-content {
        margin-top: 24px;
        padding-left: 0;
        font-size: clamp(14px, 2.4vw, 20px);
    }

    .header-content h1 {
        font-size: clamp(28px, 6vw, 55px);
    }
}

/* =========================================================
     VANTA BACKGROUNDS
     (Note: Home uses #vanta-header inside #header;
            Blog/Library use full-page #vanta-bg)
     ========================================================= */
/* Full-page Vanta (Blog + Library) */
#vanta-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Header-only Vanta (Home hero) */
#vanta-header {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Give page content breathing room below fixed nav on non-hero layouts */
main.container {
    padding-top: 90px;
}

/* =========================================================
     ABOUT SECTION
     ========================================================= */
#about {
    padding: 80px 0;
    color: #ababab;
}

.row {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.about-col-1 {
    flex-basis: 35%;
}

.about-col-1 img {
    width: 100%;
    border-radius: 15px;
    display: block;
}

.about-col-2 {
    flex-basis: 60%;
}

.sub-title {
    font-size: 60px;
    font-weight: 600;
    color: #fff;
}

/* Tabs header */
.tab-titles {
    display: flex;
    margin: 20px 0 40px;
    /* fixed invalid margin-top usage */
}

.tab-links {
    margin: 50px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
}

.tab-links::after {
    content: '';
    width: 0%;
    height: 3px;
    background: #00d539;
    position: absolute;
    left: 0;
    bottom: -8px;
    transition: 0.5s;
}

.tab-links.active-link::after {
    width: 50%;
}

/* Tab contents (lists) */
.tab-contents {
    display: none;
}

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

.tab-contents ul li {
    list-style: none;
    margin: 10px 0;
}

.tab-contents ul li span {
    color: #00d9ff;
    font-size: 14px
}

/* About image sizing and desktop column lock */
.about-col-1 img {
    width: clamp(180px, 28vw, 340px);
    height: auto;
    border-radius: 15px;
    display: block;
}

@media (min-width: 992px) {
    .about-col-1 {
        flex: 0 0 360px;
        max-width: 360px;
        align-self: flex-start;
    }

    .about-col-2 {
        flex: 1;
    }
}

/* =========================================================
     SERVICES
     ========================================================= */
#services {
    padding: 30px 0;
}

.services-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    /* normalized from grid-gap */
    margin-top: 50px;
}

.services-list div {
    background: #262626;
    padding: 40px;
    font-size: 13px;
    font-weight: 300;
    border-radius: 10px;
    transition: background 0.5s, transform 0.5s;
}

.services-list div i {
    font-size: 50px;
    margin-bottom: 30px;
}

.services-list div h2 {
    font-size: 30px;
    font-weight: 500;
    margin-bottom: 15px;
}

.services-list div a {
    text-decoration: none;
    color: #fff;
    font-size: 12px;
    margin-top: 20px;
    display: inline-block;
}

.services-list div:hover {
    background: #00d539;
    transform: translateY(-10px);
}

/* =========================================================
     PORTFOLIO
     ========================================================= */
#portfolio {
    padding: 50px 0;
}

.work-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    /* normalized from grid-gap */
    margin-top: 50px;
}

.work {
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.work img {
    width: 100%;
    border-radius: 10px;
    display: block;
    transition: transform 0.5s;
}

.layer {
    width: 100%;
    height: 0%;
    background: linear-gradient(rgba(0, 0, 0, 0.6), #00d539);
    border-radius: 10px;
    position: absolute;
    left: 0;
    bottom: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 40px;
    text-align: center;
    font-size: 14px;
    transition: height 0.5s;
}

.layer h3 {
    font-weight: 500;
    margin-bottom: 20px;
}

.layer a {
    margin-top: 20px;
    color: #00d539;
    text-decoration: none;
    font-size: 18px;
    line-height: 60px;
    background: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    text-align: center;
}

.work:hover img {
    transform: scale(1.1);
}

.work:hover .layer {
    height: 100%;
}

/* =========================================================
     BUTTONS
     ========================================================= */
.btn {
    display: block;
    margin: 50px auto;
    width: fit-content;
    border: 1px solid #00d539;
    padding: 14px 50px;
    border-radius: 6px;
    text-decoration: none;
    color: #fff;
    transition: background 0.5s;
}

.btn:hover {
    background: #00d539;
}

/* Buttons tap size (accessibility) */
.btn,
.btn.btn2 {
    min-height: 44px;
}

/* =========================================================
     CONTACT
     ========================================================= */
.contact-left {
    flex-basis: 35%;
}

.contact-right {
    flex-basis: 60%;
}

.contact-left p {
    margin-top: 30px;
}

.contact-left p i {
    color: #00d539;
    margin-right: 15px;
    font-size: 25px;
}

.social-icons {
    margin-top: 30px;
}

.social-icons a {
    text-decoration: none;
    font-size: 30px;
    margin-right: 15px;
    color: #ababab;
    display: inline-block;
    transition: transform 0.5s;
}

.social-icons a:hover {
    color: #00d539;
    transform: translateY(-5px);
}

.btn.btn2 {
    display: inline-block;
    background: #00d539;
}

.contact-right form {
    width: 100%;
}

form input,
form textarea {
    width: 100%;
    border: 0;
    outline: none;
    background: #262626;
    padding: 15px;
    margin: 15px 0;
    color: #fff;
    font-size: 18px;
    border-radius: 6px;
}

form .btn2 {
    padding: 14px 60px;
    font-size: 18px;
    margin-top: 20px;
    cursor: pointer;
}

#msg {
    color: #0091ff;
    margin-top: -40px;
    display: block;
}

/* =========================================================
     GLOBAL MEDIA / ACCESSIBILITY
     ========================================================= */
img {
    max-width: 100%;
    height: auto;
}

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

/* ≤ 480px: compact spacing */
@media (max-width:480px) {
    .sub-title {
        font-size: 40px;
    }

    .services-list,
    .work-list {
        gap: 16px;
    }

    nav {
        padding: 12px var(--container-pad);
    }
}

/* =========================================================
     NON-HOME PAGES (NO HERO)
     ========================================================= */
.no-hero #header {
    height: auto;
    /* remove 60vh gap */
    min-height: unset;
    background: transparent;
}

.no-hero main.container {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

/* Links */
a,
a:visited {
    color: #fff;
    text-decoration: none;
}

a:hover,
a:focus-visible {
    color: #00d539;
}

/* =========================================================
     BLOG LIST + LIBRARY CARDS
     ========================================================= */

.post-list li {
    margin: 0 0 1rem;
    line-height: 1.5;
}

.post-list a {
    font-weight: 600;
}

/* Library grid/cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.card {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: .5rem;
    background: #262626;
    border-radius: .75rem;
    padding: .75rem;
    transition: transform .15s ease, box-shadow .15s ease;
    color: inherit;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}

.card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: .5rem;
    display: block;
}

@media (max-width: 480px) {
    .card img {
        height: 240px;
    }
}

.muted {
    color: #8a8a8a;
    font-size: .9rem;
}

.hero,
.post img {
    max-width: 100%;
    height: auto;
    border-radius: .5rem;
    display: block;
}

.lib-heading {
    margin: 2.5rem 0 1rem;
    font-size: 28px;
    font-weight: 600;
    color: #fff;
    border-left: 4px solid #00d539;
    padding-left: 10px;
}

/* === Post bubble over Vanta (Blog only) === */
.post {
    /* size & centering */
    max-width: 900px;
    margin: 1.5rem auto 3rem;
    padding: 1.25rem 1.5rem;

    /* bubble look */
    background: rgba(255, 255, 255, 0.06);
    /* translucent gray */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    backdrop-filter: blur(4px);
    /* frosted vibe */
}

/* tidy up spacing for header/meta and images inside the bubble */
.post header {
    margin-bottom: 1rem;
}

.post .meta {
    color: #8a8a8a;
    font-size: .95rem;
}

.post .hero {
    border-radius: 12px;
    margin: .75rem 0 1.25rem;
    display: block;
}

/* mobile: tighter padding */
@media (max-width: 768px) {
    .post {
        padding: 1rem 1rem;
    }
}

/* =========================================================
     READABILITY (BLOG ONLY)
     ========================================================= */
.post-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.75;
    text-align: left;
}

.post h1,
.post img.hero {
    max-width: 100%;
}

/* --- Blog index enhancements --- */
.blog-tagline {
    color: #8a8a8a;
    font-size: 1.1rem;
    margin: 0 0 1.75rem;
}

.post-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
}

.post-card {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin: 0 0 1.25rem;
    transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
    backdrop-filter: blur(6px);
    opacity: 0;
    transform: translateY(14px);
    animation: fadeUp .5s ease forwards;
}

.post-card:nth-child(1) {
    animation-delay: .05s;
}

.post-card:nth-child(2) {
    animation-delay: .1s;
}

.post-card:nth-child(3) {
    animation-delay: .15s;
}

.post-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, .07);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

.post-card a {
    display: block;
    color: inherit;
    text-decoration: none;
}

.post-title {
    margin: 0 0 .35rem;
    font-weight: 600;
    color: #00d9ff;
}

.post-card .meta {
    margin: 0 0 .5rem;
    color: #8a8a8a;
    font-size: .95rem;
}

.post-card .excerpt {
    margin: 0;
    line-height: 1.6;
}

/* entrance animation */
@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Mobile contact layout ===== */
@media (max-width: 768px) {

    /* stack contact section */
    #contact .row {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    /* FORM FIRST */
    #contact .contact-right {
        order: 1;
        width: 100%;
        max-width: 540px;
        margin: 0 auto;
    }

    /* make the heading centered above the fields */
    #contact .contact-right form {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    /* INFO SECOND */
    #contact .contact-left {
        order: 2;
        width: 100%;
        max-width: 540px;
        margin: 0 auto;
        text-align: center;
    }

    #contact .contact-left .social-icons {
        justify-content: center;
    }

    #contact .contact-left .btn.btn2 {
        margin-left: auto;
        margin-right: auto;
    }
}

/* desktop / large screens: push contact info down a bit */
@media (min-width: 769px) {
    #contact .row {
        align-items: flex-start;
    }

    .contact-left {
        margin-top: 11rem;
        /* tweak this value until it lines up how you like */
    }
}

@media (max-width: 768px) {

    /* keep page from getting wider than screen */
    body {
        overflow-x: hidden;
    }

    /* row with Skills / Experience / Education */
    .tab-titles {
        justify-content: space-between;
        gap: 1rem;
        width: 100%;
    }

    /* each tab was margin: 50px; – that's what made it wide */
    .tab-links {
        margin: 0;
        font-size: 1rem;
    }
}

/* desktop / large screens */
@media (min-width: 992px) {
    #about .row {
        justify-content: flex-start;
    }

    /* photo stays ~360 */
    .about-col-1 {
        flex: 0 0 360px;
        max-width: 360px;
        margin-right: 2.5rem;
    }

    /* text column never gets wider than 720px */
    .about-col-2 {
        flex: 1 1 auto;
        max-width: 720px;
    }

    /* cap the tab content so skills/experience text doesn't run super long */
    .tab-contents {
        max-width: 720px;
    }
}