/*
 * port.css — shared overrides on top of the legacy stylesheets.
 * See README.md for the port's styling structure.
 * Loaded last on every page.
 */

/* ---- Content visible without JavaScript ---------------------------------
 * style.css hides section titles (.animated-line) until a script reveals
 * them. Hide them only when scripts run (html.js is set before first paint). */
.animated-line {
    opacity: 1;
}

.js .animated-line {
    opacity: 0;
}

/* GSAP controls this fixed decorative layer's visibility while scrolling.
 * Without scripts it would cover the page and intercept navigation. */
html:not(.js) .scene {
    display: none;
}

/* ---- Visible keyboard focus ---------------------------------------------
 * The PHP site removed focus outlines (style.css, layout-index.css,
 * layout-services.css). Restore one for keyboard users only. */
html body a:focus-visible,
html body button:focus-visible,
html body [role="button"]:focus-visible,
html body [tabindex]:focus-visible,
html body input:focus-visible,
html body textarea:focus-visible,
html body select:focus-visible,
html body summary:focus-visible {
    outline: 2px solid currentColor !important;
    outline-offset: 3px;
}

html body .custom-control-input:focus-visible ~ .custom-control-label::before {
    outline: 2px solid #141414 !important;
    outline-offset: 3px;
}

/* ---- Reduced motion ------------------------------------------------------
 * Scripts skip their animations under this preference; this stops the CSS
 * transitions (logo flips, card flips, tab fades, accordion, menus). */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto !important;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ---- Contact form consent line (new) ------------------------------------ */
.form-consent {
    margin-top: 24px;
    font-size: 14px;
    line-height: 1.4;
}

.form-consent a {
    color: inherit;
    text-decoration: underline !important;
}

/* ---- Careers form (one step: details and resume) ------------------------ */
.careers-apply select option {
    background-color: white;
    border-bottom-width: 4px;
    border-bottom-color: black;
}

.careers-apply .resume-hint {
    font-size: 14px;
    margin-top: 8px;
}

/* ---- Job posts ------------------------------------------------------------
 * The visible title was an <h3>; it is the page's <h1> now, styled as before. */
.describe {
    padding: 10px 25px;
}

h1.job-title {
    font-size: 3.75rem;
    line-height: 3.75rem;
    font-weight: 500;
}

/* ---- Case study detail pages (were inline <style> blocks) --------------- */
.cs-detail-desc-logo {
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
}

@media (max-width: 767px) {
    .seeall-cs-tall .seeall-cs-wrapper-sub .row {
        height: 100vh;
    }
}

/* ---- 404 page (was an inline <style> block in 404.php) ------------------ */
.error-wrapper {
    background: #1E1E1E;
    height: 100vh;
}

.error-wrapper .row {
    height: 100vh;
    display: flex;
    align-items: center;
}

.header-dark {
    background: transparent;
}

.header-dark .link-arrow {
    filter: invert(100%);
}

.header-dark a {
    color: #fff !important;
}

.header-dark .logo-mobile {
    filter: invert(100%);
}

/* ---- Legal pages (new) --------------------------------------------------- */
.legal-wrapper {
    padding: 180px 0 100px 0;
}

.legal-wrapper h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 40px;
}

.legal-wrapper .legal-placeholder {
    border: 2px dashed #141414;
    padding: 24px;
    max-width: 760px;
}

/* ---- Process steps text for search engines and screen readers ----------- */
.process-steps-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- Standards-mode parity -----------------------------------------------
 * The PHP pages rendered in quirks mode (a curly-quoted doctype). React always
 * renders in standards mode, where a line made only of inline-blocks still
 * gets the block's line-height "strut", so a few boxes grew taller. Each rule
 * below restores the quirks-mode geometry of one such spot (measured against
 * the live site). */

/* Odometer digits: no strut around a digit or a run of digits. A number with
 * a decimal mark has real text in its line, so it keeps the strut. */
html body .odometer .odometer-digit .odometer-digit-spacer {
    vertical-align: baseline !important;
}

html body .odometer:not(:has(.odometer-formatting-mark)) .odometer-digit {
    vertical-align: baseline !important;
}

.client-number-wrap .big-number:has(.odometer-inside) {
    line-height: 0;
}

/* Footer link arrows. */
.footer-link-arrow {
    line-height: 0;
}

/* Home hero: the wordmark box (and, on phones, the mark that replaced the
 * iframe) sits alone in its line. */
.big-logo-intro {
    line-height: 0;
}

/* 404: the visible line was an <h2>; it is the page's <h1> now, sized as before. */
h1.h2-like {
    font-size: 5.5rem;
    line-height: 5.6875rem;
    margin-bottom: 100px;
}

@media (max-width: 767px) {
    h1.h2-like {
        font-size: 2.375rem;
        line-height: 2.875rem;
        margin-bottom: 30px;
    }
}

/* Services and case-studies heroes: in quirks mode the inner .row.h-100
 * resolved its 100% against the hero (the nearest box with a height); in
 * standards mode it needs every box in between to have one. */
.intro-services > .container-fluid,
.intro-casestudies > .container-fluid {
    height: 100%;
}

/* Unitless lengths: quirks mode read them as pixels, standards mode drops
 * them. These are the ones the ported pages use. */
.ico-dot-org {
    width: 8px;
    height: 8px;
}

.text-50-sup-2 {
    top: 1px;
}

.services-rcmd-link {
    bottom: 20px;
}

/* The quirks-mode browser stylesheet gives every form a 1em bottom margin
 * (https://quirks.spec.whatwg.org/ and the HTML rendering section). */
form {
    margin-bottom: 1em;
}

/* Client logos are no longer links (they pointed at the brands' own sites);
 * the same fade and hover, on the span that replaced the anchor. */
.client-logo-box .client-logo img {
    opacity: 0.2;
    transition: .5s;
}

.client-logo-box:hover .client-logo img {
    opacity: 1;
}

/* Case-studies hero overflow (audit fix, D5): on desktop the absolutely
 * positioned "We power ambitious brands" ran past the dark hero whenever the
 * window was shorter than about 1100 px. The heading now sits in the flow,
 * at the bottom of the hero as before, and the hero grows to contain it. */
@media (min-width: 992px) {
    .intro-casestudies {
        height: auto;
        min-height: 100%;
        display: flex;
        flex-direction: column;
    }

    .intro-casestudies > .container-fluid {
        flex: 1 0 auto;
        display: flex;
        height: auto;
    }

    .intro-casestudies > .container-fluid > .row {
        flex: 1 1 auto;
        align-content: space-between;
        height: auto !important;
    }

    .heading-casestudies {
        position: static;
    }
}
