/* ============================================================
   ORIGINAL — untouched from source
   ============================================================ */
body {
    font-family: 'Playfair Display', serif;
    margin: 0;
    background-color: #000000;
    color: #ffffff;
}

.viewport-section {
    min-height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    scroll-snap-align: start;
}

#hero {
    background-color: #000000;
    color: #ffffff;
    overflow: hidden;
}

.gradient-bg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.hero-overlay {
    position: relative;
    z-index: 10;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.container {
    width: 80%;
    margin: 0 auto;
}

.hero-content {
    display: flex;
    width: 100%;
    max-width: 1200px;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 0 auto;
}

.hero-left {
    flex: 0 0 60%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-right: 2.5rem;
    animation: fadeInUp 1.7s ease-out 0.5s forwards;
    opacity: 0;
}

.hero-title-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
}

.social-links {
    width: 75%;
    max-width: 420px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 2.25rem;
}

.social-link {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.84);
    text-decoration: none;
    line-height: 1;
    filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.34));
    transition: transform 0.18s ease, color 0.18s ease, opacity 0.18s ease, filter 0.18s ease;
}

.social-link:hover,
.social-link:focus-visible {
    color: #ffffff;
    opacity: 1;
    filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.5));
    transform: translateY(-2px);
}

.social-link svg {
    width: 1.55rem;
    height: 1.55rem;
    fill: currentColor;
    opacity: 0.88;
}

.hero-right {
    flex: 0 0 40%;
    padding: 0 0 0 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 1.2s ease-out 1.5s forwards;
    opacity: 0;
}

.hero-about-copy {
    margin: 0;
    padding: 0.4rem 0 0.2rem 0.25rem;
    font-family: 'Merriweather', serif;
    font-size: 0.92rem;
    font-weight: 300;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.9);
}

.hero-highlight {
    color: #ffffff;
    text-decoration: none;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.34), 0 0 18px rgba(72, 119, 228, 0.18);
    transition: color 0.18s ease, text-shadow 0.18s ease, opacity 0.18s ease;
}

.hero-about-copy a,
.hero-about-copy a:visited,
.hero-about-copy a:hover,
.hero-about-copy a:active {
    color: #ffffff;
    text-decoration: none;
}

.hero-highlight:hover,
.hero-highlight:focus-visible {
    color: #ffffff;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.46), 0 0 20px rgba(72, 119, 228, 0.22);
}

.hero-bullets {
    margin: 1rem 0 1.1rem 1.2rem;
    padding: 0;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Merriweather', serif;
    font-size: 0.95rem;
    line-height: 1.6;
}

.hero-bullets li::marker {
    color: rgba(255, 255, 255, 0.78);
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-weight: 400;
    margin: 0;
}

h1 {
    font-size: 3rem;
    margin: 0;
}

h1#title_name {
    font-family: 'Playfair Display', serif;
    font-style: normal;
    font-size: 4.5rem;
    letter-spacing: 0.1vw;
    text-indent: 0vw;
    text-align: center;
    margin: 0;
    width: 100%;
}

.hero-divider {
    width: 1px;
    height: 200px;
    background: radial-gradient(circle at center, 
        rgba(255,255,255,0.9) 0%, 
        rgba(255,255,255,0.4) 40%, 
        rgba(255,255,255,0) 100%);
    box-shadow: 0 0 5px rgba(255,255,255,0.2);
    flex-shrink: 0;
    animation: fadeInUp 1.6s ease-out 1.2s forwards;
    opacity: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
}

/* ============================================================
   PORTFOLIO SECTION — rebuilt for mobile centering fix
   ============================================================ */
.portfolio-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    width: 100%;
    padding: 20vh 0;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
    background-color: #000000;
    position: relative;
    z-index: 20;
}

.portfolio-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.tab-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    background: #000;
    padding: 0rem;
    border-radius: 50px;
    position: relative;
    border: 1px solid rgba(0, 33, 111, 0.914);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.142), inset 0 0 10px rgba(255, 255, 255, 0.05);
}

.tab-indicator {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(110deg, #003566 0%, #6012cd48 100%, #013f80b9 50%);
    border-radius: 40px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    box-shadow: 0 0 15px rgba(0, 49, 182, 0.322);
}

.tab-btn {
    background: none;
    border: 1px solid transparent;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'EB Garamond', serif;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem 1.5rem;
    border-radius: 40px;
    transition: color 0.3s ease;
    position: relative;
    z-index: 1;
}

.tab-btn.active {
    color: #ffffff;
}

.portfolio-divider {
    width: 60%;
    height: 1px;
    background: radial-gradient(circle at center, 
        rgba(255,255,255,0.8) 0%, 
        rgba(255,255,255,0.3) 40%, 
        rgba(255,255,255,0) 100%);
    box-shadow: 0 0 5px rgba(255,255,255,0.1);
    margin-bottom: 3rem;
    flex-shrink: 0;
}

.projects-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    gap: 3rem;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.project-card {
    flex: 0 1 450px;
    min-width: 0;
    display: flex;
    position: relative;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.95rem;
    min-height: 216px;
    padding: 1.15rem 1.2rem;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out forwards;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.025);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.08), inset 0 0 8px rgba(255, 255, 255, 0.03);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.project-card::before {
    content: "";
    position: absolute;
    inset: -30%;
    background:
        radial-gradient(circle at 20% 20%, rgba(83, 141, 255, 0.17), transparent 42%),
        radial-gradient(circle at 80% 30%, rgba(16, 94, 173, 0.12), transparent 38%),
        radial-gradient(circle at 50% 85%, rgba(10, 52, 115, 0.18), transparent 46%),
        linear-gradient(135deg, rgba(3, 24, 58, 0.26), rgba(8, 54, 110, 0.14), rgba(1, 18, 39, 0.3));
    background-size: 140% 140%;
    animation: projectGradientShift 18s ease-in-out infinite alternate;
    opacity: 0.98;
    z-index: 0;
}

.project-card > * {
    position: relative;
    z-index: 1;
}

.project-card:hover,
.project-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.1), inset 0 0 10px rgba(255, 255, 255, 0.04);
}

.project-card:hover::before,
.project-card:focus-visible::before {
    opacity: 0.58;
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.project-header h3 {
    font-size: 2rem;
    line-height: 1.05;
}

.project-title-block {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.project-date {
    font-family: 'EB Garamond', serif;
    font-style: italic;
    opacity: 0.6;
}

.project-link {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    color: rgba(255, 255, 255, 0.72);
    transition: color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.project-link:hover,
.project-link:focus-visible {
    color: #ffffff;
    transform: translateY(-1px);
}

.project-link svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: currentColor;
}

.project-description {
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.8;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tag {
    display: inline-flex;
    align-items: center;
    min-height: 1.65rem;
    padding: 0.2rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.78);
    background: rgba(255, 255, 255, 0.05);
    font-family: 'EB Garamond', serif;
    font-size: 0.88rem;
    line-height: 1;
}

.project-load-error {
    margin: 0;
    color: rgba(255, 255, 255, 0.74);
    font-family: 'Merriweather', serif;
    font-size: 0.95rem;
}

@keyframes projectGradientShift {
    0% {
        transform: translate3d(-2%, -1%, 0) scale(1);
        filter: hue-rotate(0deg);
    }
    50% {
        transform: translate3d(2%, 2%, 0) scale(1.04);
        filter: hue-rotate(8deg);
    }
    100% {
        transform: translate3d(-1%, 3%, 0) scale(1.02);
        filter: hue-rotate(-6deg);
    }
}

/* ============================================================
   MOBILE (≤ 768px)
   — hero rules: original verbatim
   — portfolio rules: rebuilt fix
   ============================================================ */
@media (max-width: 768px) {

    /* --- Hero (original) --- */
    .container {
        width: 90%;
    }

    .hero-content {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3rem;
        padding: 15vh 2rem;
        box-sizing: border-box;
        min-height: 100vh;
    }

    .hero-left {
        flex: 0 0 auto;
        width: 100%;
        padding-right: 0;
        animation: fadeInUpMobile 1.2s ease-out forwards;
    }

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

    h1#title_name {
        font-size: 4.3rem;
    }

    .social-links {
        width: 100%;
        gap: 1.5rem;
    }

    .hero-divider {
        width: 70% !important;
        height: 1px !important;
        min-height: 1px !important;
        background: radial-gradient(circle at center, 
            rgba(255,255,255,0.9) 0%, 
            rgba(255,255,255,0.4) 40%, 
            rgba(255,255,255,0) 100%) !important;
        margin: 1rem auto !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .hero-right {
        flex: 0 0 auto;
        padding: 0;
        text-align: center;
        width: 100%;
        animation: fadeInUpMobile 1.2s ease-out 0.5s forwards;
    }

    .hero-about-copy {
        padding: 0.35rem 0;
    }

    .hero-bullets {
        display: inline-block;
        text-align: left;
        margin: 1rem 0 1.1rem 0;
    }

    /* --- Shared section (original) --- */
    .viewport-section {
        height: auto !important;
        min-height: 100vh;
        scroll-snap-align: none !important;
        overflow: visible !important;
        position: relative;
    }

    /* --- Tab bar (original) --- */
    .tab-bar {
        gap: 0.5rem;
        margin-bottom: 2rem;
    }

    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }

    /* --- Portfolio container (original base, keeps padding) --- */
    .portfolio-container {
        height: auto !important;
        min-height: auto;
        padding: 10vh 0;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
    }

    /* --- Grid & cards: the fix --- */
    .projects-grid {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        max-width: 100%;
        padding: 0 1.5rem;
        overflow: visible;
        max-height: none;
        flex: none;
    }

    .project-card {
        flex: none;
        width: 100%;
        max-width: 480px;
        margin-left: auto;
        margin-right: auto;
        min-height: 196px;
    }

    .project-header h3 {
        font-size: 1.7rem;
    }
}
