/* ==========================================================================
   Hussain Shamkhani — Portfolio
   Design System: Dark mode, premium SaaS aesthetic
   ========================================================================== */

/* --- CSS Variables / Design Tokens --- */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #101018;
    --bg-card: #13131d;
    --bg-card-hover: #181825;
    --border: #1e1e2e;
    --border-light: #2a2a3c;

    --text-primary: #e4e4e7;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --accent-subtle: rgba(59, 130, 246, 0.08);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.1);

    --max-width: 1200px;
    --nav-height: 72px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

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

ul, ol {
    list-style: none;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

h4 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

p {
    color: var(--text-secondary);
}

/* --- Layout --- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

section {
    padding: 100px 0;
}

/* --- Section Headers --- */
.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 64px;
}

.section-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-subtle);
    border: 1px solid rgba(59, 130, 246, 0.15);
    padding: 6px 16px;
    border-radius: 100px;
    margin-bottom: 20px;
    letter-spacing: 0.02em;
}

.section-header h2 {
    margin-bottom: 16px;
}

.section-header p {
    font-size: 1.1rem;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-light);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-subtle);
    transform: translateY(-1px);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1rem;
}

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: 1000;
    transition: all 0.3s ease;
    background: transparent;
}

.nav.scrolled {
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    padding: 8px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

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

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

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

.nav-cta {
    background: var(--accent);
    color: #fff !important;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.nav-cta:hover {
    background: var(--accent-hover);
    color: #fff !important;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

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

.hero-badge {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 24px;
    letter-spacing: 0.02em;
}

.hero h1 {
    margin-bottom: 24px;
}

.text-accent {
    color: var(--accent);
}

.hero-sub {
    font-size: 1.2rem;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 640px;
    margin-bottom: 40px;
}

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

.hero-proof {
    display: flex;
    align-items: center;
    gap: 32px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.hero-proof-item strong {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.hero-proof-item span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.hero-proof-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
}

/* --- Proof / Metrics --- */
.proof {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    text-align: center;
    transition: all 0.3s ease;
}

.metric-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}

.metric-icon {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 20px;
}

.metric-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1;
    display: inline;
}

.metric-suffix {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.metric-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 12px;
}

/* --- Projects --- */
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px;
    margin-bottom: 32px;
    transition: all 0.3s ease;
}

.project-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.project-header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 36px;
}

.project-number {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-subtle);
    border: 1px solid rgba(59, 130, 246, 0.15);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.project-meta h3 {
    font-size: 1.35rem;
    margin-bottom: 12px;
}

.project-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.project-tags span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 100px;
}

.project-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.project-detail h4 {
    margin-bottom: 10px;
}

.project-detail p {
    font-size: 0.95rem;
    line-height: 1.7;
}

/* --- Services --- */
.services {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    transition: all 0.3s ease;
}

.service-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}

.service-icon {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 20px;
}

.service-card h3 {
    margin-bottom: 16px;
}

.service-card p {
    font-size: 0.95rem;
}

/* --- About --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 64px;
    align-items: center;
}

.about-image img {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    aspect-ratio: 4/5;
    object-fit: cover;
    object-position: center top;
    width: 100%;
}

.about-content .section-tag {
    margin-bottom: 16px;
}

.about-content h2 {
    margin-bottom: 24px;
}

.about-content p {
    margin-bottom: 16px;
    font-size: 1.05rem;
}

.about-highlights {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.about-highlight {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.about-highlight i {
    color: var(--accent);
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* --- Tech Stack --- */
.stack {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.stack-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.stack-category {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.stack-category h3 {
    margin-bottom: 20px;
    font-size: 1rem;
}

.stack-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stack-item {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.stack-item:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* --- CTA --- */
.cta {
    text-align: center;
    padding: 120px 0;
}

.cta h2 {
    margin-bottom: 16px;
}

.cta > .container > .cta-content > p {
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto 40px;
}

.cta-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.cta-secondary {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.cta-secondary a {
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.cta-secondary a:hover {
    color: var(--accent);
}

.cta-secondary i {
    margin-right: 6px;
}

.cta-divider {
    color: var(--border-light);
}

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

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: color 0.2s ease;
}

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

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 24px;
    text-align: center;
}

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

/* --- Animations --- */
.animate-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.metrics-grid .animate-in:nth-child(2),
.services-grid .animate-in:nth-child(2),
.stack-grid .animate-in:nth-child(2) {
    transition-delay: 0.1s;
}

.metrics-grid .animate-in:nth-child(3),
.services-grid .animate-in:nth-child(3),
.stack-grid .animate-in:nth-child(3) {
    transition-delay: 0.2s;
}

.metrics-grid .animate-in:nth-child(4),
.stack-grid .animate-in:nth-child(4) {
    transition-delay: 0.3s;
}

/* --- Responsive --- */
@media screen and (max-width: 1024px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stack-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .project-body {
        grid-template-columns: 1fr;
        gap: 24px;
    }

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

    .about-image {
        max-width: 400px;
    }
}

@media screen and (max-width: 768px) {
    section {
        padding: 72px 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: rgba(10, 10, 15, 0.98);
        backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 24px;
        gap: 16px;
        border-bottom: 1px solid var(--border);
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s ease;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-cta {
        width: 100%;
        text-align: center;
    }

    .hero {
        min-height: auto;
        padding: 120px 0 60px;
    }

    .hero-proof {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .hero-proof-divider {
        width: 40px;
        height: 1px;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .stack-grid {
        grid-template-columns: 1fr;
    }

    .project-card {
        padding: 28px;
    }

    .project-header {
        flex-direction: column;
        gap: 12px;
    }

    .cta-actions {
        flex-direction: column;
        align-items: center;
    }

    .cta-secondary {
        flex-direction: column;
        gap: 8px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

@media screen and (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .hero-sub {
        font-size: 1.05rem;
    }

    .btn-lg {
        padding: 14px 24px;
        font-size: 0.9rem;
    }

    .metric-card {
        padding: 28px 20px;
    }

    .metric-number {
        font-size: 2.25rem;
    }
}

/* --- Selection --- */
::selection {
    background: var(--accent);
    color: #fff;
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
