:root {
    --clr-bg: #E14147;
    --clr-text: #F2E9E1;
    --text-hero: clamp(2.5rem, 5.5vw, 6.5rem);
    --text-h2: clamp(2.5rem, 6vw, 6rem);
    --text-massive: clamp(3rem, 10vw, 12rem);

    /* Pulled left padding tighter specifically for mobile */
    --padding-x: clamp(1rem, 5vw, 4rem);
    --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
    cursor: auto;
}

body {
    background-color: var(--clr-bg);
    color: var(--clr-text);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* === PRELOADER (Curtain) === */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--clr-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.9s cubic-bezier(0.77, 0, 0.18, 1);
    will-change: transform;
}

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

.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* === AESTHETIC DOTS LOADER === */
.loader-dots {
    position: relative;
    width: 70px;
    height: 70px;
}

/* Orbiting dots */
.dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--clr-text);
    border-radius: 50%;
    /* Each dot starts at a different angle (set via --i inline style) */
    transform: translate(-50%, -50%) rotate(calc(60deg * var(--i))) translateX(30px);
    animation: orbitSpin 1.8s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    animation-delay: calc(-0.15s * var(--i));
    will-change: transform, opacity;
}

@keyframes orbitSpin {
    0% {
        opacity: 0.2;
        transform: translate(-50%, -50%) rotate(calc(60deg * var(--i))) translateX(30px) scale(0.6);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(calc(60deg * var(--i) + 180deg)) translateX(30px) scale(1.3);
    }

    100% {
        opacity: 0.2;
        transform: translate(-50%, -50%) rotate(calc(60deg * var(--i) + 360deg)) translateX(30px) scale(0.6);
    }
}

/* Center pulsing dot */
.dot-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    background: var(--clr-text);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulseCenter 1.8s ease-in-out infinite alternate;
    box-shadow: 0 0 20px rgba(242, 233, 225, 0.3);
}

@keyframes pulseCenter {
    0% {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: 0.4;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.4);
        opacity: 1;
    }
}

/* Brand text below dots */
.loader-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--clr-text);
    letter-spacing: 0.1em;
    line-height: 1.2;
    animation: pulseText 1.8s ease-in-out infinite alternate;
}

@keyframes pulseText {
    0% {
        opacity: 0.3;
        transform: scale(0.95);
    }

    100% {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* Hide preloader when JS is disabled (failsafe) */
.no-js #preloader {
    display: none;
}




a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: 100%;
    padding: 0 var(--padding-x);
}

.section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(0rem, 0vh, 0em) var(--padding-x);
    z-index: 100;
    transition: transform 0.4s var(--ease-premium);
    will-change: transform;
}

.nav--hidden {
    transform: translateY(-100%);
}

.nav-logo {
    display: flex;
    align-items: center;
    transform: translateX(-4vw);
}

.nav-logo img {
    height: clamp(100px, 12vw, 140px);
    width: auto;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

#logo-fallback {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
}

#logo-fallback span {
    font-weight: 400;
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: clamp(1.8rem, 5vw, 3.5rem);
    font-size: clamp(0.8rem, 1.2vw, 0.95rem);
    font-weight: 600;
}

.nav-links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    transition: opacity 0.3s var(--ease-premium), transform 0.3s var(--ease-premium);
}

.nav-links a:hover {
    opacity: 0.7;
    transform: translateY(-2px);
}

/* Hero & Kinetic Canvas */
.hero {
    overflow: hidden;
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* height set by JS to extend into services */
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 2s ease;
    /* Fade the canvas out at the bottom using a mask */
    -webkit-mask-image: linear-gradient(to bottom,
            rgba(0, 0, 0, 1) 0%,
            rgba(0, 0, 0, 1) 55%,
            rgba(0, 0, 0, 0) 100%);
    mask-image: linear-gradient(to bottom,
            rgba(0, 0, 0, 1) 0%,
            rgba(0, 0, 0, 1) 55%,
            rgba(0, 0, 0, 0) 100%);
}

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

/* Ensure services section content renders above the canvas */
.services .container {
    position: relative;
    z-index: 10;
}

.premium-reveal {
    font-size: var(--text-hero);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.text-mask {
    overflow: hidden;
    line-height: 1.1;
    padding-bottom: 0.1em;
}

.m-br {
    display: none;
}

.mask-inner {
    display: block;
    transform: translateY(110%);
    transition: transform 1.2s var(--ease-premium);
    text-wrap: balance;
    word-break: keep-all;
    overflow-wrap: break-word;
    /* fallback for older browsers */
}

.is-visible .mask-inner {
    transform: translateY(0);
}

.premium-reveal .text-mask:nth-child(1) .mask-inner {
    transition-delay: 0.1s;
}

.premium-reveal .text-mask:nth-child(2) .mask-inner {
    transition-delay: 0.25s;
}

.premium-reveal .text-mask:nth-child(3) .mask-inner {
    transition-delay: 0.4s;
}

/* Services */
.section-title {
    font-size: var(--text-h2);
    margin-bottom: 5vh;
}

.service-list {
    list-style: none;
    border-top: 1px solid rgba(242, 233, 225, 0.3);
}

.service-item {
    display: flex;
    align-items: center;
    padding: clamp(2rem, 4vh, 3rem) 0;
    border-bottom: 1px solid rgba(242, 233, 225, 0.3);
    position: relative;
    overflow: hidden;
    transition: padding-left 0.5s var(--ease-premium);
}

.service-number {
    font-size: 1.2rem;
    margin-right: clamp(1rem, 3vw, 3rem);
    opacity: 0.5;
}

.service-name {
    font-size: clamp(1.2rem, 3vw, 3rem);
    font-weight: 500;
}

.service-line {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--clr-text);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s var(--ease-premium);
}

/* Contact / Quicklinks */
.contact-footer {
    justify-content: center;
    padding-bottom: 10vh;
}

.motto {
    font-family: monospace;
    font-size: clamp(0.85rem, 1.5vw, 1.2rem);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.8;
    margin-bottom: 5vh;
}

.massive-links {
    display: flex;
    flex-direction: column;
}

.link-wrapper {
    overflow: hidden;
    line-height: 0.9;
}

.massive-links a {
    display: inline-block;
    font-size: var(--text-massive);
    font-weight: 700;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    transition: opacity 0.4s ease, transform 0.5s var(--ease-premium);
    position: relative;
    z-index: 10;
    opacity: 0.35;
    /* <--- CHANGED: Starts dim (shadow colour) */
}

/* Staggered entry animation */
.link-wrapper:nth-child(1) {
    transition-delay: 0.1s;
}

.link-wrapper:nth-child(2) {
    transition-delay: 0.2s;
}

.link-wrapper:nth-child(3) {
    transition-delay: 0.3s;
}

.link-wrapper:nth-child(4) {
    transition-delay: 0.4s;
}

/* Global Reveals */
.reveal-fade {
    opacity: 0;
    transition: opacity 1.5s ease;
}

.is-visible.reveal-fade {
    opacity: 1;
}

.reveal-slide {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s ease, transform 1.2s var(--ease-premium);
}

.is-visible.reveal-slide,
.is-visible .reveal-slide {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   RIPPLE EFFECT (for touch)
   ========================================= */
.ripple-effect {
    position: fixed;
    pointer-events: none;
    border-radius: 50%;
    background: rgba(242, 233, 225, 0.3);
    transform: scale(0);
    width: 0;
    height: 0;
    opacity: 0;
    transition: none;
    z-index: 9999;
}

.ripple-effect.active {
    width: 120px;
    height: 120px;
    opacity: 1;
    transform: scale(1);
    transition: width 0.4s ease, height 0.4s ease, opacity 0.6s ease, transform 0.4s ease;
}

/* =========================================
   GHOST TOUCH ELIMINATION (Hover strictly for Desktop)
   ========================================= */
@media (hover: hover) and (pointer: fine) {
    html {
        cursor: none;
    }

    .service-item:hover {
        padding-left: 2rem;
    }

    .service-item:hover .service-line {
        transform: scaleX(1);
    }

    .massive-links a:hover {
        opacity: 1;
        transform: translateX(20px);
    }


    .massive-links a:hover {
        opacity: 1;
        transform: translateX(20px);
    }

    /* Custom Cursor only exists on desktop */
    .cursor {
        position: fixed;
        top: 0;
        left: 0;
        width: 12px;
        height: 12px;
        background-color: var(--clr-text);
        border-radius: 50%;
        pointer-events: none;
        z-index: 9999;
        transform: translate(-50%, -50%);
        transition: width 0.3s var(--ease-premium), height 0.3s var(--ease-premium), background-color 0.3s ease;
        will-change: transform;
        display: block;
    }

    .cursor.hovered {
        width: 60px;
        height: 60px;
        background-color: rgba(242, 233, 225, 0.05);
        border: 1px solid var(--clr-text);
        backdrop-filter: blur(2px);
    }
}

@media (hover: none) {
    .cursor {
        display: none !important;
    }
}

/* FAILSAFE: If JS breaks */
@keyframes forceReveal {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mask-inner {
    animation: forceReveal 0.1s linear 1.5s forwards;
}

/* =========================================
   MOBILE & TOUCH OPTIMIZATION
   ========================================= */

a,
button,
.hover-target {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Touch feedback (Active State) */
@media (hover: none) {

    a:active,
    .hover-target:active {
        opacity: 0.6;
        transform: scale(0.98);
        transition: opacity 0.1s ease, transform 0.1s ease;
    }

    /* SPECIFIC FIX: Massive links turn FULL WHITE on tap */
    .massive-links a:active {
        opacity: 1 !important;
        /* Turns bright white */
        transform: scale(0.98);
        /* Keeps the subtle press effect */
    }
}

/* Specific Mobile Layout Adjustments */
@media (max-width: 768px) {
    html {
        scroll-snap-type: y mandatory;
    }

    .section {
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }

    :root {
        --text-hero: clamp(2.5rem, 11vw, 5rem);
        --text-massive: clamp(2.5rem, 15vw, 6rem);
        --padding-x: clamp(1.2rem, 6vw, 2rem);
    }

    /* Hero text centered and refined typography for mobile */
    .premium-reveal {
        text-align: center;
        letter-spacing: -0.02em;
    }

    /* Center hero content vertically / visually and pull it up */
    .hero-content {
        padding-top: 0;
        margin-top: -6vh;
    }

    .text-mask {
        line-height: 1.15;
        padding-bottom: 0.05em;
    }

    .m-br {
        display: block;
    }

    .service-item {
        padding: 1.5rem 0;
    }

    .massive-links a {
        transform: none !important;
    }

    /* Navbar adjustments */
    .nav {
        padding-top: 0rem;
        padding-bottom: 0.5rem;
        padding-left: clamp(0.2rem, 1vw, 0.5rem);
        padding-right: clamp(0.8rem, 2.5vw, 1.5rem);
    }

    .nav-logo img {
        height: clamp(90px, 10vw, 120px);
    }

    .nav-links {
        display: none;
    }
}