/* ==========================================================================
   GLOBAL DESIGN VARIABLES & RESET
   ========================================================================== */
:root {
    --color-bg-main: #FFFFFF;
    --color-bg-alt: #F3F4F6;
    --color-bg-subtle: #F9FAFB;
    --color-text-main: #111827;
    --color-text-muted: #4B5563;
    --color-primary-blue: #0A3A60;
    --color-accent-blue: #1D70B8;
    --color-accent-gold: #D97706;
    --color-accent-red: #DC2626;

    --radius-card: 16px;
    --radius-button: 9999px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 20px -2px rgba(10, 58, 96, 0.08);
    --shadow-lg: 0 20px 25px -5px rgba(10, 58, 96, 0.1),
                 0 10px 10px -5px rgba(10, 58, 96, 0.04);

    --container-max: 1240px;
    --container-gutter: 2rem;
    --section-space: 6rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--color-bg-main);
    color: var(--color-text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img,
picture,
svg,
video,
canvas {
    display: block;
    max-width: 100%;
}

img,
picture,
video,
canvas {
    height: auto;
}

a,
button,
input,
select,
textarea {
    font: inherit;
}

a,
p,
li,
h1,
h2,
h3 {
    overflow-wrap: anywhere;
}

/* ==========================================================================
   TYPOGRAPHY HIERARCHY
   ========================================================================== */
h1,
h2,
h3 {
    text-wrap: balance;
}

h1 {
    font-size: clamp(2.35rem, 5vw, 3.25rem);
    font-weight: 800;
    color: var(--color-primary-blue);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: clamp(1.9rem, 3.5vw, 2.25rem);
    font-weight: 700;
    color: var(--color-primary-blue);
    line-height: 1.2;
    margin-bottom: 1rem;
}

h3 {
    font-size: clamp(1.2rem, 2vw, 1.35rem);
    font-weight: 700;
    color: var(--color-primary-blue);
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

p {
    color: var(--color-text-muted);
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    line-height: 1.6;
}

/* ==========================================================================
   STRUCTURE & UTILITIES
   ========================================================================== */
.container {
    width: min(100%, var(--container-max));
    margin-inline: auto;
    padding-inline: var(--container-gutter);
}

.section-padding {
    padding-block: var(--section-space);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
}

/* ==========================================================================
   COMPONENTS
   ========================================================================== */

/* Global Navigation Bar */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    min-width: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.brand img,
.brand svg {
    flex: 0 0 auto;
    max-width: 100%;
    height: auto;
}

.brand-text-top {
    display: block;
    color: var(--color-primary-blue);
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.brand-text-bottom {
    display: block;
    color: var(--color-text-muted);
    font-size: clamp(0.75rem, 1.4vw, 0.9rem);
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.08em;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2rem;
    min-width: 0;
}

.nav-item {
    color: var(--color-text-muted);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.nav-item:hover,
.nav-item:focus-visible,
.nav-item.active {
    color: var(--color-accent-blue);
}

/* Interactive Pill Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 44px;
    padding: 0.85rem 1.85rem;
    border: none;
    border-radius: var(--radius-button);
    box-shadow: var(--shadow-sm);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: normal;
    cursor: pointer;
    transition: background-color 0.2s ease,
                color 0.2s ease,
                border-color 0.2s ease,
                box-shadow 0.2s ease,
                transform 0.2s ease;
}

.btn:focus-visible,
.nav-item:focus-visible,
.solution-link:focus-visible {
    outline: 3px solid rgba(29, 112, 184, 0.3);
    outline-offset: 3px;
}

.btn-primary {
    background-color: var(--color-accent-blue);
    color: #FFFFFF;
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background-color: var(--color-primary-blue);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    padding: 0.75rem 1.75rem;
    border: 2px solid var(--color-accent-blue);
    background-color: transparent;
    color: var(--color-accent-blue);
}

.btn-outline:hover,
.btn-outline:focus-visible {
    background-color: rgba(29, 112, 184, 0.04);
}

/* Dynamic Grid Solution Cards */
.solution-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    height: 100%;
    padding: 3rem 2.5rem;
    border: 1px solid rgba(10, 58, 96, 0.08);
    border-radius: var(--radius-card);
    background: #FFFFFF;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.solution-card img {
    width: auto;
    max-width: 100%;
    max-height: 90px;
    margin-bottom: 1.5rem;
    object-fit: contain;
}

.solution-card p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.solution-link {
    margin-top: auto;
    color: var(--color-accent-blue);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
}

.solution-link:hover,
.solution-link:focus-visible {
    text-decoration: underline;
}

/* Custom Horizontal Component Lists */
.features-ul {
    width: 100%;
    margin-bottom: 2rem;
    list-style: none;
    text-align: left;
}

.features-ul li {
    position: relative;
    margin-bottom: 0.5rem;
    padding-left: 1.75rem;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.features-ul li:last-child {
    margin-bottom: 0;
}

.features-ul li::before {
    content: "•";
    position: absolute;
    top: 0;
    left: 0.5rem;
    color: var(--color-accent-blue);
    font-weight: 700;
}

/* Site Footer */
.site-footer {
    margin-top: auto;
    padding: 4rem 0 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: var(--color-bg-subtle);
    font-size: 0.95rem;
}

.footer-wrap {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 3rem;
}

.footer-wrap > * {
    min-width: 0;
}

/* ==========================================================================
   INTERACTION CAPABILITIES
   ========================================================================== */
@media (hover: hover) and (pointer: fine) {
    .btn-primary:hover {
        transform: translateY(-1px);
    }

    .solution-card:hover {
        transform: translateY(-8px);
        border-color: rgba(29, 112, 184, 0.2);
        box-shadow: var(--shadow-lg);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ==========================================================================
   TABLET
   ========================================================================== */
@media (max-width: 1024px) {
    :root {
        --container-gutter: 1.5rem;
        --section-space: 5rem;
    }

    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem;
    }

    .header-wrap {
        gap: 1.5rem;
    }

    .nav-links {
        gap: 1.25rem;
    }

    .solution-card {
        padding: 2.5rem 2rem;
    }
}

/* ==========================================================================
   MOBILE NAVIGATION & SINGLE-COLUMN LAYOUT
   ========================================================================== */
@media (max-width: 767px) {
    :root {
        --container-gutter: 1.25rem;
        --section-space: 4rem;
    }

    .site-header {
        position: relative;
        padding: 0.85rem 0;
    }

    .header-wrap {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .brand {
        justify-content: flex-start;
        gap: 0.9rem;
    }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
        gap: 0.75rem 1.25rem;
        flex-wrap: wrap;
        padding-top: 0.85rem;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
    }

    .nav-item {
        white-space: normal;
    }

    .grid-3 {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
    }

    .solution-card {
        padding: 2.25rem 1.75rem;
    }

    .footer-wrap {
        flex-direction: column;
        justify-content: flex-start;
        gap: 2rem;
    }
}

/* ==========================================================================
   SMALL PHONES
   ========================================================================== */
@media (max-width: 480px) {
    :root {
        --container-gutter: 1rem;
        --section-space: 3.25rem;
    }

    h1 {
        margin-bottom: 1.25rem;
    }

    .brand-text-bottom {
        letter-spacing: 0.05em;
    }

    .nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .nav-item {
        display: block;
        width: 100%;
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .nav-item:last-child {
        border-bottom: 0;
    }

    .btn {
        width: 100%;
        padding-inline: 1.25rem;
    }

    .btn-outline {
        padding-inline: 1.25rem;
    }

    .solution-card {
        padding: 2rem 1.25rem;
    }

    .solution-card img {
        max-height: 76px;
    }

    .features-ul {
        margin-bottom: 1.5rem;
    }

    .site-footer {
        padding: 3rem 0 1.5rem;
    }
}

/* ========================================================================== 
   RESPONSIVE OVERRIDES FOR LEGACY INLINE LAYOUTS
   These rules intentionally use !important where inline page styles otherwise
   prevent responsive behavior.
   ========================================================================== */

@media (max-width: 900px) {
    /* Shared page-level two-column content layouts */
    main .container[style*="grid-template-columns"],
    section > .container[style*="grid-template-columns"],
    section .container > div[style*="grid-template-columns"] {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 2.5rem !important;
    }

    /* Keep every grid child shrinkable instead of overflowing */
    [style*="display: grid"] > * {
        min-width: 0;
    }

    /* Remove oversized desktop-only vertical separation */
    [style*="margin-bottom: 5rem"] {
        margin-bottom: 3rem !important;
    }
}

@media (max-width: 767px) {
    /* Inline header declarations currently override the mobile header rules */
    .header-wrap[style] {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        flex-wrap: nowrap !important;
        gap: 1rem !important;
    }

    .brand[style] {
        width: 100%;
        min-width: 0;
        gap: 0.85rem !important;
    }

    .brand img {
        width: auto !important;
        height: 44px !important;
        max-width: 52px;
    }

    .brand > div {
        min-width: 0;
    }

    .brand-text-bottom {
        font-size: 0.72rem !important;
        letter-spacing: 0.04em !important;
        overflow-wrap: normal;
    }

    .nav-links[style] {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch !important;
        justify-content: stretch !important;
        width: 100%;
        gap: 0.65rem !important;
        padding-top: 1rem;
    }

    .nav-links .nav-item,
    .nav-links select,
    .nav-links .btn {
        width: 100%;
        min-width: 0;
        min-height: 44px;
    }

    .nav-links .nav-item {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.7rem 0.65rem !important;
        border: 1px solid rgba(10, 58, 96, 0.1);
        border-radius: 8px;
        background: #fff;
        text-align: center;
    }

    .nav-links select {
        grid-column: 1 / -1;
        padding: 0.7rem 0.75rem !important;
    }

    .nav-links .btn {
        padding: 0.7rem 0.9rem !important;
    }

    /* Inline subpage heading sizes are too rigid for narrow screens */
    section h1[style*="font-size: 2.75rem"] {
        font-size: clamp(2rem, 10vw, 2.55rem) !important;
        overflow-wrap: normal;
        word-break: normal;
    }

    /* Inline two-column cards and content blocks */
    section > .container[style*="grid-template-columns"],
    section .container > div[style*="grid-template-columns"] {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 2rem !important;
    }

    /* Responsive card spacing */
    [style*="padding: 4rem 3rem"] {
        padding: 2.25rem 1.25rem !important;
    }

    [style*="padding: 3rem 2.5rem"],
    [style*="padding: 3rem"] {
        padding: 2rem 1.25rem !important;
    }

    [style*="padding: 2.5rem"] {
        padding: 1.75rem 1.25rem !important;
    }

    /* Home hero should stack cleanly and not retain desktop height */
    section[style*="min-height: 650px"] {
        min-height: auto !important;
        display: block !important;
    }

    section[style*="min-height: 650px"] .container {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 2.5rem !important;
    }

    section[style*="min-height: 650px"] [style*="text-align: right"] {
        text-align: center !important;
    }

    /* Negative desktop overlap causes cards to collide on mobile */
    .grid-3[style*="margin-top: -120px"] {
        margin-top: 0 !important;
    }

    /* Long contact details must wrap rather than force viewport overflow */
    strong {
        max-width: 100%;
    }

    strong[style*="font-size: 1.75rem"] {
        display: block;
        font-size: clamp(1.2rem, 6vw, 1.55rem) !important;
        overflow-wrap: anywhere;
    }

    /* Footer links need wrapping on smaller widths */
    .footer-wrap nav[style] {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.75rem 1.25rem !important;
    }
}

@media (max-width: 480px) {
    .nav-links[style] {
        grid-template-columns: minmax(0, 1fr);
    }

    .nav-links select {
        grid-column: auto;
    }

    .nav-links .nav-item {
        justify-content: flex-start;
        text-align: left;
    }

    .brand-text-top {
        font-size: 1.1rem !important;
    }

    .brand-text-bottom {
        font-size: 0.66rem !important;
    }
}
