/* ========================================
   CSS Variables & Reset
   ======================================== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --accent: #f59e0b;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --bg-dark: #0f172a;
    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::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, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

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

ul {
    list-style: none;
}

/* ========================================
   Utilities
   ======================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-tag {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.2;
}

.section-desc {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 560px;
    margin: 0 auto;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

.btn-full {
    width: 100%;
}

.btn-nav {
    padding: 10px 24px;
    font-size: 0.875rem;
}

/* ========================================
   Navbar
   ======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px 0;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    padding: 12px 0;
    box-shadow: var(--shadow);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -1px;
}

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

.navbar:not(.scrolled) .logo {
    color: #fff;
}

.navbar:not(.scrolled) .logo span {
    color: var(--accent);
}

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

.nav-links a {
    padding: 8px 16px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-light);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

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

.navbar:not(.scrolled) .nav-links a {
    color: rgba(255, 255, 255, 0.8);
}

.navbar:not(.scrolled) .nav-links a:hover {
    color: #fff;
}

.navbar:not(.scrolled) .btn-nav {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.navbar:not(.scrolled) .btn-nav:hover {
    background: #fff;
    color: var(--primary);
    border-color: #fff;
}

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

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

.navbar:not(.scrolled) .nav-toggle span {
    background: #fff;
}

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

.hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    z-index: -2;
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(37, 99, 235, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 80%, rgba(245, 158, 11, 0.08) 0%, transparent 50%);
}

.hero-content {
    position: relative;
    z-index: 1;
    padding-top: 80px;
}

.hero-greeting {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: rgba(255, 255, 255, 0.7);
    max-width: 560px;
    margin-bottom: 40px;
    line-height: 1.7;
}

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

.hero-actions .btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.hero-actions .btn-outline {
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.hero-actions .btn-outline:hover {
    background: #fff;
    color: var(--text);
    border-color: #fff;
}

.hero-stats {
    display: flex;
    gap: 48px;
}

.stat {
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.4), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.4; height: 40px; }
    50% { opacity: 1; height: 60px; }
}

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

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

.about-photo {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    object-position: center top;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
}

.about-text {
    font-size: 1.0625rem;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.8;
}

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

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

.highlight-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.highlight h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.highlight p {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* ========================================
   Services
   ======================================== */
.services {
    background: var(--bg-alt);
}

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

.services-grid .service-card:nth-child(4),
.services-grid .service-card:nth-child(5) {
    /* Center the last two cards in a 3-col grid */
}

@media (min-width: 769px) and (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.service-card {
    background: var(--bg);
    padding: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
}

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

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    width: 56px;
    height: 56px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 24px;
}

.service-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.service-card p {
    font-size: 0.9375rem;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 20px;
}

.service-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    transition: var(--transition);
}

.service-link:hover {
    gap: 4px;
}

/* ========================================
   Portfolio
   ======================================== */
.portfolio {
    background: var(--bg);
}

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

.portfolio-card {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
    background: var(--bg);
}

.portfolio-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

.portfolio-image {
    height: 220px;
    position: relative;
    overflow: hidden;
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.2);
    display: flex;
    align-items: flex-end;
    padding: 20px;
    transition: var(--transition);
}

.portfolio-card:hover .portfolio-overlay {
    background: rgba(0,0,0,0.4);
}

.portfolio-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.portfolio-info {
    padding: 24px;
}

.portfolio-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.portfolio-info p {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* ========================================
   Hobbies / Gallery
   ======================================== */
.hobbies {
    background: var(--bg-alt);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 240px;
    gap: 16px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
}

.gallery-item-wide {
    grid-column: span 2;
}

.gallery-item-tall {
    grid-row: span 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: #fff;
    opacity: 0;
}

.gallery-item:hover .gallery-overlay {
    background: rgba(15, 23, 42, 0.4);
    opacity: 1;
}

.gallery-overlay svg {
    transform: scale(0.8);
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay svg {
    transform: scale(1);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    animation: lightboxFadeIn 0.3s ease;
}

@keyframes lightboxFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 2001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 2001;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lightbox-prev {
    left: 24px;
}

.lightbox-next {
    right: 24px;
}

.lightbox-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 1px;
}

/* ========================================
   Contact
   ======================================== */
.contact {
    background: var(--bg);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 64px;
    align-items: start;
}

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

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

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

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

.contact-item p {
    font-size: 0.9375rem;
    color: var(--text-light);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

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

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

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

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--bg-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 64px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand .logo {
    color: #fff;
    margin-bottom: 12px;
    display: inline-block;
}

.footer-brand p {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.7;
}

.footer-links h4,
.footer-social h4 {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.5);
    transition: var(--transition);
}

.footer-links a:hover {
    color: #fff;
}

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

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding: 24px 0;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.3);
}

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

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

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

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

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 200px;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
        z-index: 1001;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg);
        flex-direction: column;
        align-items: flex-start;
        padding: 100px 32px 32px;
        gap: 4px;
        box-shadow: var(--shadow-xl);
        transition: var(--transition);
    }

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

    .nav-links a {
        color: var(--text) !important;
        width: 100%;
        padding: 12px 16px;
    }

    .hero-stats {
        gap: 32px;
    }

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

    .about-photo {
        aspect-ratio: 16/9;
        max-height: 300px;
    }

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

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

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 180px;
    }

    .gallery-item-wide {
        grid-column: span 2;
    }

    .gallery-item-tall {
        grid-row: span 1;
    }

    .lightbox-prev {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }

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

    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .section {
        padding: 72px 0;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.25rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 24px;
    }

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

    .hero-actions .btn {
        width: 100%;
    }

    .stat-number {
        font-size: 2rem;
    }

    .service-card {
        padding: 28px;
    }
}

/* ========================================
   Form Error Message
   ======================================== */
.form-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.875rem;
    margin-bottom: 16px;
    animation: fadeInError 0.3s ease;
}

@keyframes fadeInError {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
