/* ============================================
   Code Colony - Main Stylesheet
   Clean SaaS/Tech Corporate Style
   Navy + Teal color palette
   ============================================ */

/* --- CSS Variables --- */
:root {
    --navy: #1a2b4a;
    --navy-light: #243656;
    --teal: #00b4d8;
    --teal-dark: #0096b7;
    --teal-light: #e0f7fa;
    --white: #ffffff;
    --bg-alt: #f8f9fc;
    --text: #333333;
    --text-muted: #6b7280;
    --heading: #1a2b4a;
    --border: #e5e7eb;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 6px;
    --radius-lg: 12px;
    --transition: 0.3s ease;
    --max-width: 1200px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font);
    color: var(--text);
    line-height: 1.6;
    background: var(--white);
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--teal-dark);
    text-decoration: none;
    transition: color var(--transition);
}

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

h1, h2, h3, h4, h5, h6 {
    color: var(--heading);
    font-weight: 700;
    line-height: 1.3;
}

h1 { font-size: 2.75rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

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

.section {
    padding: 5rem 0;
}

.section--alt {
    background: var(--bg-alt);
}

.section--navy {
    background: var(--navy);
    color: var(--white);
}

.section--navy h2,
.section--navy h3,
.section--navy h4 {
    color: var(--white);
}

/* --- Header / Navigation --- */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    transition: box-shadow var(--transition);
}

.header--scrolled {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo img {
    height: 48px;
    width: auto;
}

.logo span {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--navy);
}

.nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav a {
    padding: 0.5rem 1rem;
    color: var(--navy);
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition);
}

.nav a:hover,
.nav a.active {
    background: var(--teal);
    color: var(--white);
}

.nav a.nav--support {
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: var(--radius);
}

.nav a.nav--support:hover {
    background: #2e7d32;
    color: var(--white);
}

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

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--navy);
    margin: 5px 0;
    transition: var(--transition);
}

/* --- Hero Image --- */
.hero-image {
    min-height: 500px;
    background: url('../images/site/hero-bg.jpg') center center / cover no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-image__logo {
    position: absolute;
    left: 12%;
    top: 50%;
    transform: translateY(-50%);
}

.hero-image__logo img {
    height: 120px;
    width: auto;
    max-width: none;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.hero-image__overlay {
    width: 100%;
    min-height: 500px;
    display: flex;
    align-items: center;
}

.hero-image h1 {
    color: var(--white);
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
}

.hero-image__subtitle {
    color: rgba(255,255,255,0.85);
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

/* --- Split Section (Quote + About 50/50) --- */
.split-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.featured-quote {
    font-size: 1.35rem;
    font-style: italic;
    color: var(--navy);
    line-height: 1.6;
    border-left: 4px solid var(--teal);
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.featured-quote__cite {
    font-style: normal;
    font-weight: 500;
    color: var(--text-muted);
    padding-left: 1.5rem;
}

/* Legacy hero (kept for other pages if needed) */
.hero {
    padding: 6rem 0 5rem;
    background: linear-gradient(135deg, var(--bg-alt) 0%, var(--white) 50%, var(--teal-light) 100%);
    text-align: center;
}

.hero__quote {
    max-width: 800px;
    margin: 0 auto 2rem;
}

.hero__quote blockquote {
    font-size: 1.5rem;
    font-style: italic;
    color: var(--navy);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.hero__quote cite {
    font-size: 1rem;
    color: var(--text-muted);
    font-style: normal;
    font-weight: 500;
}

.hero__subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid transparent;
    text-decoration: none;
}

.btn--primary {
    background: var(--teal);
    color: var(--white);
    border-color: var(--teal);
}

.btn--primary:hover {
    background: var(--teal-dark);
    border-color: var(--teal-dark);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,180,216,0.3);
}

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

.btn--outline:hover {
    background: var(--teal);
    color: var(--white);
}

.btn--white {
    background: var(--white);
    color: var(--navy);
    border-color: var(--white);
}

.btn--white:hover {
    background: transparent;
    color: var(--white);
    border-color: var(--white);
}

/* --- Stats Bar --- */
.stats {
    padding: 3rem 0;
    background: var(--navy);
}

.stats .container {
    display: flex;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat__number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--teal);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat__label {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* --- Section Headers --- */
.section__header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
}

.section__header h2 {
    margin-bottom: 1rem;
}

.section__header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* --- Services Grid --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
    display: block;
}

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

.service-card__icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.service-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.service-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

/* --- Project Cards Grid --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

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

.project-card__image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: top left;
    border-bottom: 1px solid var(--border);
}

.project-card__body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-card__body h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.project-card__body p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.project-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: var(--teal-light);
    color: var(--teal-dark);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* --- Quote Section --- */
.quote-section {
    padding: 5rem 0;
    background: var(--navy);
    text-align: center;
}

.quote-section blockquote {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.5rem;
    font-style: italic;
    color: var(--white);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.quote-section cite {
    color: var(--teal);
    font-style: normal;
    font-weight: 500;
    font-size: 1rem;
}

/* --- CTA Section --- */
.cta {
    padding: 5rem 0;
    text-align: center;
}

.cta h2 {
    margin-bottom: 1rem;
}

.cta p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* --- Footer --- */
.footer {
    background: var(--navy);
    color: rgba(255,255,255,0.7);
    padding: 3rem 0;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer__brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer__brand img {
    height: 32px;
    opacity: 0.8;
}

.footer__brand span {
    color: rgba(255,255,255,0.8);
    font-weight: 600;
}

.footer__links {
    display: flex;
    gap: 1.5rem;
}

.footer__links a {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

.footer__links a:hover {
    color: var(--teal);
}

.footer__copy {
    font-size: 0.85rem;
}

/* --- Filter Buttons --- */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.filter-btn {
    padding: 0.4rem 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--white);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--teal);
    color: var(--white);
    border-color: var(--teal);
}

/* --- Project Detail Page --- */
.breadcrumb {
    padding: 1rem 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-muted);
}

.breadcrumb a:hover {
    color: var(--teal);
}

.breadcrumb span {
    margin: 0 0.5rem;
}

.project-detail {
    padding: 3rem 0 5rem;
}

.project-detail h1 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

.project-detail__meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.project-detail__content {
    max-width: 800px;
}

.project-detail__content h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
}

.project-detail__content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.project-detail__screenshots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.project-detail__screenshots img {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: top left;
}

/* --- About Page --- */
.about-intro {
    max-width: 800px;
}

.methodology-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.methodology-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.methodology-card__step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--teal);
    color: var(--white);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.methodology-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.methodology-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.industries-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.industry-tag {
    padding: 0.5rem 1.25rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--navy);
}

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

.contact-info h3 {
    margin-bottom: 1.5rem;
}

.contact-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.contact-item__icon {
    font-size: 1.25rem;
    color: var(--teal);
    min-width: 24px;
    text-align: center;
}

.contact-form h3 {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--heading);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: border-color var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(0,180,216,0.1);
}

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

/* --- Services Detail Page --- */
.service-detail {
    padding: 3rem 0 5rem;
}

.service-detail__content {
    max-width: 800px;
}

.service-detail__content h1 {
    margin-bottom: 1.5rem;
}

.service-detail__content h2 {
    font-size: 1.4rem;
    margin: 2rem 0 1rem;
    color: var(--navy);
}

.service-detail__content p {
    margin-bottom: 1.25rem;
    line-height: 1.7;
}

.service-detail__content ul {
    margin: 1rem 0 1.5rem 1.5rem;
}

.service-detail__content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.service-sidebar {
    position: sticky;
    top: 100px;
}

.service-sidebar ul {
    list-style: none;
}

.service-sidebar li {
    margin-bottom: 0.25rem;
}

.service-sidebar a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text);
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: all var(--transition);
}

.service-sidebar a:hover,
.service-sidebar a.active {
    background: var(--teal-light);
    color: var(--teal-dark);
}

.service-detail__layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 3rem;
}

/* --- Page Hero (inner pages) --- */
.page-hero {
    padding: 4rem 0 3rem;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
}

.page-hero h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
}

.page-hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }

    .section { padding: 3rem 0; }

    .nav {
        display: none;
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }

    .nav.open {
        display: flex;
    }

    .nav a {
        padding: 0.75rem 1rem;
        width: 100%;
    }

    .nav-toggle {
        display: block;
    }

    .hero-image {
        min-height: 300px;
    }

    .hero-image__logo {
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .hero-image__logo img {
        filter: drop-shadow(0 0 40px rgba(255,255,255,0.9)) drop-shadow(0 0 80px rgba(255,255,255,0.6));
    }

    .hero-image__logo img {
        height: 80px;
        width: auto;
        max-width: none;
    }

    .hero-image__overlay {
        min-height: 300px;
    }

    .hero-image h1 {
        font-size: 2.25rem;
    }

    .split-section {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero {
        padding: 4rem 0 3rem;
    }

    .hero__quote blockquote {
        font-size: 1.2rem;
    }

    .stats .container {
        gap: 2rem;
    }

    .stat__number {
        font-size: 2rem;
    }

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

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

    .service-detail__layout {
        grid-template-columns: 1fr;
    }

    .service-sidebar {
        position: static;
        display: flex;
        overflow-x: auto;
        gap: 0.5rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--border);
        margin-bottom: 2rem;
    }

    .service-sidebar ul {
        display: flex;
        gap: 0.5rem;
    }

    .service-sidebar a {
        white-space: nowrap;
    }

    .project-detail__screenshots {
        grid-template-columns: 1fr;
    }

    .quote-section blockquote {
        font-size: 1.2rem;
    }

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

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

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

    .hero-image__logo {
        display: none;
    }

    .stats .container {
        gap: 1.5rem;
    }
}

/* --- Lightbox (clickable screenshot zoom) --- */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-overlay img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    object-fit: contain;
}

.lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1.5rem;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 10000;
    line-height: 1;
    font-weight: 300;
    opacity: 0.7;
    transition: opacity var(--transition);
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 10000;
    padding: 1rem;
    opacity: 0.6;
    transition: opacity var(--transition);
    user-select: none;
    line-height: 1;
}

.lightbox-nav:hover {
    opacity: 1;
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

.lightbox-counter {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    z-index: 10000;
}

.project-detail__screenshots img {
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}

.project-detail__screenshots img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-hover);
}

/* --- Utility Classes --- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 2rem; }
