/* ===== CSS Custom Properties ===== */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --bg-card-hover: #222230;
    --text-primary: #e8e8ed;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;
    --accent: #6c63ff;
    --accent-light: #8b85ff;
    --accent-dark: #4d47cc;
    --accent2: #ff6b6b;
    --accent3: #4ecdc4;
    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1100px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

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

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

ul {
    list-style: none;
}

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

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

.section {
    padding: 100px 0;
}

/* ===== Accessibility ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: -60px;
    left: 16px;
    background: var(--accent);
    color: #fff;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    z-index: 2000;
    transition: top var(--transition);
}

.skip-link:focus {
    top: 16px;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ===== Section Titles ===== */
.section-title {
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 700;
    margin-bottom: 16px;
    text-align: center;
}

.section-title span {
    color: var(--accent);
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 17px;
    margin-bottom: 56px;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 16px 0;
    transition: background var(--transition), box-shadow var(--transition);
}

.navbar.scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border);
}

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

.nav-logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -1px;
    transition: color var(--transition);
}

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

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

.nav-link {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition);
    position: relative;
}

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

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

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

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

.mobile-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

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

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

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

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(108, 99, 255, 0.35);
}

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

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

.btn-small {
    font-size: 13px;
    padding: 8px 18px;
}

.btn-full {
    width: 100%;
}

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

.hero-content {
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 2;
}

.hero-greeting {
    font-size: 18px;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 12px;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.hero-name {
    font-size: clamp(36px, 7vw, 72px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.15s forwards;
}

.hero-dot {
    color: var(--accent);
}

.hero-typing {
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 24px;
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.3s forwards;
    min-height: 36px;
}

.static-text {
    color: var(--text-secondary);
}

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

.cursor {
    color: var(--accent);
    animation: blink 0.8s infinite;
}

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

.hero-tagline {
    font-size: 17px;
    color: var(--text-muted);
    max-width: 540px;
    margin-bottom: 36px;
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.45s forwards;
}

.hero-cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.6s forwards;
}

.hero-socials {
    display: flex;
    gap: 20px;
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.75s forwards;
}

.social-link {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    transition: all var(--transition);
}

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

.social-link:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.25);
}

/* Hero Visual */
.hero-visual {
    position: absolute;
    right: -100px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    pointer-events: none;
}

.hero-shape {
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(108, 99, 255, 0.12) 0%, transparent 70%);
    opacity: 0.6;
}

/* ===== About Section ===== */
.about {
    background: var(--bg-secondary);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-image {
    display: flex;
    justify-content: center;
}

.image-placeholder {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-card-hover));
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.image-placeholder::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    z-index: -1;
    opacity: 0.3;
}

.placeholder-icon {
    width: 100px;
    height: 100px;
    color: var(--text-muted);
    opacity: 0.5;
}

.about-text h3 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 20px;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 16px;
}

.about-stats {
    display: flex;
    gap: 40px;
    margin-top: 32px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 36px;
    font-weight: 800;
    color: var(--accent);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.highlight {
    color: var(--accent-light);
    font-weight: 500;
}

/* ===== Skills Section ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.skill-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 32px;
    text-align: center;
    transition: all var(--transition);
}

.skill-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.skill-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(108, 99, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--accent);
}

.skill-icon svg {
    width: 28px;
    height: 28px;
}

.skill-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.skill-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

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

.skill-tags span {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.skill-tags span:hover {
    background: rgba(108, 99, 255, 0.12);
    border-color: var(--accent);
    color: var(--accent-light);
}

/* ===== Projects Section ===== */
.projects {
    background: var(--bg-secondary);
}

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

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

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

.project-image {
    height: 180px;
    overflow: hidden;
    flex-shrink: 0;
}

.project-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.15), rgba(108, 99, 255, 0.05));
}

.project-placeholder svg {
    width: 48px;
    height: 48px;
    color: var(--accent);
    opacity: 0.6;
}

.project-placeholder.accent2 {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(255, 107, 107, 0.05));
}

.project-placeholder.accent2 svg {
    color: var(--accent2);
}

.project-placeholder.accent3 {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.15), rgba(78, 205, 196, 0.05));
}

.project-placeholder.accent3 svg {
    color: var(--accent3);
}

.project-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.project-info p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.6;
}

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

.project-tech span {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 16px;
    background: rgba(108, 99, 255, 0.1);
    color: var(--accent-light);
}

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

.project-status {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 16px;
    background: rgba(78, 205, 196, 0.12);
    color: var(--accent3);
}

/* ===== Blog Section ===== */
.blog {
    background: var(--bg-primary);
}

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

.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

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

.blog-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.blog-tag {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(108, 99, 255, 0.12);
    color: var(--accent-light);
}

.blog-date {
    font-size: 12px;
    color: var(--text-muted);
}

.blog-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.blog-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.blog-read {
    margin-top: auto;
    padding-top: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-light);
    transition: color var(--transition);
}

.blog-card:hover .blog-read {
    color: var(--accent);
}

/* ===== Contact Section ===== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 48px;
    align-items: start;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.contact-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.contact-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(108, 99, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--accent);
}

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

.contact-item h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.contact-item p {
    font-size: 14px;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.contact-link {
    transition: color var(--transition);
}

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

.contact-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 32px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    transition: all var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 40px 0;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -1px;
}

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

.footer-socials {
    display: flex;
    gap: 16px;
}

.footer-socials a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all var(--transition);
}

.footer-socials a svg {
    width: 16px;
    height: 16px;
}

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

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ===== Toast Notification ===== */
.toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 3.7s forwards;
    max-width: 360px;
}

.toast-error {
    border-color: var(--accent2);
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* ===== Responsive Design ===== */
@media (max-width: 968px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-image {
        order: -1;
    }

    .image-placeholder {
        width: 200px;
        height: 200px;
    }

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

    .blog-grid {
        grid-template-columns: 1fr;
        max-width: 560px;
        margin: 0 auto;
    }

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

    .skills-grid {
        grid-template-columns: 1fr;
        max-width: 480px;
        margin: 0 auto;
    }

    .hero-visual {
        display: none;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 260px;
        height: 100vh;
        flex-direction: column;
        background: var(--bg-secondary);
        padding: 100px 32px 32px;
        gap: 24px;
        transition: right var(--transition);
        border-left: 1px solid var(--border);
    }

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

    .mobile-toggle {
        display: flex;
    }
}

@media (max-width: 640px) {
    .section {
        padding: 72px 0;
    }

    .hero {
        padding: 100px 20px 60px;
    }

    .hero-typing {
        min-height: 68px;
    }

    .static-text {
        display: block;
        margin-bottom: 4px;
    }

    .hero-cta {
        flex-direction: column;
    }

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

    .projects-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .about-stats {
        gap: 24px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .stat-number {
        font-size: 28px;
    }

    .contact-form {
        padding: 20px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero-greeting,
    .hero-name,
    .hero-typing,
    .hero-tagline,
    .hero-cta,
    .hero-socials {
        opacity: 1;
        animation: none;
    }

    .cursor {
        animation: none;
    }

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