/* =====================================================
   Alcalá Designers — Light Theme Premium
   Design System: Modern / Minimal + Vibrant Accents
   ===================================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: #f8f9fc;
    color: #1a1a2e;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ── Typography ── */
.font-display {
    font-family: 'Outfit', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    line-height: 1.15;
    color: #0f0f1a;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f0f0f5; }
::-webkit-scrollbar-thumb { background: #005fbf; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #0053a8; }

/* ── Gradient Text ── */
.gradient-text {
    background: linear-gradient(135deg, #005fbf, #00b4d8, #0077b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Hero Section ── */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 15, 26, 0.945) 0%, rgba(0, 36, 112, 0.75) 50%, rgba(8, 8, 19, 0.88) 100%);
}

.hero-content {
    position: relative;
    z-index: 10;
}

/* ── Floating Shapes ── */
.floating-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.12;
    pointer-events: none;
}

/* ── Gradient Border Card ── */
.gradient-border {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #005fbf, #00b4d8, #0077b6);
    border-radius: 18px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gradient-border:hover::before {
    opacity: 1;
}

/* ── Service Cards ── */
.service-card {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 1;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 2px;
    background: conic-gradient(
        from var(--card-angle, 0deg),
        #005fbf, #00b4d8, #0077b6, #005fbf
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.service-card:hover::before {
    opacity: 1;
    animation: rotate-gradient 2s linear infinite;
}

@keyframes rotate-gradient {
    to { --card-angle: 360deg; }
}

@property --card-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.service-card:hover {
    transform: scale(1.03);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.12);
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}

.service-icon {
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ── Masonry Grid ── */
.masonry-grid {
    columns: 3;
    column-gap: 1rem;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1rem;
}

@media (max-width: 1024px) {
    .masonry-grid {
        columns: 2;
    }
}

@media (max-width: 640px) {
    .masonry-grid {
        columns: 1;
    }
}

/* ── Lightbox ── */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

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

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

/* ── Portfolio Grid ── */
.portfolio-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: white;
    border: 1px solid #e5e7eb;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.portfolio-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.portfolio-card .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
}

.portfolio-card:hover .overlay {
    opacity: 1;
}

/* ── Lightbox ── */
#lightbox {
    animation: fadeIn 0.2s ease;
}

#lightbox img {
    animation: zoomIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ── Portfolio Items ── */
.portfolio-item {
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.portfolio-item:hover {
    transform: scale(1.03);
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-overlay {
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* ── Buttons ── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #005fbf;
    color: #ffffff;
    padding: 1rem 2rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 1.125rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(32, 64, 131, 0.35);
    background: #1a3252;
}

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

.btn-accent {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #005fbf;
    color: #ffffff;
    padding: 1rem 2rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 1.125rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    border: none;
    cursor: pointer;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(233, 30, 99, 0.35);
    background: #d81b60;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: #ffffff;
    padding: 1rem 2rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 1.125rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    border: 2px solid rgba(255,255,255,0.3);
    cursor: pointer;
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.6);
}

/* ── Marquee ── */
.marquee-container {
    overflow: hidden;
    white-space: nowrap;
}

.marquee-content {
    display: inline-block;
    animation: marquee 25s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ── Reveal Animation ── */
.reveal,
.stagger-children,
.stagger-children > * {
    opacity: 1;
    transform: translateY(0);
}

.stagger-children.active > *:nth-child(1) { transition: all 0.6s 0.1s cubic-bezier(0.23, 1, 0.32, 1); }
.stagger-children.active > *:nth-child(2) { transition: all 0.6s 0.2s cubic-bezier(0.23, 1, 0.32, 1); }
.stagger-children.active > *:nth-child(3) { transition: all 0.6s 0.3s cubic-bezier(0.23, 1, 0.32, 1); }
.stagger-children.active > *:nth-child(4) { transition: all 0.6s 0.4s cubic-bezier(0.23, 1, 0.32, 1); }
.stagger-children.active > *:nth-child(5) { transition: all 0.6s 0.5s cubic-bezier(0.23, 1, 0.32, 1); }
.stagger-children.active > *:nth-child(6) { transition: all 0.6s 0.6s cubic-bezier(0.23, 1, 0.32, 1); }

/* ── Stats Counter ── */
.stat-number {
    font-variant-numeric: tabular-nums;
}

/* ── Noise Texture ── */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ── Line Clamp ── */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Prose ── */
.prose p {
    color: #374151;
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

/* ── Spinner ── */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #005fbf;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

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

/* ── Section Alternating ── */
.section-alt {
    background: #f0f2f7;
}

/* ── Color Accent Blocks ── */
.accent-magenta { background: rgba(233, 30, 99, 0.1); color: #e91e63; }
.accent-orange { background: rgba(255, 109, 0, 0.1); color: #ff6d00; }
.accent-yellow { background: rgba(255, 214, 0, 0.1); color: #f59e0b; }
.accent-cyan { background: rgba(0, 188, 212, 0.1); color: #00bcd4; }
.accent-purple { background: rgba(156, 39, 176, 0.1); color: #9c27b0; }
.accent-lime { background: rgba(139, 195, 74, 0.1); color: #689f38; }
.accent-blue { background: rgba(32, 64, 131, 0.1); color: #005fbf; }

/* ── WhatsApp FAB ── */
.whatsapp-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    background: #25d366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    z-index: 50;
    text-decoration: none;
}

.whatsapp-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.5);
}

/* ── Breadcrumb ── */
.breadcrumb a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #005fbf;
}

/* ── Sidebar ── */
.sidebar-service-link {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    color: #374151;
}

.sidebar-service-link:hover {
    background: #f3f4f6;
    color: #005fbf;
}

.sidebar-service-link.active {
    background: #005fbf;
    color: white;
}

/* ── Form Focus ── */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #005fbf;
    box-shadow: 0 0 0 3px rgba(32, 64, 131, 0.15);
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .marquee-content { animation: none; }
    .reveal { opacity: 1; transform: none; }
    .stagger-children > * { opacity: 1; transform: none; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .hero-section { min-height: auto; padding-top: 6rem; padding-bottom: 4rem; }
    .btn-primary, .btn-accent, .btn-outline { padding: 0.875rem 1.5rem; font-size: 1rem; }
}
