/* =====================================================
   builtbypham.tech — Design System
   ===================================================== */

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

:root {
    --black: #080808;
    --surface: #111111;
    --border: rgba(255, 255, 255, 0.07);
    --text: #e8e8e8;
    --text-muted: rgba(232, 232, 232, 0.4);
    --accent-1: #a78bfa;
    --accent-2: #38bdf8;
    --radius: 12px;
    --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background: var(--black);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

/* =====================================================
   Background Canvas
   ===================================================== */
#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.35;
    pointer-events: none;
}

/* =====================================================
   Header (Apple Glass Island)
   ===================================================== */
#site-header {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: calc(100% - 80px);
    max-width: 1200px;
    padding: 12px 32px;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    transition: all var(--transition);
}

#site-header.scrolled {
    top: 16px;
    background: rgba(8, 8, 8, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.header-inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
    transition: transform var(--transition);
}

.logo:hover {
    transform: scale(1.05);
}

.logo .dot {
    color: var(--accent-1);
    text-shadow: 0 0 10px rgba(167, 139, 250, 0.5);
}

.header-nav a {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: color var(--transition);
}

.header-nav a:hover {
    color: var(--text);
}

/* =====================================================
   Hero
   ===================================================== */
#hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 40px;
    text-align: center;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.hero-label {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.hero-title {
    font-size: clamp(3.5rem, 9vw, 7rem);
    font-weight: 300;
    line-height: 1.02;
    letter-spacing: -0.03em;
    margin-bottom: 28px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 480px;
    line-height: 1.7;
    margin: 0 auto;
}

/* Scroll hint */
.hero-scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
}

.hero-scroll-hint span {
    display: block;
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--accent-1), transparent);
    margin: 0 auto;
    animation: scrollHint 2s ease-in-out infinite;
}

@keyframes scrollHint {

    0%,
    100% {
        opacity: 0.2;
        transform: scaleY(0.6);
        transform-origin: top;
    }

    50% {
        opacity: 0.8;
        transform: scaleY(1);
        transform-origin: top;
    }
}

/* =====================================================
   Projects Immersive — Full-Bleed Evolution
   ===================================================== */
#projects {
    position: relative;
    z-index: 10;
}

.projects-immersive {
    width: 100%;
}

.project-portal {
    min-height: 100vh;
    padding: 120px 40px 60px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.portal-header {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.portal-info {
    max-width: 600px;
}

.portal-num {
    display: block;
    font-size: 0.75rem;
    color: var(--accent-1);
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.portal-title {
    font-size: 2.2rem;
    font-weight: 400;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.portal-tag {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.portal-actions {
    display: flex;
    gap: 16px;
}

.portal-btn {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 10px 20px;
    border-radius: 100px;
    border: 1px solid var(--border);
    transition: all var(--transition);
    background: rgba(255, 255, 255, 0.03);
}

.portal-btn:hover {
    background: var(--accent-1);
    color: #000;
    border-color: var(--accent-1);
}

/* Portal Window (The Iframe Container) */
.portal-window {
    flex: 1;
    position: relative;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-portal.active .portal-window {
    border-color: rgba(167, 139, 250, 0.4);
    box-shadow: 0 40px 120px rgba(167, 139, 250, 0.15);
}

.live-preview {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-preview iframe {
    width: 100%;
    height: 100%;
    border: none;
    opacity: 0;
    transition: opacity 1s ease;
}

.live-preview iframe.loaded {
    opacity: 1;
}

/* Enable interaction when PORTAL is active */
.project-portal.active .live-preview iframe {
    pointer-events: auto;
}

.preview-load-text {
    font-size: 0.7rem;
    color: var(--accent-1);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.8;
    }
}

/* Professional Footer */
#site-footer {
    position: relative;
    z-index: 10;
    padding: 160px 40px 80px;
    background: var(--black);
    border-top: 1px solid var(--border);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.footer-cta {
    margin-bottom: 100px;
    text-align: center;
}

.cta-title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 40px;
}

.cta-btn {
    display: inline-block;
    font-size: 1rem;
    font-weight: 500;
    color: var(--black);
    background: var(--text);
    padding: 18px 36px;
    border-radius: 100px;
    transition: all var(--transition);
}

.cta-btn:hover {
    background: var(--accent-1);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(167, 139, 250, 0.3);
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-copy p {
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 4px;
}

.footer-copy span {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.footer-links {
    display: flex;
    gap: 32px;
    justify-content: center;
}

.footer-links a {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--accent-1);
}

/* Responsive Fixes */
@media (max-width: 768px) {
    #site-header {
        padding: 20px 24px;
    }

    #hero {
        padding: 0 24px;
    }

    .hero-title {
        font-size: clamp(3rem, 12vw, 5rem);
    }

    .project-portal {
        padding: 100px 24px 40px;
    }

    .portal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .portal-title {
        font-size: 1.6rem;
    }

    .portal-window {
        aspect-ratio: 10 / 16;
    }

    #site-footer {
        padding: 100px 24px 60px;
    }

    .cta-title {
        font-size: 3rem;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 40px;
    }
}