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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #111;
    color: #e8e8e8;
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

/* ── Sections ─────────────────────────────────────────── */

#sections-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    will-change: transform;
    transition: transform 0.9s cubic-bezier(0.76, 0, 0.24, 1);
}

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

/* ── Section Content ──────────────────────────────────── */

.section-content {
    max-width: 560px;
    padding: 0 32px;
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease 0.2s, transform 0.7s ease 0.2s;
}

.section.active .section-content {
    opacity: 1;
    transform: translateY(0);
}

.section-label {
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 20px;
}

.section-content h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    font-weight: 300;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 20px;
}

.section-body {
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 300;
}

.contact-link {
    display: inline-block;
    margin-top: 28px;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 3px;
    transition: color 0.2s, border-color 0.2s;
}

.contact-link:hover {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.6);
}

/* ── Scroll hint (home section) ───────────────────────── */

.scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.6s ease;
}

#section-0.active .scroll-hint {
    opacity: 1;
}

.scroll-hint span {
    display: block;
    width: 1px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    animation: scrollPulse 1.6s ease-in-out infinite;
}

.scroll-hint span:nth-child(2) { animation-delay: 0.15s; }
.scroll-hint span:nth-child(3) { animation-delay: 0.3s; }

@keyframes scrollPulse {
    0%, 100% { opacity: 0.15; transform: scaleY(1); }
    50%       { opacity: 0.7;  transform: scaleY(1.4); }
}

/* ── Navbar background bar (stays at top, fades in) ──── */

#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px;
    z-index: 200;
    pointer-events: none;

    background: transparent;
    border-bottom: 1px solid transparent;
    box-shadow: none;

    transition:
        background 0.55s ease,
        border-color 0.55s ease,
        box-shadow 0.55s ease;
}

#navbar.scrolled {
    background: rgba(17, 17, 17, 0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 2px 32px rgba(0, 0, 0, 0.5);
    pointer-events: all;
}

/* ── Nav Brand (position set by JS, animates independently) */

.nav-brand {
    position: fixed;
    z-index: 201;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    cursor: default;
    opacity: 0;

    transition:
        top 0.85s cubic-bezier(0.76, 0, 0.24, 1),
        left 0.85s cubic-bezier(0.76, 0, 0.24, 1),
        opacity 0.4s ease;
}

.nav-logo {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    /*
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    */
    color: rgba(255, 255, 255, 0.55);
    flex-shrink: 0;
}

.nav-logo svg {
    width: 21px;
    height: 21px;
}

.nav-title {
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.85);
}

/* ── Nav Links (position set by JS, animates independently) */

.nav-links {
    position: fixed;
    z-index: 201;
    display: flex;
    align-items: center;
    gap: 28px;
    pointer-events: all;
    opacity: 0;

    transition:
        top 0.85s cubic-bezier(0.76, 0, 0.24, 1),
        left 0.85s cubic-bezier(0.76, 0, 0.24, 1),
        opacity 0.4s ease;
}

.nav-link {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
    user-select: none;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.8);
    transform: scaleX(0);
    transition: transform 0.25s ease;
}

.nav-link:hover {
    color: rgba(255, 255, 255, 0.8);
}

.nav-link.active {
    color: rgba(255, 255, 255, 0.9);
}

.nav-link.active::after {
    transform: scaleX(1);
}

/* ── Section Dots ─────────────────────────────────────── */

#section-dots {
    position: fixed;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 150;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

#section-dots.visible {
    opacity: 1;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.22);
    cursor: pointer;
    padding: 0;
    transition: background 0.3s ease, transform 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.dot.active {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.35);
}

.dot:hover:not(.active) {
    background: rgba(255, 255, 255, 0.45);
}

/* ── Mobile (≤ 600px) ─────────────────────────────────── */

@media (max-width: 600px) {
    /* Hide brand text — logo alone fits the centered layout */
    .nav-title {
        display: none;
    }

    /* Tighter link spacing */
    .nav-links {
        gap: 20px;
    }

    /* More breathing room for section text */
    .section-content {
        padding: 0 24px;
    }

    /* Email can wrap on narrow screens */
    .contact-link {
        font-size: 0.8rem;
        word-break: break-all;
    }

    /* Dots: 28×28 px tap targets, visual dot via ::before */
    #section-dots {
        right: 4px;
        gap: 4px;
    }

    .dot {
        width: 28px;
        height: 28px;
        background: transparent;
        position: relative;
    }

    .dot::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.22);
        transition: background 0.3s ease, transform 0.3s ease;
    }

    .dot.active {
        background: transparent;
        transform: none;
    }

    .dot.active::before {
        background: rgba(255, 255, 255, 0.8);
        transform: translate(-50%, -50%) scale(1.35);
    }

    .dot:hover:not(.active)::before {
        background: rgba(255, 255, 255, 0.45);
    }
}

.portfolio-content {
    max-width: 800px;
}

.portfolio-card {
    display: flex;
    gap: 20px;
    align-items: center;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.portfolio-card .video-container {
    flex: 0 0 55%;
}

.portfolio-card-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.portfolio-card-title {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.portfolio-card-body {
    font-size: 0.85rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 300;
}

.video-container {
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-image: url('assets/portfolio/0_ags/placeholder-blur.webp');
    aspect-ratio: 16 / 9;
}

.pf_player {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    backdrop-filter: blur(20px); 
    transition: opacity 0.5s ease-in-out;
}