@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&family=Raleway:ital,wght@0,100..900;1,100..900&display=swap');

:root{
    --primary-font-color: black;
    --secondary-font-color: #FE6F5E;
    --primary-font-color-inverted: white;
    --accent-color: white;
    --overlay-color: rgba(0, 0, 0, 0.61);
    --primary-bg: white;
    --base-bg: rgb(255, 255, 250);
    --shadow-color: rgba(142, 142, 137, 0.265);
    --footer-color: #090100;

    /* fonts */
    --heading-font: "Oswald", sans-serif;
    --primary-font: ;
}

/* animations */

@keyframes throb {
    0%{
        opacity: 0;
        scale: 1;
    }
    25%{
        opacity: 1;
    }
    50%{
        opacity: 0;
        scale: 1.1;
    }
    100%{
        opacity: 0;
        scale: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: .6s;
}

/* Body layout properties must never transition — animating position/overflow
   during lockScroll/unlockScroll causes scroll-position jumps on desktop */
body {
    transition: none;
}

a, p, label, input, button, textarea{
    text-decoration: none;
    font-family: "Raleway", sans-serif;
}

h1, h2{
    font-family: var(--heading-font);
}

button{
    cursor: pointer;
}

body{
    background: rgb(243, 249, 252);
    width: 100vw;
    overflow-x: hidden;
    background: linear-gradient(var(--overlay-color), var(--overlay-color)), url("./Assets/crane.jpg");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* ── Safari background-attachment: fixed fix ────────────────────────────────
   Safari mishandles background-size: cover when background-attachment: fixed
   is set, and iOS ignores fixed entirely. We detect Safari via the
   -webkit-touch-callout feature (only true in Safari/WebKit) and replace the
   body background with a fixed-position ::before pseudo-element instead.
   Chrome and Firefox never enter this block so their implementation is
   completely untouched.
─────────────────────────────────────────────────────────────────────────── */
@supports (-webkit-touch-callout: none) {
    body {
        background: none;
        background-color: rgb(243, 249, 252);
    }

    body::before {
        content: '';
        position: fixed;
        inset: 0;
        z-index: -1;
        background: linear-gradient(var(--overlay-color), var(--overlay-color)),
                    url("./Assets/crane.jpg");
        background-position: center;
        background-size: cover;
        background-repeat: no-repeat;
    }
}

/* header hidden state when services section is active */
header.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-20px);
}


header{
    display: flex;
    width: 100%;
    justify-content: space-between;
    padding: 12px;
    position: fixed;
    top: 10px;
    z-index: 99;
}

header ion-icon{
    display: none;
}

header nav{
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid rgb(175, 175, 175);
    padding: 8px;
    backdrop-filter: blur(10px);
}

header nav a{
    color: var(--secondary-font-color);
}

header nav a:hover{
    color: var(--primary-font-color);
}

header nav button{
    font-weight: bold;
    padding: 10px;
    border: none;
    background: black;
    color: var(--secondary-font-color);
}

header nav button:hover{
    background: var(--secondary-font-color);
    color: var(--primary-font-color);
}

.logo img{
    height: 70px;
}

.logo{
    display: flex;
    align-items: center;
    gap: .8rem;
}

.logo.blurred{
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.logo.blurred img{
    padding: 5px;
}

.logo.blurred h1{
    padding: 5px;
}

section{
    width: 100%;
    background: var(--base-bg);
}

/* hero section */

.hero{
    height: calc(100vh - 150px);
    margin-top: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: none;
}

.hero h1{
    margin: 10px;
}

.hero .hook{
    font-size: 4rem;
    color: var(--secondary-font-color);
}

.hero .desc{
    font-size: 2rem;
    color: var(--primary-font-color-inverted);
}

.cta{
    margin-left: 10px;
    margin-block: 20px;
    margin-bottom: 150px;
    display: flex;
    gap: 2rem;
}

.cta a{
    border: 2px solid var(--secondary-font-color);
    padding: 12px;
    width: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

.cta a:first-child{
    color: var(--secondary-font-color);
    position: relative;
    z-index: 9;
}

.cta a:last-child::before{
    content: '';
    position: absolute;
    width: 200px;
    height: 50px;
    border: 2px solid var(--primary-font-color-inverted);
    z-index: 1;
    opacity: 0;
    animation: throb ease-in 2s 4;
}

.cta a:last-child{
    background: var(--secondary-font-color);
    color: var(--accent-color);
}

/* ─── services section ─────────────────────────────────────────────────────── */

.services {
    padding: 16px 16px 12px;
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.services h2 {
    margin-bottom: 12px;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.scroll {
    display: flex;
    flex: 1;
    gap: 16px;
    min-height: 0;
}

/* LEFT: overview panel */

.overview {
    width: 55%;
    flex-shrink: 0;
}

.view {
    height: 100%;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    transition: background-image 0.5s ease;
}

.view::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.82) 0%,
        rgba(0,0,0,0.35) 50%,
        rgba(0,0,0,0.08) 100%
    );
    z-index: 1;
}

.view-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 28px 24px;
    z-index: 2;
    animation: fadeInUp 0.4s ease both;
}

.service-num {
    font-family: var(--heading-font);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--secondary-font-color);
    line-height: 1;
    opacity: 0.7;
    display: block;
    margin-bottom: 4px;
}

.view-content h1 {
    font-size: 1.75rem;
    color: var(--primary-font-color-inverted);
    line-height: 1.2;
    margin-bottom: 10px;
    font-weight: 600;
}

.view-content .cat {
    background: var(--secondary-font-color);
    width: fit-content;
    padding: 4px 14px;
    color: var(--primary-font-color-inverted);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    opacity: 0.9;
    margin-bottom: 12px;
}

.view-desc {
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    line-height: 1.6;
    font-family: "Raleway", sans-serif;
    max-width: 480px;
}

/* RIGHT: list column */

.list-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
    min-width: 0;
}

.list {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    overflow: hidden;
}

.horizontal-card {
    border: 1px solid var(--secondary-font-color);
    padding: 12px 14px;
    background: var(--primary-bg);
    cursor: pointer;
    overflow: hidden;

    /* single-line clipping on all text children */
    display: grid;
    grid-template-rows: auto auto auto;
    gap: 4px;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.35s ease,
                box-shadow 0.35s ease,
                border-color 0.35s ease;
}

/* text overflow to ellipsis for non-selected cards */
.horizontal-card h1,
.horizontal-card p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.horizontal-card h1 {
    font-size: 1rem;
    font-weight: 600;
}

.horizontal-card .cat {
    background: var(--secondary-font-color);
    width: fit-content;
    max-width: 100%;
    padding: 2px 10px;
    color: var(--primary-font-color-inverted);
    border-radius: 100px;
    font-size: 0.7rem;
    opacity: 0.55;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.horizontal-card p:not(.cat) {
    font-size: 0.82rem;
    color: #555;
    line-height: 1.4;
}

/* Far away cards — barely visible */
.horizontal-card.far-up,
.horizontal-card.far-down {
    transform: scaleX(0.88) scaleY(0.85);
    opacity: 0.25;
    pointer-events: none;
}

/* Adjacent cards */
.horizontal-card.up {
    transform: scaleX(0.95) scaleY(0.9);
    opacity: 0.55;
    border-color: rgba(254, 111, 94, 0.35);
}

.horizontal-card.down {
    transform: scaleX(0.97) scaleY(0.93);
    opacity: 0.65;
    border-color: rgba(254, 111, 94, 0.45);
}

.horizontal-card.up:hover {
    transform: scaleX(0.98) scaleY(0.95);
    opacity: 0.75;
}

.horizontal-card.down:hover {
    transform: scaleX(0.99) scaleY(0.97);
    opacity: 0.8;
}

/* Selected card */
.horizontal-card.selected {
    outline: 2px solid var(--secondary-font-color);
    box-shadow: 0 4px 24px 0 rgba(254, 111, 94, 0.18), 0 0 0 4px rgba(254, 111, 94, 0.06);
    transform: scaleX(1) scaleY(1);
    opacity: 1;
    border-color: var(--secondary-font-color);
    background: linear-gradient(to right, rgba(254,111,94,0.05), transparent);
    z-index: 2;
    position: relative;
}

/* On selected card, allow description to wrap (show more) */
.horizontal-card.selected p:not(.cat) {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.horizontal-card.ghost {
    border: none;
    background: transparent;
    pointer-events: none;
    min-height: 40px;
    opacity: 0;
}

/* scroll hint */
.scroll-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(0,0,0,0.4);
    font-size: 0.78rem;
    font-family: "Raleway", sans-serif;
    margin-top: 8px;
    padding-left: 2px;
    user-select: none;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.scroll-hint.visible {
    opacity: 1;
    pointer-events: auto;
}

.scroll-hint ion-icon {
    font-size: 16px;
    animation: bounce 1.4s ease-in-out infinite;
}

.scroll-hint ion-icon:first-child {
    animation-delay: 0.2s;
}

/* CTA card — lives inside .list as the final slot */
.horizontal-card.cta-card {
    height: 50px;
    min-height: 50px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
    cursor: default;
    gap: 8px;
}

.horizontal-card.cta-card::before {
    content: '';
    position: absolute;
    inset: -5px;
    border: 2px solid var(--secondary-font-color);
    opacity: 0;
    animation: throb ease-in 2s infinite;
    pointer-events: none;
}

/* Both buttons share base styles */
.horizontal-card.cta-card a {
    flex: 1;
    height: 100%;
    font-weight: bold;
    font-family: "Raleway", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Filled: Call Us Now */
.horizontal-card.cta-card a.call {
    background: var(--secondary-font-color);
    color: var(--primary-font-color-inverted);
    border: 2px solid var(--secondary-font-color);
}

.horizontal-card.cta-card a.call:hover {
    background: transparent;
    color: var(--secondary-font-color);
}

/* Outlined: View All Services */
.horizontal-card.cta-card a.services-link {
    background: transparent;
    color: var(--secondary-font-color);
    border: 2px solid var(--secondary-font-color);
}

.horizontal-card.cta-card a.services-link:hover {
    background: var(--secondary-font-color);
    color: var(--primary-font-color-inverted);
}

/* ─── contact form ─────────────────────────────────────────────────────────── */

.contact-form{
    padding: 10px;
}

.contact-form h2{
    margin-block: 15px;
}

.contact-form form{
    width: 100%;
    display: flex;
    flex-direction: column;
    outline: 2px solid var(--secondary-font-color);
    padding: 10px;
}

.contact-form form button{
    padding: 10px;
    border: none;
    font-weight: bold;
}

.input-group{
    display: flex;
    flex-direction: column;
    margin-block: 10px;
}

.input-group input, .input-group textarea{
    padding: 10px;
    border: 1px solid var(--secondary-font-color);
    caret-color: var(--secondary-font-color);
}

.input-group input:active{
    outline: 2px solid var(--secondary-font-color);
}

.input-group input:focus, .input-group textarea:focus{
    outline: 2px solid var(--secondary-font-color);
}

/* ─── home form helpers ─────────────────────────────────────────────────────── */

.form-name-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-select {
    padding: 10px 36px 10px 10px;
    border: 1px solid var(--secondary-font-color);
    background: white;
    font-family: "Raleway", sans-serif;
    font-size: 0.9rem;
    color: #333;
    caret-color: var(--secondary-font-color);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23FE6F5E' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.form-select:focus {
    outline: 2px solid var(--secondary-font-color);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-success {
    display: none;
    padding: 14px;
    margin-top: 12px;
    border: 1px solid var(--secondary-font-color);
    background: rgba(254, 111, 94, 0.06);
    font-family: "Raleway", sans-serif;
    font-size: 0.9rem;
    color: var(--secondary-font-color);
    font-weight: 600;
    text-align: center;
}

.form-error {
    display: none;
    padding: 14px;
    margin-top: 12px;
    border: 1px solid #e53e3e;
    background: rgba(229, 62, 62, 0.06);
    font-family: "Raleway", sans-serif;
    font-size: 0.9rem;
    color: #e53e3e;
    font-weight: 600;
    text-align: center;
}

@media screen and (max-width: 600px) {
    .form-name-row {
        grid-template-columns: 1fr;
    }
}

/* ─── footer ───────────────────────────────────────────────────────────────── */

footer{
    display: flex;
    height: 60vh;
    background: var(--footer-color);
    color: var(--primary-font-color-inverted);
    padding: 20px;
    width: 100vw;
    justify-content: space-between;
}

footer hr{
    border: none;
    border-right: 2px solid var(--accent-color);
}

footer > *{
    padding: 20px;
}

footer .info img{
    height: 100px;
}

footer .info{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.links{
    display: flex;
    flex-direction: column;
    margin-top: 20px;
    gap: .8rem;
}

.links a{
    color: var(--primary-font-color-inverted);
}

.links a:hover{
    color: var(--secondary-font-color);
}

/* icon alignment in footer contact links */
.contacts .links a {
    display: flex;
    align-items: center;
    gap: 10px;
}

.contacts .links a ion-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    color: var(--secondary-font-color);
}

/* services page */
.search input{
    padding: 8px;
    background: none;
    border: 1px solid var(--secondary-font-color);
    color: var(--accent-color);
    caret-color: var(--secondary-font-color);

}

.search input:focus{
    outline: 2px solid var(--secondary-font-color);
}

/* ─── responsive ───────────────────────────────────────────────────────────── */

@media screen and (max-width: 768px) {
    /* ── header ── */
    header {
        border: 1px solid rgb(175, 175, 175);
        padding: 20px;
        align-items: center;
        backdrop-filter: blur(10px);
        top: 0;
    }
    header ion-icon { display: block; font-size: 36px; }
    .title { display: none; }

    /* ── mobile nav drawer ── */
    header nav {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        background: rgba(0, 0, 0, 0.92);
        backdrop-filter: blur(12px);
        z-index: 98;
        padding: 40px 20px;

        /* hidden state — off to the left, invisible */
        opacity: 0;
        visibility: hidden;
        transform: translateX(-100%);
        transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
    }

    header nav.open {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }

    header nav a {
        font-size: 1.4rem;
        font-family: var(--heading-font);
        letter-spacing: 0.05em;
    }

    header nav button {
        width: 220px;
        padding: 14px;
        font-size: 1rem;
        background: var(--secondary-font-color);
        color: var(--primary-font-color);
    }

    /* X close button inside the nav */
    .nav-close {
        position: absolute;
        top: 20px;
        right: 20px;
        font-size: 36px;
        color: var(--primary-font-color-inverted);
        cursor: pointer;
        line-height: 1;
        transition: color 0.2s;
    }

    .nav-close:hover {
        color: var(--secondary-font-color);
    }

    /* keep hamburger above the nav overlay */
    header ion-icon {
        z-index: 99;
        position: relative;
    }

    /* ── hero CTA ── */
    .cta {
        margin-bottom: 150px;
        margin-block: 20px;
        flex-direction: column;
        gap: 2rem;
        padding: 10px;
    }
    .cta a { width: auto; margin: 0; }
    .cta a:last-child::before {
        content: '';
        position: absolute;
        width: 92vw;
        height: 55px;
        border: 2px solid var(--secondary-font-color);
        z-index: 1;
        opacity: 0;
        animation: throb ease-in 2s 4;
    }

    /* ── services: mobile carousel ── */
    .services {
        height: auto;
        scroll-snap-align: none;
        padding: 16px;
    }
    .scroll {
        flex-direction: column;
        height: auto;
        flex: none;
        gap: 0;
    }

    /* Hide the list — overview is the carousel on mobile */
    .list-column { display: none; }

    .overview {
        width: 100%;
        height: 460px;
        position: relative;
        overflow: hidden;
        touch-action: pan-y; /* browser owns vertical, JS owns horizontal */
    }

    .hook{
        font-size: 1rem;
    }

    /* Dots — rendered inside .view-content by JS */
    .swipe-dots {
        display: flex;
        gap: 7px;
        margin-bottom: 10px;
    }
    .swipe-dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: rgba(255,255,255,0.4);
        transition: background 0.3s, transform 0.3s;
        flex-shrink: 0;
    }
    .swipe-dot.active {
        background: var(--secondary-font-color);
        transform: scale(1.35);
    }

    /* Swipe hint / CTA row — sits below dots */
    .mobile-cta-row {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 2px;
    }

    .swipe-hint {
        display: flex;
        align-items: center;
        gap: 5px;
        color: rgba(255,255,255,0.55);
        font-size: 0.78rem;
        font-family: "Raleway", sans-serif;
        user-select: none;
    }
    .swipe-hint ion-icon { font-size: 15px; }

    /* Two CTA buttons on last card */
    .mobile-cta-btn {
        flex: 1;
        padding: 9px 6px;
        font-weight: bold;
        font-family: "Raleway", sans-serif;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-size: 0.72rem;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        border: 2px solid var(--secondary-font-color);
    }
    .mobile-cta-btn.filled {
        background: var(--secondary-font-color);
        color: white;
    }
    .mobile-cta-btn.outlined {
        background: transparent;
        color: var(--secondary-font-color);
    }

    /* ── footer ── */
    footer { height: auto; flex-direction: column; }
    footer .info { flex-direction: column; align-items: baseline; justify-content: center; }
    footer hr { border: none; border-right: unset; border-bottom: 2px solid var(--accent-color); }
}

@media screen and (min-width: 769px) {
    html, body {
        scrollbar-gutter: stable;
    }

    .contact-form {
        padding: 20px;
    }

    /* Desktop-only: hide mobile-specific UI */
    .mobile-cta-btns { display: none; }
    .mobile-dots { display: none; }
    .swipe-hint { display: none; }
}