/* Crescent homepage – "Developing for the city's finest locations" section in the
   approved template look (index.php only). Loaded after home-update.css.
   Montserrat is used for the tracked caps stat labels; elements that carry .cr-ls
   opt out of the global letter-spacing reset in site-fonts.css. */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600&display=swap');

:root {
    --cr-ink: #1f2224;
    --cr-label: #5a5e62;
    --cr-sans: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
}

.cr-lbl {
    font-family: var(--cr-sans);
    font-weight: 600;
    text-transform: uppercase;
}

/* ---------- Page background ----------
   Sections stay transparent so the body's mnemonic pattern (--cr-pattern,
   brand-update.css) runs unbroken down the whole page. */
.cr-purpose {
    background: transparent;
}

/* ---------- Map + stats ---------- */
section#services-2 {
    padding: clamp(80px, 9vw, 140px) 0;
    background: transparent;
}

.productcover-section .cg-map-impact {
    margin-bottom: 0;
}

.productcover-section .cg-map-impact .tp-section-4-title {
    max-width: 640px;
    margin-bottom: 26px;
    font-size: clamp(38px, 3.8vw, 54px) !important;
    line-height: 1.08 !important;
}

.productcover-section .cg-map-impact h4 {
    margin: 0 0 26px;
    padding: 0;
    font-size: 28px;
    font-style: italic;
    font-weight: 500;
}

.productcover-section .cg-map-impact .cg-impact__copy {
    max-width: 540px;
    margin: 0;
    font-size: 21px;
    line-height: 1.7;
}

.cr-mapstats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: 840px;
    margin-top: 40px;
    border-top: 1px solid #c9cac8;
}

.cr-mapstats__item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 28px 18px 0;
}

.cr-mapstats__item:first-child {    
    padding-left: 0;
}

.cr-mapstats__item + .cr-mapstats__item {
    border-left: 1px solid #c9cac8;
}

.cr-mapstats__num {
    color: var(--cr-ink);
    font-size: clamp(38px, 3.6vw, 52px);
    font-weight: 500;
    line-height: 1;
}

.cr-mapstats__label {
    color: var(--cr-label);
    font-size: 11px;
    letter-spacing: 0.14em;
    line-height: 1.6;
}

/* Two-up stats where the column is narrow: phones, and laptops where the
   map takes half the row (992–1399px). */
@media (max-width: 575px), (min-width: 992px) and (max-width: 1399px) {
    .cr-mapstats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cr-mapstats__item:nth-child(odd) {
        padding-left: 0;
        border-left: 0;
    }

    .cr-mapstats__item:nth-child(n + 3) {
        margin-top: 24px;
        border-top: 1px solid #c9cac8;
    }
}

/* ---------- Our Projects: Featured / Ongoing / Completed / Upcoming tabs ---------- */
:root {
    --cr-line: #d6d7d5;
    --cr-header-h: 67px; /* fixed header once scrolled (index.php pins the tabs right under it) */
    --cr-pin-top: 150px; /* header + pinned tabs (20px padding + ~34px) + gap: where pinned Featured cards sit */
}

/* Shows the body's mnemonic pattern through (--cr-pattern, brand-update.css). */
.cr-lattice {
    background: transparent;
}

.cr-home-h2 {
    margin: 0;
    color: var(--cr-ink);
    font-size: clamp(40px, 4vw, 58px);
    font-weight: 400;
    line-height: 1.05;
}

.cr-projects {
    padding: clamp(80px, 9vw, 140px) 0 clamp(36px, 4vw, 60px);
}

.cr-projects__head {
    margin-bottom: 36px; /* + the tab bar's 20px top padding */
    padding-bottom: 32px;
    border-bottom: 1px solid var(--cr-line);
}

.cr-projects__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    position: relative;
    z-index: 5; /* above the Featured cards that scroll under it */
    margin-bottom: 40px;
    padding-top: 20px;
}

/* Pinned under the header: solid white edge to edge so the cards scrolling
   up behind the tabs don't show through them. */
.cr-projects__bar.is-pinned {
    background: #fff;
    box-shadow: 0 0 0 100vmax #fff;
    clip-path: inset(0 -100vmax);
}

.cr-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 44px;
}

.cr-tab {
    padding: 0 0 12px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #6b6f73;
    font-family: var(--cr-sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2em;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.cr-tab[aria-selected="true"] {
    border-bottom-color: var(--cr-ink);
    color: var(--cr-ink);
}

.cr-tab:hover {
    color: var(--cr-ink);
}

/* Carousel arrows: prev chevron on the left edge of the card row, next on the
   right, centred on the card images (384px wide x 4:5 = 480px tall). */
.cr-panels {
    position: relative;
}

.cr-arrows {
    position: absolute;
    top: 240px;
    left: 16px;
    right: 16px;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none;
}

.cr-arrows[hidden],
.cr-panel[hidden] {
    display: none !important;
}

.cr-arrows button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--cr-silver);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92); /* readable over the card images */
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    color: var(--cr-charcoal);
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

/* Brand palette (brand-update.css): both arrows silver outline, charcoal on hover. */
.cr-arrows button:hover,
.cr-arrows button:focus-visible {
    border-color: var(--cr-charcoal);
    background: var(--cr-charcoal);
    color: #fff;
}

.cr-arrows svg {
    width: 18px;
    height: 18px;
}

/* White chevron on the charcoal hover circle (set on the svg itself so no
   theme button color can leave it dark). */
.cr-arrows button:hover svg,
.cr-arrows button:focus-visible svg {
    color: #fff;
    stroke: #fff;
}

@keyframes cr-rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}

/* No fade on Featured: a transform on an ancestor would break the GSAP pins. */
.cr-panel:not([data-panel="featured"]) > div {
    animation: cr-rise 700ms cubic-bezier(.2, .7, .2, 1) both;
}

/* Featured: each card fills a screen-high panel; main.js pins the panels on
   page scroll (desktop) so every card slides up over the previous one. */
.cr-fpanel {
    display: flex;
    align-items: flex-start;
    min-height: 100vh;
    padding: var(--cr-pin-top) 0 40px; /* clears the header and pinned tabs while pinned */
    box-sizing: border-box;
    pointer-events: none; /* the transparent part must not block the tabs */
}

/* The pull-up below makes the panels wrapper, the featured panel and
   GSAP's pin wrappers overlap the tabs, so they pass clicks through; only the
   cards and arrows take them. */
.cr-panels,
.cr-stack,
.cr-stack .pin-spacer {
    pointer-events: none;
}

/* The last card isn't pinned (index.php), so its panel fits the card.
   Pinned panels sit inside GSAP .pin-spacer wrappers, so only the
   unwrapped last panel is a direct child of .cr-stack. */
.cr-stack > .cr-fpanel:last-child {
    position: relative;
    z-index: 2; /* paint above the pinned (position: fixed) cards it slides over */
    min-height: 0;
    padding-bottom: 0;
}

.cr-fpanel > .cr-feat,
.cr-panel:not([data-panel="featured"]),
.cr-arrows button {
    pointer-events: auto;
}

/* Pull the stack up by the panel's top padding so the first card sits
   right under the tabs instead of that padding further down. */
.cr-stack {
    margin-top: calc(-1 * var(--cr-pin-top));
}

/* Screens too short for a whole card under the pinned tabs (index.php adds
   the class): no pins, the cards just follow one another. */
.cr-stack--flow {
    margin-top: 0;
}

.cr-stack--flow .cr-fpanel {
    min-height: 0;
    padding: 0 0 32px;
}

.cr-stack--flow > .cr-fpanel:last-child {
    padding-bottom: 0;
}

.cr-feat {
    display: flex;
    width: 100%;
    min-height: min(620px, calc(100vh - var(--cr-pin-top) - 50px));
    overflow: hidden;
    background: #fff;
    box-shadow: 0 -18px 50px rgba(31, 34, 36, 0.14);
}

/* Same 3:2 frame on every card, matching the *-3x2 renders (index.php), so the
   whole building shows. On short screens the frame narrows (its width follows
   the screen height) so the card still fits under the pinned tabs. */
.cr-feat__media {
    --cr-feat-fit: calc((100vh - var(--cr-pin-top) - 40px) * 1.5);
    position: relative;
    flex: 0 1 min(55%, var(--cr-feat-fit));
    min-width: 0;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: var(--cr-silver-light);
}

.cr-feat__media img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Two classes so it beats .cr-reveal.is-done's transition (site-enhancements.css). */
.cr-feat .cr-feat__media img {
    transition: all 0.9s;
}

/* No entrance zoom on the render either. */
.cr-feat .cr-feat__media img.cr-reveal {
    scale: 1;
}

.cr-feat__body {
    display: flex;
    flex: 1 1 45%;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
    padding: 44px 52px;
    box-sizing: border-box;
}

.cr-feat__status {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 11px;
    letter-spacing: 0.18em;
}

.cr-feat__status::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--cr-line);
}

/* Height comes from --logo-h (set per project in index.php) so every logo
   renders at the same size and visual weight. */
.cr-feat__logo {
    display: block;
    width: auto;
    max-width: 100%;
    height: var(--logo-h, 54px);
    object-fit: contain;
    object-position: left center;
}

.cr-feat__logo,
.cr-feat__logo-ph {
    flex-shrink: 0;
}

@media (max-width: 575px) {
    .cr-feat__logo {
        height: calc(var(--logo-h, 54px) * 0.8);
    }
}

.cr-feat__logo-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 56px;
    border: 1px dashed #8a8d90;
    color: var(--cr-label);
    font-size: 10px;
    letter-spacing: 0.14em;
}

.cr-feat__title {
    margin: 0;
    font-size: clamp(24px, 2.4vw, 33.6px);
    font-weight: 400;
    line-height: 1.08;
}

.cr-feat__title a {
    color: var(--cr-ink);
}

/* Two classes and !important line-height: site-fonts.css sets every <p> to
   21px / 1.75 !important through a body :is() rule that outranks one class. */
.cr-feat .cr-feat__desc {
    margin: 0;
    color: var(--cr-body);
    font-size: 19px;
    line-height: 1.6 !important;
}

.cr-dl {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    row-gap: 10px;
    margin: 0;
    padding-top: 18px;
    border-top: 1px solid var(--cr-line);
    font-size: 19px;
}

.cr-dl dt {
    padding-top: 6px;
    color: var(--cr-label);
    font-family: var(--cr-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.cr-dl dd {
    margin: 0;
    color: var(--cr-ink);
    line-height: 1.5;
}

.cr-dl a {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--cr-ink);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.cr-dl a svg {
    flex: none;
    width: 16px;
    height: 16px;
    margin-top: 6px;
}

.cr-feat__cta {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 16px;
    color: var(--cr-ink);
    font-family: var(--cr-sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.cr-feat__cta i {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--cr-charcoal);
    color: #fff;
    transition: transform 0.25s ease;
}

.cr-feat__cta i svg {
    width: 18px;
    height: 18px;
    color: #fff !important;
    stroke: #fff !important;
}

.cr-feat__cta:hover {
    color: var(--cr-ink);
}

.cr-feat__cta:hover i {
    transform: translateX(4px);
}

/* Laptops (and short desktop screens): smaller type and spacing keep the card
   as short as possible, and the render gets a wider share so it shows bigger. */
@media (min-width: 992px) and (max-width: 1599px),
       (min-width: 992px) and (max-height: 860px) {
    .cr-feat {
        min-height: 0;
    }

    .cr-feat__media {
        flex-basis: min(60%, var(--cr-feat-fit));
    }

    .cr-feat__body {
        flex-basis: 40%;
        gap: 12px;
        padding: 26px 34px;
    }

    .cr-feat__status {
        font-size: 10px;
    }

    .cr-feat__logo {
        height: calc(var(--logo-h, 54px) * 0.65);
    }

    .cr-feat__title {
        font-size: clamp(20px, 1.8vw, 26px);
    }

    .cr-feat .cr-feat__desc {
        font-size: 16px;
        line-height: 1.5 !important;
    }

    .cr-feat .cr-dl {
        grid-template-columns: 100px minmax(0, 1fr);
        row-gap: 2px;
        padding-top: 10px;
        font-size: 15px;
    }

    .cr-feat .cr-dl dt {
        padding-top: 4px;
        font-size: 10px;
    }

    .cr-feat .cr-dl a svg {
        width: 14px;
        height: 14px;
        margin-top: 4px;
    }

    .cr-feat__cta {
        gap: 12px;
        font-size: 11px;
    }

    .cr-feat__cta i {
        width: 40px;
        height: 40px;
    }

    .cr-feat__cta i svg {
        width: 15px;
        height: 15px;
    }
}

/* Ongoing / Completed / Upcoming: swipeable card row */
.cr-track {
    display: flex;
    gap: 28px;
    padding-bottom: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.cr-track::-webkit-scrollbar {
    display: none;
}

.cr-card {
    display: flex;
    flex: 0 0 384px;
    flex-direction: column;
    gap: 18px;
    color: var(--cr-ink);
    scroll-snap-align: start;
}

.cr-card:hover {
    color: var(--cr-ink);
}

.cr-card__img {
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--cr-silver-light);
}

.cr-card__img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cr-card .cr-card__img img {
    transition: all 0.9s;
}

.cr-card:hover .cr-card__img img {
    transform: scale(1.03);
}

/* Project logo on an Ongoing card (WTC Dahisar Toll Plaza Phase 1 / 2).
   Fixed width so both lockups match. */
.cr-card__brand {
    display: block;
    width: 220px;
    max-width: 70%;
    height: auto;
}

.cr-card__name {
    font-size: 24px;
    font-weight: 400;
    line-height: 1.15;
}

.cr-card .cr-dl {
    grid-template-columns: 100px minmax(0, 1fr);
    row-gap: 6px;
    margin-top: -4px;
    padding-top: 14px;
    font-size: 18px;
}

/* Upcoming: project logo on a plain tile, location written under it. */
.cr-card__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    padding: 40px;
    border: 1px solid var(--cr-line);
    background: #fff;
    transition: border-color 0.3s ease;
}

.cr-card__logo img {
    display: block;
    width: auto;
    max-width: 78%;
    height: auto;
    max-height: 120px;
    object-fit: contain;
    opacity: 0.4;
}

.cr-card--upcoming:hover .cr-card__logo {
    border-color: var(--cr-ink);
}

.cr-projects__more {
    display: flex;
    justify-content: center;
    margin-top: 48px;
    padding: 28px 0 0;
    border-top: 1px solid var(--cr-line);
    background: transparent;
}

.cr-projects .cr-btn-outline {
    display: inline-flex;
    align-items: center;
    height: 54px;
    padding: 0 34px;
    border: 1px solid var(--cr-ink);
    color: var(--cr-ink);
    font-family: var(--cr-sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2em;
}

.cr-projects .cr-btn-outline:hover,
.cr-projects .cr-btn-outline:focus-visible {
    background: var(--cr-charcoal);
    color: #fff !important;
}

@media (max-width: 991px) {
    .cr-fpanel {
        display: block;
        min-height: 0;
        padding: 0;
    }

    .cr-stack {
        margin-top: 0;
    }

    .cr-feat {
        flex-direction: column;
        height: auto;
        min-height: 0;
        max-height: none;
        margin-bottom: 32px;
        box-shadow: 0 18px 50px rgba(31, 34, 36, 0.1);
    }

    .cr-feat__media {
        flex: none;
    }

    .cr-feat__body {
        padding: 32px 24px;
    }

    .cr-projects__bar,
    .cr-projects__head {
        margin-bottom: 36px;
    }
}

@media (max-width: 575px) {
    /* Phones: tabs stay on one line and swipe sideways if they don't fit. */
    .cr-projects__bar {
        margin-bottom: 28px;
    }

    .cr-tabs {
        flex-wrap: nowrap;
        gap: 0 20px;
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .cr-tabs::-webkit-scrollbar {
        display: none;
    }

    .cr-tab {
        flex: none;
        font-size: 11px;
        letter-spacing: 0.12em;
        white-space: nowrap;
    }

    /* Cards are swiped on phones, so the arrow buttons are not needed. */
    .cr-arrows {
        display: none !important;
    }
}

/* Small phones (360px class): a little tighter so all four tabs fit. */
@media (max-width: 380px) {
    .cr-tabs {
        gap: 0 14px;
    }

    .cr-tab {
        font-size: 10.5px;
        letter-spacing: 0.1em;
    }

    .cr-dl {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .cr-card {
        flex-basis: 78vw;
    }

    .cr-card__name {
        font-size: 20.8px;
    }
}

/* ---------- Get in touch (includes/contact-block.php) ----------
   The block has its own 1240px / 24px frame; on the home page it follows the
   same width and side padding as the .container container-1520 sections above
   it, so its edges and the rule under its heading line up with theirs. */
#contact-block {
    --cb-w: 100%;
    --cb-pad: 16px;
}

@media (min-width: 576px) { #contact-block { --cb-w: 540px; } }
@media (min-width: 768px) { #contact-block { --cb-w: 720px; --cb-pad: 24px; } }
@media (min-width: 992px) { #contact-block { --cb-w: 960px; --cb-pad: 36px; } }
@media (min-width: 1200px) { #contact-block { --cb-w: 1140px; } }
@media (min-width: 1400px) { #contact-block { --cb-w: 1550px; --cb-pad: 70px; } }
@media (min-width: 1501px) { #contact-block { --cb-pad: 60px; } }

#contact-block .cb__heading,
#contact-block .cb__wrap {
    box-sizing: border-box;
    max-width: var(--cb-w);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--cb-pad);
    padding-right: var(--cb-pad);
}

/* The rule is drawn inside the side padding, not edge to edge. */
#contact-block .cb__heading {
    border-bottom: 0;
    background: linear-gradient(#e4e5e6, #e4e5e6) center bottom / calc(100% - 2 * var(--cb-pad)) 1px no-repeat;
}

/* The <picture> only swaps the glass artwork; the <img> keeps its own box. */
.cr-glass-pic {
    display: contents;
}

/* ---------- Banner (video + glass triangle): portrait phones and tablets ----------
   Full screen height, so cstm.js pins it during the zoom as on desktop. The
   video covers the screen (its sides are cropped; the frosted glass blurs them
   anyway) and the glass is the tall artwork (crescent-glass-tall.svg, via the
   <picture> in index.php) with its matching mask, so it covers the whole
   screen while the triangle still spans ~60% of the width. */
@media (orientation: portrait) {
    .banner-wrapper {
        min-height: 0;
    }

    .banner-wrapper .banner-content .section,
    .banner-wrapper .image-container {
        height: 100vh;
        height: 100svh;
        min-height: 0;
    }

    .banner-wrapper .section.hero video {
        object-fit: cover;
        object-position: center center;
    }

    .banner-wrapper .image-container img {
        object-fit: cover;
    }

    .banner-wrapper .image-container img.cr-glass {
        -webkit-mask-image: url("../img/crescent-tall.svg");
        mask-image: url("../img/crescent-tall.svg");
        -webkit-mask-size: cover;
        mask-size: cover;
    }
}

/* Landscape screens narrower than 16:9 (tablets, 4:3 and 16:10 laptops): the
   video spans the full width uncropped (site-enhancements.css), so a full-height
   banner left a dark band above it. Here the banner is only as tall as the
   video plus the header that covers its top; cstm.js then drops the pin, since
   the banner no longer fills the screen. */
:root {
    --cr-banner-header: 82px;
}

@media (min-width: 1200px) {
    :root {
        --cr-banner-header: 62px;
    }
}

@media (orientation: landscape) and (max-aspect-ratio: 16/9) and (min-height: 601px) {
    .banner-wrapper {
        min-height: 0;
    }

    .banner-wrapper .banner-content .section,
    .banner-wrapper .image-container {
        height: min(100vh, calc(56.25vw + var(--cr-banner-header)));
        height: min(100svh, calc(56.25vw + var(--cr-banner-header)));
        min-height: 0;
    }
}

/* Phones held sideways (short landscape screens): the 520px minimum height
   made the banner taller than the screen and cut off the triangle's bottom.
   Fit it to the screen height instead. */
@media (orientation: landscape) and (max-height: 600px) {
    .banner-wrapper {
        min-height: 0;
    }

    .banner-wrapper .banner-content .section,
    .banner-wrapper .image-container {
        height: 100vh;
        height: 100svh;
        min-height: 0;
    }

    /* The wide artwork is cropped top and bottom here; crop less from the top
       (artwork and its mask together) so the triangle's tip clears the 82px
       header instead of sitting under it. */
    .banner-wrapper .image-container img {
        object-position: 50% 35%;
    }

    .banner-wrapper .image-container img.cr-glass {
        -webkit-mask-position: 50% 35%;
        mask-position: 50% 35%;
    }
}