:root {
    --primary: #E30613;
    --accent: #CC0000;
    --background: #FFFFFF;
    --foreground: #1A1A1A;
    --muted: #F5F5F5;
    --border: #E5E5E5;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    overflow-x: hidden;
}

h1, h2, h3 { font-family: 'Montserrat', sans-serif; text-wrap: balance; }
.mono { font-family: 'JetBrains Mono', monospace; }

/* Typography Scale */
.hero-headline { font-size: clamp(2.5rem, 8vw, 5.25rem); font-weight: 800; line-height: 1.08; letter-spacing: -0.04em; }
.section-headline { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.sub-headline { font-size: 1.25rem; font-weight: 700; line-height: 1.3; }
.body-text { font-size: 1rem; line-height: 1.7; font-weight: 400; }
.caption-text { font-size: 0.65rem; font-family: 'JetBrains Mono', monospace; letter-spacing: 0.05em; text-transform: uppercase; }

/* Signature Effect: Blueprint Drawing Board */
.blueprint-drawing-board {
    position: relative;
    border: 1px solid var(--border);
    background-image:
        linear-gradient(to right, var(--border) 1px, transparent 1px),
        linear-gradient(to bottom, var(--border) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center;
}
.blueprint-drawing-board::before {
    content: '';
    position: absolute;
    top: -5px; left: -5px;
    width: 10px; height: 10px;
    border-top: 2px solid var(--primary);
    border-left: 2px solid var(--primary);
    z-index: 10;
}

/* Motion System */
.animate-enter {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1), transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}
.animate-enter.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.word-reveal-parent {
    overflow: hidden;
    display: inline-block;
    vertical-align: bottom;
    padding-bottom: 0.15em;
}
.animate-word-enter {
    display: inline-block;
    transform: translateY(110%);
    transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}
.hero-headline.is-visible .animate-word-enter {
    transform: translateY(0);
}

/* Components */
.cta-button {
    display: inline-flex;
    align-items: center;
    padding: 16px 32px;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    transition: all 300ms cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 4px 14px 0 rgba(227, 6, 19, 0.3);
    gap: 12px;
}
.cta-button:hover {
    transform: translateY(-1px);
    background: var(--accent);
    box-shadow: 0 10px 20px -10px rgba(227, 6, 19, 0.5);
}

.service-card {
    padding: 32px;
    border: 1px solid var(--border);
    transition: all 400ms cubic-bezier(0.23, 1, 0.32, 1);
    background: white;
}
.service-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px -20px rgba(0,0,0,0.1);
}

.reveal-container {
    overflow: hidden;
    position: relative;
}
.reveal-mask {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: white;
    z-index: 10;
    transition: transform 1s cubic-bezier(0.19, 1, 0.22, 1);
}
.is-visible .reveal-mask {
    transform: translateX(101%);
}
.reveal-container img {
    transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1);
    transform: scale(1.1);
}
.is-visible img {
    transform: scale(1);
}

/* Navigation underline */
nav a { position: relative; }
nav a::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 0; height: 1px;
    background: var(--primary);
    transition: width 0.3s ease;
}
nav a:hover::after { width: 100%; }
nav a.active { color: var(--primary) !important; }

/* Sections spacing */
section { padding-top: 160px; padding-bottom: 160px; }
.hero-section { padding: 0; height: 100vh; min-height: 700px; position: relative; }

/* ============================================================
   ENHANCED VISUAL POLISH
   ============================================================ */

/* Subtle noise/grain texture overlay for depth on dark sections */
.hero-section::after,
.relative.py-32.overflow-hidden::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 3px 3px;
    z-index: 5;
    opacity: 0.4;
}

/* Glow accent line under section captions */
.caption-text {
    position: relative;
}

/* CTA button shine sweep on hover */
.cta-button {
    position: relative;
    overflow: hidden;
}
.cta-button::before {
    content: '';
    position: absolute;
    top: 0; left: -75%;
    width: 50%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
}
.cta-button:hover::before { left: 125%; }

/* Service cards: gradient top border reveal + icon lift */
.service-card {
    position: relative;
}
.service-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #ff6b6b, var(--primary));
    background-size: 200% 100%;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 400ms cubic-bezier(0.23, 1, 0.32, 1);
}
.service-card:hover::before {
    transform: scaleX(1);
    animation: gradientShift 2s linear infinite;
}
.service-card img { transition: transform 400ms cubic-bezier(0.23, 1, 0.32, 1); }
.service-card:hover img { transform: scale(1.08) rotate(-2deg); }

@keyframes gradientShift {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* Stat numbers: subtle gradient text */
.counter, .mono.text-5xl {
    background: linear-gradient(135deg, #ffffff 40%, #ff8a8a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Portfolio card lift */
.portfolio-card { transition: transform 400ms cubic-bezier(0.23, 1, 0.32, 1); }
.portfolio-card:hover { transform: translateY(-6px); }

/* Zoomable images: cursor + subtle scale on hover */
.zoomable {
    cursor: zoom-in;
    transition: transform 500ms cubic-bezier(0.23, 1, 0.32, 1), filter 400ms ease;
}
.zoomable:hover {
    filter: brightness(1.03);
}

/* Zoom hint badge shown on image hover */
.zoom-hint {
    position: absolute;
    inset: 0;
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: white;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    transition: opacity 350ms ease;
    pointer-events: none;
}
.group:hover .zoom-hint,
.reveal-container:hover .zoom-hint {
    opacity: 1;
}
.zoom-hint-icon {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 1.5px solid rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.7);
    transition: transform 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(2px);
}
.group:hover .zoom-hint-icon,
.reveal-container:hover .zoom-hint-icon {
    transform: scale(1);
}
.zoom-hint-icon svg { width: 20px; height: 20px; }

/* ============================================================
   LIGHTBOX / IMAGE ZOOM MODAL
   ============================================================ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 350ms cubic-bezier(0.19, 1, 0.22, 1);
}
.lightbox.is-open {
    opacity: 1;
    visibility: visible;
}
.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(6px);
}
.lightbox-stage {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: min(92vw, 1100px);
    max-height: 90vh;
    transform: scale(0.94);
    transition: transform 400ms cubic-bezier(0.19, 1, 0.22, 1);
}
.lightbox.is-open .lightbox-stage {
    transform: scale(1);
}
.lightbox-frame {
    overflow: hidden;
    max-height: 78vh;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6);
}
.lightbox-frame img {
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    transition: transform 300ms ease;
    cursor: zoom-in;
}
.lightbox-frame img.is-zoomed {
    transform: scale(2.2);
    cursor: zoom-out;
}
.lightbox-meta {
    margin-top: 20px;
    text-align: center;
    color: white;
}
.lightbox-counter {
    display: inline-block;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--primary);
    margin-bottom: 8px;
}
.lightbox-caption {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.75);
}
.lightbox-close,
.lightbox-nav {
    position: absolute;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.05);
    color: white;
    cursor: pointer;
    transition: all 250ms ease;
}
.lightbox-close svg,
.lightbox-nav svg { width: 20px; height: 20px; }
.lightbox-close:hover,
.lightbox-nav:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.08);
}
.lightbox-close {
    top: 24px;
    right: 24px;
}
.lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover, .lightbox-next:hover { transform: translateY(-50%) scale(1.08); }

@media (max-width: 640px) {
    .lightbox-prev, .lightbox-next { width: 40px; height: 40px; }
    .lightbox-close { width: 40px; height: 40px; top: 14px; right: 14px; }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
}

/* ============================================================
   PRELOADER
   ============================================================ */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #0d0d0d;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    transition: opacity 700ms cubic-bezier(0.19, 1, 0.22, 1), visibility 700ms;
}
.preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.preloader-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.75);
    animation: preloaderLogoPop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes preloaderLogoPop {
    0% { opacity: 0; transform: scale(0.75); }
    60% { opacity: 1; transform: scale(1.06); }
    100% { opacity: 1; transform: scale(1); }
}
.preloader-path {
    stroke-dasharray: 260;
    stroke-dashoffset: 260;
    animation: drawPath 1.1s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
.preloader-path-accent {
    stroke-dasharray: 90;
    stroke-dashoffset: 90;
    animation: drawPath 0.6s 0.5s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
@keyframes drawPath {
    to { stroke-dashoffset: 0; }
}
.preloader-label {
    color: white;
    letter-spacing: 0.3em;
    font-size: 0.8rem;
    opacity: 0.8;
}
.preloader-dots::after {
    content: '';
}
.preloader-bar {
    width: 160px;
    height: 2px;
    background: rgba(255,255,255,0.15);
    overflow: hidden;
    border-radius: 999px;
}
.preloader-bar span {
    display: block;
    width: 40%;
    height: 100%;
    background: var(--primary);
    animation: preloaderSlide 1.1s ease-in-out infinite;
}
@keyframes preloaderSlide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* ============================================================
   SCROLL PROGRESS BAR
   ============================================================ */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), #ff8a8a);
    z-index: 998;
    transition: width 80ms linear;
    box-shadow: 0 0 8px rgba(227, 6, 19, 0.6);
}

/* ============================================================
   CUSTOM CURSOR (desktop only)
   ============================================================ */
.has-custom-cursor, .has-custom-cursor a, .has-custom-cursor button {
    cursor: none !important;
}
.cursor-dot, .cursor-ring {
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 9998;
    transition: opacity 200ms ease;
}
.cursor-dot {
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    background: var(--primary);
    border-radius: 50%;
}
.cursor-ring {
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 1.5px solid rgba(227, 6, 19, 0.6);
    border-radius: 50%;
    transition: width 250ms cubic-bezier(0.19,1,0.22,1), height 250ms cubic-bezier(0.19,1,0.22,1),
                margin 250ms cubic-bezier(0.19,1,0.22,1), border-color 250ms ease, background 250ms ease, opacity 200ms ease;
}
.cursor-ring.is-hovering {
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
    background: rgba(227, 6, 19, 0.08);
    border-color: var(--primary);
}
.cursor-dot.is-hovering { transform: scale(0); }
.cursor-ring.is-clicking { transform: scale(0.85); }

@media (max-width: 1024px) {
    .cursor-dot, .cursor-ring { display: none !important; }
    .has-custom-cursor, .has-custom-cursor a, .has-custom-cursor button { cursor: auto !important; }
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
.back-to-top {
    position: fixed;
    right: 28px;
    bottom: 28px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #1A1A1A;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 400;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: opacity 350ms ease, visibility 350ms ease, transform 350ms ease, background 250ms ease;
    cursor: pointer;
}
.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover { background: var(--primary); }
.back-to-top-arrow {
    width: 18px;
    height: 18px;
    position: relative;
    z-index: 2;
}
.back-to-top-progress {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.back-to-top-track {
    fill: none;
    stroke: rgba(255,255,255,0.12);
    stroke-width: 2;
}
.back-to-top-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 2;
    stroke-linecap: round;
    transition: stroke-dashoffset 150ms linear;
}

@media (max-width: 640px) {
    .back-to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
}

/* ============================================================
   MARQUEE / BRAND STRIP
   ============================================================ */
.marquee-strip {
    background: #1A1A1A;
    color: white;
    overflow: hidden;
    white-space: nowrap;
    padding: 18px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.marquee-track {
    display: inline-flex;
    align-items: center;
    animation: marqueeScroll 28s linear infinite;
    will-change: transform;
}
.marquee-item {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    padding: 0 20px;
    color: rgba(255,255,255,0.85);
}
.marquee-sep {
    color: var(--primary);
    font-size: 0.8rem;
}
@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Card tilt: smooth easing when JS not moving (reset state) */
.service-card, .portfolio-card {
    transition: transform 400ms cubic-bezier(0.23, 1, 0.32, 1), border-color 400ms ease, box-shadow 400ms ease;
    will-change: transform;
}

/* Magnetic buttons: smooth spring-back */
.cta-button {
    transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1), background 300ms ease, box-shadow 300ms ease;
}

/* ============================================================
   PORTFOLIO IMAGE UPLOAD — DROPZONE
   ============================================================ */
.dropzone {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    border: 2px dashed var(--border);
    background: var(--muted);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 300ms ease, background 300ms ease;
}
.dropzone:hover,
.dropzone.is-dragover {
    border-color: var(--primary);
    background: rgba(227, 6, 19, 0.04);
}
.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 32px 16px;
    text-align: center;
    transition: opacity 250ms ease;
}
.dropzone-icon {
    width: 36px;
    height: 36px;
    color: var(--primary);
    margin-bottom: 6px;
    transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dropzone:hover .dropzone-icon,
.dropzone.is-dragover .dropzone-icon {
    transform: translateY(-4px);
}
.dropzone-preview {
    display: none;
    max-width: 100%;
    max-height: 260px;
    object-fit: contain;
    padding: 12px;
}
.dropzone.has-preview .dropzone-content { display: none; }
.dropzone.has-preview .dropzone-preview { display: block; }

/* Upload button loading state */
.cta-button.is-uploading {
    opacity: 0.7;
    pointer-events: none;
}
.cta-button.is-uploading span::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    vertical-align: middle;
    animation: spin 700ms linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar styling */
* {
    scrollbar-width: thin;
    scrollbar-color: #bfc5ce transparent;
}
*::-webkit-scrollbar { width: 6px; }
*::-webkit-scrollbar-thumb { background-color: #bfc5ce; border-radius: 9999px; }
*::-webkit-scrollbar-track { background-color: transparent; border-radius: 9999px; }
