/* ============================================================
   SARAL SINGH — PREMIUM PORTFOLIO
   Design: Minimal · Editorial · Technical · Quiet Confidence
   ============================================================ */

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

:root {
    --bg: #F7F7F5;
    --bg-elevated: #FFFFFF;
    --text-primary: #111111;
    --text-secondary: #6B6B6B;
    --text-tertiary: #999999;
    --accent: #2D2D2D;
    --accent-hover: #3A3D5C;
    --accent-blue: #4A5568;
    --border: rgba(0, 0, 0, 0.06);
    --border-strong: rgba(0, 0, 0, 0.1);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --nav-height: 72px;
    --section-gap: 160px;
    --container-max: 1200px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    font-size: 18px;
    line-height: 1.7;
    overflow-x: hidden;
}

::selection {
    background: var(--accent);
    color: white;
}

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

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

/* --- CONTAINER --- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 48px;
}

/* --- TYPOGRAPHY --- */
.label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 20px;
    display: block;
}

.heading-xl {
    font-size: clamp(56px, 8vw, 110px);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.035em;
    color: var(--text-primary);
}

.heading-lg {
    font-size: clamp(36px, 4.5vw, 56px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.heading-md {
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.heading-sm {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.body-lg {
    font-size: 20px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.body-md {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.micro {
    font-size: 13px;
    color: var(--text-tertiary);
    letter-spacing: 0.01em;
}

/* --- NAVBAR --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: all 0.5s var(--ease-out);
    background: transparent;
}

.navbar.scrolled {
    background: rgba(247, 247, 245, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

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

.nav-brand {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 40px;
    list-style: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    letter-spacing: 0.01em;
}

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

.nav-right {
    flex-shrink: 0;
}

.btn-resume {
    font-size: 13px;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 100px;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-resume:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

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

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

/* --- HERO SECTION --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: var(--nav-height);
    overflow: hidden;
}

.hero-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.7;
    pointer-events: none;
}

.hero-layout {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 64px;
    position: relative;
    z-index: 1;
}

.hero-content {
    flex: 1;
    max-width: 640px;
    padding: 100px 0;
}

.hero-image {
    flex-shrink: 0;
    padding-top: 140px;
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    animation: fadeScale 1s var(--ease-out) 0.5s forwards;
}

.hero-image-wrapper {
    width: 280px;
    height: 280px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.06);
}

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

.hero-content .label {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s var(--ease-out) 0.2s forwards;
}

.hero-content .heading-xl {
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s var(--ease-out) 0.4s forwards;
}

.hero-subheading {
    max-width: 560px;
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s var(--ease-out) 0.6s forwards;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s var(--ease-out) 0.8s forwards;
}

.btn-primary-cta {
    font-size: 15px;
    font-weight: 600;
    padding: 16px 36px;
    border-radius: 100px;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.01em;
}

.btn-primary-cta:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.btn-primary-cta .arrow {
    transition: transform 0.3s var(--ease-out);
    font-size: 18px;
}

.btn-primary-cta:hover .arrow {
    transform: translateX(4px);
}

.btn-secondary-cta {
    font-size: 15px;
    font-weight: 500;
    padding: 16px 36px;
    border-radius: 100px;
    background: transparent;
    color: var(--text-primary);
    border: 1.5px solid var(--border-strong);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary-cta:hover {
    border-color: var(--text-primary);
    background: var(--text-primary);
    color: white;
}

/* --- SECTION LAYOUT --- */
.section {
    padding: var(--section-gap) 0;
}

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

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

.section-divider {
    width: 100%;
    height: 1px;
    background: var(--border);
}

/* --- ABOUT SECTION --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
}

.about-text p {
    margin-bottom: 24px;
}

.about-text p:last-child {
    margin-bottom: 0;
}

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

.detail-block {
    padding: 28px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: all 0.3s var(--ease-out);
}

.detail-block:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.04);
}

.detail-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.detail-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

/* --- PROJECTS SECTION --- */
.projects-grid {
    display: grid;
    gap: 24px;
}

.project-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.4s var(--ease-out);
    cursor: default;
}

.project-card:hover {
    border-color: var(--border-strong);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.06);
    transform: translateY(-4px);
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.project-info {
    padding: 40px;
    display: flex;
    flex-direction: column;
}

.project-number {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    font-variant-numeric: tabular-nums;
}

.project-info .heading-md {
    margin-bottom: 16px;
}

.project-desc {
    margin-bottom: 24px;
}

.project-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.stack-tag {
    font-size: 12px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 100px;
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    letter-spacing: 0.02em;
}

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

.project-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 100px;
    border: 1px solid var(--border-strong);
    transition: all 0.3s var(--ease-out);
}

.project-link:hover {
    background: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
}

/* --- SKILLS SECTION --- */
.skills-table {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-elevated);
}

.skill-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    align-items: center;
    gap: 0;
    padding: 24px 36px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

.skill-row:last-child {
    border-bottom: none;
}

.skill-row:hover {
    background: var(--bg);
}

.skill-category-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

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

.skill-pill {
    font-size: 13px;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 100px;
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
}

.skill-pill:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.skill-pill--accent {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.skill-pill--accent:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

/* --- EDUCATION SECTION --- */
.education-list {
    display: grid;
    gap: 24px;
    max-width: 700px;
}

.edu-item {
    padding: 36px 40px;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 32px;
    transition: all 0.3s var(--ease-out);
}

.edu-item:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.04);
}

.edu-degree {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.edu-school {
    font-size: 15px;
    color: var(--text-secondary);
}

.edu-year {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-tertiary);
    white-space: nowrap;
    padding: 6px 16px;
    background: var(--bg);
    border-radius: 100px;
    flex-shrink: 0;
}

/* --- CONTACT SECTION --- */
.contact-content {
    max-width: 600px;
}

.contact-content .heading-lg {
    margin-bottom: 24px;
}

.contact-content .body-lg {
    margin-bottom: 48px;
}

.contact-email {
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 600;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
    border-bottom: 2px solid var(--border);
    transition: all 0.3s var(--ease-out);
    margin-bottom: 48px;
    letter-spacing: -0.02em;
}

.contact-email:hover {
    border-color: var(--text-primary);
}

.contact-email .arrow-link {
    font-size: 24px;
    transition: transform 0.3s var(--ease-out);
}

.contact-email:hover .arrow-link {
    transform: translate(4px, -4px);
}

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

.social-link {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-secondary);
    transition: all 0.3s var(--ease-out);
}

.social-link:hover {
    background: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
    transform: translateY(-2px);
}

/* SVG icons inside social links */
.social-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* --- FOOTER --- */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--border);
}

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

.footer-left {
    font-size: 14px;
    color: var(--text-tertiary);
}

.footer-right {
    display: flex;
    gap: 32px;
}

.footer-right a {
    font-size: 13px;
    color: var(--text-tertiary);
    transition: color 0.3s ease;
}

.footer-right a:hover {
    color: var(--text-primary);
}

/* --- SCROLL REVEAL --- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s var(--ease-out);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- ANIMATIONS --- */
@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeScale {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .container {
        padding: 0 32px;
    }

    .hero-layout {
        flex-direction: column-reverse;
        text-align: center;
        gap: 40px;
    }

    .hero-content {
        max-width: 100%;
        padding: 40px 0 80px;
    }

    .hero-subheading {
        margin-left: auto;
        margin-right: auto;
    }

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

    .hero-image-wrapper {
        width: 200px;
        height: 200px;
    }

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

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

    .skill-row {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 20px 28px;
    }
}

/* --- BODY SCROLL LOCK (mobile nav open) --- */
body.nav-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    :root {
        --section-gap: 100px;
    }

    .container {
        padding: 0 24px;
    }

    /* Mobile nav */
    .nav-toggle {
        display: flex;
        z-index: 9999;
        position: relative;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: var(--bg);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 32px;
        transform: translateX(100%);
        transition: transform 0.5s var(--ease-out);
        z-index: 9998;
    }

    .nav-links.open {
        transform: translateX(0);
    }

    .nav-links a {
        font-size: 24px;
        font-weight: 600;
    }

    .nav-right {
        display: none;
    }

    .hero-content {
        padding: 20px 0 60px;
    }

    .hero-image {
        display: flex;
        justify-content: center;
        padding-top: 0;
        width: 100%;
    }

    .hero-image-wrapper {
        width: 160px;
        height: 160px;
    }

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

    .about-details {
        grid-template-columns: 1fr;
    }

    .project-info {
        padding: 32px;
    }

    .skill-row {
        padding: 16px 20px;
    }

    .skill-category-label {
        font-size: 11px;
    }
    .edu-item {
        flex-direction: column;
        gap: 12px;
        padding: 28px;
    }

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

@media (max-width: 480px) {
    .skill-pill {
        font-size: 12px;
        padding: 5px 12px;
    }
}
