/* ========================================
   GUIDOMELVIN PORTFOLIO — Design System
   ======================================== */

/* --- Custom Properties --- */
:root {
    --bg-primary: #0a0a0a;
    --bg-card: #161616;
    --bg-card-hover: #1c1c1c;
    --border-card: rgba(255, 255, 255, 0.06);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.55);
    --text-link: rgba(255, 255, 255, 0.8);
    --accent-red: #c22;
    --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius-card: 16px;
    --radius-sm: 8px;
    --dot-color: rgba(255, 255, 255, 0.12);
    --dot-spacing: 28px;
    --container-max: 100%;
    --section-pad-y: 120px;
    --section-pad-x: 112px;
    --nav-width: 160px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    /* Dot grid background */
    background-image: radial-gradient(circle, var(--dot-color) 1px, transparent 1px);
    background-size: var(--dot-spacing) var(--dot-spacing);
}

body.scroll-lock {
    overflow: hidden;
    height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: disc;
    padding-left: 1.5em;
}

img {
    display: block;
    max-width: 100%;
}

/* --- Layout --- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--section-pad-x);
}

.section {
    padding: var(--section-pad-y) 0;
}

/* --- Side Navigation --- */
.side-nav {
    position: fixed;
    left: 32px;
    bottom: 40px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0;
    text-decoration: none;
    opacity: 1;
    width: 22px;
}

.side-nav:hover .nav-item {
    width: 160px;
}

.nav-dot {
    width: 22px;
    height: 22px;
    border-radius: 0;
    flex-shrink: 0;
    background-color: #555555;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.nav-item:last-child .nav-dot {
    background-color: #8b0000;
}

.nav-item .nav-dot.filled {
    background-color: #ffffff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.1);
}

.nav-item:last-child .nav-dot.filled {
    background-color: #cc2233;
    box-shadow: 0 0 6px rgba(204, 34, 51, 0.3);
}

@keyframes cascadeLight {

    0%,
    100% {
        background-color: #555555;
        box-shadow: none;
    }

    15%,
    35% {
        background-color: #ffffff;
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    }
}

@keyframes cascadeLightRed {

    0%,
    100% {
        background-color: #555555;
        box-shadow: none;
    }

    15%,
    35% {
        background-color: #ff3344;
        box-shadow: 0 0 10px rgba(255, 51, 68, 0.8);
    }
}

@keyframes fadeToFilled {
    from {
        background-color: #555555;
        box-shadow: none;
    }
    to {
        background-color: #ffffff;
        box-shadow: 0 0 6px rgba(255, 255, 255, 0.1);
    }
}

@keyframes fadeToFilledRed {
    from {
        background-color: #555555;
        box-shadow: none;
    }
    to {
        background-color: #cc2233;
        box-shadow: 0 0 6px rgba(204, 34, 51, 0.3);
    }
}

.nav-item .nav-dot.fade-in {
    animation: fadeToFilled 0.8s ease-out forwards;
}

.nav-item:last-child .nav-dot.fade-in {
    animation: fadeToFilledRed 0.8s ease-out forwards;
}

.nav-item .nav-dot.animating {
    animation: cascadeLight 1.2s 4 ease-in-out forwards;
}

.nav-item:last-child .nav-dot.animating {
    animation: cascadeLightRed 1.2s 4 ease-in-out forwards;
}

.nav-item:hover .nav-dot {
    background-color: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.nav-item:last-child:hover .nav-dot {
    background-color: #ff3344;
    box-shadow: 0 0 8px rgba(255, 51, 68, 0.5);
}

.nav-label {
    position: absolute;
    left: 0;
    padding-left: 36px;
    font-size: 10px;
    font-weight: 400;
    color: var(--text-primary);
    white-space: nowrap;
    letter-spacing: 0.01em;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, font-size 0.3s ease, font-weight 0.3s ease;
}

.side-nav:hover .nav-label {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.4);
}

.nav-item:hover .nav-label {
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}

.side-nav:hover .nav-item.active .nav-label {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

/* --- Hero Section --- */
.section--hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-left: 0;
}

.hero-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.2s ease;
}

#heroLayer1 {
    z-index: 1;
}

#heroLayer2 {
    z-index: 2;
}

#heroLayer3 {
    z-index: 3;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0;
    transition: opacity 1.2s ease;
    background-color: rgba(10, 10, 10, 0.75);
}

.hero-overlay.visible {
    opacity: 1;
}

.hero-content {
    position: relative;
    z-index: 4;
    text-align: center;
    padding: 0 20px;
}

.hero-greeting {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 500;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-greeting.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-name {
    font-size: clamp(3rem, 8vw, 6.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-bottom: 16px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease 0.15s, transform 0.8s ease 0.15s;
}

.hero-name.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-tagline {
    font-size: clamp(0.95rem, 1.5vw, 1.25rem);
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

.hero-tagline.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- About Section --- */
.section--about {
    min-height: auto;
    padding-top: 160px;
    padding-bottom: 100px;
}

.about-content {
    max-width: 900px;
}

.about-content p {
    font-size: 1.05rem;
    font-weight: 300;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 1.2em;
}

.about-content ul {
    margin-bottom: 1.2em;
    padding-left: 2em;
}

.about-content li {
    font-size: 1.05rem;
    font-weight: 300;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 0.3em;
}

.about-content a {
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: border-color 0.3s ease;
}

.about-content a:hover {
    border-color: var(--text-primary);
}

.external-arrow {
    font-size: 0.75em;
    vertical-align: super;
    margin-left: 2px;
    opacity: 0.6;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
    max-width: 100%;
    margin: 0 auto;
}

.col-span-1 {
    grid-column: span 1;
}

.col-span-2 {
    grid-column: span 2;
}

.col-span-3 {
    grid-column: span 3;
}

.col-span-4 {
    grid-column: span 4;
}

.col-span-5 {
    grid-column: span 5;
}

.card-center {
    grid-column: 1 / -1;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
}

.cards-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
    max-width: 100%;
    margin: 0 auto;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-card);
    padding: 32px 36px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.1);
}

.card--wide {
    grid-column: 1 / -1;
}

.card-title {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.card-title a {
    transition: opacity 0.3s ease;
}

.card-title a:hover {
    opacity: 0.8;
}

.card-role {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.card-desc {
    font-size: 0.9rem;
    font-weight: 300;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.card-date {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
}

/* --- Education Cards --- */
.card--edu {
    padding: 28px 32px;
}

.card--edu .card-title {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.card--edu .card-role {
    margin-bottom: 16px;
}

.card--volunteer {
    max-width: 100%;
    margin: 0 auto;
}

/* --- Experience Section --- */
.section--experience {
    min-height: auto;
    padding-top: 60px;
    padding-bottom: 100px;
}

/* --- Education Section --- */
.section--education {
    min-height: auto;
    padding-top: 60px;
    padding-bottom: 100px;
}

/* --- Volunteering Section --- */
.section--volunteering {
    min-height: 200px;
    padding-top: 60px;
    padding-bottom: 100px;
}

/* --- Projects Section --- */
.section--projects {
    min-height: auto;
    padding-top: 60px;
    padding-bottom: 100px;
}

.projects-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    max-width: 100%;
    margin: 0 auto;
}

.project-card {
    display: block;
    text-decoration: none;
    transition: transform 0.35s ease;
}

.project-card:hover {
    transform: translateY(-4px);
}

.project-preview {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius-card);
    overflow: hidden;
    margin-bottom: 16px;
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
}

.project-preview-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.project-preview--wiki {
    background: linear-gradient(135deg, #1a1a1a 0%, #222 50%, #1a1a1a 100%);
}

.project-preview--wiki .project-preview-inner {
    background:
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 20px;
}

.preview-label {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.02em;
}

.project-preview--review {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.preview-label-large {
    font-size: 2.5rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.18);
    letter-spacing: -0.03em;
}

.project-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.project-date {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
}

/* --- Contact Section --- */
.section--contact {
    min-height: auto;
    padding-top: 120px;
    padding-bottom: 240px;
}

.contact-content {
    text-align: center;
}

.contact-text {
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.social-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--text-primary);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.social-icon {
    position: relative;
}

.social-icon:hover {
    transform: scale(1.12);
    opacity: 0.8;
}

.social-icon::after {
    content: attr(data-username);
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(255, 255, 255, 0.95);
    color: #0a0a0a;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    font-family: var(--font-primary);
}

.social-icon:hover::after,
.social-icon:active::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.social-icon svg {
    width: 36px;
    height: 36px;
}

/* --- Scroll Reveal Animation --- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    :root {
        --section-pad-x: 40px;
        --section-pad-y: 120px;
        --nav-width: 0px;
    }

    .side-nav {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        left: 50%;
        transform: translateX(-50%);
        bottom: 24px;
        width: max-content;
        gap: 2px;
        touch-action: pan-y;
        background: rgba(20, 20, 20, 0.85);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding: 12px 24px;
        border-radius: 40px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    }

    .nav-item {
        width: 22px;
        height: 22px;
        justify-content: center;
    }

    .side-nav:hover .nav-item {
        width: 22px;
    }

    .nav-dot {
        width: 20px;
        height: 20px;
    }

    .nav-label {
        left: 50%;
        bottom: 100%;
        padding: 6px 12px;
        background: rgba(255, 255, 255, 0.95);
        color: #0a0a0a !important;
        border-radius: 8px;
        transform: translateX(-50%) translateY(10px);
        text-align: center;
        opacity: 0 !important;
        pointer-events: none;
        transition: opacity 0.3s ease, transform 0.3s ease;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    }

    .side-nav:hover .nav-label {
        opacity: 0 !important;
        transform: translateX(-50%) translateY(10px);
    }

    .nav-item:hover .nav-label,
    .nav-item:active .nav-label {
        opacity: 1 !important;
        transform: translateX(-50%) translateY(-10px);
        font-size: 13px !important;
    }

    .section {
        padding-left: 0;
    }
}

@media (max-width: 768px) {
    :root {
        --section-pad-x: 24px;
        --section-pad-y: 120px;
    }

    .cards-grid,
    .cards-row,
    .projects-row {
        grid-template-columns: 1fr;
    }

    .card--wide,
    .col-span-1,
    .col-span-2,
    .col-span-3,
    .col-span-4,
    .col-span-5 {
        grid-column: 1 / -1;
    }

    .hero-name {
        font-size: clamp(2.4rem, 10vw, 4rem);
    }

    .card {
        padding: 24px 28px;
    }

    .social-icons {
        gap: 20px;
    }
}

@media (max-width: 480px) {
    :root {
        --section-pad-x: 16px;
    }

    .hero-greeting {
        font-size: 1.2rem;
    }

    .hero-tagline {
        font-size: 0.9rem;
    }
}