/* Genesis site theme — typography, spacing, section systems
   Loaded after styles.css to override duplicated legacy rules. */

:root {
    --brand-blue: #3d9bc7;
    --brand-blue-dark: #3487ad;
    --brand-orange: #e8722a;
    --brand-orange-dark: #d4631f;
    --ink: #1d1d1f;
    --ink-muted: #4a4a4f;
    --ink-soft: #6e6e73;
    --page-bg: #ffffff;
    --section-space: clamp(2.75rem, 5vw, 4.25rem);
    --content-max: 1100px;
    --font: 'Outfit', 'Avenir Next', 'Segoe UI', sans-serif;
}

html {
    background: var(--page-bg);
}

body {
    font-family: var(--font) !important;
    background: var(--page-bg) !important;
    color: var(--ink-muted);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4,
.hero-reform,
.nav-links,
.btn,
button,
input,
textarea {
    font-family: var(--font) !important;
}

/* Global section rhythm + heading hierarchy */
.section {
    padding: var(--section-space) 24px !important;
    box-sizing: border-box;
}

.section > h2,
.section h2.system-title,
.section h2.featured-articles-title,
.section h2.five-stages-title,
.section h2.who-we-serve-title,
.section h2.contact-title,
#philosophy > h2 {
    font-family: var(--font) !important;
    font-size: clamp(1.85rem, 3.4vw, 2.65rem) !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    letter-spacing: -0.025em !important;
    color: var(--ink) !important;
    text-align: center;
    padding: 0 0 1rem !important;
    margin: 0 auto !important;
    max-width: 52rem;
}

.system-title .accent,
.featured-articles-title .accent,
.who-we-serve-title .accent,
#philosophy h2 .accent {
    color: var(--brand-blue) !important;
}

.five-stages-title-lead {
    color: var(--ink) !important;
}

.five-stages-title-accent {
    color: var(--brand-blue) !important;
}

.contact-title .accent {
    color: var(--brand-orange) !important;
}

.contact-title {
    font-size: clamp(1.55rem, 2.8vw, 2.15rem) !important;
    max-width: 44rem !important;
    line-height: 1.3 !important;
}

.system-intro,
.system-outro,
.featured-articles-intro,
.five-stages-intro,
.who-we-serve-intro,
#philosophy .section-intro > p:first-of-type {
    font-family: var(--font) !important;
    font-size: clamp(1.02rem, 1.5vw, 1.15rem) !important;
    line-height: 1.65 !important;
    color: var(--ink-muted) !important;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
}

/* Five Stages — HTML flow diagram */
.five-stages-section {
    max-width: none;
}

.five-stages-diagram-wrap {
    max-width: 980px;
    margin: 2rem auto 0;
    padding: 1.5rem 1.25rem 1.75rem;
    background: #f4f6f8;
    border: 1px solid #d8dde3;
    border-radius: 16px;
}

.stages-flow {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.stages-row {
    display: grid;
    align-items: stretch;
}

.stages-row-top {
    grid-template-columns: 1fr auto 1fr;
    gap: 0.75rem;
    align-items: center;
}

.stages-row-bottom {
    grid-template-columns: 1fr 1fr auto 1fr;
    gap: 0.65rem;
    align-items: stretch;
}

.stage-card {
    background: #fff;
    border: 1px solid #e5e9ef;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    padding: 1rem 1.1rem 1.15rem;
    text-align: left;
    height: 100%;
}

.stage-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.stage-num {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: var(--brand-orange);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.stage-card h3 {
    margin: 0.15rem 0 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a3557;
    line-height: 1.25;
    letter-spacing: -0.015em;
}

.stage-card h3::after {
    content: '';
    display: block;
    width: 2.25rem;
    height: 2px;
    margin-top: 0.4rem;
    background: var(--brand-blue);
}

.stage-card p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
    color: #333;
}

.stage-arrow-h {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-orange);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    user-select: none;
}

.stages-branch {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    height: 52px;
    margin: 0.15rem 0 0.35rem;
    position: relative;
}

.stages-branch::before {
    content: '';
    position: absolute;
    left: 16.66%;
    right: 16.66%;
    top: 14px;
    height: 3px;
    background: var(--brand-blue);
    border-radius: 2px;
}

.stages-branch span {
    position: relative;
    display: block;
}

.stages-branch span::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 14px;
    width: 3px;
    height: 24px;
    transform: translateX(-50%);
    background: var(--brand-blue);
}

.stages-branch span::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 34px;
    width: 0;
    height: 0;
    transform: translateX(-50%);
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 9px solid var(--brand-blue);
}

@media (max-width: 800px) {
    .stages-row-top,
    .stages-row-bottom {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }

    .stage-arrow-h {
        transform: rotate(90deg);
        padding: 0.15rem 0;
    }

    .stages-branch {
        display: none;
    }
}

/* Who We Serve — equal card heights / aligned CTAs */
.roles-grid-reform {
    align-items: stretch;
}

.roles-grid-reform .role-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100%;
    min-height: 100%;
    box-sizing: border-box;
}

.roles-grid-reform .role-card > p:not(.role-label) {
    flex: 1 1 auto;
}

.roles-grid-reform .learn-more {
    margin-top: auto !important;
}

.roles-grid-reform .learn-more::after {
    content: none !important;
    display: none !important;
}

.roles-grid-reform .role-card:first-child {
    display: flex !important;
}

/* Footer */
footer {
    background: #f5f6f8 !important;
    border-top: 1px solid #e5e7eb;
    padding: 2.5rem 24px 1.5rem !important;
    margin-top: 0 !important;
}

.footer-content {
    max-width: var(--content-max);
    margin: 0 auto 1.5rem !important;
    display: grid !important;
    grid-template-columns: 1.4fr 1fr;
    gap: 2rem;
    padding: 0 !important;
}

.footer-section h3 {
    font-size: 1rem !important;
    font-weight: 700;
    color: var(--ink) !important;
    margin: 0 0 0.65rem !important;
}

.footer-section p {
    font-size: 0.92rem !important;
    line-height: 1.55 !important;
    color: var(--ink-muted) !important;
    margin: 0 !important;
    max-width: 36rem;
}

.footer-nav {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    gap: 0.55rem;
    z-index: auto !important;
}

.footer-nav a {
    color: var(--brand-blue) !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0 !important;
    background: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.footer-nav a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
    color: var(--brand-blue-dark) !important;
    transform: none !important;
}

.footer-bottom {
    max-width: var(--content-max);
    margin: 0 auto !important;
    padding-top: 1.25rem !important;
    border-top: 1px solid #e5e7eb;
    text-align: left !important;
}

.footer-bottom p {
    margin: 0 !important;
    font-size: 0.85rem !important;
    color: var(--ink-soft) !important;
}

@media (max-width: 720px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* IAS ↔ Value-Based Compensation diagram */
.system-diagram-wrap {
    max-width: 920px;
    margin: 0 auto 2rem;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.ias-vbc-diagram {
    display: grid;
    grid-template-columns: 1fr minmax(7.5rem, 9rem) 1fr;
    gap: 1.5rem 2rem;
    align-items: center;
    padding: 1.5rem 1.6rem;
    background: #fff;
    border: 1px solid #d8dde3;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
    text-align: left;
}

.ias-vbc-panel h3,
.ias-vbc-heading {
    margin: 0 0 0.85rem;
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    font-weight: 700;
    line-height: 1.25;
    color: #12304f;
    letter-spacing: -0.015em;
}

.ias-vbc-heading::after {
    content: '';
    display: block;
    width: 4.5rem;
    height: 3px;
    margin-top: 0.45rem;
    border-radius: 2px;
}

.ias-vbc-heading-blue::after {
    background: linear-gradient(90deg, var(--brand-blue) 0%, rgba(61, 155, 199, 0.15) 100%);
}

.ias-vbc-heading-orange::after {
    background: linear-gradient(90deg, var(--brand-orange) 0%, rgba(232, 114, 42, 0.15) 100%);
}

.ias-vbc-panel p {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.55;
    color: #555960;
}

.ias-vbc-arrows {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    align-items: center;
    justify-content: center;
    padding: 0 1.35rem;
    box-sizing: border-box;
}

.ias-vbc-arrow {
    width: 72px;
    height: 34px;
    display: block;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.18));
}

.ias-vbc-arrow-orange {
    background: var(--brand-orange);
    clip-path: polygon(0 18%, 68% 18%, 68% 0, 100% 50%, 68% 100%, 68% 82%, 0 82%);
}

.ias-vbc-arrow-blue {
    background: var(--brand-blue);
    clip-path: polygon(0 50%, 32% 0, 32% 18%, 100% 18%, 100% 82%, 32% 82%, 32% 100%);
}

@media (max-width: 760px) {
    .ias-vbc-diagram {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        text-align: left;
    }

    .ias-vbc-arrows {
        flex-direction: row;
        justify-content: center;
        order: 0;
    }

    .ias-vbc-arrow {
        width: 56px;
        height: 28px;
    }

    .ias-vbc-arrow-orange {
        transform: rotate(90deg);
    }

    .ias-vbc-arrow-blue {
        transform: rotate(90deg);
    }
}

/* Building CATALYST-style video modals */
.bc-video-modal {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(15, 18, 24, 0.62);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.bc-video-modal.is-open {
    opacity: 1;
}

.bc-video-modal-panel {
    width: min(880px, 96vw);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

.bc-video-modal-panel-wide {
    width: min(980px, 96vw);
}

.bc-video-modal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1.1rem;
    border-bottom: 1px solid #e8ebf0;
}

.bc-video-modal-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #12304f;
    letter-spacing: -0.015em;
}

.bc-video-modal-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.bc-video-nav-btn,
.bc-video-modal-close {
    font-family: inherit;
    cursor: pointer;
}

.bc-video-nav-btn {
    padding: 0.35rem 0.7rem;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    background: #fff;
    color: #1d1d1f;
    font-size: 0.85rem;
    font-weight: 600;
}

.bc-video-nav-btn:hover {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}

.bc-video-modal-close {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #6b7280;
    font-size: 1.5rem;
    line-height: 1;
}

.bc-video-modal-close:hover {
    background: #f3f4f6;
    color: #111;
}

.bc-video-modal-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.55rem;
    padding: 0.85rem 1.1rem 0.35rem;
}

.bc-video-tab {
    padding: 0.65rem 0.75rem;
    border: 1px solid #d8dde3;
    border-radius: 999px;
    background: #fff;
    color: #4a4a4f;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bc-video-tab:hover {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}

.bc-video-tab.is-active {
    background: rgba(61, 155, 199, 0.12);
    border-color: var(--brand-blue);
    color: #12304f;
}

.bc-video-modal-body {
    padding: 0.85rem 1.1rem 1.15rem;
}

.bc-video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

.bc-video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 720px) {
    .bc-video-modal-tabs {
        grid-template-columns: 1fr;
    }

    .bc-video-modal-top {
        flex-wrap: wrap;
    }
}
