/* CSS Variables synced with Advanced Themer */
:root {
    /* Mapped seamlessly to Advanced Themer core variables so your backend updates styling instantly */
    --bg-dark: var(--at-DeepBackground, var(--at-deep-background, #0f1013));
    --bg-panel: var(--at-PanelBackground, var(--at-panel-background, #1a1c23));
    --primary-red: var(--at-PrimaryRed, var(--at-primary-red, #ed1c24));
    --primary-red-glow: rgba(237, 28, 36, 0.4);
    --text-light: var(--at-TextLight, var(--at-text-light, #f5f4ef));
    --text-muted: var(--at-TextMuted, var(--at-text-muted, #dbd6c2));
    --border-color: var(--at-BorderDark, var(--at-border-dark, #2b2f38));

    --font-heading: "Impact", sans-serif;
    --font-body: "Montserrat", sans-serif;

    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /*cursor: none; /* Hide default cursor to use custom */
}

html {
    scroll-behavior: auto; /* Handle scrolling manually with custom smooth behavior if needed */
    background-color: var(--bg-dark);
}

body {
    font-family: var(--font-body);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

body::-webkit-scrollbar {
    width: 6px;
}
body::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
body::-webkit-scrollbar-thumb {
    background: var(--border-color);
}
body::-webkit-scrollbar-thumb:hover {
    background: var(--primary-red);
}

/* Utility noise overlay for grunge feel */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opactiy='0.05'/%3E%3C/svg%3E");
    opacity: 0.03;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.section-title {
    font-size: 3.5rem;
    color: var(--text-light);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.8);
}
.section-title span {
    color: var(--primary-red);
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: -10px;
    margin-bottom: 20px;
}

.divider {
    height: 2px;
    width: 60px;
    background-color: var(--primary-red);
    margin: 20px 0;
}
.divider.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2000; /* above fullscreen menu */
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(15, 16, 19, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px 5%;
}

.logo img {
    height: 45px;
    display: block;
    filter: drop-shadow(0px 0px 4px rgba(255, 255, 255, 0.2));
    position: relative;
    z-index: 2001; /* Stay above any menu layer */
}

/* Burger Menu Button */
.menu-btn {
    background: transparent;
    border: none;
    cursor: none; /* using our custom cursor */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 35px;
    height: 24px;
    z-index: 2001;
    position: relative;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: var(--text-light);
    border-radius: 2px;
    transition:
        transform 0.4s cubic-bezier(0.54, -0.81, 0.57, 0.57),
        opacity 0.3s;
    transform-origin: right;
}

.menu-btn:hover .hamburger-line {
    background-color: var(--primary-red);
}

/* Active State for Burger */
.menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(-45deg) translate(-2px, 3px);
}
.menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}
.menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(45deg) translate(-2px, -3px);
}

/* Fullscreen Overlay Menu */
.fullscreen-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: clip-path 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    clip-path: circle(0% at right 5%); /* Hides menu */
    pointer-events: none;
}

.fullscreen-menu.open {
    clip-path: circle(150% at right 5%);
    pointer-events: all;
}

/* Menu Background with Image */
.menu-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: grayscale(1) contrast(1.2);
    opacity: 0;
    transition: opacity 1s ease 0.4s;
    transform: scale(1.1);
    transition:
        transform 10s ease,
        opacity 0.8s ease 0.4s;
}

.fullscreen-menu.open .menu-bg-img {
    opacity: 0.2; /* Subtly show background behind the dark overlay */
    transform: scale(1);
}

.menu-overlay-dark {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark); /* Solid dark base */
    opacity: 0.95;
    z-index: -1;
}

/* Menu Content */
.menu-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    padding: 0 5%;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.nav-list li {
    overflow: hidden;
}

.nav-list li a {
    font-family: var(--font-heading);
    color: var(--text-light);
    font-size: clamp(3rem, 6vw, 6rem);
    text-decoration: none;
    line-height: 1;
    display: inline-block;
    position: relative;
    transform: translateY(100%);
    opacity: 0;
    transition:
        transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        color 0.3s,
        text-shadow 0.3s;
    transition-delay: calc(0.1s * var(--i));
    -webkit-text-stroke: 1px transparent; /* For stroke effect on hover */
}

.fullscreen-menu.open .nav-list li a {
    transform: translateY(0);
    opacity: 1;
}

.nav-list li a span {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-red);
    vertical-align: super;
    margin-right: 15px;
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-list li:hover a span {
    opacity: 1;
}

.nav-list li a:hover {
    color: transparent;
    -webkit-text-stroke: 1px var(--text-light);
    text-shadow: 4px 4px 0px rgba(237, 28, 36, 0.5); /* red shadow */
    transform: translateX(20px);
}

.menu-contact {
    margin-top: 50px;
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 0.6s ease,
        transform 0.6s ease;
    transition-delay: 0.8s;
}

.fullscreen-menu.open .menu-contact {
    opacity: 1;
    transform: translateY(0);
}

.menu-contact p {
    color: var(--primary-red);
    font-family: var(--font-heading);
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.menu-contact a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
    transition: color 0.3s;
}

.menu-contact a:hover {
    color: var(--text-light);
}

/* Custom Cursor */
.cursor {
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-red);
    border-radius: 50%;
    position: fixed;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10000;
    transition:
        width 0.2s,
        height 0.2s,
        background-color 0.2s;
}
.cursor.active {
    width: 40px;
    height: 40px;
    background-color: rgba(237, 28, 36, 0.2);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding: 0 5%;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -2;
    background-color: #000;
}

.glitch-bg {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.4;
    animation: slowZoom 20s infinite alternate;
    filter: contrast(1.2) grayscale(0.5);
}

.hero::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, var(--bg-dark) 100%);
    z-index: -1;
}

@keyframes slowZoom {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.1);
    }
}

.hero-content {
    max-width: 900px;
    z-index: 1;
}

.glitch-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.glitch {
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 0.9;
    color: var(--text-light);
    position: relative;
    text-shadow: 4px 4px 10px rgba(0, 0, 0, 0.8);
}
.glitch.highlight {
    color: var(--primary-red);
}

/* Hero text animation */
.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
    pointer-events: none;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 red;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 blue;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(25px, 9999px, 86px, 0);
    }
    5% {
        clip: rect(69px, 9999px, 32px, 0);
        transform: translate(-2px, 1px);
    }
    10% {
        clip: rect(4px, 9999px, 98px, 0);
        transform: translate(2px, -1px);
    }
    15% {
        clip: rect(100px, 9999px, 11px, 0);
    }
    20% {
        clip: rect(85px, 9999px, 49px, 0);
    }
    25% {
        clip: rect(50px, 9999px, 20px, 0);
        transform: translate(0, 0);
    }
    100% {
        clip: rect(50px, 9999px, 20px, 0);
        transform: translate(0, 0);
    }
}

.subtitle {
    font-size: clamp(1.8rem, 2vw, 2rem);
    color: var(--text-muted);
    font-weight: 300;
    margin-bottom: 40px;
    max-width: 600px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 36px;
    font-family: var(--font-heading);
    font-size: 2rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    border: none;
}

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

.btn-text {
    position: relative;
    z-index: 2;
    margin-top: 5px; /* Alignment for specific font */
}

.primary-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    z-index: 1;
}

.primary-btn:hover::before {
    left: 0;
}

.primary-btn:hover {
    box-shadow: 0 0 20px var(--primary-red-glow);
    transform: translateY(-3px);
}

.outline-btn {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--text-light);
}

.outline-btn:hover {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: white;
    transform: translateY(-3px);
}

.scroll-indicator {
    position: absolute;
    bottom: 80px;
    left: 5%;
    display: flex;
    align-items: center;
    gap: 15px;
    transform: rotate(-90deg);
    transform-origin: left center;
}

.scroll-indicator .text {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--text-muted);
}

.scroll-indicator .line {
    width: 60px;
    height: 1px;
    background-color: var(--primary-red);
    animation: pulseWidth 2s infinite;
}

@keyframes pulseWidth {
    0% {
        width: 20px;
    }
    50% {
        width: 60px;
    }
    100% {
        width: 20px;
    }
}

/* Sections */
section {
    padding: 100px 0;
    position: relative;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 60px;
    align-items: center;
}

@media (min-width: 992px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.about-text p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--text-muted);
}
.about-text p strong {
    color: var(--text-light);
}

.visual-box {
    position: relative;
    padding: 20px;
}
.decor-box {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 40px;
    left: 40px;
    border: 2px solid var(--border-color);
    z-index: -1;
    transition: var(--transition);
}
.visual-box:hover .decor-box {
    border-color: var(--primary-red);
    transform: translate(10px, -10px);
}
.parallax-img {
    width: 100%;
    height: auto;
    filter: grayscale(0.8) contrast(1.2);
    transition: var(--transition);
    display: block;
}
.visual-box:hover .parallax-img {
    filter: grayscale(0) contrast(1.1);
}

/* Services Grid */
.services-section {
    background-color: var(--bg-panel);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.text-center {
    text-align: center;
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 60px;
}

@media (min-width: 768px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.service-card {
    padding: 50px 30px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    position: relative;
    text-align: left;
    transition: var(--transition);
    overflow: hidden;
}

.service-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--primary-red);
    transition: width 0.4s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(237, 28, 36, 0.3);
}

.service-card:hover::after {
    width: 100%;
}

.card-number {
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--border-color);
    position: absolute;
    top: -10px;
    right: 20px;
    line-height: 1;
    transition: var(--transition);
}

.service-card:hover .card-number {
    color: rgba(237, 28, 36, 0.2);
}

.service-card h3 {
    font-size: 2rem;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.service-card p {
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

/* Projects */
.projects-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-top: 50px;
}
@media (min-width: 992px) {
    .projects-gallery {
        grid-template-columns: 1fr 1fr;
    }
}

.project-img-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.project-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1);
    transition:
        transform 0.6s ease,
        filter 0.6s ease;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 28, 35, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.project-item:hover .project-img-wrapper img {
    transform: scale(1.05);
    filter: grayscale(0);
}

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

.project-info {
    padding-top: 20px;
}

.project-info h3 {
    font-size: 2rem;
    color: var(--text-light);
}

.project-info span {
    font-size: 0.9rem;
    color: var(--primary-red);
    font-family: var(--font-body);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Marquee */
.marquee-container {
    background-color: var(--primary-red);
    padding: 20px 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

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

.marquee span {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--bg-dark);
    margin-right: 20px;
}

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

/* Footer */
.footer {
    background-color: var(--bg-panel);
    padding: 80px 0 20px;
    border-top: 1px solid var(--border-color);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 60px;
}
@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 1.5fr 1fr;
    }
}

.footer-logo {
    max-width: 250px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.footer-brand p {
    color: var(--text-muted);
    max-width: 400px;
}

.footer-contact h4 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-light);
}

.contact-link {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 15px;
    transition: var(--transition);
}

.contact-link:hover {
    color: var(--primary-red);
    transform: translateX(5px);
}

.contact-link .icon {
    margin-right: 15px;
    font-size: 1.2rem;
}

.location {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    margin-top: 20px;
}
.location .icon {
    margin-right: 15px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(219, 214, 194, 0.5);
    font-size: 0.9rem;
}

/* Interior Hero Background */
.interior-header {
    position: relative;
    padding: 180px 5% 100px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.interior-bg-img {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: grayscale(1) contrast(1.2);
    opacity: 0.5;
    z-index: 0 !important;
}

.interior-overlay-dark {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(15, 16, 19, 0.2) 0%,
        rgba(15, 16, 19, 0.8) 70%,
        var(--bg-dark) 100%
    );
    z-index: 1 !important;
}

.interior-header > h1,
.interior-header > p {
    position: relative;
    z-index: 2;
}

/* Animations */
.fade-in {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 1s ease,
        transform 1s ease;
}

.js-running .fade-in:not(.visible) {
    opacity: 0;
    transform: translateY(30px);
}

/* Single Page Specific Styles */
.blog-post-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto;
}
.blog-post-content h2 {
    color: var(--text-light);
    margin: 60px 0 30px;
    font-size: 2.2rem;
}
.blog-post-content p {
    margin-bottom: 25px;
}
.blog-post-content blockquote {
    border-left: 4px solid var(--primary-red);
    padding: 20px 0 20px 30px;
    font-size: 1.5rem;
    color: var(--text-light);
    margin: 50px 0;
    font-family: var(--font-heading);
    letter-spacing: 1px;
}
.blog-post-content img {
    width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    margin: 40px 0;
    filter: grayscale(0.5);
}

.project-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 60px 0;
    margin: 60px 0;
}
.meta-item h4 {
    color: var(--primary-red);
    font-size: 0.8rem;
    font-family: var(--font-body);
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 2px;
}
.meta-item p {
    color: var(--text-light);
    font-size: 1.2rem;
    font-weight: 400;
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

.project-full-img {
    width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    margin-bottom: 40px;
    filter: grayscale(1);
    transition: var(--transition);
}
.project-full-img:hover {
    filter: grayscale(0);
}

/* Background Animation Variations */
.bg-zoom-pan {
    animation: zoomPan 25s linear infinite alternate !important;
}

@keyframes zoomPan {
    0% {
        transform: scale(1) translate(0, 0);
    }
    100% {
        transform: scale(1.15) translate(-2%, -2%);
    }
}

.bg-flicker {
    animation: crtFlicker 6s infinite !important;
}

@keyframes crtFlicker {
    0%,
    9%,
    11%,
    19%,
    21%,
    79%,
    81%,
    100% {
        opacity: 0.4;
        transform: translate(0, 0);
        filter: contrast(1.2) grayscale(0.5);
    }
    10% {
        opacity: 0.7;
        transform: translate(-5px, 2px);
        filter: contrast(2) grayscale(0);
    }
    20% {
        opacity: 0.2;
        transform: translate(5px, -3px);
        filter: contrast(1) grayscale(1);
    }
    80% {
        opacity: 0.9;
        transform: translate(-3px, 5px);
        filter: contrast(2.5) grayscale(0.2);
    }
}

.bg-parallax {
    height: 130% !important; /* Extra height to allow movement */
    top: -15% !important;
    position: relative;
    animation: none !important;
    will-change: transform;
}
