/* ==========================================================================
   CivicFirst — Global Stylesheet
   ========================================================================== */

/* --- Fonts --- */
@font-face {
    font-family: 'Sofia Pro';
    src: url('../assets/type/Sofia Pro Light Az.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Sofia Pro';
    src: url('../assets/type/Sofia Pro Regular Az.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'Sofia Pro';
    src: url('../assets/type/Sofia Pro Semi Bold Az.otf') format('opentype');
    font-weight: 600;
    font-style: normal;
    font-display: block;
}

/* --- Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* --- Colours --- */
:root {
    --color-bg: #ffffff;
    --color-surface: #f8f8f8;
    --color-mid: #f1f1f1;
    --color-border: #e2e2e2;
    --color-text: #111111;
    --color-text-muted: #6b7280;
    --color-white: #ffffff;
    --color-accent: #0a1628;
    --color-red: #E05C53;
    --color-header-bg: #ffffff;
}

/* --- Typography --- */
html {
    font-size: 16px;
    overflow-x: clip;
}

body {
    overflow-x: hidden;
    padding-top: 4.5rem;
    font-family: 'Sofia Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
    font-weight: 400;
    line-height: 1.25;
}

h1 {
    font-size: 40px;
    margin-bottom: 2rem;
}

.h1--hero {
    font-size: 55px;
}

h1:last-child {
    margin-bottom: 0;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1.5rem;
    font-weight: 400;
}

strong {
    font-weight: 600;
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Layout --- */
main {
    max-width: 75rem;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 6rem 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: 1.5rem;
}

main > * {
    grid-column: 1 / -1;
    min-width: 0;
}

main > *:last-child {
    margin-bottom: 0;
}

section {
    margin-bottom: 4rem;
}

section p:last-child {
    margin-bottom: 0;
}

/* --- Body type scale --- */
p.body-0 {
    font-size: 20px;
    font-weight: 400;
    line-height: 1.5;
}

p.body-1 {
    font-size: 21px;
    font-weight: 400;
    line-height: 1.5;
}

/* .body-2 is the default body size (18px) — no override needed */

/* --- Header & Navigation --- */
header {
    background-color: var(--color-header-bg);
    border-bottom: 1px solid var(--color-border);
    padding-left: 30px;
    padding-right: 30px;
    display: flex;
    align-items: center;
    gap: 0;
    height: 4.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    width: 100%;
    box-sizing: border-box;
    transition: transform 0.3s ease;
}

header > a {
    display: flex;
    align-items: center;
    align-self: stretch;
    flex-shrink: 0;
    margin-left: -30px;
    padding: 0 1.5rem 0 30px;
    border-radius: 0;
    transition: background-color 0.15s;
}

header > a:hover {
    background-color: var(--color-mid);
}

header img {
    height: 1.75rem;
    width: auto;
}

.header__search {
    margin-left: auto;
    margin-right: -30px;
    display: flex;
    align-items: stretch;
    align-self: stretch;
    flex-shrink: 0;
    height: 100%;
}

.header__search-input {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(183px + 1.5rem);
    right: 3.5rem;
    width: auto;
    height: 100%;
    margin: 0;
    padding: 0 0.75rem 0 1rem;
    border: none;
    border-radius: 0;
    outline: none;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    background: var(--color-surface);
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.header__search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    display: none;
}

.header__search--open .header__search-input {
    display: block;
    right: 7rem;
}

.header__search-btn {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 1.5rem;
    color: #4b5563;
    align-self: stretch;
    border-radius: 0;
    transition: background-color 0.15s, color 0.15s;
}

.header__search-btn:hover {
    background-color: var(--color-mid);
    color: #000000;
}

.header__search--open .header__search-btn {
    background-color: transparent;
}

.header__search svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header__search .icon-close {
    display: none;
}

.header__search--open .icon-search {
    display: none;
}

.header__search--open .icon-close {
    display: block;
}

/* Search icon shown as flex item left of button when open */
.header__search-icon-open {
    display: none;
    align-items: center;
    align-self: stretch;
    padding: 0 1.5rem 0 1rem;
    color: #4b5563;
    pointer-events: none;
    background-color: var(--color-surface);
}

.header__search-icon-open svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header__search--open .header__search-icon-open {
    display: flex;
}

.header__search-results {
    position: fixed;
    top: 4.5rem;
    left: calc(183px + 1.5rem);
    right: calc(1.5rem + 1.25rem + 1.5rem);
    width: auto;
    max-height: 24rem;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--color-border);
    border-top: none;
    border-radius: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    display: none;
    z-index: 600;
    margin-top: 0;
}

.header__search--open .header__search-results {
    display: block;
}

.header__search-results a {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
    transition: background-color 0.1s;
}

.header__search-results a:last-child {
    border-bottom: none;
}

.header__search-results a:hover {
    background-color: var(--color-surface);
}

.header__search-results a strong {
    display: block;
    margin-bottom: 0.125rem;
}

.header__search-results a span {
    color: var(--color-text-muted);
    font-size: 0.8125rem;
}

.header__search-results .no-results {
    padding: 1rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    text-align: center;
}

header nav {
    align-self: stretch;
    display: flex;
    align-items: stretch;
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 0;
    align-items: stretch;
}

header nav ul li {
    display: flex;
    align-items: stretch;
}

header nav a {
    color: #4b5563;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    border-radius: 0;
}

header nav a:hover {
    color: #000000;
    text-decoration: none;
    background-color: var(--color-mid);
}

/* Chevron next to What We Do */
.nav-chevron {
    width: 0.6rem;
    height: 0.6rem;
    margin-left: 0.35rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    vertical-align: middle;
}

.nav-link--has-chevron.is-open .nav-chevron {
    transform: rotate(180deg);
}

/* What We Do subnav dropdown */
.nav-subnav {
    position: fixed;
    top: 4.5rem;
    left: 0;
    right: 0;
    width: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid var(--color-border);
    list-style: none;
    margin: 0;
    padding: 0.5rem 0 1rem 0;
    z-index: 200;
    box-sizing: border-box;
    padding-left: calc(50% - 37.5rem);
    padding-right: calc(50% - 37.5rem);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    flex-direction: unset;
}

.nav-subnav__image {
    grid-column: 3;
    grid-row: 1 / -1;
    align-self: stretch;
    display: flex;
    align-items: flex-start;
    padding: 2.25rem 0 2.25rem 2rem;
}

.nav-subnav__image img {
    width: 220px;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nav-item--has-subnav.is-open .nav-subnav,
.nav-subnav.is-open {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.nav-subnav-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 99;
}

.nav-subnav-backdrop.is-visible {
    display: block;
}

.nav-subnav li:not(.nav-subnav__intro):not(.nav-subnav__image) {
    grid-column: 2;
}

.nav-subnav li a {
    display: block;
    padding: 0.35rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #000000;
    white-space: nowrap;
    background-color: transparent;
    box-shadow: none !important;
}

.nav-subnav__intro {
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: stretch;
    display: flex;
    align-items: flex-start;
    padding: 2.25rem 3rem 0.75rem 0;
    font-size: 26px;
    font-weight: 600;
    color: #000000;
    max-width: 22rem;
    line-height: 1.3;
}

.nav-subnav__links {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 2.25rem 0;
    position: relative;
    padding-left: 3rem;
}

.nav-subnav__links::before {
    content: '';
    position: absolute;
    left: 0;
    top: -0.5rem;
    bottom: -1rem;
    width: 1px;
    background-color: var(--color-border);
}

.nav-subnav__heading {
    display: block;
    padding: 0 0 0.4rem;
    font-size: 1.125rem;
    font-weight: 800;
}

.nav-subnav__links a {
    display: block;
    padding: 0.55rem 0 !important;
    font-size: 1rem;
}

.nav-subnav__links a:hover {
    color: #E05C53;
    background-color: transparent;
}

.nav-subnav li a:hover {
    background-color: transparent;
    color: #E05C53;
}

header nav a[aria-current="page"] {
    color: #000000;
    text-decoration: none;
    background-color: transparent;
    box-shadow: inset 0 -4px 0 0 #e5e7eb;
}

.discover-link {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 1.25rem;
    color: #E05C53;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: text-decoration 0.15s;
}

.discover-link:hover {
    text-decoration: underline;
}

.discover-arrow {
    width: 0.875rem;
    height: 0.875rem;
    stroke: #E05C53;
    fill: none;
    stroke-width: 2;
    stroke-linecap: butt;
    stroke-linejoin: miter;
    flex-shrink: 0;
}

/* Red full-width bottom border when search is open */
header:has(.header__search--open)::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: calc(183px + 1.5rem);
    right: calc(1.5rem + 1.25rem + 1.5rem);
    height: 2px;
    background: #E05C53;
    z-index: 1;
}

/* Header hidden state handled via inline style in JS — transition defined above */

/* Subnav follows header when it hides (no longer needed - handled in JS via syncSubnavTop) */

/* Hamburger button — hidden on desktop */
.nav-toggle {
    display: none;
}

/* --- Footer --- */
footer {
    width: 100%;
    border-top: 1px solid var(--color-border);
}

footer .footer__inner {
    max-width: 75rem;
    margin: 0 auto;
    padding: 2.5rem 0;
}

footer hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 1.5rem 0;
    height: 0;
    padding: 0;
}

hr.rule--content {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 0 0 2rem 0;
    height: 0;
    padding: 0;
}

.section--border-bottom {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 4rem;
}

.footer__top {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 2rem;
    align-items: flex-start;
    padding: 1.5rem 0;
}

.footer__brand {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.footer__logo {
    display: block;
    margin-bottom: 1.5rem;
}

.footer__logo img {
    display: block;
}

.footer__brand hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 0 0 1rem 0;
    height: 0;
    padding: 0;
}

.footer__copy {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--color-text);
    margin-bottom: 0;
}

.footer__docs {
    text-align: left;
    min-width: 0;
}

.footer__docs-heading {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

footer nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

footer nav {
    margin: 0;
}

footer nav a {
    color: var(--color-text);
    font-size: 0.9375rem;
    line-height: 1.3;
}

footer nav a:hover {
    color: var(--color-text);
}

/* --- Form --- */
label {
    display: block;
    font-size: 0.875rem;
    font-weight: 400;
    margin-bottom: 0.375rem;
    color: var(--color-text-muted);
}

input, textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-family: 'Sofia Pro', sans-serif;
    font-size: 0.9375rem;
    font-weight: 300;
    color: var(--color-text);
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 0.25rem;
    margin-bottom: 1.25rem;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

button[type="submit"] {
    font-family: 'Sofia Pro', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.625rem 1.5rem;
    color: var(--color-white);
    background-color: var(--color-accent);
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: opacity 0.2s;
    letter-spacing: 0.02em;
}

button[type="submit"]:hover {
    opacity: 0.85;
}

/* --- Section Label --- */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 3rem;
}

.section-label::before {
    content: '';
    display: block;
    width: 8px;
    height: 22px;
    background-color: var(--color-red);
    border-radius: 0;
    flex-shrink: 0;
    align-self: center;
}

.section-label span {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--color-text);
    text-transform: none;
    line-height: 22px;
    padding-top: 4px;
}

/* --- Fade-up animation --- */
.fade-up {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Hero Banner --- */
.hero-banner {
    width: 100%;
    height: 80vh;
    overflow: hidden;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 1;
}

.hero-banner__heading {
    position: absolute;
    top: calc(50% - 4.5rem);
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 75px;
    font-weight: 400;
    color: #ffffff;
    margin: 0;
    line-height: 1.1;
    text-align: center;
    width: 100%;
    animation: heroFadeUp 0.7s ease forwards;
    z-index: 2;
}

.hero-banner__scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-size: 0.875rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    margin: 0;
    white-space: nowrap;
    z-index: 2;
}

@keyframes heroFadeUp {
    from {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 28px));
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Rotating word in hero heading */
.word-rotator {
    display: inline-block;
    position: relative;
    height: 1.1em;
    overflow: hidden;
    vertical-align: bottom;
    line-height: 1.1;
    text-align: left;
}
.word-rotator::before {
    /* Reserves width of longest word so layout doesn't shift */
    content: "Infrastructure";
    display: inline-block;
    visibility: hidden;
    height: 1.1em;
}
.word-rotator__track {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    animation: wordRotate 18s cubic-bezier(.77,0,.2,1) infinite;
}
.word-rotator__track > span {
    height: 1.1em;
    display: block;
}
@keyframes wordRotate {
    0%, 15%   { transform: translateY(0); }
    20%, 35%  { transform: translateY(-1.1em); }
    40%, 55%  { transform: translateY(-2.2em); }
    60%, 75%  { transform: translateY(-3.3em); }
    80%, 95%  { transform: translateY(-4.4em); }
    100%      { transform: translateY(-5.5em); }
}
@media (prefers-reduced-motion: reduce) {
    .word-rotator__track { animation: none; }
}

.hero-banner__video-placeholder {
    width: 100%;
    height: 560px;
    background-color: #c8c8c8;
}

.hero-banner video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* --- Page Banner --- */
.page-banner {
    width: 100%;
    height: 350px;
    background-color: #d0d0d0;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.page-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0) 60%);
    pointer-events: none;
}

.page-banner img,
.page-banner video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.page-banner__inner {
    position: relative;
    z-index: 1;
    max-width: 75rem;
    width: 100%;
    margin: 0 auto;
    padding: 0 0 2.5rem;
}

.page-banner .section-label {
    margin-bottom: 1rem;
}

.page-banner .section-label span {
    color: #ffffff;
}

.page-banner .section-label::before {
    background-color: #ffffff;
}

.page-banner h1 {
    margin-bottom: 0;
    max-width: 52rem;
    color: #ffffff;
    font-size: 3rem;
}

.page-intro {
    font-size: 3.25rem;
    font-weight: 400;
    color: var(--color-text);
    margin-bottom: 2.5rem;
    line-height: 1.15;
}

main > *:has(.page-intro) {
    grid-column: 1 / -1;
}

/* 2+2 column split within a section */
.split-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1.5rem;
    align-items: start;
}

/* 4-column card grid — black bg covers cards only, aligned with main content */
.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background-color: #000000;
    max-width: calc(75rem + 40px);
    width: calc(100% - 40px);
    margin: 0 auto 4rem;
}

.grey-box {
    background-color: var(--color-mid);
    border-radius: 1rem;
    min-height: 12rem;
}

.section--ruled {
    border-top: none;
    padding-top: 3rem;
    position: relative;
}

.section--ruled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    border-top: 1px solid var(--color-border);
}

.section--ruled h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.section--partners-bg {
    background-color: var(--color-surface);
    padding-top: 3rem;
    padding-bottom: 40px;
    padding-left: 30px;
    padding-right: 30px;
    margin-bottom: 40px;
}

.section--partners-bg > .split-2 {
    max-width: 75rem;
    margin: 0 auto;
}

.section--partners-bg .split-2 {
    height: 500px;
}

.partners-content-box {
    background-color: #ffffff;
    padding: 2rem;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 5px;
}

.section--partners-bg .grey-box {
    height: 100%;
    border-radius: 5px;
    overflow: hidden;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.btn--dark {
    background-color: var(--color-text);
    color: #fff;
}

.policy-body p:has(> strong:only-child) {
    margin-bottom: 0.25rem;
}

.policy-layout {
    display: grid;
    grid-template-columns: 1fr 3fr;
    column-gap: 3rem;
    align-items: start;
}

.policy-body {
    column-gap: 2rem;
}

.policy-body ul {
    padding-left: 1.25rem;
    margin: 0 0 1rem;
}

.policy-body li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.card {
    aspect-ratio: 1 / 1;
    padding: 1.5rem;
    display: flex;
    align-items: flex-end;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.card > a {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    text-decoration: none;
    z-index: 3;
}

.card > a h2 {
    color: #ffffff;
    margin-bottom: 0;
    position: relative;
    z-index: 2;
}

.card > a img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 0;
}

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

.card::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.card > a::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.card h2 {
    position: relative;
    z-index: 2;
    color: #ffffff;
    margin-bottom: 0;
}

.card:nth-child(1) { background-color: #ebebeb; }
.card:nth-child(2) { background-color: #e2e2e2; }
.card:nth-child(3) { background-color: #d8d8d8; }
.card:nth-child(4) { background-color: #cecece; }

/* ==========================================================================
   Responsive — 4-tier system
   Wide  ≥ 100rem (1600px+)   Large monitors / 27–28" screens
   Desktop        (default)   MacBook / 1200px content width
   Tablet ≤ 64rem (1024px)    iPad landscape, small laptops
   Mobile ≤ 40rem (640px)     Phones
   ========================================================================== */

/* --- Wide (≥ 100rem / 1600px+) --- */
@media (min-width: 100rem) {
    .page-banner__inner {
        max-width: 75rem;
    }

    .nav-subnav {
        padding-left: calc(50% - 50rem);
        padding-right: calc(50% - 50rem);
    }

    .hero-banner__heading {
        font-size: 80px;
    }

    h1 {
        font-size: 48px;
    }

    .h1--hero {
        font-size: 55px;
    }

    .page-intro {
        font-size: 3.75rem;
    }
}

/* --- Desktop side-padding (content narrower than viewport) --- */
@media (max-width: 75rem) {
    main {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    footer .footer__inner {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .page-banner__inner {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .nav-subnav {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* --- Tablet (≤ 64rem / 1024px) --- */
@media (max-width: 64rem) {

    /* --- Typography --- */
    h1 {
        font-size: 2rem;
    }

    .h1--hero {
        font-size: 2.625rem;
    }

    .hero-banner__heading {
        font-size: 50px;
    }

    .page-intro {
        font-size: 2.5rem;
    }

    /* --- Layout --- */
    main {
        padding: 4rem 1.5rem;
    }

    .split-2 {
        grid-template-columns: 1fr;
        row-gap: 1.5rem;
    }

    .section--partners-bg .split-2 {
        height: auto;
    }

    .partners-content-box {
        height: auto;
    }

    .section--partners-bg .grey-box {
        height: 320px;
    }

    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    /* --- Footer: 2-col grid on tablet --- */
    .footer__top {
        grid-template-columns: 1fr 1fr;
        row-gap: 2rem;
    }

    /* --- Hero banner --- */
    .hero-banner__scroll {
        font-size: 0.875rem;
    }

    /* --- Hide desktop nav, show hamburger on tablet + mobile --- */
    header nav {
        position: fixed;
        top: 4.5rem;
        right: 0;
        width: 100%;
        height: calc(100% - 4.5rem);
        background-color: var(--color-header-bg);
        z-index: 199;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        padding-top: 0;
    }

    header nav.is-open {
        transform: translateX(0);
    }

    header nav ul {
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 0 1rem;
        align-items: stretch;
        width: 100%;
    }

    header nav ul li {
        display: block;
        width: 100%;
        border-bottom: 1px solid var(--color-border);
        outline: none;
    }

    header nav ul li:last-child {
        border-bottom: none;
    }

    header nav a {
        display: block;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        font-weight: 600;
        -webkit-tap-highlight-color: transparent;
    }

    header nav a:active,
    header nav a:focus,
    header nav a:hover,
    .nav-subnav__links a:hover,
    .nav-subnav li a:hover {
        background-color: transparent !important;
        color: inherit !important;
        outline: none;
        box-shadow: none;
    }

    header nav a:focus-visible {
        outline: none;
    }

    header nav a::after {
        display: none;
    }

    .header__search {
        display: none;
    }

    .header__search-results {
        display: none !important;
    }

    /* --- Hamburger button --- */
    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        position: relative;
        z-index: 201;
        margin-left: auto;
        gap: 5px;
        width: 44px;
        height: 44px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        flex-shrink: 0;
    }

    .nav-toggle span {
        display: block;
        width: 24px;
        height: 2px;
        background-color: var(--color-text);
        border-radius: 1px;
        transition: transform 0.25s ease, opacity 0.25s ease;
        transform-origin: center;
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* --- Subnav mobile/tablet --- */
    .nav-subnav {
        position: static;
        display: flex !important;
        flex-direction: column;
        opacity: 1 !important;
        transform: none !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transition: none !important;
        box-shadow: none;
        border: none;
        margin: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
    }

    .nav-item--has-subnav.is-open .nav-subnav {
        max-height: 30rem;
        transition: max-height 0.3s ease !important;
    }

    .nav-subnav__intro { display: none; }
    .nav-subnav__image { display: none; }
    .nav-subnav__links { padding: 0; }
    .nav-subnav__links::before { display: none; }
    .nav-subnav__heading { display: none; }

    .nav-subnav__links a,
    .nav-subnav li a {
        -webkit-tap-highlight-color: transparent;
    }

    .nav-subnav__links a {
        padding: 0.4rem 1.5rem !important;
        font-size: 0.9375rem;
    }

    .nav-subnav-backdrop {
        display: none !important;
    }
}

/* --- Mobile (≤ 40rem / 640px) --- */
@media (max-width: 40rem) {

    /* Rotator centered on mobile when heading wraps */
    .word-rotator {
        display: block;
        text-align: center;
    }
    .word-rotator::before {
        display: none;
    }
    .word-rotator__track {
        position: static;
    }

    /* --- Typography --- */
    h1 {
        font-size: 1.625rem;
        margin-bottom: 1.5rem;
    }

    .h1--hero {
        font-size: 30px;
    }

    h2 {
        font-size: 1.25rem;
    }

    .card h2 {
        font-size: 1.5rem;
    }

    body {
        font-size: 16px;
    }

    p.body-1 {
        font-size: 16px;
    }

    #solutions .split-2 h1 {
        margin-bottom: 0;
    }

    /* --- Layout --- */
    main {
        padding: 3rem 20px;
        grid-template-columns: 1fr;
    }

    .split-2 {
        grid-template-columns: 1fr;
    }

    /* card-grid: 1 column on mobile, 20px inset */
    .card-grid {
        grid-template-columns: 1fr;
        gap: 0;
        padding-left: 0;
        padding-right: 0;
        width: calc(100% - 40px) !important;
        max-width: calc(100% - 40px) !important;
        margin-left: 20px !important;
        margin-right: 20px !important;
    }

    .card {
        padding: 20px;
    }

    section {
        margin-bottom: 2rem;
    }

    /* --- Header --- */
    header {
        padding-left: 20px;
        padding-right: 20px;
    }

    header > a {
        margin-left: -20px;
        padding-left: 20px;
    }

    /* --- Hero Banner --- */
    .hero-banner {
        height: 100vh;
    }

    .hero-banner__heading {
        font-size: 36px;
        width: 90%;
    }

    .hero-banner__video-placeholder {
        height: 100%;
    }

    .hero-banner video {
        height: 100%;
    }

    /* --- Page Banner --- */
    .page-banner {
        height: 220px;
    }

    .page-banner h1 {
        font-size: 1.875rem;
    }

    /* --- Page Intro --- */
    .page-intro {
        font-size: 2rem;
    }

    main > *:has(.page-intro) {
        grid-column: 1 / -1;
    }

    /* --- Section Label --- */
    .section-label {
        margin-bottom: 1.5rem;
        gap: 10px;
    }

    .section-label span {
        font-size: 1rem;
    }

    /* --- Footer --- */
    .footer__top {
        grid-template-columns: 1fr 1fr;
        row-gap: 1.5rem;
    }

    .partners-content-box {
        padding: 20px;
    }

    .section--partners-bg {
        padding-left: 20px;
        padding-right: 20px;
    }

    .footer__brand {
        grid-column: 1 / -1;
        padding-bottom: 1rem;
    }

    .footer__bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    footer .footer__inner {
        padding: 20px 1.25rem 2rem;
    }

    .footer__logo {
        margin-bottom: 40px;
    }

    .footer__copy {
        margin-bottom: 60px;
    }

    /* --- Form --- */
    input, textarea {
        font-size: 16px; /* Prevents iOS auto-zoom */
        padding: 0.75rem;
    }

    button[type="submit"] {
        width: 100%;
        padding: 0.875rem;
        font-size: 1rem;
    }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    .fade-up {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .fade-up.is-visible {
        opacity: 1;
        transform: none;
    }

    .nav-toggle span {
        transition: none;
    }
}
