/* Mohammad Maaz Portfolio — HUD / 3D Design System */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-deep: #060a12;
    --bg-panel: #0c1220;
    --bg-elevated: #111827;
    --primary: #3b82f6;
    --primary-bright: #60a5fa;
    --accent: #22d3ee;
    --accent-dim: #0891b2;
    --steel: #64748b;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: rgba(59, 130, 246, 0.2);
    --glow: 0 0 40px rgba(59, 130, 246, 0.15);
    --glow-accent: 0 0 30px rgba(34, 211, 238, 0.2);
    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --radius: 12px;
    --radius-lg: 20px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text);
    line-height: 1.65;
    overflow-x: hidden;
}

main {
    position: relative;
    z-index: 1;
}

#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
}

.scanlines {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    opacity: 0.4;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Loading */
.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-inner { text-align: center; }

.loading-ring {
    width: 56px;
    height: 56px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 0.8s linear infinite;
}

.loading-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    color: var(--accent);
    display: block;
    margin-bottom: 16px;
}

.loading-bar {
    width: 180px;
    height: 2px;
    background: var(--bg-elevated);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loading-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    animation: loadBar 1.8s ease forwards;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes loadBar { from { width: 0; } to { width: 100%; } }

/* Nav */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(6, 10, 18, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.nav-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.05em;
}

.logo-bracket { color: var(--accent); }

.nav-menu {
    display: flex;
    list-style: none;
    gap: 28px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width var(--transition);
}

.nav-link:hover { color: var(--text); }
.nav-link:hover::after { width: 100%; }

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: var(--transition);
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: 100px 24px 60px;
}

.hero-grid {
    max-width: 1140px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 60px;
    align-items: center;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 20px;
    padding: 6px 14px;
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 100px;
    background: rgba(34, 211, 238, 0.05);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.5); }
    50% { opacity: 0.7; box-shadow: 0 0 0 8px rgba(34, 211, 238, 0); }
}

.hero-title { margin-bottom: 20px; }

.title-line {
    display: block;
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 8px;
}

.title-name {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary-bright) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-role {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    color: var(--primary-bright);
    font-weight: 500;
    margin-top: 8px;
}

.hero-description {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 520px;
    margin-bottom: 32px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 8px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-dim) 100%);
    color: white;
    box-shadow: var(--glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-accent);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.hero-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-meta i { color: var(--accent); font-size: 0.9rem; }

/* Avatar 3D frame */
.hero-visual {
    display: flex;
    justify-content: center;
    perspective: 1000px;
}

.avatar-frame {
    position: relative;
    width: 280px;
    height: 280px;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
}

.avatar-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid;
}

.ring-1 {
    inset: -20px;
    border-color: rgba(59, 130, 246, 0.3);
    animation: ringRotate 12s linear infinite;
}

.ring-2 {
    inset: -40px;
    border-color: rgba(34, 211, 238, 0.15);
    animation: ringRotate 18s linear infinite reverse;
}

@keyframes ringRotate { to { transform: rotate(360deg); } }

.avatar-core {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--bg-elevated), var(--bg-panel));
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    color: var(--steel);
    overflow: hidden;
    box-shadow: var(--glow), inset 0 0 60px rgba(59, 130, 246, 0.1);
}

.avatar-core img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-badge {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.1em;
}

.scroll-hint {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    animation: bounce 2s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* Sections */
.section {
    padding: 100px 0;
    position: relative;
}

.section-alt {
    background: linear-gradient(180deg, transparent, rgba(12, 18, 32, 0.6), transparent);
}

.section-header {
    margin-bottom: 56px;
}

.section-tag {
    display: block;
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--text);
}

/* Intro video */
.intro-video-section .section-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 560px;
    margin: -8px auto 0;
}

.video-wrapper {
    max-width: 900px;
    margin: 0 auto;
    perspective: 1000px;
}

.video-frame {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--glow), 0 24px 48px rgba(0, 0, 0, 0.4);
    transition: var(--transition);
}

.video-frame:hover {
    border-color: rgba(34, 211, 238, 0.4);
    box-shadow: var(--glow-accent), 0 28px 56px rgba(0, 0, 0, 0.45);
}

.video-frame iframe,
.video-frame video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    object-fit: cover;
    background: #000;
}

/* About */
.about-grid {
    display: grid;
    gap: 40px;
}

.about-text {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 800px;
    line-height: 1.8;
}

.about-highlights {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.highlight-card {
    padding: 28px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    transform-style: preserve-3d;
}

.highlight-card:hover {
    border-color: rgba(34, 211, 238, 0.4);
    transform: translateY(-4px);
    box-shadow: var(--glow);
}

.highlight-card i {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 16px;
}

.highlight-card h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    margin-bottom: 8px;
}

.highlight-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Experience timeline */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    opacity: 0.4;
}

.exp-card {
    position: relative;
    margin-bottom: 32px;
    padding: 28px 32px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.exp-card::before {
    content: '';
    position: absolute;
    left: -37px;
    top: 32px;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--accent);
}

.exp-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: var(--glow);
}

.exp-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.exp-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
}

.exp-period {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 500;
}

.exp-company {
    color: var(--primary-bright);
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.exp-location {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.exp-highlights {
    list-style: none;
}

.exp-highlights li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.exp-highlights li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* Education */
.edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.edu-card {
    padding: 28px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.edu-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-3px);
}

.edu-degree {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-bright);
    margin-bottom: 6px;
}

.edu-school {
    font-weight: 500;
    margin-bottom: 4px;
}

.edu-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.edu-coursework {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.edu-tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-muted);
}

/* Skills bento */
.skills-bento {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.skill-card {
    padding: 22px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.skill-card:hover {
    border-color: var(--accent);
    box-shadow: var(--glow-accent);
}

.skill-card h3 {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.skill-tag {
    font-size: 0.8rem;
    padding: 5px 12px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 6px;
    color: var(--text);
    transition: var(--transition);
}

.skill-tag:hover {
    background: rgba(34, 211, 238, 0.15);
    border-color: var(--accent);
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.project-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.project-card.has-media .project-card-body {
    padding: 24px 28px 28px;
}

.project-card-body {
    padding: 28px;
}

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity var(--transition);
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: var(--glow);
}

.project-card:hover::after { opacity: 1; }

.project-media {
    position: relative;
    background: #000;
    border-bottom: 1px solid var(--border);
}

.project-media-viewport {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
}

.project-media-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.project-media-slide.active {
    opacity: 1;
    visibility: visible;
}

.project-media-slide iframe,
.project-media-slide video,
.project-media-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    object-fit: cover;
    background: #000;
}

.media-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(6, 10, 18, 0.75);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: var(--transition);
    z-index: 2;
}

.media-nav:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.media-prev { left: 10px; }
.media-next { right: 10px; }

.media-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}

.media-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    padding: 0;
    transition: var(--transition);
}

.media-dot.active,
.media-dot:hover {
    background: var(--accent);
    transform: scale(1.15);
}

.project-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

.project-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.7;
}

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

.tech-tag {
    font-size: 0.72rem;
    padding: 4px 10px;
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 4px;
    color: var(--accent);
    font-family: var(--font-display);
}

.project-links {
    display: flex;
    gap: 12px;
}

.project-link {
    font-size: 0.8rem;
    color: var(--primary-bright);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

.project-link:hover { color: var(--accent); }

/* Certifications */
.certs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.cert-card {
    padding: 28px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition);
}

.cert-card:hover {
    border-color: var(--accent);
    box-shadow: var(--glow-accent);
    transform: scale(1.02);
}

.cert-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--primary), var(--accent-dim));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
}

.cert-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.cert-issuer {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.cert-link {
    font-size: 0.8rem;
    color: var(--accent);
    text-decoration: none;
}

.cert-link:hover { text-decoration: underline; }

/* Contact */
.contact-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
    align-items: center;
}

.contact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    width: 100%;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.contact-card:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.contact-card i {
    font-size: 1.25rem;
    color: var(--accent);
    width: 40px;
    text-align: center;
}

.contact-card h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.contact-card p, .contact-card a {
    font-size: 0.95rem;
    color: var(--text);
    text-decoration: none;
}

.social-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.social-btn {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 1.2rem;
    text-decoration: none;
    transition: var(--transition);
}

.social-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--glow-accent);
}

/* Footer */
.footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

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

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
    grid-column: 1 / -1;
}

/* Responsive */
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; text-align: center; }
    .hero-description { margin-left: auto; margin-right: auto; }
    .hero-actions { justify-content: center; }
    .hero-meta { justify-content: center; }
    .about-highlights { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .hamburger { display: flex; }

    .nav-menu {
        position: fixed;
        top: 64px;
        left: -100%;
        width: 100%;
        flex-direction: column;
        gap: 0;
        background: rgba(6, 10, 18, 0.98);
        padding: 20px 0;
        border-bottom: 1px solid var(--border);
        transition: left var(--transition);
    }

    .nav-menu.active { left: 0; }
    .nav-menu li { padding: 12px 24px; }

    .timeline { padding-left: 24px; }
    .exp-card::before { left: -29px; }

    .projects-grid,
    .skills-bento,
    .certs-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
