/* ============================================
   ADARSHA ARYAL — PORTFOLIO STYLES
   ============================================ */

/* --- Custom Properties --- */
:root {
    --color-bg: #ffffff;
    --color-bg-alt: #f8f9fa;
    --color-text: #1a1a2e;
    --color-text-muted: #6b7280;
    --color-heading: #0f172a;
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-light: #eff6ff;
    --color-border: #e5e7eb;

    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;

    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 3rem;
    --space-xl: 5rem;
    --space-2xl: 8rem;

    --max-width: 1100px;
    --nav-height: 64px;

    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

ul {
    list-style: none;
}

/* --- Typography --- */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--color-heading);
    line-height: 1.2;
    font-weight: 700;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.125rem, 2vw, 1.35rem); }
h4 { font-size: 1.125rem; }

/* --- Layout --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

section {
    padding: var(--space-xl) 0;
}

.section-title {
    margin-bottom: var(--space-lg);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--color-primary);
    margin-top: var(--space-xs);
    border-radius: 2px;
}

.subsection-title {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-md);
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: 1000;
    transition: background-color var(--transition-base), box-shadow var(--transition-base);
}

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

.navbar--scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-sm);
}

.nav-logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--color-heading);
    letter-spacing: 0.04em;
}

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

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

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

.nav-list {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

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

.nav-link:hover,
.nav-link--active {
    color: var(--color-primary);
}

.nav-link--active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--color-primary);
    border-radius: 1px;
}

.nav-resume-btn {
    border: 1.5px solid var(--color-primary);
    color: var(--color-primary);
    padding: 0.4rem 1rem;
    border-radius: 5px;
    transition: all var(--transition-fast);
}

.nav-resume-btn:hover {
    background-color: var(--color-primary);
    color: #ffffff;
}

/* Hamburger */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-heading);
    margin: 5px 0;
    border-radius: 2px;
    transition: all var(--transition-base);
}

.nav-toggle--active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

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

.nav-toggle--active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

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

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 99, 235, 0.1), transparent),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(37, 99, 235, 0.05), transparent),
        radial-gradient(ellipse 40% 30% at 10% 80%, rgba(37, 99, 235, 0.03), transparent);
    z-index: 0;
}

.hero-content {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
    gap: var(--space-lg);
    position: relative;
    z-index: 1;
}

.hero-text {
    flex: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: 20px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: var(--space-md);
}

.hero-name {
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

/* Typing effect */
.hero-typed {
    font-family: var(--font-heading);
    font-size: clamp(1.15rem, 2.5vw, 1.5rem);
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
    line-height: 1.5;
    min-height: 2.3em;
}

.hero-typed-rotate {
    color: var(--color-primary);
    font-weight: 600;
}

.hero-typed-cursor {
    color: var(--color-primary);
    font-weight: 300;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-summary {
    max-width: 560px;
    margin: 0 auto var(--space-lg);
    color: var(--color-text-muted);
    font-size: 1.05rem;
    line-height: 1.8;
}

.hero-cta {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--space-lg);
}

.hero-social {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
}

.hero-social a {
    color: var(--color-text-muted);
    padding: 0.5rem;
    border-radius: 50%;
    transition: color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

.hero-social a:hover {
    color: var(--color-primary);
    background-color: var(--color-primary-light);
    transform: translateY(-2px);
}

/* Hero Image */
.hero-image {
    flex-shrink: 0;
}

.hero-image-wrapper {
    position: relative;
    width: 220px;
    height: 220px;
    animation: float 6s ease-in-out infinite;
}

.hero-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--color-bg);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.hero-image-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px dashed var(--color-primary);
    opacity: 0.3;
    animation: spin 20s linear infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

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

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border-radius: 6px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-base);
    border: 2px solid transparent;
}

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

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-outline:hover {
    background-color: var(--color-primary);
    color: #ffffff;
    transform: translateY(-2px);
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.05rem;
}

/* ============================================
   ABOUT
   ============================================ */
.about {
    background-color: var(--color-bg-alt);
}

.about-content {
    max-width: 700px;
    margin-bottom: var(--space-lg);
}

.about-content p {
    margin-bottom: var(--space-sm);
    color: var(--color-text-muted);
    font-size: 1.05rem;
    line-height: 1.8;
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.skill-category h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--color-heading);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.skill-tag {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: var(--font-heading);
}

/* ============================================
   EXPERIENCE & EDUCATION
   ============================================ */
.timeline {
    position: relative;
    padding-left: 2rem;
    margin-bottom: var(--space-lg);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--color-border);
}

.timeline-item {
    position: relative;
    margin-bottom: var(--space-lg);
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -2.35rem;
    top: 0.35rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--color-primary);
    border: 2px solid var(--color-bg);
    box-shadow: 0 0 0 2px var(--color-primary);
}

.timeline-header h4 {
    margin-bottom: 0.15rem;
}

.timeline-company {
    color: var(--color-primary);
    font-weight: 500;
    font-size: 1rem;
}

.timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin: 0.35rem 0 0.75rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.timeline-details {
    list-style: disc;
    padding-left: 1.25rem;
}

.timeline-details li {
    margin-bottom: 0.4rem;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Education */
.education-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.education-card {
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: var(--space-md);
    transition: box-shadow var(--transition-base);
}

.education-card:hover {
    box-shadow: var(--shadow-md);
}

.education-icon {
    color: var(--color-primary);
    margin-bottom: var(--space-xs);
}

.education-card h4 {
    margin-bottom: 0.25rem;
}

.education-institution {
    color: var(--color-primary);
    font-weight: 500;
    font-size: 0.95rem;
}

.education-date {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin: 0.2rem 0;
}

.education-focus {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* ============================================
   PROJECTS
   ============================================ */
.projects {
    background-color: var(--color-bg-alt);
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.project-card {
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-sm);
}

.project-folder {
    color: var(--color-primary);
}

.project-links {
    display: flex;
    gap: var(--space-xs);
}

.project-links a {
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

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

.project-title {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.project-description {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: var(--space-sm);
    flex-grow: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: auto;
}

.project-tech span {
    font-size: 0.8rem;
    color: var(--color-primary);
    background-color: var(--color-primary-light);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-weight: 500;
}

/* ============================================
   CONTACT
   ============================================ */
.contact {
    text-align: center;
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
}

.contact .section-title {
    display: block;
}

.contact .section-title::after {
    margin: var(--space-xs) auto 0;
}

.contact-text {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: var(--space-md);
}

.contact-details {
    margin-top: var(--space-md);
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.contact-details p {
    margin-bottom: 0.25rem;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    padding: var(--space-lg) 0;
    text-align: center;
    border-top: 1px solid var(--color-border);
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.footer-social a {
    color: var(--color-text-muted);
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.footer-social a:hover {
    color: var(--color-primary);
    transform: translateY(-2px);
}

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

/* ============================================
   ANIMATIONS
   ============================================ */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
                transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Stagger hero text elements */
.hero-text > .fade-in:nth-child(1) { transition-delay: 200ms; }
.hero-text > .fade-in:nth-child(2) { transition-delay: 350ms; }
.hero-text > .fade-in:nth-child(3) { transition-delay: 500ms; }
.hero-text > .fade-in:nth-child(4) { transition-delay: 650ms; }
.hero-text > .fade-in:nth-child(5) { transition-delay: 800ms; }
.hero-text > .fade-in:nth-child(6) { transition-delay: 950ms; }

/* Hero image appears first */
.hero-image.fade-in { transition-delay: 0ms; }

/* Project cards stagger within grid */
.projects-grid > .fade-in:nth-child(1) { transition-delay: 0ms; }
.projects-grid > .fade-in:nth-child(2) { transition-delay: 100ms; }
.projects-grid > .fade-in:nth-child(3) { transition-delay: 200ms; }
.projects-grid > .fade-in:nth-child(4) { transition-delay: 300ms; }

/* Skill tags slide in */
.skill-tag {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.skill-tag:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* --- Mobile menu --- */
@media (max-width: 767px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--color-bg);
        box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
        padding: calc(var(--nav-height) + var(--space-md)) var(--space-md) var(--space-md);
        transition: right var(--transition-base);
        z-index: 999;
    }

    .nav-menu--open {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        gap: var(--space-md);
    }

    .nav-link {
        font-size: 1rem;
    }
}

/* --- Tablet (768px+) --- */
@media (min-width: 768px) {
    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
    }

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

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

/* --- Tablet (768px) hero image --- */
@media (min-width: 768px) and (max-width: 1023px) {
    .hero-image-wrapper {
        width: 260px;
        height: 260px;
    }
}

/* --- Desktop (1024px+) --- */
@media (min-width: 1024px) {
    section {
        padding: var(--space-2xl) 0;
    }

    .hero-content {
        flex-direction: row;
        text-align: left;
        align-items: center;
    }

    .hero-summary {
        margin-left: 0;
    }

    .hero-cta {
        justify-content: flex-start;
    }

    .hero-social {
        justify-content: flex-start;
    }

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

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

    html {
        scroll-behavior: auto;
    }

    .fade-in {
        opacity: 1;
        transform: none;
    }

    .hero-image-wrapper,
    .hero-image-ring {
        animation: none;
    }
}
