/* -------------------------------------------------------------
   Mert Construction - Global Stylesheet & Design System
   ------------------------------------------------------------- */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    /* Colors */
    --color-primary: #1d5ea8;       /* Medium Corporate Royal Blue */
    --color-primary-dark: #0d4685;  /* Deeper royal blue for hover */
    --color-primary-light: #f0f6fc; /* Very soft light blue tint */
    --color-secondary: #0a356c;     /* Dark Corporate Navy */
    --color-secondary-light: #124c8c;
    --color-dark: #071527;          /* Deep Midnight Blue */
    --color-dark-muted: #4a5d78;    /* Sleek Slate-gray text */
    --color-light: #f8fafc;         /* Very clean light gray-blue background */
    --color-light-muted: #cbd5e1;   /* Soft slate border */
    --color-white: #ffffff;
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-accent: #c5a059;        /* Gold/Champagne accent */
    --color-accent-dark: #ab8540;   /* Deeper gold for hover */
    --color-accent-light: #fbf8f0;  /* Very soft gold tint */
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(7, 21, 39, 0.06), 0 2px 4px -2px rgba(7, 21, 39, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(7, 21, 39, 0.08), 0 4px 6px -4px rgba(7, 21, 39, 0.08);
    --shadow-xl: 0 20px 25px -5px rgba(7, 21, 39, 0.1), 0 8px 10px -6px rgba(7, 21, 39, 0.1);
    --shadow-glow: 0 0 20px rgba(29, 94, 168, 0.25);

    /* Layout & Spacing */
    --max-width: 1280px;
    --border-radius-sm: 6px;
    --border-radius-md: 12px;
    --border-radius-lg: 24px;
    --header-height: 80px;

    /* Fonts */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Transitions */
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-dark-muted);
    background-color: var(--color-light);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

h1 { font-size: 2.75rem; }
h2 { font-size: 2.25rem; margin-bottom: 1.5rem; position: relative; }
h3 { font-size: 1.5rem; }

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

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

ul {
    list-style: none;
}

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

.section {
    padding: 6rem 0;
}

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

.section-bg-dark h2, 
.section-bg-dark h3 {
    color: var(--color-white);
}

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

.section-title-wrapper {
    max-width: 700px;
    margin: 0 auto 4rem auto;
    text-align: center;
}

.section-title-wrapper h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--color-primary);
    margin: 0.75rem auto 0 auto;
    border-radius: 2px;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--color-dark-muted);
    margin-top: 0.5rem;
}

.section-bg-dark .subtitle {
    color: var(--color-light-muted);
}

/* --- Common Components --- */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-normal);
    cursor: pointer;
    border: 2px solid transparent;
}

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

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

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

.btn-secondary:hover {
    background-color: var(--color-white);
    color: var(--color-dark);
    transform: translateY(-2px);
}

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

.btn-outline:hover {
    background-color: var(--color-dark);
    color: var(--color-white);
    transform: translateY(-2px);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 50px;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Grid System */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

/* Flex Center */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Header / Sticky Nav --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: transparent;
    z-index: 1000;
    transition: var(--transition-normal);
}

.header.scrolled {
    background-color: rgba(7, 21, 39, 0.98);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-md);
    height: 70px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-white);
}

.logo svg {
    max-width: 100%;
    height: auto;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background-color: transparent;
    color: var(--color-primary);
    flex-shrink: 0;
}

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

/* Navigation Links */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 2.25rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 0.5rem 0;
}

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

.nav-link:hover {
    color: var(--color-white);
}

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

.nav-link.active {
    color: var(--color-accent);
}

/* Accessibility Focus Rings */
a:focus-visible, 
button:focus-visible, 
input:focus-visible, 
select:focus-visible, 
textarea:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 3px;
}

/* Header Action */
.header-cta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Menu Toggle Button (Mobile) */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1100;
}

.nav-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--color-white);
    border-radius: 3px;
    transition: var(--transition-normal);
}

/* Header styles for page sub headers (when not index.html) */
.header.inner-page {
    background-color: var(--color-dark);
    position: sticky;
}

/* --- Footer --- */
.footer {
    background-color: var(--color-dark);
    color: var(--color-light-muted);
    padding: 5rem 0 2rem 0;
    border-top: 5px solid var(--color-primary);
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.2fr 1.6fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

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

.footer-brand p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
    color: var(--color-white);
    transition: var(--transition-normal);
}

.social-link:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
    transform: translateY(-3px);
}

.footer-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-white);
    margin-bottom: 1.75rem;
    position: relative;
}

.footer-title::after {
    content: '';
    display: block;
    width: 30px;
    height: 2px;
    background-color: var(--color-primary);
    margin-top: 0.5rem;
}

.footer-links li {
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--color-light-muted);
}

.footer-links a:hover {
    color: var(--color-primary);
    padding-left: 5px;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.footer-contact li svg {
    margin-top: 0.25rem;
    color: var(--color-primary);
    flex-shrink: 0;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.footer-bottom-links {
    display: flex;
    gap: 2rem;
}

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

/* --- Scroll animations --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- Preloader (Option 1) --- */
body.preloader-active {
    overflow: hidden;
    height: 100vh;
}

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #122d52 0%, var(--color-dark) 80%);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.8s cubic-bezier(0.85, 0, 0.15, 1);
    transform: translateY(0);
}

#preloader.fade-out {
    transform: translateY(-100%);
}

.preloader-content {
    text-align: center;
    width: 100%;
    max-width: 450px;
    padding: 2rem;
    animation: preloaderZoomOut 3s cubic-bezier(0.1, 1, 0.1, 1) forwards;
}

.preloader-content svg {
    width: 100%;
    height: auto;
    max-height: 150px;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 30px rgba(29, 94, 168, 0.25));
}

/* Animations for Logo Blocks with custom bounce */
.preloader-content .block-left {
    opacity: 0;
    transform: translateY(-150px);
    animation: preloaderDropBounce 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    animation-delay: 0.1s;
}

.preloader-content .block-middle {
    opacity: 0;
    transform: translateY(-150px);
    animation: preloaderDropBounce 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    animation-delay: 0.25s;
}

.preloader-content .block-right {
    opacity: 0;
    transform: translateY(-150px);
    animation: preloaderDropBounce 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    animation-delay: 0.4s;
}

/* Animations for Text Group */
.preloader-content .preloader-text-mert {
    opacity: 0;
    transform: translateX(-35px);
    animation: preloaderSlideInRight 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    animation-delay: 0.8s;
}

.preloader-content .preloader-line {
    transform: scaleX(0);
    transform-origin: 64px 40px;
    animation: preloaderScaleWidth 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    animation-delay: 1.0s;
}

.preloader-content .preloader-text-construction {
    opacity: 0;
    transform: translateX(-35px);
    animation: preloaderSlideInRight 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    animation-delay: 1.2s;
}

@keyframes preloaderZoomOut {
    0% {
        transform: scale(1.12);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes preloaderDropBounce {
    0% {
        opacity: 0;
        transform: translateY(-150px) scaleY(1.3);
    }
    60% {
        opacity: 1;
        transform: translateY(12px) scaleY(0.9);
    }
    80% {
        transform: translateY(-6px) scaleY(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
}

@keyframes preloaderSlideInRight {
    0% {
        opacity: 0;
        transform: translateX(-35px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes preloaderScaleWidth {
    0% {
        transform: scaleX(0);
    }
    100% {
        transform: scaleX(1);
    }
}

/* --- Responsive Breakpoints --- */
@media (max-width: 1024px) {
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.85rem; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-top { grid-template-columns: repeat(2, 1fr); gap: 2.5rem; }
}

@media (max-width: 768px) {
    :root {
        --header-height: 70px;
    }
    
    .section {
        padding: 4rem 0;
    }

    .grid-3, .grid-2 {
        grid-template-columns: 1fr;
    }
    
    /* Responsive Navigation Menu */
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background-color: var(--color-dark);
        flex-direction: column;
        justify-content: center;
        gap: 2rem;
        padding: 2rem;
        transition: var(--transition-normal);
        z-index: 1050;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2);
    }

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

    .nav-menu .nav-link {
        font-size: 1.25rem;
    }

    .header-cta {
        display: none; /* Hide standard CTA in mobile header to save space, will place inside mobile nav if needed */
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}
