:root {
    --upfim-green: #006341;
    --upfim-green-2: #00865a;
    --upfim-ink: #10231d;
    --upfim-muted: #5a6863;
    --upfim-line: #dfe7e3;
    --upfim-bg: #f5f8f6;
    --upfim-gold: #c49a2c;
    --upfim-red: #8f1f2d;
    --upfim-white: #ffffff;
    --shadow: 0 18px 45px rgba(16, 35, 29, .12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--upfim-ink);
    font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        linear-gradient(180deg, #ffffff 0%, #f7faf8 44%, #ffffff 100%);
    line-height: 1.6;
}

a {
    color: var(--upfim-green);
    text-decoration-thickness: .08em;
    text-underline-offset: .18em;
}

a:hover {
    color: var(--upfim-red);
}

:focus-visible {
    outline: 3px solid var(--upfim-gold);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -5rem;
    z-index: 9999;
    padding: .75rem 1rem;
    color: var(--upfim-white);
    background: var(--upfim-green);
    border-radius: 6px;
}

.skip-link:focus {
    top: 1rem;
}

.topbar {
    color: var(--upfim-white);
    background: var(--upfim-green);
    font-size: .9rem;
}

.topbar .container {
    min-height: 42px;
}

.topbar a {
    color: var(--upfim-white);
    margin-left: 1rem;
    text-decoration: none;
}

.main-nav {
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--upfim-line);
    box-shadow: 0 10px 36px rgba(16, 35, 29, .07);
}

.navbar-brand img,
.footer-logo {
    width: auto;
    max-width: 180px;
    height: auto;
}

.navbar-brand img {
    max-height: 70px;
    object-fit: contain;
}

.footer-logo {
    max-height: 86px;
    object-fit: contain;
}

.nav-link {
    color: var(--upfim-ink);
    font-weight: 700;
}

.dropdown-menu {
    border: 1px solid var(--upfim-line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.dropdown-item {
    white-space: normal;
}

.btn {
    border-radius: 6px;
    font-weight: 800;
}

.btn-upfim {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--upfim-white);
    background: var(--upfim-green);
    border-color: var(--upfim-green);
}

.btn-upfim:hover {
    color: var(--upfim-white);
    background: var(--upfim-red);
    border-color: var(--upfim-red);
}

.btn-ghost {
    color: var(--upfim-white);
    border: 1px solid rgba(255,255,255,.45);
}

.btn-ghost:hover {
    color: var(--upfim-ink);
    background: var(--upfim-white);
}

.hero {
    color: var(--upfim-white);
    background:
        linear-gradient(120deg, rgba(11, 34, 48, .96), rgba(31, 111, 120, .78)),
        url("../img/logo-upfim-oficial.png") right 8% center / 220px auto no-repeat,
        var(--upfim-blue-deep);
    min-height: 620px;
    display: flex;
    align-items: center;
}

.hero.flagship {
    position: relative;
    overflow: hidden;
}

.hero.flagship::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255,255,255,.08) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(90deg, #000, transparent 78%);
    pointer-events: none;
}

.hero.flagship .container {
    position: relative;
    z-index: 1;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 3rem;
    align-items: center;
}

.eyebrow {
    margin: 0 0 .75rem;
    color: var(--upfim-gold);
    font-size: .82rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero h1,
.page-hero h1 {
    max-width: 880px;
    margin: 0;
    font-size: clamp(2.3rem, 5vw, 4.8rem);
    line-height: 1.03;
    font-weight: 900;
}

.hero-copy {
    max-width: 720px;
    margin: 1.35rem 0 0;
    font-size: 1.25rem;
    color: rgba(255,255,255,.88);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
    margin-top: 2rem;
}

.hero-panel {
    padding: 2rem;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 8px;
    backdrop-filter: blur(12px);
}

.hero-panel.glass {
    box-shadow: 0 28px 80px rgba(0,0,0,.22);
}

.hero-panel strong {
    display: block;
    margin-bottom: .5rem;
    font-size: 1.1rem;
}

.hero-panel p {
    color: rgba(255,255,255,.84);
}

.panel-number {
    display: block;
    font-size: 4rem;
    line-height: 1;
    font-weight: 900;
}

.panel-label {
    display: block;
    margin: .75rem 0 1.25rem;
}

.hero-panel a {
    color: var(--upfim-white);
    font-weight: 800;
}

.section {
    padding: 5rem 0;
}

.metrics-band {
    color: var(--upfim-white);
    background: #0b1f19;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metrics-grid div {
    min-height: 142px;
    padding: 1.5rem;
    border-left: 1px solid rgba(255,255,255,.12);
}

.metrics-grid div:last-child {
    border-right: 1px solid rgba(255,255,255,.12);
}

.metrics-grid strong {
    display: block;
    color: var(--upfim-gold);
    font-size: 1.3rem;
    font-weight: 900;
}

.metrics-grid span {
    display: block;
    margin-top: .5rem;
    color: rgba(255,255,255,.76);
}

.academic-showcase {
    background:
        linear-gradient(180deg, rgba(0,99,65,.06), rgba(196,154,44,.08)),
        var(--upfim-white);
}

.academic-intro,
.editorial-grid {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(300px, .65fr);
    gap: 2rem;
    align-items: end;
    margin-bottom: 2rem;
}

.academic-intro h2,
.editorial-grid h2 {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.7rem);
    font-weight: 900;
}

.academic-intro p,
.editorial-grid p {
    color: var(--upfim-muted);
    font-size: 1.05rem;
}

.editorial-band {
    color: var(--upfim-white);
    background:
        linear-gradient(120deg, rgba(16,35,29,.96), rgba(0,99,65,.9)),
        #10231d;
}

.editorial-band .eyebrow,
.editorial-band p {
    color: rgba(255,255,255,.78);
}

.editorial-links {
    display: grid;
    gap: .7rem;
}

.editorial-links a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.1rem;
    color: var(--upfim-white);
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 900;
}

.editorial-links a:hover {
    background: rgba(255,255,255,.14);
}

.section.alt,
.quick-section {
    background: var(--upfim-bg);
}

.section-heading {
    margin-bottom: 2rem;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(1.75rem, 3vw, 2.7rem);
    font-weight: 900;
}

.section-heading.split {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

.quick-link,
.program-card,
.news-card,
.content-aside,
.news-row {
    background: var(--upfim-white);
    border: 1px solid var(--upfim-line);
    border-radius: 8px;
}

.quick-link {
    min-height: 116px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--upfim-ink);
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.quick-link i {
    color: var(--upfim-green);
    font-size: 1.8rem;
}

.quick-link span {
    font-weight: 900;
}

.quick-link:hover,
.program-card:hover,
.news-card:hover {
    transform: translateY(-3px);
    border-color: rgba(0,99,65,.3);
    box-shadow: var(--shadow);
}

.program-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.program-card {
    position: relative;
    overflow: hidden;
    min-height: 250px;
    padding: 1.5rem;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.program-card::after {
    content: "";
    position: absolute;
    right: -42px;
    bottom: -42px;
    width: 130px;
    height: 130px;
    border: 28px solid rgba(0,99,65,.08);
    border-radius: 50%;
}

.academic-card {
    background:
        linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.98)),
        linear-gradient(135deg, rgba(0,99,65,.18), rgba(196,154,44,.16));
}

.academic-card h3 {
    min-height: 3.05rem;
}

.program-card span {
    display: inline-block;
    margin-bottom: 1rem;
    padding: .25rem .55rem;
    color: var(--upfim-green);
    background: #e6f3ee;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 900;
}

.program-card h3,
.news-card h3,
.news-row h2 {
    margin: 0 0 .75rem;
    font-size: 1.22rem;
    line-height: 1.25;
    font-weight: 900;
}

.program-card p,
.news-card p,
.news-row p {
    color: var(--upfim-muted);
}

.program-card a,
.news-card a,
.news-row a {
    font-weight: 900;
    text-decoration: none;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.news-card {
    padding: 1.4rem;
}

.news-card time,
.news-row time {
    display: block;
    margin-bottom: .75rem;
    color: var(--upfim-red);
    font-size: .85rem;
    font-weight: 900;
}

.contact-band {
    background: #10231d;
    color: var(--upfim-white);
}

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(320px, 1.2fr);
    gap: 2rem;
    align-items: center;
}

.map-shell {
    min-height: 360px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.2);
}

.map-shell iframe {
    width: 100%;
    height: 360px;
    border: 0;
}

.page-hero {
    color: var(--upfim-white);
    background:
        radial-gradient(circle at 78% 20%, rgba(44,123,134,.28), transparent 30%),
        linear-gradient(135deg, #0b2230 0%, #17384b 54%, #111817 100%);
}

.section-hero {
    position: relative;
    overflow: hidden;
    padding: 5.5rem 0;
}

.section-hero::after {
    content: "";
    position: absolute;
    right: 7%;
    top: 12%;
    width: 260px;
    height: 260px;
    border: 42px solid rgba(255,255,255,.08);
    border-radius: 50%;
}

.hero-meta {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin-top: 1rem;
    padding: .45rem .7rem;
    color: var(--upfim-white);
    background: rgba(255,255,255,.14);
    border-radius: 999px;
    font-weight: 800;
}

.impact-tile {
    position: relative;
    z-index: 1;
    padding: 2rem;
    color: var(--upfim-white);
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 8px;
    box-shadow: 0 28px 80px rgba(0,0,0,.18);
}

.impact-tile i {
    display: block;
    margin-bottom: 1.2rem;
    color: var(--upfim-gold);
    font-size: 2.4rem;
}

.impact-tile strong,
.impact-tile span {
    display: block;
}

.impact-tile strong {
    font-size: 1.35rem;
    font-weight: 900;
}

.impact-tile span {
    margin-top: .5rem;
    color: rgba(255,255,255,.78);
}

.page-hero.compact {
    padding: 5rem 0;
}

.page-hero p:not(.eyebrow) {
    max-width: 760px;
    margin-top: 1rem;
    color: rgba(255,255,255,.88);
    font-size: 1.15rem;
}

.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 2rem;
    align-items: start;
}

.content-layout.upgraded {
    grid-template-columns: minmax(0, 1fr) 340px;
}

.content-body {
    min-width: 0;
    padding: 2rem;
    background: var(--upfim-white);
    border: 1px solid var(--upfim-line);
    border-radius: 8px;
    box-shadow: 0 20px 55px rgba(16,35,29,.08);
}

.content-body h2,
.content-body h3,
.content-body h4 {
    margin-top: 2rem;
    color: var(--upfim-green);
    font-weight: 900;
}

.content-body p,
.content-body li {
    color: #263b34;
}

.content-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.content-body iframe {
    max-width: 100%;
}

.content-body table {
    width: 100%;
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
}

.media-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
    margin-bottom: 1.5rem;
}

.media-strip img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.resource-panel {
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: #f3f8f5;
    border: 1px solid var(--upfim-line);
    border-radius: 8px;
}

.resource-panel h2 {
    margin: 0 0 1rem;
    color: var(--upfim-ink);
    font-size: 1.3rem;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.resource-card {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    padding: .9rem;
    color: var(--upfim-ink);
    background: var(--upfim-white);
    border: 1px solid var(--upfim-line);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 800;
}

.resource-card i {
    color: var(--upfim-red);
    font-size: 1.25rem;
}

.resource-card:hover {
    border-color: rgba(143,31,45,.35);
    box-shadow: 0 12px 28px rgba(16,35,29,.08);
}

.tender-board {
    display: grid;
    gap: 1rem;
}

.tender-board-intro {
    max-width: 840px;
    margin: 0 0 1.5rem;
    color: #43564f;
}

.tender-accordion {
    overflow: hidden;
    background: #f7faf8;
    border: 1px solid var(--upfim-line);
    border-radius: 8px;
    box-shadow: 0 18px 44px rgba(16,35,29,.08);
}

.tender-accordion summary {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1.25rem 1.35rem;
    cursor: pointer;
    list-style: none;
    background:
        linear-gradient(135deg, rgba(7,25,35,.97), rgba(24,78,86,.92));
    color: var(--upfim-white);
}

.tender-accordion summary::-webkit-details-marker {
    display: none;
}

.tender-title {
    display: grid;
    gap: .25rem;
}

.tender-title span {
    color: var(--upfim-gold);
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.tender-title strong {
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    font-weight: 900;
}

.tender-status {
    padding: .45rem .75rem;
    color: #f6e2a8;
    border: 1px solid rgba(246,226,168,.38);
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 800;
    white-space: nowrap;
}

.tender-panel {
    padding: 1.25rem;
}

.tender-doc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
}

.tender-doc {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .85rem;
    align-items: center;
    min-height: 76px;
    padding: 1rem;
    color: var(--upfim-ink);
    background: var(--upfim-white);
    border: 1px solid var(--upfim-line);
    border-radius: 8px;
    text-decoration: none;
}

.tender-doc i {
    color: var(--upfim-red);
    font-size: 1.45rem;
}

.tender-doc strong {
    display: block;
    font-size: 1rem;
    font-weight: 900;
}

.tender-doc span {
    display: block;
    color: var(--upfim-muted);
    font-size: .9rem;
}

.tender-doc::after {
    content: "Abrir";
    color: var(--upfim-green);
    font-size: .86rem;
    font-weight: 900;
}

.tender-doc:hover {
    border-color: rgba(0,99,65,.3);
    box-shadow: 0 14px 30px rgba(16,35,29,.09);
    transform: translateY(-2px);
}

.tender-doc.is-pending {
    opacity: .72;
    cursor: default;
}

.tender-doc.is-pending i {
    color: #8a9892;
}

.tender-doc.is-pending::after {
    content: "Pendiente";
    color: #7c8b85;
}

.content-body th,
.content-body td {
    padding: .75rem;
    border: 1px solid var(--upfim-line);
}

.content-aside {
    position: sticky;
    top: 1rem;
    min-width: 0;
    padding: 1.25rem;
    box-shadow: 0 16px 38px rgba(16,35,29,.07);
    overflow: hidden;
}

.content-aside h2 {
    font-size: 1rem;
    font-weight: 900;
}

.content-aside a {
    display: flex;
    gap: .5rem;
    padding: .6rem 0;
    text-decoration: none;
    font-weight: 800;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
}

.content-aside a i {
    flex: 0 0 auto;
    margin-top: .2rem;
}

.news-list {
    display: grid;
    gap: 1rem;
}

.news-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 1rem;
    padding: 1.2rem;
}

.search-box {
    max-width: 760px;
    margin-top: 1.5rem;
}

.search-results {
    display: grid;
    gap: 1rem;
}

.search-result {
    padding: 1rem;
    border: 1px solid var(--upfim-line);
    border-radius: 8px;
}

.search-result h2 {
    margin: 0 0 .35rem;
    font-size: 1.15rem;
    font-weight: 900;
}

.site-footer {
    padding: 4rem 0 1.5rem;
    color: rgba(255,255,255,.82);
    background: #091612;
}

.site-footer h2 {
    color: var(--upfim-white);
    font-size: 1rem;
    font-weight: 900;
}

.site-footer a {
    display: block;
    margin: .45rem 0;
    color: rgba(255,255,255,.82);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--upfim-gold);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,.14);
    font-size: .9rem;
}

@media (max-width: 1199px) {
    .offcanvas-body .navbar-nav {
        align-items: stretch !important;
    }
}

@media (max-width: 991px) {
    .hero {
        min-height: auto;
        padding: 5rem 0;
        background: linear-gradient(120deg, rgba(11, 34, 48, .96), rgba(31, 111, 120, .86)), var(--upfim-blue-deep);
    }

    .hero-grid,
    .contact-grid,
    .content-layout,
    .content-layout.upgraded,
    .academic-intro,
    .editorial-grid {
        grid-template-columns: 1fr;
    }

    .quick-grid,
    .program-grid,
    .news-grid,
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content-aside {
        position: static;
    }
}

@media (max-width: 640px) {
    .topbar nav {
        display: none;
    }

    .hero h1,
    .page-hero h1 {
        font-size: 2.35rem;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .quick-grid,
    .program-grid,
    .news-grid,
    .news-row,
    .metrics-grid,
    .resource-grid,
    .media-strip {
        grid-template-columns: 1fr;
    }

    .content-body {
        padding: 1.25rem;
    }

    .section {
        padding: 3.25rem 0;
    }

    .section-heading.split,
    .footer-bottom {
        display: block;
    }
}

/* Editorial institutional skin inspired by major university portals. */
:root {
    --upfim-green: #005f3c;
    --upfim-green-2: #0b7f55;
    --upfim-ink: #0b1612;
    --upfim-red: #8b1d2c;
    --upfim-black: #050706;
    --upfim-paper: #f7f4ed;
}

h1,
h2,
h3,
.home-hero h1,
.page-hero h1,
.section-heading h2,
.story-copy h2,
.editorial-grid h2 {
    font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

.topbar,
.main-nav {
    background: var(--upfim-black);
}

.topbar {
    color: rgba(255,255,255,.74);
    border-bottom: 1px solid rgba(255,255,255,.11);
}

.topbar a {
    color: rgba(255,255,255,.8);
}

.topbar a:hover {
    color: var(--upfim-gold);
}

.main-nav {
    border-bottom: 1px solid rgba(255,255,255,.12);
    box-shadow: none;
}

.nav-link {
    color: rgba(255,255,255,.92);
    font-size: .95rem;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--upfim-gold);
}

.navbar-nav > .nav-item > .nav-link,
.navbar-nav > .nav-item > .nav-link.show,
.navbar-nav > .nav-item > .nav-link:active,
.navbar-nav > .nav-item > .nav-link:focus {
    color: rgba(255,255,255,.92);
    background: transparent;
    box-shadow: none;
}

.navbar-nav > .nav-item > .nav-link:hover,
.navbar-nav > .nav-item > .nav-link.show:hover,
.navbar-nav > .nav-item > .nav-link:focus-visible {
    color: var(--upfim-gold);
}

.navbar-nav > .nav-item > .nav-link.dropdown-toggle::after {
    display: none;
}

.dropdown-menu {
    min-width: 300px;
    padding: .8rem;
    background: #101614;
    border: 1px solid rgba(255,255,255,.14);
    box-shadow: 0 24px 70px rgba(0,0,0,.34);
}

.dropdown-item {
    color: rgba(255,255,255,.88);
    border-radius: 6px;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: var(--upfim-white);
    background: rgba(255,255,255,.1);
}

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu {
    top: -.8rem;
    left: 100%;
    margin-left: .35rem;
}

.dropdown-submenu:hover > .dropdown-menu,
.dropdown-submenu:focus-within > .dropdown-menu {
    display: block;
}

.dropdown-submenu > .dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.dropdown-submenu > .dropdown-toggle::after {
    transform: rotate(-90deg);
}

@media (min-width: 1200px) {
    .navbar-nav > .dropdown:hover > .dropdown-menu,
    .navbar-nav > .dropdown:focus-within > .dropdown-menu {
        display: block;
    }
}

.navbar-toggler {
    border-color: rgba(255,255,255,.35);
}

.navbar-toggler-icon,
.btn-close {
    filter: invert(1);
}

.offcanvas {
    color: var(--upfim-white);
    background: var(--upfim-black);
}

.main-nav .btn-upfim {
    color: var(--upfim-black);
    background: var(--upfim-white);
    border-color: var(--upfim-white);
}

.main-nav .btn-upfim:hover {
    color: var(--upfim-white);
    background: var(--upfim-red);
    border-color: var(--upfim-red);
}

.home-hero {
    position: relative;
    min-height: 720px;
    display: grid;
    align-items: end;
    overflow: hidden;
    color: var(--upfim-white);
    background: var(--upfim-black);
}

.home-hero-media {
    position: absolute;
    inset: 0;
}

.home-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(.95) contrast(1.05);
    transform: scale(1.02);
    animation: heroDrift 18s ease-in-out infinite alternate;
}

.home-hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(5,7,6,.94) 0%, rgba(5,7,6,.65) 44%, rgba(5,7,6,.14) 100%),
        linear-gradient(0deg, rgba(5,7,6,.86) 0%, rgba(5,7,6,.06) 62%);
}

.home-hero-content {
    position: relative;
    z-index: 1;
    width: calc(100% - clamp(2rem, 7vw, 8rem));
    max-width: 1520px;
    padding-top: 8rem;
    padding-bottom: 6rem;
}

.home-hero h1 {
    max-width: 940px;
    margin: 0;
    font-size: clamp(3.25rem, 7.4vw, 7.35rem);
    line-height: .94;
    font-weight: 900;
}

.home-hero p:not(.eyebrow) {
    max-width: 720px;
    margin: 1.5rem 0 0;
    color: rgba(255,255,255,.86);
    font-size: clamp(1.15rem, 2vw, 1.55rem);
}

@keyframes heroDrift {
    from { transform: scale(1.02) translate3d(0, 0, 0); }
    to { transform: scale(1.08) translate3d(-1.2%, -.8%, 0); }
}

.feature-ribbon {
    color: var(--upfim-white);
    background: var(--upfim-black);
}

.metrics-grid a {
    display: block;
    min-height: 150px;
    padding: 1.55rem;
    color: var(--upfim-white);
    border-left: 1px solid rgba(255,255,255,.12);
    text-decoration: none;
    transition: background .22s ease, transform .22s ease;
}

.metrics-grid a:last-child {
    border-right: 1px solid rgba(255,255,255,.12);
}

.metrics-grid a:hover {
    background: rgba(255,255,255,.07);
    transform: translateY(-2px);
}

.editorial-section {
    padding-top: 6rem;
}

.quick-link {
    min-height: 152px;
    padding: 1.4rem;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, background .22s ease;
}

.quick-link:hover,
.program-card:hover,
.news-card:hover {
    transform: translateY(-5px);
}

.story-split {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
    min-height: 620px;
    background: var(--upfim-white);
}

.story-image {
    min-height: 460px;
}

.story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(2rem, 6vw, 5rem);
    background: var(--upfim-paper);
}

.story-copy h2 {
    max-width: 700px;
    margin: 0;
    font-size: clamp(2.35rem, 5vw, 5.25rem);
    line-height: .98;
    font-weight: 900;
}

.story-copy p {
    max-width: 620px;
    margin-top: 1.4rem;
    color: #3c4742;
    font-size: 1.18rem;
}

.text-arrow {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    margin-top: 1rem;
    color: var(--upfim-green);
    text-decoration: none;
    font-weight: 900;
}

.program-card {
    min-height: 285px;
}

.news-editorial .news-card:first-child {
    grid-column: span 2;
    min-height: 310px;
    padding: 2rem;
    color: var(--upfim-white);
    background:
        radial-gradient(circle at 88% 18%, rgba(194,159,91,.24), transparent 32%),
        linear-gradient(135deg, #0b2230 0%, #15384c 58%, #1f6f78 100%);
}

.news-editorial .news-card:first-child a,
.news-editorial .news-card:first-child time,
.news-editorial .news-card:first-child p {
    color: var(--upfim-white);
}

.news-editorial .news-card:first-child h3 {
    font-family: "Montserrat", system-ui, sans-serif;
    font-size: clamp(2rem, 5.2vw, 4.9rem);
    line-height: .98;
    max-width: 100%;
}

[data-animate] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .7s ease, transform .7s ease;
}

[data-animate].is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

    [data-animate] {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 991px) {
    .home-hero {
        min-height: auto;
    }

    .home-hero-content {
        padding-top: 6rem;
        padding-bottom: 4rem;
    }

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

    .news-editorial .news-card:first-child {
        grid-column: span 1;
    }
}

@media (max-width: 640px) {
    .home-hero h1 {
        font-size: 3rem;
    }
}

/* Premium homepage service and academic modules. */
:root {
    --upfim-navy: #102738;
    --upfim-teal: #1f6f78;
    --upfim-steel: #e7edf0;
    --upfim-amber: #b98a34;
    --upfim-charcoal: #111817;
}

.service-hub {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, #f8faf9 0%, #eef4f2 48%, #ffffff 100%);
}

.service-hub::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(16,39,56,.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16,39,56,.06) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent);
    pointer-events: none;
}

.service-hub-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(280px, .42fr) minmax(0, .58fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}

.service-hub-intro {
    position: sticky;
    top: 1.5rem;
    padding-top: .5rem;
}

.service-hub-intro h2,
.program-feature h2 {
    margin: 0;
    color: var(--upfim-charcoal);
    font-size: clamp(2.35rem, 4.7vw, 5rem);
    line-height: .98;
    font-weight: 900;
}

.service-hub-intro p,
.program-feature p {
    margin-top: 1.25rem;
    color: #52605d;
    font-size: 1.08rem;
}

.service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .9rem;
}

.service-link {
    position: relative;
    min-height: 132px;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 24px;
    gap: 1rem;
    align-items: center;
    padding: 1.15rem;
    color: var(--upfim-charcoal);
    background: rgba(255,255,255,.86);
    border: 1px solid rgba(16,39,56,.12);
    box-shadow: 0 18px 44px rgba(16,39,56,.07);
    backdrop-filter: blur(12px);
}

.service-link::after {
    content: "";
    position: absolute;
    left: 0;
    top: 18px;
    bottom: 18px;
    width: 4px;
    background: var(--upfim-amber);
    border-radius: 0 999px 999px 0;
    transform: scaleY(.35);
    transform-origin: center;
    transition: transform .22s ease;
}

.service-link:hover {
    color: var(--upfim-charcoal);
    background: #ffffff;
    border-color: rgba(31,111,120,.28);
    box-shadow: 0 24px 60px rgba(16,39,56,.12);
}

.service-link:hover::after {
    transform: scaleY(1);
}

.service-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    color: var(--upfim-navy);
    background: var(--upfim-steel);
    border-radius: 50%;
}

.service-icon i {
    color: inherit;
    font-size: 1.45rem;
}

.service-copy {
    display: grid;
    gap: .15rem;
}

.service-copy small {
    color: var(--upfim-teal);
    font-size: .72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.service-copy strong {
    font-size: 1.02rem;
    line-height: 1.18;
}

.service-arrow {
    color: #8c9895;
    font-size: 1.1rem;
}

.program-stage {
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(16,39,56,.97), rgba(17,24,23,.98)),
        var(--upfim-navy);
}

.program-stage-grid {
    display: grid;
    grid-template-columns: minmax(290px, .38fr) minmax(0, .62fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}

.program-feature {
    position: sticky;
    top: 1.5rem;
    min-height: 520px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(1.5rem, 4vw, 2.4rem);
    background:
        linear-gradient(180deg, rgba(255,255,255,.11), rgba(255,255,255,.045)),
        radial-gradient(circle at top right, rgba(185,138,52,.22), transparent 36%);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 8px;
    box-shadow: 0 30px 80px rgba(0,0,0,.22);
}

.program-feature h2,
.program-feature p {
    color: #ffffff;
}

.program-feature p {
    color: rgba(255,255,255,.75);
}

.program-feature-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 2rem;
}

.program-feature .btn-dark {
    color: var(--upfim-charcoal);
    background: #ffffff;
    border-color: #ffffff;
}

.program-feature .btn-outline-dark {
    color: #ffffff;
    border-color: rgba(255,255,255,.5);
}

.program-feature .btn-outline-dark:hover {
    color: var(--upfim-charcoal);
    background: #ffffff;
}

.program-orbit {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.program-orbit .program-card {
    min-height: 246px;
    color: #ffffff;
    background:
        linear-gradient(180deg, rgba(255,255,255,.105), rgba(255,255,255,.05));
    border-color: rgba(255,255,255,.14);
    box-shadow: none;
}

.program-orbit .program-card::after {
    border-color: rgba(185,138,52,.18);
}

.program-orbit .program-card:hover {
    border-color: rgba(185,138,52,.5);
    background:
        linear-gradient(180deg, rgba(255,255,255,.15), rgba(255,255,255,.07));
    box-shadow: 0 24px 70px rgba(0,0,0,.25);
}

.program-orbit .program-card span {
    color: #f2d596;
    background: rgba(185,138,52,.16);
}

.program-orbit .program-card h3,
.program-orbit .program-card p,
.program-orbit .program-card a {
    color: #ffffff;
}

.program-orbit .program-card p {
    color: rgba(255,255,255,.72);
}

.program-orbit .program-card a {
    color: #f2d596;
}

.program-orbit .academic-card h3 {
    min-height: auto;
}

@media (max-width: 991px) {
    .service-hub-grid,
    .program-stage-grid {
        grid-template-columns: 1fr;
    }

    .service-hub-intro,
    .program-feature {
        position: static;
    }

    .program-feature {
        min-height: auto;
    }

    .dropdown-submenu > .dropdown-menu {
        position: static;
        display: block;
        margin: .15rem 0 .35rem 1rem;
        padding: .25rem 0 .25rem .65rem;
        border-left: 1px solid rgba(255,255,255,.18);
        box-shadow: none;
    }

    .dropdown-submenu > .dropdown-toggle::after {
        transform: none;
    }
}

@media (max-width: 640px) {
    .service-grid,
    .program-orbit {
        grid-template-columns: 1fr;
    }

    .service-link {
        grid-template-columns: 48px minmax(0, 1fr) 20px;
    }
}

/* Refinements: Montserrat, cool institutional palette, overflow-safe cards. */
:root {
    --upfim-blue-deep: #0b2230;
    --upfim-blue: #15384c;
    --upfim-blue-soft: #eaf1f4;
    --upfim-cyan-muted: #2c7b86;
    --upfim-sand: #f3efe6;
}

body,
button,
input,
select,
textarea {
    font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.home-hero h1,
.story-copy h2,
.section-heading h2,
.program-feature h2,
.page-hero h1,
.news-card h3,
.program-card h3 {
    font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

.home-hero h1 {
    font-size: clamp(2.9rem, 6.9vw, 6.85rem);
    line-height: .96;
    max-width: 1040px;
}

.page-hero {
    background:
        radial-gradient(circle at 78% 20%, rgba(44,123,134,.28), transparent 30%),
        linear-gradient(135deg, #0b2230 0%, #17384b 54%, #111817 100%);
}

.section-hero::after {
    border-color: rgba(255,255,255,.07);
}

.impact-tile {
    background: rgba(255,255,255,.105);
}

.news-editorial .news-card:first-child {
    background:
        radial-gradient(circle at 88% 18%, rgba(194,159,91,.24), transparent 32%),
        linear-gradient(135deg, #0b2230 0%, #15384c 58%, #1f6f78 100%);
}

.news-editorial .news-card:first-child h3 {
    font-family: "Montserrat", system-ui, sans-serif;
    font-size: clamp(2rem, 5.2vw, 4.9rem);
    line-height: .98;
    max-width: 100%;
}

.news-card,
.news-row,
.search-result,
.resource-card,
.content-body,
.program-card,
.quick-link {
    overflow-wrap: anywhere;
    word-break: normal;
}

.news-card p,
.news-row p,
.program-card p,
.search-result p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

.news-card h3,
.news-row h2,
.program-card h3 {
    overflow-wrap: anywhere;
}

.news-card {
    min-width: 0;
}

.news-card time,
.news-row time {
    color: var(--upfim-cyan-muted);
}

.news-editorial .news-card:first-child time {
    color: #f1d99e;
}

.news-editorial .news-card:first-child p {
    max-width: 1180px;
    -webkit-line-clamp: 4;
}

.program-stage {
    background:
        radial-gradient(circle at 80% 10%, rgba(44,123,134,.22), transparent 34%),
        linear-gradient(135deg, #071923 0%, #102738 50%, #111817 100%);
}

.program-feature {
    min-width: 0;
    min-height: 500px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.105), rgba(255,255,255,.042)),
        radial-gradient(circle at top right, rgba(44,123,134,.22), transparent 38%);
}

.program-feature h2 {
    max-width: 8.5em;
    font-size: clamp(2.05rem, 3.35vw, 3.65rem);
    line-height: 1;
    overflow-wrap: anywhere;
}

.program-feature p {
    max-width: 680px;
}

.program-orbit .program-card span {
    color: #f1d99e;
    background: rgba(194,159,91,.16);
}

.program-orbit .program-card a {
    color: #f1d99e;
}

.program-orbit .program-card:hover {
    border-color: rgba(44,123,134,.55);
}

.service-icon {
    color: var(--upfim-blue);
    background: var(--upfim-blue-soft);
}

.service-copy small {
    color: var(--upfim-cyan-muted);
}

.service-link::after {
    background: var(--upfim-cyan-muted);
}

.service-link:hover {
    border-color: rgba(44,123,134,.36);
}

@media (max-width: 1199px) {
    .program-stage-grid {
        grid-template-columns: minmax(260px, .42fr) minmax(0, .58fr);
    }

    .program-feature h2 {
        font-size: clamp(2rem, 4vw, 3.55rem);
    }
}

@media (max-width: 991px) {
    .program-stage-grid {
        grid-template-columns: 1fr;
    }

    .program-feature h2 {
        max-width: 760px;
    }
}

@media (max-width: 640px) {
    .home-hero h1 {
        font-size: 2.65rem;
    }

    .news-editorial .news-card:first-child h3,
    .program-feature h2 {
        font-size: 2.15rem;
    }

    .tender-accordion summary,
    .tender-doc {
        grid-template-columns: 1fr;
    }

    .tender-doc-grid {
        grid-template-columns: 1fr;
    }

    .tender-status {
        justify-self: start;
    }
}
