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

:root{
    --bg-opacity: 0; /* default minimal */
    --header-opacity: 0; /* default minimal */
    --footer-opacity: 0; /* default minimal */
    --about-bg-opacity: 0; /* opacity for the About section */
    --fab-size: 50px; /* default floating button size */
    --fab-opacity: 0.7; /* default fab opacity */
}

/* Thin, elegant scrollbars that match the site palette */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(142,68,173,0.15);
}
::-webkit-scrollbar-thumb {
  background: #8e44ad;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #9b59b6;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.header {
    position: fixed;
    top: 0;
    width: 100%;
    /* header uses black with adjustable opacity via the existing variable */
    background: rgba(0, 0, 0, var(--header-opacity));
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 0.75rem 0;
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.logo {
    font-size: 1.4rem;
    font-weight: 600;
    color: #ffffff;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: #ffffff;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #8e44ad;
}

/* Hamburger button (now active on all viewports) */
#menu-toggle {
    display: block; /* make burger visible on desktop as well */
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: #ffffff; /* ensure burger icon is white */
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.15s ease;
    z-index: 1350;
}
#menu-toggle:hover {
    background: rgba(0,0,0,0.05);
}

/* Desktop behaviour: default nav hidden, hamburger opens an overlay menu */
@media (min-width: 769px) {
    /* hide the traditional inline desktop nav so the burger controls it */
    .nav-links {
        display: none;
    }

    /* when open, show as a centered overlay panel on desktop */
    .nav-links.open {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 100vh;
        background: rgba(0, 0, 0, 0.95);
        flex-direction: column;
        gap: 0;
        align-items: center;
        justify-content: center;
        z-index: 1340;
        padding-top: 0;
        transition: opacity 0.25s ease, transform 0.25s ease;
    }
    .nav-links.open a {
        color: #ffffff;
        font-size: 1.25rem;
        padding: 1rem 1.5rem;
    }
    .nav-links.open li {
        width: auto;
        text-align: center;
    }
}

.main-content {
    position: relative;
    z-index: 1;
}

.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    /* use CSS variable for overlay opacity */
    background: linear-gradient(135deg, rgba(142,68,173,var(--bg-opacity)), rgba(52,152,219,var(--bg-opacity)));
    color: white;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(50px);
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(50px);
}

.cta-button {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    background: #8e44ad;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(50px);
}

.cta-button:hover {
    background: #9b59b6;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.services, .about, .contact {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    background-color: rgba(255,255,255,var(--bg-opacity));

    /* center all section content horizontally and vertically */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1.25rem;
}

.services {
    /* keep subtle overlay using variable */
    background: rgba(255,255,255,var(--bg-opacity));
}

.services h2, .about h2, .contact h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #ffffff;
}

.services h2 {
    color: #ffffff;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    background: rgba(248,249,250,var(--bg-opacity)); /* apply 10% overlay by default */
    padding: 1.5rem;
    border-radius: 12px;
}

.service-card {
    background: rgba(248, 249, 250, 0.85); /* 85% opacity */
    /* reduce top padding so the image area sits fully inside the card */
    padding: 1rem 2rem 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    overflow: visible; /* ensure the image container is fully visible */
}

/* image at top of each service card - responsive aspect container using percentage */
.img-wrap {
    width: 100%;
    position: relative;
    /* --aspect is percentage height relative to width; default increased to 135% */
    padding-top: var(--aspect, 135%);
    overflow: hidden;
    border-radius: 8px;
    margin: 0 0 1rem;
    background: #e9e9e9;
}

/* make the image fully cover the wrapper: 100% width and 100% height while preserving proportion */
.service-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* preserves aspect while filling both dimensions */
    display: block;
    border-radius: 0; /* corners handled by wrapper */
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-card h3 {
    color: #8e44ad;
    margin-bottom: 1rem;
}

.about {
    /* allow adjustable opacity via --about-bg-opacity */
    background: rgba(248,249,250,var(--about-bg-opacity));
    text-align: center;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* Improve readability of long prose in the About section */
.about-content {
    max-width: 900px;               /* constrain line length for readability */
    margin: 0 auto;
    text-align: center;             /* center content to match section centering */
    background: rgba(255,255,255,0.98);
    padding: 1.75rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    color: #24303a;                 /* slightly richer text color for contrast */
    line-height: 1.78;              /* more comfortable leading */
    font-size: 1rem;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    column-gap: 2.25rem;

    /* ensure lists and long blocks remain centered and readable */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Use two column layout on wider viewports for better digestible blocks */
@media (min-width: 900px) {
    .about-content {
        column-count: 2;
        padding: 2rem;
    }
}

/* Keep headings full width so they remain clear above columns */
.about-content h3, .about-content h2 {
    column-span: all;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

/* Ensure lists remain readable across columns */
.about-content ul {
    margin: 0.5rem 0 1rem 1.1rem;
}



.footer {
    /* footer uses its own adjustable opacity variable */
    background: rgba(44, 62, 80, var(--footer-opacity));
    color: white;
    text-align: center;
    padding: 2rem;
}

/* header settings button and panel */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#settings-button {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.15s ease;
}
#settings-button:hover {
    background: rgba(0,0,0,0.05);
}

/* Modal-style settings panel with backdrop, centered content */
.settings-panel {
    position: fixed;
    inset: 0; /* full screen */
    display: none; /* toggled by JS */
    align-items: center;
    justify-content: center;
    z-index: 1200;
    background: rgba(0,0,0,0.45); /* backdrop */
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    padding: 1rem;
}

.settings-panel .settings-content {
    width: 340px;
    max-width: calc(100% - 32px);
    background: rgba(255,255,255,0.98);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.25);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.settings-panel h3 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: #2c3e50;
}

.settings-panel label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

#bg-opacity-range {
    width: 100%;
}

.settings-row {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.settings-row button {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    background: #8e44ad;
    color: white;
    font-size: 0.9rem;
}

.settings-row button#settings-close {
    background: #2c3e50;
}

@media (max-width: 768px) {
    .nav {
        flex-direction: row;
        gap: 0;
        padding: 0 1rem;
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255,255,255,0.98);
        flex-direction: column;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .nav-links.open {
        max-height: 300px;
        background: #000000; /* when open on mobile, use black background */
    }
    
    .nav-links li {
        width: 100%;
        text-align: center;
    }
    
    .nav-links a {
        display: block;
        padding: 1rem;
    }
    
    #menu-toggle {
        display: block;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }

    .settings-panel {
        /* keep full-screen modal on small devices */
        inset: 0;
        padding: 0.75rem;
    }
    .settings-panel .settings-content {
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
    }
}

/* Floating WhatsApp FAB */
.whatsapp-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: var(--fab-size);
    height: var(--fab-size);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 1300;
    /* soft drop shadow + neon purple glow outline */
    box-shadow:
        0 8px 24px rgba(0,0,0,0.25),
        0 0 10px rgba(142,68,173,0.18),
        0 0 22px rgba(142,68,173,0.12);
    border: 2px solid rgba(142,68,173,0.9);
    /* default transparency controlled by CSS variable; hover will become fully opaque */
    background: linear-gradient(135deg, rgba(37,211,102,0.7), rgba(18,140,126,0.7));
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.12s ease, width 0.12s ease, height 0.12s ease;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    opacity: var(--fab-opacity);
}

.whatsapp-fab img {
    width: 60%;
    height: 60%;
    display: block;
    pointer-events: none;
    filter: drop-shadow(0 0 6px rgba(142,68,173,0.35));
}

/* ensure fully opaque on hover/focus for clarity and accessibility */
.whatsapp-fab:hover,
.whatsapp-fab:focus {
    opacity: 1;
    transform: translateY(-4px);
    box-shadow:
        0 12px 36px rgba(0,0,0,0.28),
        0 0 18px rgba(142,68,173,0.28),
        0 0 36px rgba(142,68,173,0.18);
}

/* Floating Home FAB (stacked above WhatsApp) */
.home-fab {
    position: fixed;
    right: 20px;
    bottom: calc(20px + var(--fab-size) + 12px); /* stacked above the WhatsApp button */
    width: var(--fab-size);
    height: var(--fab-size);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 1300;
    /* soft drop shadow + neon purple glow outline */
    box-shadow:
        0 8px 22px rgba(0,0,0,0.22),
        0 0 10px rgba(142,68,173,0.14),
        0 0 20px rgba(142,68,173,0.10);
    border: 2px solid rgba(142,68,173,0.85);
    /* default transparency controlled by CSS variable; hover will become fully opaque */
    background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(240,240,240,0.7));
    color: #2c3e50;
    font-size: 1.25rem;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease, width 0.12s ease, height 0.12s ease;
    -webkit-tap-highlight-color: transparent;
    opacity: var(--fab-opacity);
}

.home-fab span {
    display: inline-block;
    line-height: 1;
    transform: translateY(-1px);
    pointer-events: none;
    text-shadow: 0 0 6px rgba(142,68,173,0.28);
}

/* ensure fully opaque on hover/focus for clarity and accessibility */
.home-fab:hover,
.home-fab:focus {
    opacity: 1;
    transform: translateY(-4px);
    box-shadow:
        0 12px 30px rgba(0,0,0,0.24),
        0 0 18px rgba(142,68,173,0.22),
        0 0 34px rgba(142,68,173,0.14);
}

/* touch feedback */
.whatsapp-fab:active,
.home-fab:active {
    transform: translateY(2px) scale(0.98);
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

/* slightly larger on wide screens */
@media (min-width: 1200px) {
    .whatsapp-fab {
        width: 60px;
        height: 60px;
        right: 28px;
        bottom: 28px;
    }
    .whatsapp-fab img {
        width: 62%;
        height: 62%;
    }
    .home-fab {
        width: 60px;
        height: 60px;
        right: 28px;
        bottom: 110px;
        font-size: 1.4rem;
    }

    /* Ensure joystick FAB matches other FAB sizes on wide screens for consistent visual weight
       and move it to the bottom-left corner instead of the right stack.
       Use the same vertical inset as the WhatsApp FAB (28px) for pixel-perfect alignment. */
    .joystick-fab {
        width: 60px;
        height: 60px;
        left: 28px;                 /* move to left corner */
        right: auto;
        bottom: 28px;               /* match WhatsApp FAB vertical inset */
        font-size: 1.25rem;
    }
}

/* Joystick FAB */
.joystick-fab {
    position: fixed;
    right: 20px;
    bottom: calc(20px + var(--fab-size) * 2 + 24px); /* above home and whatsapp */
    width: var(--fab-size);
    height: var(--fab-size);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 1400;
    /* soft drop shadow + neon purple outline */
    box-shadow:
        0 10px 30px rgba(0,0,0,0.25),
        0 0 10px rgba(142,68,173,0.16),
        0 0 20px rgba(142,68,173,0.10);
    background: radial-gradient(circle at 30% 30%, #ffffff, #f0f0f0);
    border: 2px solid rgba(142,68,173,0.9);
    cursor: pointer;
    font-size: 1.1rem;
    transition: transform 0.12s ease, opacity 0.12s ease, box-shadow 0.12s ease;
    opacity: var(--fab-opacity);
}

/* make joystick hover/focus behavior match home-fab for consistent transparency and affordance */
.joystick-fab:hover,
.joystick-fab:focus {
    opacity: 1;
    transform: translateY(-4px);
    box-shadow:
        0 12px 30px rgba(0,0,0,0.24),
        0 0 18px rgba(142,68,173,0.22),
        0 0 34px rgba(142,68,173,0.14);
}

.joystick-fab:active {
    transform: translateY(2px) scale(0.98);
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

/* Joystick container overlay (centered at the bottom of the viewport) */
.joystick-container {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    width: 220px;
    height: 220px;
    border-radius: 50%;
    pointer-events: none; /* enabled when visible */
    display: none;
    z-index: 1450;
    touch-action: none;
    user-select: none;
    /* ensure it doesn't block other controls when hidden */
    background: transparent;
}
.joystick-container.active {
    display: block;
    pointer-events: auto;
    background: rgba(0,0,0,0.0); /* transparent shell; nipple will render inside */
}

/* small visual hint behind the nipple */
.joystick-container .joystick-hint {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.02), rgba(0,0,0,0.06));
    pointer-events: none;
}