@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');

/* CSS Variables & Theme */
:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --secondary-text: #666666;
    --border-color: #e5e5e5;
    --accent-color: #333333;
    --spacing-unit: 1rem;
    --container-width: 1400px;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-speed: 0.4s;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
}

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed) ease;
}

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

/* Layout Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.flex {
    display: flex;
}

.grid {
    display: grid;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

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

.gap-1 {
    gap: 1rem;
}

.gap-2 {
    gap: 2rem;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1 {
    font-size: 3.5rem;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 1.75rem;
}

.text-small {
    font-size: 0.875rem;
    color: var(--secondary-text);
}

.text-uppercase {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 0;
    z-index: 1000;
    background: transparent;
    /* Initially transparent */
    backdrop-filter: none;
    /* No blur initially */
    border-bottom: 1px solid transparent;
    transition: var(--transition-speed);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    /* White on scroll */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    /* Optional shadow */
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 3rem;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 1px;
    background: var(--text-color);
    transition: width var(--transition-speed) ease;
}

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

.logo {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

/* Hero Section */
/* Hero Section */
.hero-scroll-wrapper {
    height: 100vh;
    /* Full viewport height */
    position: relative;
    z-index: 10;
    border: none;
    background: #fff;
    margin: 0;
    padding: 0;
}

.hero {
    height: 100vh;
    width: 100%;
    position: relative;
    /* Back to relative */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* ensure canvas behind is visible */
    background: #fff;
    border: none;
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* Dark Overlay on Canvas - REMOVED */
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background: rgba(0, 0, 0, 0.4); Removed fade */
    z-index: 1;
    pointer-events: none;
    display: none;
}

.hero-content {
    color: #000;
    /* Text changed to black */
    text-align: center;
    z-index: 10;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-logo-container {
    width: 80%;
    max-width: 400px;
    /* Reduced from 600px */
    margin-bottom: 2rem;
}

.hero-logo-main {
    width: 100%;
    height: auto;
    /* Invert removed */
    display: block;
    margin-bottom: 0.5rem;
}

.hero-subtitle-spread {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    width: 100%;
    /* Shift center left to align with logo text portion */
    padding-right: 3rem;
    box-sizing: border-box;
    /* Ensure padding inside width */
    color: #000;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    font-weight: 600;
}

@media (max-width: 768px) {
    .hero-content {
        height: 100vh;
        justify-content: center;
        /* Keep logo centered vertically */
        align-items: flex-start;
        /* Left-align all content */
        padding: 4rem 1rem;
        /* Balanced padding */
        box-sizing: border-box;
    }

    .hero-logo-container {
        width: 90%;
        /* Use more screen width */
        max-width: none;
        /* Remove max-width restriction */
        margin: 0 0 0 0;
        /* Remove margins */
    }

    .hero-subtitle-spread {
        font-size: 0.85rem;
        /* Larger to match logo text width */
        gap: 1rem;
        /* Wider spacing */
        padding-left: 1.5rem;
        /* Shift right to align with logo text */
        padding-right: 0;
        justify-content: flex-start;
        /* Left-align text to match logo */
    }

    .hero-btn {
        margin-top: 8rem;
        /* Push button lower while logo stays centered */
        align-self: center;
        /* Center the button horizontally */
    }
}

.hero-btn {
    display: inline-block;
    margin-top: 3rem;
    /* Increased margin for spacing */
    padding: 1rem 3rem;
    background: rgba(255, 255, 255, 0.75);
    /* Less transparent (0.75) */
    /* Semi-transparent white box */
    color: #000 !important;
    /* Force Black text */
    /* Black text */
    text-transform: uppercase;
    letter-spacing: 0.15em;
    /* Spaced out text */
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, 0.1);
    /* Subtle border */
    backdrop-filter: blur(5px);
    /* Nice glass effect */
    transition: all 0.3s ease;
}

.hero-btn:hover {
    color: #000 !important;
    /* Force Black text */
    transform: translateY(-2px);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2px;
    /* Minimal gap */
    background: var(--bg-color);
}

.project-card {
    position: relative;
    /* aspect-ratio: 3/2; */
    /* Replaced by fixed height */
    height: 350px;
    overflow: hidden;
    cursor: pointer;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    box-sizing: border-box;
    line-height: 0;
    /* Anti-gap measure */
    font-size: 0;
    /* Anti-gap measure */
    background: transparent;
    /* Reveal check */
}

.project-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    display: block;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.project-card:hover .project-image {
    transform: scale(1.03);
}

.project-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    box-sizing: border-box;
    /* prevent width overflow */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
    color: #fff;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
}

.project-card:hover .project-info {
    opacity: 1;
    transform: translateY(0);
}

/* Project Expansion */
.project-details-expander {
    grid-column: 1 / -1;
    background: #f4f4f4;
    padding: 3rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    height: 0;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.project-details-expander.active {
    height: auto;
    opacity: 1;
    margin-top: 1rem;
}

.expander-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.expander-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.5rem;
    color: var(--secondary-text);
}

.expander-close:hover {
    color: var(--text-color);
}

.project-gallery {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}

.gallery-item {
    flex: 0 0 auto;
    /* Allow auto width based on image */
    height: 80vh;
    /* Responsive height */
    max-height: 80vh;
    scroll-snap-align: center;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    display: flex;
    /* Ensure centering */
    align-items: center;
    /* Vertically center */
    justify-content: center;
    /* Horizontally center */
}

.gallery-item img {
    width: auto;
    height: 100%;
    max-width: 100%;
    /* Prevent horizontal overflow */
    object-fit: contain;
    /* Ensure full image is visible */
    background: transparent;
    /* Transparent background */
}

/* Custom Scrollbar for Gallery */
.project-gallery::-webkit-scrollbar {
    height: 6px;
}

.project-gallery::-webkit-scrollbar-track {
    background: #e0e0e0;
}

.project-gallery::-webkit-scrollbar-thumb {
    background: var(--text-color);
    border-radius: 3px;
}

/* Admin Panel */
.admin-container {
    max-width: 800px;
    margin: 8rem auto;
    padding: 2rem;
    border: 1px solid var(--border-color);
}

.auth-form,
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

input,
textarea,
select,
button {
    padding: 1rem;
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 1rem;
    background: transparent;
}

button {
    background: var(--text-color);
    color: #fff;
    cursor: pointer;
    transition: opacity 0.3s;
}

button:hover {
    opacity: 0.9;
}

/* Utility */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Reviews Section */
.reviews-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.review-card {
    padding: 2rem;
    background: #f9f9f9;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease;
}

.review-card:hover {
    transform: translateY(-5px);
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.review-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-style: italic;
    color: var(--text-color);
}

.review-author {
    display: flex;
    flex-direction: column;
}

.client-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.client-role {
    font-size: 0.8rem;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Hero Button */
.hero-btn {
    display: inline-block;
    margin-top: 2rem;
    padding: 1rem 2.5rem;
    border: 1px solid #fff;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

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

/* Mobile Navigation & Responsive Styles */

/* Hamburger Menu Button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1002;
    padding: 0.5rem;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: var(--transition-speed);
}

/* Mobile Responsive Media Query */
@media (max-width: 768px) {

    /* Container Adjustments */
    .container {
        padding: 0 1.25rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* Navigation */
    .navbar {
        background: rgba(255, 255, 255, 0.98);
        padding: 1rem 0;
    }

    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        height: auto;
        padding: 3rem 0;
        background-color: var(--bg-color);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        gap: 1.5rem;
        transform: translateY(-20px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 990;
        border-bottom: none;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-links li {
        opacity: 0;
        transform: translateY(-20px);
        transition: opacity 0.4s ease, transform 0.4s ease;
    }

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

    /* Menu Toggle Animation */
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

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

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

    /* Typography */
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    /* Centering Content on Mobile */
    body {
        text-align: center;
    }

    /* Mobile Review Carousel */
    .reviews-grid {
        display: flex;
        overflow-x: auto;
        gap: 1.5rem;
        scroll-snap-type: x mandatory;
        padding-bottom: 2rem;
        /* Scrollbar space */
        -webkit-overflow-scrolling: touch;

        /* Centering Logic */
        padding-left: calc(50% - 42.5vw);
        padding-right: calc(50% - 42.5vw);

        flex-wrap: nowrap;
        margin-bottom: 0;
        /* Adjusted for dots */
    }

    .mobile-dots-container {
        display: flex;
        justify-content: center;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .dot-btn {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        border: 1px solid var(--text-color);
        background: transparent;
        cursor: pointer;
        padding: 0;
        transition: background-color 0.3s;
    }

    .dot-btn.active {
        background-color: var(--text-color);
    }

    .reviews-grid::-webkit-scrollbar {
        height: 0;
        /* Hide scrollbar */
    }

    .review-card {
        flex: 0 0 85vw;
        /* Show mostly one card */
        width: 85vw;
        scroll-snap-align: center;
        scroll-snap-stop: always;
        /* Force stop at each item */
        text-align: left;
    }

    /* Specific section alignments */
    .hero-content {
        text-align: center;
        align-items: center;
    }

    /* Projects Grid */
    .projects-grid {
        grid-template-columns: 1fr;
        /* Single column on mobile */
    }

    /* Details Expander */
    .expander-header {
        flex-direction: column;
        text-align: left;
        padding: 1.5rem;
    }

    .expander-header button {
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: #fff;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        justify-content: center;
        align-items: center;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        z-index: 10;
    }

    .project-details-expander {
        padding: 0;
        margin-left: -1.25rem;
        margin-right: -1.25rem;
        width: calc(100% + 2.5rem);
    }

    .project-gallery {
        flex-direction: column;
        overflow-x: hidden;
        gap: 0;
        cursor: default;
        padding-bottom: 0;
    }

    .gallery-item {
        flex: none;
        width: 100%;
        height: auto;
        max-height: none;
        margin-bottom: 1rem;
        border-radius: 0;
    }

    .gallery-item img {
        background: transparent;
        height: auto;
        width: 100%;
        object-fit: cover;
    }

    /* Footer */
    .footer .flex {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .footer-link {
        color: var(--secondary-text);
        text-decoration: none;
        transition: color 0.3s ease;
        font-size: 0.9rem;
    }

    .footer-link:hover {
        color: var(--text-color);
        text-decoration: underline;
    }

    /* Center text in flex containers where appropriate */
    .flex.justify-between:not(.navbar .container) {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
}

/* Blog Expander */
.blog-details-expander {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    height: 0;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.blog-details-expander.active {
    height: auto;
    opacity: 1;
}

.blog-title-hover:hover {
    color: var(--secondary-text);
    transition: color 0.3s;
}

.blog-inline-image-container {
    width: 100%;
    margin-top: 3rem;
    margin-bottom: 3rem;
    overflow: hidden;
    height: 500px;
    border-radius: 4px;
}

.blog-inline-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .blog-inline-image-container {
        height: 300px;
        margin-top: 2rem;
        margin-bottom: 2rem;
    }
}

/* Blog Card Background Animation */
.blog-entry:hover .blog-card-bg {
    transform: scale(1.05);
    opacity: 0.25 !important;
}

/* Mobile Footer Layout */
@media (max-width: 768px) {
    footer .flex.justify-between {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2rem;
    }

    footer .flex.justify-between>div:last-child {
        width: 100%;
        justify-content: flex-start !important;
        /* Left-align links to match logo */
    }
}