/* ============================================================
   EmSen Mühendislik — Ultra Modern Global Stylesheet
   ============================================================ */

/* ---------- Custom Properties (Design Tokens) ---------- */
:root {
    --primary:        #0ea5e9;
    --primary-dark:   #0284c7;
    --primary-light:  #38bdf8;
    --navy:           #0f172a;
    --navy-light:     #1e293b;
    --navy-lighter:   #334155;
    --navy-dark:      #0d1b2a;
    --white:          #ffffff;

    --radius-sm:   8px;
    --radius:      12px;
    --radius-lg:   16px;
    --radius-xl:   20px;
    --radius-2xl:  24px;

    --shadow-sm:   0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow:      0 4px 12px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg:   0 16px 48px rgba(0,0,0,0.14), 0 4px 16px rgba(0,0,0,0.08);
    --shadow-xl:   0 24px 64px rgba(0,0,0,0.18);
    --shadow-glow: 0 0 32px rgba(14, 165, 233, 0.35);
    --shadow-card: 0 2px 8px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);

    --transition-fast: 150ms cubic-bezier(.4,0,.2,1);
    --transition:      250ms cubic-bezier(.4,0,.2,1);
    --transition-slow: 400ms cubic-bezier(.4,0,.2,1);

    --gradient-primary: linear-gradient(135deg, #0284c7 0%, #0ea5e9 50%, #38bdf8 100%);
    --gradient-hero: linear-gradient(135deg, rgba(13,27,42,0.97) 0%, rgba(15,23,42,0.82) 55%, rgba(14,165,233,0.08) 100%);
    --gradient-card: linear-gradient(135deg, rgba(14,165,233,0.06) 0%, transparent 100%);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    overflow-x: hidden;
}

[x-cloak] { display: none !important; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
:focus:not(:focus-visible) { outline: none; }
::selection { background: var(--primary); color: white; }

/* ---------- Custom Scrollbar ---------- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--navy-lighter); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }
.dark ::-webkit-scrollbar-track { background: var(--navy-light); }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================================
   HEADER
   ============================================================ */
header { transition: background var(--transition-slow), box-shadow var(--transition-slow); }

/* ============================================================
   HERO SECTION — animated background & overlays
   ============================================================ */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* Animated grid pattern overlay */
.hero-grid {
    position: absolute;
    inset: 0;
    opacity: 0.05;
    background-image:
        linear-gradient(rgba(14,165,233,1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(14,165,233,1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridDrift 25s linear infinite;
}
@keyframes gridDrift {
    0%   { background-position: 0 0, 0 0; }
    100% { background-position: 50px 0, 0 50px; }
}

/* Electric accent lines animation */
.hero-lines::before,
.hero-lines::after {
    content: '';
    position: absolute;
    width: 1px;
    background: linear-gradient(180deg, transparent 0%, rgba(14,165,233,0.6) 40%, rgba(14,165,233,0.1) 100%);
    animation: linePulse 4s ease-in-out infinite;
}
.hero-lines::before { right: 25%; top: 0; height: 70%; animation-delay: 0s; }
.hero-lines::after  { right: 35%; top: 15%; height: 60%; animation-delay: 2s; }
@keyframes linePulse {
    0%, 100% { opacity: 0.25; }
    50%       { opacity: 1; }
}

/* Floating glow orbs */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    animation: orbFloat 8s ease-in-out infinite;
}
.hero-orb-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(14,165,233,0.18) 0%, transparent 70%);
    top: -120px; right: -100px;
}
.hero-orb-2 {
    width: 320px; height: 320px;
    background: radial-gradient(circle, rgba(56,189,248,0.12) 0%, transparent 70%);
    bottom: 5%; left: 5%;
    animation-delay: 4s;
}
@keyframes orbFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(-30px) scale(1.05); }
}

/* Hero title with gradient span */
.hero-title {
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 900;
    color: white;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}
.hero-title .accent {
    background: linear-gradient(90deg, #38bdf8, #0ea5e9, #7dd3fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Scroll indicator bounce */
.scroll-indicator { animation: scrollBounce 2.5s ease-in-out infinite; }
@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.5; }
    50%       { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

/* ============================================================
   STATS BAR
   ============================================================ */
.stat-value {
    font-size: clamp(2rem, 4vw, 2.625rem);
    font-weight: 900;
    color: white;
    line-height: 1;
    letter-spacing: -0.03em;
}

/* ============================================================
   SERVICE CARDS — hover morphs to gradient
   ============================================================ */
.service-card {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: transform var(--transition-slow), box-shadow var(--transition-slow);
    cursor: pointer;
    display: block;
}
.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-slow);
}
.service-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-slow);
}
.service-card:hover::before { opacity: 1; }
.service-card:hover::after  { transform: scaleX(1); }
.service-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-glow), var(--shadow-lg);
}
.service-card > * { position: relative; z-index: 1; }

/* Service number watermark */
.service-number {
    position: absolute;
    bottom: -16px; right: -8px;
    font-size: 5rem;
    font-weight: 900;
    color: rgba(14,165,233,0.05);
    line-height: 1;
    pointer-events: none;
    z-index: 0;
    transition: color var(--transition-slow);
}
.service-card:hover .service-number { color: rgba(255,255,255,0.05); }

/* ============================================================
   ABOUT SECTION
   ============================================================ */
.about-image-wrap {
    position: relative;
    border-radius: var(--radius-2xl);
    overflow: visible;
}
.about-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-2xl);
    display: block;
}
.about-image-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(14,165,233,0.2) 0%, transparent 60%);
    z-index: 1;
    pointer-events: none;
    border-radius: var(--radius-2xl);
}

/* Floating experience badge */
.about-badge {
    position: absolute;
    bottom: -1.5rem;
    right: -1.5rem;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    padding: 1.25rem 1.5rem;
    text-align: center;
    z-index: 10;
    box-shadow: var(--shadow-glow), var(--shadow-lg);
}

/* Dot grid decoration */
.dot-grid {
    background-image: radial-gradient(circle, rgba(14,165,233,0.4) 1px, transparent 1px);
    background-size: 12px 12px;
}

/* Check list */
.check-list { list-style: none; }
.check-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    font-size: 0.9375rem;
    line-height: 1.5;
}
.dark .check-list li { border-color: rgba(255,255,255,0.04); }
.check-list li:last-child { border-bottom: none; }

/* ============================================================
   PROJECT CARDS
   ============================================================ */
.project-card {
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: block;
    transition: all var(--transition-slow);
}
.project-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-xl); }
.project-card-img { aspect-ratio: 16/10; overflow: hidden; position: relative; }
.project-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(.4,0,.2,1); }
.project-card:hover .project-card-img img { transform: scale(1.06); }
.project-card-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(13,27,42,0.8) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--transition);
    display: flex; align-items: flex-end; padding: 1.25rem;
}
.project-card:hover .project-card-overlay { opacity: 1; }

/* ============================================================
   TESTIMONIAL CARDS
   ============================================================ */
.testimonial-card {
    border-radius: var(--radius-xl);
    padding: 2rem;
    position: relative;
    transition: all var(--transition);
    box-shadow: var(--shadow-card);
}
.testimonial-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.testimonial-quote {
    position: absolute;
    top: 1rem; right: 1.5rem;
    font-size: 4rem;
    font-family: Georgia, serif;
    line-height: 1;
    color: var(--primary);
    opacity: 0.12;
    font-weight: 900;
    pointer-events: none;
}

/* Carousel item widths */
.testimonial-carousel-item {
    flex: 0 0 100%;
    padding: 0 0.5rem;
    box-sizing: border-box;
}
@media (min-width: 768px) {
    .testimonial-carousel-item { flex: 0 0 50%; }
}
@media (min-width: 1024px) {
    .testimonial-carousel-item { flex: 0 0 33.3333%; }
}

/* Arrow buttons */
.testimonial-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: all var(--transition);
    z-index: 10;
}
.testimonial-arrow:hover { background: var(--primary); color: white; border-color: var(--primary); }
.testimonial-arrow-left  { left: -1.25rem; }
.testimonial-arrow-right { right: -1.25rem; }
@media (max-width: 767px) {
    .testimonial-arrow-left  { left: 0; }
    .testimonial-arrow-right { right: 0; }
}


/* ============================================================
   CTA SECTION
   ============================================================ */
.cta-section {
    position: relative;
    overflow: hidden;
}
.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(14,165,233,0.15) 0%, transparent 60%);
    pointer-events: none;
}
.cta-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    border-radius: var(--radius-lg);
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    font-family: inherit;
}
.btn::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.25) 0%, transparent 70%);
    transform: scale(0);
    border-radius: inherit;
    transition: none;
}
.btn:active::after { transform: scale(3); }

/* ============================================================
   FORMS
   ============================================================ */
input[type="text"], input[type="email"], input[type="tel"],
input[type="url"], input[type="password"], input[type="number"],
input[type="search"], textarea, select {
    transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, textarea:focus, select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(14,165,233,0.12) !important;
    outline: none;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(14,165,233,0.4), transparent);
}
footer { position: relative; }

/* ============================================================
   REVEAL ANIMATIONS (IntersectionObserver)
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s cubic-bezier(.4,0,.2,1), transform 0.65s cubic-bezier(.4,0,.2,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-left  { opacity: 0; transform: translateX(-28px); transition: opacity 0.65s ease, transform 0.65s ease; }
.reveal-right { opacity: 0; transform: translateX(28px);  transition: opacity 0.65s ease, transform 0.65s ease; }
.reveal-left.visible, .reveal-right.visible { opacity: 1; transform: translateX(0); }

.delay-100 { transition-delay: 0.1s !important; }
.delay-200 { transition-delay: 0.2s !important; }
.delay-300 { transition-delay: 0.3s !important; }
.delay-400 { transition-delay: 0.4s !important; }
.delay-500 { transition-delay: 0.5s !important; }

/* ============================================================
   KEYFRAMES
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-10px); }
}
@keyframes shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

.animate-fade-in-up { animation: fadeInUp 0.6s ease forwards; }
.animate-float      { animation: float 4s ease-in-out infinite; }

/* ============================================================
   SKELETON LOADING
   ============================================================ */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: var(--radius);
}
.dark .skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
#back-to-top {
    position: fixed;
    bottom: 2rem; right: 2rem;
    z-index: 99;
    width: 46px; height: 46px;
    border-radius: 14px;
    background: var(--gradient-primary);
    color: white;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: none;
    box-shadow: 0 4px 20px rgba(14,165,233,0.4);
    transition: transform var(--transition), box-shadow var(--transition);
}
#back-to-top:hover { transform: translateY(-4px); box-shadow: 0 8px 32px rgba(14,165,233,0.6); }

/* ============================================================
   UTILITIES
   ============================================================ */
.h-18   { height: 4.5rem; }
.h-4\.5 { height: 1.125rem; }
.w-4\.5 { width: 1.125rem; }
.scrollbar-none::-webkit-scrollbar { display: none; }
.scrollbar-none { -ms-overflow-style: none; scrollbar-width: none; }
.line-clamp-2 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.line-clamp-3 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.line-clamp-4 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.divider-glow { height: 1px; background: linear-gradient(90deg, transparent, rgba(14,165,233,0.4) 50%, transparent); }

/* ============================================================
   PROSE (Blog/Page content)
   ============================================================ */
.prose { line-height: 1.8; }
.prose h2, .prose h3 { font-weight: 800; margin-top: 2.5rem; margin-bottom: 1rem; }
.prose p  { margin-bottom: 1.25rem; }
.prose ul { margin-left: 1.5rem; margin-bottom: 1.25rem; }
.prose pre {
    background: var(--navy-light);
    border: 1px solid var(--navy-lighter);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    overflow-x: auto;
}

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 768px) {
    .hero-orb-1 { display: none; }
    .about-badge { bottom: -1rem; right: -0.5rem; padding: 1rem; }
    #back-to-top { bottom: 1.25rem; right: 1.25rem; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    header, footer, #back-to-top { display: none !important; }
    body { background: white !important; color: black !important; }
}
