/* ==========================================================================
   Design Tokens
   --------------------------------------------------------------------------
   Shared variables keep the SPA visually aligned with the original static
   pages. Update these first when changing brand colors, spacing, or fonts.
   ========================================================================== */
:root {
    --font-body: 'Inter', sans-serif;
    --font-heading: 'Nunito', sans-serif;

    --color-text: #333;
    --color-heading: #2c3e50;
    --color-body-copy: #555;
    --color-brand: #4F518C;
    --color-brand-dark: #2C2A4A;
    --color-accent: #7FDEFF;
    --color-link-hover: #3498db;
    --color-white: #ffffff;
    --color-light: #EBEFF2;
    --color-light-alt: #F7F9FB;
    --color-contact: #eaf5ef;
    --color-footer: #5f8673;

    --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-nav: 0 8px 24px rgba(149, 157, 165, 0.2);

    --radius-pill: 25px;
    --radius-card: 18px;
    --section-padding: 60px 40px;
}

/* ==========================================================================
   Base Reset
   --------------------------------------------------------------------------
   Remove browser defaults and establish the base document behavior.
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--color-text);
}

a {
    color: inherit;
}

button,
input,
textarea {
    font: inherit;
}

#root {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.app-shell {
    display: flex;
    flex: 1;
    flex-direction: column;
}

main {
    display: block;
    flex: 1;
}

.page-stage {
    opacity: 1;
    transform: translateY(0);
    will-change: opacity, transform;
}

/* Initial load animation reveals the app shell in small staggered steps. */
.app-shell .navbar,
.app-shell main,
.app-shell footer {
    opacity: 0;
    transform: translateY(28px);
}

.app-shell.is-loaded .navbar,
.app-shell.is-loaded main,
.app-shell.is-loaded footer {
    animation: shell-fade-slide 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.app-shell.is-loaded main {
    animation-delay: 0.16s;
}

.app-shell.is-loaded footer {
    animation-delay: 0.3s;
}

/* Page swaps use a short fade/slide transition to mimic moving between screens. */
.page-stage-entering {
    animation: page-enter 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.page-stage-exiting {
    animation: page-exit 0.18s ease forwards;
}

@keyframes shell-fade-slide {
    from {
        opacity: 0;
        transform: translateY(28px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes page-enter {
    from {
        opacity: 0;
        transform: translateY(26px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes page-exit {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-12px);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   Shared Buttons
   --------------------------------------------------------------------------
   Reusable CTA styling for nav, homepage, and contact form actions.
   ========================================================================== */
.help-button,
.help-button-center,
.contact-button,
.submit-button {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: var(--radius-pill);
    background-color: var(--color-brand);
    color: var(--color-white);
    font-family: var(--font-body);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s ease;
}

.help-button {
    padding: 10px 20px;
}

.help-button:hover,
.help-button-center:hover,
.contact-button:hover,
.submit-button:hover,
.service-card:hover {
    transform: translateY(-2px);
}

.help-button:hover,
.help-button-center:hover,
.contact-button:hover,
.submit-button:hover {
    background-color: var(--color-brand-dark);
}

/* ==========================================================================
   Shared Section Headings And Card Rows
   --------------------------------------------------------------------------
   Heading decorations and horizontal card layouts reused across sections.
   ========================================================================== */
.help-centre h1,
.home-why h1,
.home-contact h1,
.business h2,
.residential h2 {
    position: relative;
    margin-bottom: 1.5rem;
    padding-bottom: 15px;
    color: var(--color-heading);
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
}

.help-centre h1::after,
.home-why h1::after,
.home-contact h1::after,
.business h2::after,
.residential h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 150px;
    height: 3px;
    background-color: var(--color-accent);
    transform: translateX(-50%);
}

.help-centre p,
.home-contact p,
.home-why p {
    font-size: 1rem;
    line-height: 1.8;
    text-align: center;
}

.help-boxes,
.why-boxes {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 3rem;
}

.help-box,
.why-box {
    flex: 0 1 300px;
    padding: 2rem;
    text-align: center;
}

.help-box h3,
.why-box h2,
.why-box h3 {
    margin-bottom: 1rem;
    font-family: var(--font-heading);
    font-weight: 600;
}

/* ==========================================================================
   Navigation
   --------------------------------------------------------------------------
   Fixed pill-shaped nav used across the whole SPA.
   ========================================================================== */
.navbar {
    position: fixed;
    top: 10px;
    left: 5%;
    z-index: 1000;
    width: 90%;
    padding: 1rem 0;
    color: var(--color-heading);
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-light);
    border-radius: 30px;
    box-shadow: var(--shadow-nav);
}

.navbar .container,
.nav-right {
    display: flex;
    align-items: center;
}

.navbar .container {
    justify-content: space-between;
}

.nav-right {
    gap: 2rem;
}

.logo {
    width: auto;
    height: 50px;
}

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

.nav-links a {
    position: relative;
    color: var(--color-heading);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--color-link-hover);
}

.nav-links a.is-current {
    color: var(--color-link-hover);
}

.nav-links a:hover::after {
    content: '';
    position: absolute;
    right: -5px;
    bottom: -8px;
    left: -5px;
    height: 3px;
    background-color: var(--color-accent);
}

.nav-links a.is-current::after {
    content: '';
    position: absolute;
    right: -5px;
    bottom: -8px;
    left: -5px;
    height: 3px;
    background-color: var(--color-accent);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: transparent;
    border: 0;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--color-heading);
    border-radius: 2px;
    transition: 0.3s;
}

/* ==========================================================================
   Home Page: Hero / About
   --------------------------------------------------------------------------
   Split hero layout with decorative background art and feature image.
   ========================================================================== */
.home-about-section {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    min-height: 700px;
    margin-top: -80px;
    padding-top: 160px;
    background-color: var(--color-white);
    overflow: hidden;
}

.home-about-section::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url(./assets/layered-peaks-haikei.svg);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: scroll;
}

.about-left,
.about-right {
    position: relative;
    z-index: 1;
    flex: 1;
    width: 50%;
    height: 700px;
}

.about-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.about-box {
    height: 70%;
    margin: 0 15%;
    padding: 2rem;
    background-color: var(--color-white);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
}

.about-left h1 {
    position: relative;
    margin-bottom: 1.5rem;
    padding-bottom: 15px;
    color: var(--color-heading);
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 600;
}

.about-left h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1%;
    width: 90px;
    height: 3px;
    background-color: var(--color-accent);
}

.about-left p {
    color: var(--color-body-copy);
    font-size: 1rem;
    line-height: 1.8;
}

.about-right {
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-right img {
    width: auto;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ==========================================================================
   Home Page: Help
   --------------------------------------------------------------------------
   Introductory service summary section from the original homepage.
   ========================================================================== */
.home-help-section {
    min-height: 500px;
}

.help-centre {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 650px;
    padding: var(--section-padding);
    background-color: var(--color-white);
}

.help-centre p,
.help-box p,
.home-contact p {
    color: var(--color-body-copy);
}

.help-box {
    background-color: var(--color-white);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
}

.help-box h3 {
    color: var(--color-link-hover);
}

.help-box p,
.why-box p {
    font-size: 0.95rem;
    line-height: 1.6;
}

.help-button-center {
    margin-top: 3rem;
}

/* ==========================================================================
   Home Page: Why Choose Us
   --------------------------------------------------------------------------
   Dark contrast band used to emphasize reasons and trust signals.
   ========================================================================== */
.home-why {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--section-padding);
    background-color: var(--color-brand);
}

.home-why h1,
.why-box h2,
.why-box h3,
.why-box p {
    color: var(--color-white);
}

.home-why p {
    max-width: 600px;
    color: #e0e0e0;
}

.why-box {
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
}

/* ==========================================================================
   Home Page: Contact CTA
   --------------------------------------------------------------------------
   Closing homepage prompt that points users down to the full contact section.
   ========================================================================== */
.home-contact-section {
    padding: var(--section-padding);
    background-color: var(--color-contact);
}

.home-contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

/* ==========================================================================
   Residential And Business Pages
   --------------------------------------------------------------------------
   Anchored service sections using the same responsive card grid layout.
   ========================================================================== */
.business,
.residential {
    padding: 160px 0 60px;
    background: linear-gradient(135deg, var(--color-light) 0%, var(--color-light-alt) 100%);
}

.business h2,
.residential h2 {
    margin-bottom: 3rem;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.service-card {
    padding: 2rem;
    background: var(--color-white);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s;
}

.service-card h3 {
    margin-bottom: 1rem;
    color: var(--color-link-hover);
    font-family: var(--font-heading);
    font-weight: 600;
}

.service-card p {
    color: var(--color-body-copy);
}

/* ==========================================================================
   Contact Page
   --------------------------------------------------------------------------
   Two-column contact section with business details and embedded form.
   ========================================================================== */
.contact {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 3rem;
    padding: 160px 20px 60px;
    background: linear-gradient(135deg, var(--color-light) 0%, var(--color-contact) 100%);
}

.contact-details,
.contact-form {
    flex: 1 1 0;
    max-width: 500px;
    padding: 2rem;
    background-color: var(--color-white);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
}

.contact h2 {
    margin-bottom: 1.5rem;
    color: var(--color-heading);
    font-family: var(--font-heading);
    font-weight: 600;
}

.contact p {
    color: var(--color-body-copy);
}

.contact a {
    color: var(--color-link-hover);
}

.contact form,
.contact-form form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.name-row {
    display: flex;
    gap: 12px;
}

.name-row input {
    flex: 1;
}

.contact input,
.contact textarea,
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
}

.contact textarea {
    min-height: 140px;
    resize: vertical;
}

.contact input:focus,
.contact textarea:focus {
    outline: none;
    border-color: var(--color-link-hover);
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* ==========================================================================
   Footer
   --------------------------------------------------------------------------
   Shared footer pinned to the bottom naturally by the page flex layout.
   ========================================================================== */
footer {
    position: relative;
    width: 100%;
    margin-top: auto;
    padding: 2rem 0;
    color: var(--color-white);
    text-align: center;
    background-color: var(--color-footer);
    border-top: 1px solid #e0e0e0;
}

/* ==========================================================================
   Mobile Layout
   --------------------------------------------------------------------------
   Collapse multi-column layouts and convert the nav to a dropdown menu.
   ========================================================================== */
@media (max-width: 768px) {
    .navbar {
        top: 10px;
        left: 3%;
        width: 94%;
        padding: 0.75rem 0;
        background: rgba(255, 255, 255, 1);
        border-radius: 24px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .navbar .container,
    .nav-right {
        position: relative;
    }

    .nav-right {
        gap: 0.75rem;
    }

    .logo {
        height: 42px;
    }

    .hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        background: rgba(255, 255, 255, 0.55);
        border: 1px solid rgba(255, 255, 255, 0.6);
        border-radius: 12px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        z-index: 2100;
    }

    .hamburger span {
        width: 20px;
        height: 2px;
        transition: all 0.3s ease;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(4px, 4px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .nav-links {
        position: absolute;
        top: 58px;
        right: 0;
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        width: 180px;
        margin: 0;
        padding: 0.8rem;
        opacity: 0;
        pointer-events: none;
        background: rgba(255, 255, 255, 0.88);
        border: 1px solid rgba(255, 255, 255, 0.7);
        border-radius: 16px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.14);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        transform: translateY(-10px) scale(0.98);
        transform-origin: top right;
        transition: opacity 0.25s ease, transform 0.25s ease;
        z-index: 2000;
    }

    .nav-links.active {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        display: block;
        width: 100%;
        padding: 0.75rem 0;
        font-size: 1rem;
        text-align: center;
        border-radius: 10px;
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    .nav-links a:hover {
        color: var(--color-heading);
        background: rgba(127, 222, 255, 0.18);
    }

    .nav-links a:hover::after {
        display: none;
    }

    .nav-links a.is-current::after {
        display: none;
    }

    .help-button {
        display: none;
    }

    .home-about-section {
        flex-direction: column;
        margin-top: -60px;
        padding-top: 165px;
    }

    .home-about-section::before {
        background-position: center bottom;
        background-repeat: no-repeat;
    }

    .about-left,
    .about-right {
        width: 100%;
        height: auto;
    }

    .about-box {
        height: auto;
        margin: 0 1rem 0.75rem;
        padding: 1.5rem;
        text-align: center;
    }

    .about-left h1 {
        font-size: 2.2rem;
        text-align: center;
    }

    .about-left h1::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .about-right img {
        width: 100%;
        max-width: 400px;
        height: auto;
        margin-top: -0.5rem;
    }

    .help-centre {
        height: auto;
        padding: 40px 20px;
    }

    .help-boxes,
    .why-boxes {
        flex-direction: column;
        align-items: center;
    }

    .help-box,
    .why-box {
        width: 100%;
        max-width: 350px;
    }

    .home-contact-section {
        padding: 40px 20px;
    }

    .home-contact h1 {
        font-size: 1.6rem;
    }

    .business,
    .residential {
        padding: 130px 0 40px;
    }

    .service-grid {
        grid-template-columns: 1fr;
    }

    .contact {
        flex-direction: column;
        gap: 1.5rem;
        padding: 130px 20px 40px;
    }

    .contact-details,
    .contact-form {
        max-width: none;
    }

    .name-row {
        flex-direction: column;
    }
}
