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

:root {
    --bg: #0a0a0a;
    --surface: #111111;
    --border: #1f1f1f;
    --border-hover: #333333;
    --text: #e8e8e8;
    --text-dim: #666666;
    --text-muted: #444444;
    --accent: #ffffff;
    --accent-blue: #60a5fa;
    --accent-cyan: #22d3ee;
    --accent-green: #34d399;
    --mono: 'Space Mono', monospace;
    --sans: 'Space Grotesk', -apple-system, sans-serif;
}

html, body {
    height: 100%;
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    z-index: 1000;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 100;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    background: linear-gradient(90deg, var(--text), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-link {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    text-decoration: none;
    padding: 8px 12px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--text);
    border-color: var(--border-hover);
}

.nav-link.active {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* Content */
.content {
    height: 100vh;
    padding-top: 64px;
    overflow: hidden;
}

.page {
    display: none;
    height: calc(100vh - 64px);
    overflow-y: auto;
    animation: pageIn 0.5s ease;
}

.page.active {
    display: block;
}

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

/* Home */
#home {
    background: radial-gradient(ellipse at 70% 50%, rgba(96, 165, 250, 0.04) 0%, transparent 60%),
                radial-gradient(ellipse at 20% 80%, rgba(34, 211, 238, 0.03) 0%, transparent 50%);
}

.home-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 60px 80px;
    gap: 60px;
}

.home-left {
    flex: 1;
    max-width: 600px;
}

.status-line {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    letter-spacing: 0.1em;
}

.status-line::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    margin-right: 8px;
    box-shadow: 0 0 8px var(--accent-green);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.intro-label {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}

.hero-name {
    font-family: var(--sans);
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.3em;
    background: linear-gradient(135deg, var(--text) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
}

.hero-tagline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.tag-item {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

.tag-item:nth-child(1) { color: var(--accent-blue); }
.tag-item:nth-child(3) { color: var(--accent-cyan); }
.tag-item:nth-child(5) { color: var(--accent-green); }

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

.home-cta {
    display: flex;
    gap: 16px;
    margin-bottom: 48px;
}

.cta-btn {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    padding: 14px 24px;
    border: 1px solid var(--accent-blue);
    color: var(--text);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cta-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.cta-btn:hover {
    color: var(--bg);
    border-color: var(--accent-cyan);
}

.cta-btn:hover::before {
    opacity: 1;
}

.cta-ghost {
    border-color: var(--border-hover);
    color: var(--text-dim);
}

.cta-ghost::before {
    display: none;
}

.cta-ghost:hover {
    border-color: var(--text-dim);
    color: var(--text);
    background: transparent;
}

.system-status {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.05), transparent);
    padding: 16px 12px 12px;
    border-radius: 4px;
    margin-top: 4px;
}

/* Headshot */
.home-right {
    flex-shrink: 0;
}

.headshot-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.headshot-label {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.15em;
}

.headshot-frame {
    width: 280px;
    height: 320px;
    border: 2px solid transparent;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    background: var(--surface);
    background-image: linear-gradient(var(--surface), var(--surface)),
                      linear-gradient(135deg, var(--accent-blue), var(--accent-cyan), var(--accent-green));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 0 40px rgba(96, 165, 250, 0.1), 0 0 80px rgba(34, 211, 238, 0.05);
    transition: box-shadow 0.4s ease, transform 0.4s ease;
}

.headshot-frame:hover {
    box-shadow: 0 0 50px rgba(96, 165, 250, 0.2), 0 0 100px rgba(34, 211, 238, 0.1);
    transform: translateY(-4px);
}

.headshot-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: grayscale(10%) contrast(1.05);
    transition: filter 0.4s ease;
}

.headshot-frame:hover img {
    filter: grayscale(0%) contrast(1.08);
}

.headshot-placeholder {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.2em;
}

.headshot-caption {
    font-family: var(--mono);
    font-size: 0.6rem;
    color: var(--text-dim);
    letter-spacing: 0.08em;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.headshot-socials {
    display: flex;
    gap: 16px;
    margin-top: 4px;
}

.headshot-social-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    text-decoration: none;
}

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

.headshot-social-icon:hover {
    transform: scale(1.15);
    opacity: 0.85;
}

/* Projects */
.projects-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 60px 48px;
}

.page-header {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 8px;
}

.header-prefix {
    font-family: var(--mono);
    font-size: 1rem;
    color: var(--text-muted);
}

.page-title {
    font-family: var(--sans);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.3em;
}

.page-desc {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 48px;
    letter-spacing: 0.05em;
}

.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.project-box {
    border: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.project-box:hover {
    border-color: var(--border-hover);
}

.project-box.reverse {
    direction: rtl;
}

.project-box.reverse > * {
    direction: ltr;
}

.project-img-wrapper {
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cubo-img {
    background: #f5f5f5;
}

.cubo-img img {
    object-fit: contain;
    padding: 20px;
}

/* CUBO Synced App image */
.cubo-app-img {
    background: #0d1117;
    padding: 16px;
}

.cubo-app-img img {
    object-fit: contain;
    width: auto;
    max-width: 100%;
    max-height: 100%;
    border-radius: 16px;
}

/* Connected project connector */
.project-connector {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: -16px 0;
    padding: 0 40px;
}

.connector-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
    opacity: 0.3;
}

.connector-label {
    font-family: var(--mono);
    font-size: 0.6rem;
    color: var(--accent-blue);
    letter-spacing: 0.15em;
    white-space: nowrap;
    opacity: 0.6;
}

.project-sub {
    border-color: rgba(96, 165, 250, 0.15);
}

.project-sub:hover {
    border-color: rgba(96, 165, 250, 0.3);
}

/* YouTube link */
.project-link-youtube {
    color: #ff0000;
}

.project-info {
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-label {
    font-family: var(--mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    display: block;
    margin-bottom: 8px;
}

.project-title {
    font-family: var(--sans);
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    margin-bottom: 12px;
}

.project-body {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 16px;
    max-width: 600px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.project-tech code {
    font-family: var(--mono);
    font-size: 0.65rem;
    padding: 4px 10px;
    border: 1px solid var(--border);
    color: var(--text-dim);
    letter-spacing: 0.05em;
}

.project-links {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.project-link-icon {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 0.7rem;
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: opacity 0.2s ease;
    color: var(--text-dim);
}

.project-link-icon svg {
    width: 18px;
    height: 18px;
}

.project-link-icon:hover {
    opacity: 0.75;
}

.project-link-github {
    color: #ffffff;
}

.project-link-tiktok {
    color: #ff0050;
}

.project-link-icon:not(.project-link-github):not(.project-link-tiktok) {
    color: #60a5fa;
}

/* About */
.about-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 48px;
}

.about-divider {
    width: 100%;
    height: 1px;
    background: var(--border);
    margin: 24px 0 40px;
}

.about-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 60px;
    align-items: start;
    margin-bottom: 40px;
}

.about-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 16px;
    border: 2px solid var(--border);
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.profile-name {
    font-family: var(--sans);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.profile-role {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.profile-socials {
    display: flex;
    gap: 12px;
}

.social-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.social-icon:hover {
    transform: scale(1.1);
    opacity: 0.85;
}

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

.social-gmail {
    color: #EA4335;
}

.social-github {
    color: #ffffff;
}

.social-linkedin {
    color: #0A66C2;
}

.about-bio {
    padding-top: 8px;
}

.about-bio p {
    font-size: 0.95rem;
    color: var(--text-dim);
    line-height: 1.8;
    margin-bottom: 20px;
}

.about-bio strong {
    color: var(--text);
}

.about-bio .contact-line a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1px;
    transition: border-color 0.2s ease;
}

.about-bio .contact-line a:hover {
    border-color: var(--text);
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 0 20px;
    }

    .nav-links {
        gap: 4px;
    }

    .nav-link {
        padding: 6px 8px;
        font-size: 0.6rem;
    }

    .home-container {
        flex-direction: column-reverse;
        padding: 40px 24px;
        gap: 40px;
        justify-content: center;
    }

    .home-left {
        text-align: center;
    }

    .hero-tagline {
        justify-content: center;
    }

    .home-cta {
        justify-content: center;
        flex-wrap: wrap;
    }

    .headshot-frame {
        width: 200px;
        height: 240px;
    }

    .projects-container,
    .about-container {
        padding: 40px 20px;
    }

    .about-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .about-profile {
        align-items: center;
    }

    .project-box {
        grid-template-columns: 1fr;
    }

    .project-box.reverse {
        direction: ltr;
    }

    .project-img-wrapper {
        height: 180px;
    }

    .cubo-app-img {
        height: 240px;
    }

    .project-info {
        padding: 24px;
    }

    .project-connector {
        padding: 0 16px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
}
