/* ===== CSS Variables (No Gradients, Orange & Brown Theme) ===== */
:root {
    color-scheme: light;
    --primary-color: #d95a00; /* Vibrant Orange */
    --primary-hover: #b84c00;
    --secondary-color: #5c3a21; /* Deep Brown */
    --secondary-hover: #4a2e1a;
    --bg-color: #fcf9f6; /* Very light warm tint */
    --text-color: #2c1e16; /* Very dark brown, almost black */
    --text-light: #6e5c53;
    --card-bg: #ffffff;
    --border-color: #e8dbd1;
    --border-radius: 8px;
    --border-radius-lg: 16px;
    --transition-speed: 0.2s;
    --mobile-bottom-bar: 72px;
}



/* ===== Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

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

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

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Prevent content hidden behind fixed bottom bar on mobile */
@media (max-width: 767px) {
    body {
        padding-bottom: var(--mobile-bottom-bar);
    }
}

/* ===== Typography ===== */
h1, h2, h3 {
    line-height: 1.2;
    color: var(--text-color);
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
}

h2 {
    font-size: 2rem;
    font-weight: 600;
}

.highlight {
    color: var(--primary-color);
}

.section-title {
    text-align: center;
    margin-bottom: 2.5rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: background-color var(--transition-speed) ease, transform 0.1s ease;
}

.btn:active {
    transform: scale(0.98);
}

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

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

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

.btn-secondary:hover {
    background-color: var(--secondary-hover);
    color: #ffffff;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: rgba(217, 90, 0, 0.05);
}

.btn-linkedin {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-linkedin svg {
    flex-shrink: 0;
}

/* ===== Header & Navigation ===== */
.site-header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    transition: height 0.3s ease;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-color);
}

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

.menu-toggle {
    display: block;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger, .hamburger::before, .hamburger::after {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-color);
    transition: transform 0.3s ease;
    position: relative;
}

.hamburger::before, .hamburger::after {
    content: '';
    position: absolute;
    left: 0;
}

.hamburger::before { top: -6px; }
.hamburger::after { top: 6px; }

.nav-links {
    display: none;
    list-style: none;
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    z-index: 99;
}

.nav-links.active {
    display: flex;
}

.nav-links li {
    margin: 0.5rem 0;
    text-align: center;
}

/* Desktop Navigation */
@media (min-width: 768px) {
    .menu-toggle {
        display: none;
    }
    
    .nav-links {
        display: flex;
        flex-direction: row;
        position: static;
        background: transparent;
        border: none;
        padding: 0;
        align-items: center;
    }

    .nav-links li {
        margin: 0 0 0 2.5rem;
    }

    .nav-links a {
        color: var(--text-color);
        font-weight: 600;
        position: relative;
        padding: 0.5rem 0;
        font-size: 0.95rem;
        transition: color 0.3s ease;
    }

    /* Modern hover underline effect */
    .nav-links a:not(.btn)::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 0;
        height: 2px;
        background-color: var(--primary-color);
        transition: width 0.3s ease;
        border-radius: 2px;
    }

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

    .nav-links a:not(.btn):hover::after {
        width: 100%;
    }

    .nav-links a.btn-primary {
        border-radius: 50px;
        padding: 0.6rem 1.4rem;
        font-size: 0.875rem;
        color: #ffffff;
        box-shadow: 0 4px 12px rgba(217, 90, 0, 0.15);
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .nav-links a.btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(217, 90, 0, 0.25);
        background-color: var(--primary-hover);
    }

    /* Logo Hover Effect */
    .logo {
        transition: transform 0.3s ease;
        display: inline-block;
    }
    
    .logo:hover {
        transform: scale(1.03);
    }
}

/* ===== Mobile App Header ===== */
@media (max-width: 767px) {
    .site-header {
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        background-color: rgba(255,255,255,0.92);
        box-shadow: 0 1px 0 var(--border-color);
    }

    .header-inner {
        height: 56px;
        padding: 0 1rem;
    }

    .logo {
        font-size: 1.1rem;
    }
}

/* ===== Hero Section ===== */
.hero {
    padding: 4rem 0;
}

.hero-badge {
    display: inline-block;
    background-color: rgba(217, 90, 0, 0.1);
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    margin-bottom: 1rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero-inner {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.hero-content {
    flex: 1;
}

.hero-content h2 {
    color: var(--text-light);
    font-weight: 400;
    font-size: 1.25rem;
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    max-width: 500px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-image {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 50%;
    border: 8px solid var(--card-bg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
    .hero {
        padding: 4rem 0 6rem;
        position: relative;
        overflow: hidden;
    }

    /* Decorative background glow */
    .hero::before {
        content: '';
        position: absolute;
        top: -10%;
        left: 50%;
        transform: translateX(-50%);
        width: 600px;
        height: 400px;
        background: radial-gradient(circle, rgba(217, 90, 0, 0.05) 0%, rgba(217, 90, 0, 0) 70%);
        z-index: -1;
    }
    
    .hero-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 2rem;
    }

    .hero-image {
        order: -1;
        margin-bottom: 1rem;
    }

    .profile-image {
        width: 160px;
        height: 160px;
        border-width: 6px;
        box-shadow: 0 10px 30px rgba(217, 90, 0, 0.15);
    }

    .hero-content {
        max-width: 800px;
    }

    .hero-content h1 {
        font-size: 4rem;
        line-height: 1.1;
        margin-bottom: 1.5rem;
    }

    .hero-content h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .hero-content p {
        font-size: 1.25rem;
        margin: 0 auto 2.5rem;
        max-width: 650px;
    }

    .hero-actions {
        justify-content: center;
        gap: 1.5rem;
    }
}

/* ===== Mobile Hero — App Style ===== */
@media (max-width: 767px) {
    .hero {
        padding: 2rem 0 1.5rem;
    }

    .hero-inner {
        flex-direction: column;
        gap: 1.25rem;
        align-items: center;
        text-align: center;
    }

    /* Image first on mobile */
    .hero-image {
        order: -1;
    }

    .profile-image {
        width: 110px;
        height: 110px;
        border-width: 4px;
        box-shadow: 0 6px 24px rgba(217, 90, 0, 0.18);
    }

    .hero-content h1 {
        font-size: 1.6rem;
        margin-bottom: 0.25rem;
    }

    .hero-content h2 {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }

    .hero-content p {
        font-size: 0.9rem;
        margin-bottom: 1.25rem;
        max-width: 100%;
        color: var(--text-light);
    }

    .hero-actions {
        justify-content: center;
        gap: 0.6rem;
    }

    .hero-actions .btn {
        padding: 0.55rem 1.1rem;
        font-size: 0.85rem;
        border-radius: 50px;
    }
}

/* ===== Projects Section ===== */
.projects {
    padding: 4rem 0;
    background-color: var(--card-bg);
}

.project-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.project-card {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.project-placeholder {
    height: 200px;
    background-color: var(--border-color);
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.project-info p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

@media (min-width: 768px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1024px) {
    .project-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== Mobile Projects — 2-Column Grid ===== */
@media (max-width: 767px) {
    .projects {
        padding: 2rem 0;
    }

    .projects .container {
        padding: 0 1.25rem;
    }

    .projects .section-title {
        margin-bottom: 1.5rem;
        font-size: 1.5rem;
        text-align: left;
    }

    .project-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0;
    }

    .project-card {
        border-radius: var(--border-radius-lg);
        border: 1px solid var(--border-color);
        box-shadow: 0 4px 12px rgba(0,0,0,0.05);
        background-color: var(--card-bg);
    }

    .project-card img,
    .project-placeholder {
        height: 120px;
        width: 100%;
        object-fit: cover;
        border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    }

    .project-info {
        padding: 0.75rem;
    }

    .project-info h3 {
        font-size: 0.95rem;
        margin-bottom: 0.25rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .project-info p {
        font-size: 0.75rem;
        margin-bottom: 0.75rem;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        height: 2.8em; /* Force height for alignment */
    }

    .project-grid .project-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.6rem !important;
        width: 100% !important;
    }

    .project-grid .project-actions .btn-sm {
        display: block !important;
        width: 100% !important;
        padding: 0.65rem 1rem !important;
        font-size: 0.8rem !important;
        text-align: center !important;
        flex: none !important;
    }
}

/* ===== CTA Section ===== */
.cta {
    padding: 5rem 0;
    text-align: center;
    background-color: var(--secondary-color);
    color: #ffffff;
}

.cta h2 {
    color: #ffffff;
}

.cta p {
    margin-bottom: 2rem;
    color: #e8dbd1;
    font-size: 1.1rem;
}

/* ===== Mobile CTA Section ===== */
@media (max-width: 767px) {
    /* Hide the full CTA section on mobile — replaced by fixed bottom bar */
    .cta {
        display: none;
    }
}

/* ===== Fixed Mobile Bottom CTA Bar ===== */
.mobile-cta-bar {
    display: none;
}

@media (max-width: 767px) {
    .mobile-cta-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 200;
        background-color: var(--card-bg);
        border-top: 1px solid var(--border-color);
        padding: 0.75rem 1.25rem;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
        gap: 0.75rem;
        align-items: center;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    }

    .mobile-cta-bar .cta-label {
        flex: 1;
        min-width: 0;
    }

    .mobile-cta-bar .cta-label span {
        display: block;
        font-size: 0.7rem;
        color: var(--text-light);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-cta-bar .cta-label strong {
        display: block;
        font-size: 0.82rem;
        color: var(--text-color);
        font-weight: 700;
    }

    .mobile-cta-bar .btn-cta-fixed {
        flex-shrink: 0;
        background-color: var(--primary-color);
        color: #ffffff;
        border: none;
        border-radius: 50px;
        padding: 0.65rem 1.4rem;
        font-size: 0.88rem;
        font-weight: 700;
        cursor: pointer;
        transition: background-color var(--transition-speed) ease, transform 0.1s ease;
        white-space: nowrap;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
    }

    .mobile-cta-bar .btn-cta-fixed:hover {
        background-color: var(--primary-hover);
        color: #ffffff;
    }

    .mobile-cta-bar .btn-cta-fixed:active {
        transform: scale(0.97);
    }
}

/* ===== Footer ===== */
.site-footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    text-align: center;
}

.footer-brand {
    margin-bottom: 1.5rem;
}

.footer-brand h3 {
    margin-bottom: 0.25rem;
}

.footer-brand p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.footer-links p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}



@media (min-width: 768px) {
    .footer-inner {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        text-align: left;
    }
    .footer-brand {
        margin-bottom: 0;
    }
    .footer-links {
        text-align: right;
    }
}

@media (max-width: 767px) {
    .site-footer {
        padding: 1.5rem 0 1rem;
    }

    .footer-brand h3 {
        font-size: 1rem;
    }

    .footer-brand p,
    .footer-links p,

}

/* ===== Modal Styles ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: block;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 2% auto;
    padding: 20px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

.close-modal {
    color: var(--text-color);
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

.iframe-container {
    flex-grow: 1;
    width: 100%;
    margin-top: 20px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: #fff;
}

#preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Loader Styles */
.loader-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-color);
    z-index: 5;
    transition: opacity 0.3s ease;
}

.loader-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid var(--border-color);
    border-bottom-color: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ===== Modal Fallback Bar ===== */
.modal-fallback {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 1rem;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    flex-shrink: 0;
}

.modal-fallback span {
    font-size: 0.82rem;
    color: var(--text-light);
}

.modal-fallback-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--transition-speed) ease;
}

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


/* ===== Fixed Desktop CTA (Floating Pill) ===== */
.desktop-fixed-cta {
    display: none;
}

@media (min-width: 768px) {
    .desktop-fixed-cta {
        display: block;
        position: fixed;
        bottom: 30px;
        right: 30px;
        z-index: 200;
        animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    .btn-floating-cta {
        display: flex;
        align-items: center;
        gap: 1rem;
        background-color: var(--card-bg);
        border: 1px solid var(--border-color);
        padding: 0.75rem 1.75rem;
        border-radius: 100px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.08);
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .btn-floating-cta:hover {
        transform: translateY(-5px) scale(1.02);
        box-shadow: 0 15px 45px rgba(217, 90, 0, 0.2);
        border-color: var(--primary-color);
        background-color: #fff;
    }

    .cta-icon {
        font-size: 1.5rem;
        background: rgba(217, 90, 0, 0.1);
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: transform 0.3s ease;
    }

    .btn-floating-cta:hover .cta-icon {
        transform: rotate(15deg) scale(1.1);
    }

    .cta-text {
        text-align: left;
    }

    .cta-text span {
        display: block;
        font-size: 0.7rem;
        color: var(--text-light);
        margin-bottom: 1px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .cta-text strong {
        display: block;
        font-size: 1rem;
        color: var(--text-color);
        font-weight: 800;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== Hide Default Calendly Badge (Favoring Custom CTA) ===== */
#calendly-badge-widget,
.calendly-badge-widget,
.calendly-badge-content {
    display: none !important;
}

/* ===== Mobile Optimization for Project Preview ===== */
@media (max-width: 767px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
        height: 85vh;
        padding: 12px;
        border-radius: var(--border-radius-lg);
    }

    .close-modal {
        right: 15px;
        top: 5px;
        font-size: 32px;
    }

    .iframe-container {
        position: relative;
        overflow: hidden;
        border: 1px solid var(--border-color);
        background-color: #fff;
    }

    #preview-iframe {
        /* 
           Render at 160% width/height to give more room for the site content,
           then scale down to fit the container. This makes content look "smaller"
           and prevents mobile layouts from breaking in narrow containers.
        */
        width: 160% !important;
        height: 160% !important;
        transform: scale(0.625); /* 1 / 1.6 = 0.625 */
        transform-origin: 0 0;
        border: none;
        position: absolute;
        top: 0;
        left: 0;
    }

    .modal-fallback {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }

    .modal-fallback span {
        font-size: 0.75rem;
    }

    .modal-fallback-btn {
        padding: 0.35rem 0.8rem;
        font-size: 0.75rem;
    }
}
