@font-face {
    font-family: Montserrat;
    src: url("fuentes/montserrat.ttf") format("truetype");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --ink: #242326;
    --muted: #545357;
    --gray: #646567;
    --red: #d12421;
    --red-dark: #8a211e;
    --line: #e7e0e0;
    --paper: #faf8f8;
    --page: min(100% - 5rem, 75rem);
    color: var(--ink);
    font-family: Montserrat, system-ui, sans-serif;
    line-height: 1.6;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: #fff; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, figure { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid #27618d; outline-offset: 4px; }
.wrap { width: var(--page); margin-inline: auto; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.skip {
    position: fixed;
    top: .75rem;
    left: 1rem;
    z-index: 10;
    padding: .65rem 1rem;
    background: #fff;
    transform: translateY(-160%);
}
.skip:focus { transform: none; }

.topbar { background: #262326; color: #fff; font-size: .875rem; }
.topbar-inner, .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.topbar-inner { min-height: 2.55rem; padding-block: .35rem; }
.topbar a, footer a { text-underline-offset: .23em; }
.topbar a:hover, footer a:hover { color: #ffd2cb; }
.header-inner { min-height: 5.75rem; }
.brand {
    display: inline-flex;
    align-items: center;
    gap: 1.35rem;
    text-decoration: none;
    flex: none;
}
.brand img { width: 10rem; aspect-ratio: 4500 / 1667; object-fit: contain; }
.brand span {
    padding-left: 1.35rem;
    border-left: 1px solid var(--line);
    font-weight: 700;
    line-height: 1.23;
    font-size: .9rem;
}
nav { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem 1.65rem; }
nav a {
    font-size: .875rem;
    font-weight: 650;
    text-decoration: none;
    padding-block: .6rem;
    border-bottom: 2px solid transparent;
}
nav a:first-child, nav a:hover {
    color: var(--red-dark);
    border-bottom-color: var(--red);
}

.hero {
    width: var(--page);
    margin: .85rem auto 0;
    display: grid;
    grid-template-columns: 1.03fr 1fr;
    background: #342024;
    color: #fff;
}
.hero-copy {
    padding: clamp(2.3rem, 6.3vw, 5.5rem) clamp(1.65rem, 5.1vw, 4.4rem);
    background: radial-gradient(ellipse at bottom left, #572327, transparent 85%), #342024;
}
.eyebrow {
    color: #ffc4b9;
    font-size: .875rem;
    font-weight: 750;
    letter-spacing: .125em;
    text-transform: uppercase;
}
h1 {
    margin-top: 1.15rem;
    font-size: clamp(2.8rem, 5.05vw, 5rem);
    line-height: .99;
    letter-spacing: -.067em;
    font-weight: 780;
}
h1 span { color: #ff8679; }
.hero-description { margin-top: 1.6rem; max-width: 29rem; color: #f5e8e8; font-size: 1.03rem; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1.8rem;
    min-height: 3rem;
    padding: .7rem 1.2rem;
    border-radius: .28rem;
    font-weight: 750;
    font-size: .9rem;
    text-decoration: none;
}
.button-light { background: #fff; color: #6d2826; }
.button-light:hover { background: #ffe6e0; }
.hero-media { position: relative; min-width: 0; min-height: 15rem; background: #412f35; }
.hero-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 55%;
}
.hero-media figcaption {
    position: absolute;
    inset: auto 0 0;
    padding: 2.75rem 1.35rem 1rem;
    background: linear-gradient(transparent, rgb(23 17 19 / 90%));
    font-size: .875rem;
    font-weight: 650;
}
.hero-media figcaption span { color: #ffaea3; margin-inline: .2em; }

.projects { padding-block: 3.75rem 4.5rem; }
.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: .8rem 2rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
}
h2 {
    font-weight: 760;
    font-size: clamp(1.65rem, 3.6vw, 2.55rem);
    line-height: 1.12;
    letter-spacing: -.042em;
}
.section-heading h2 { margin-bottom: .55rem; }
.section-heading p, .about p, .participation p { color: var(--muted); }
.section-heading .project-count {
    color: var(--red-dark);
    font-size: .875rem;
    font-weight: 720;
    flex: none;
}
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.project {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    column-gap: 1.35rem;
    align-items: start;
    padding: 1.3rem;
    border: 1px solid var(--line);
    border-radius: .55rem;
    background: #fff;
}
.project:has(.project-link):hover, .project:focus-within {
    border-color: var(--red);
    box-shadow: 0 .35rem 1.2rem rgb(52 32 36 / 9%);
}
.project-art {
    display: grid;
    aspect-ratio: 1;
    place-items: center;
    border-radius: .35rem;
    overflow: hidden;
    background: linear-gradient(135deg, #5b282d, #8c302d);
    color: #fff;
}
.project:nth-child(even) .project-art { background: linear-gradient(135deg, #343d49, #505f72); }
.project-art span { font-weight: 790; font-size: 1.65rem; letter-spacing: -.06em; }
.project-art img { width: 100%; height: 100%; object-fit: cover; }
.project-category { color: var(--red-dark); font-size: .875rem; font-weight: 700; }
.project h3 {
    margin: .23rem 0 .4rem;
    font-size: clamp(1.2rem, 2.6vw, 1.66rem);
    font-weight: 760;
    line-height: 1.2;
    letter-spacing: -.035em;
    overflow-wrap: anywhere;
}
.project-link { text-decoration: none; }
.project-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: .55rem; }
.project-link:focus-visible { outline: none; }
.project-link:focus-visible::after { outline: 3px solid #27618d; outline-offset: 3px; }
.project-description { color: var(--muted); }
.project-action {
    grid-column: 1 / -1;
    align-self: end;
    margin-top: 1rem;
    padding-top: .8rem;
    border-top: 1px solid var(--line);
    color: var(--red-dark);
    font-size: .875rem;
    font-weight: 720;
}
.project-action .pending { color: var(--gray); font-weight: 600; }

.about { background: var(--paper); border-block: 1px solid var(--line); }
.about-inner {
    display: grid;
    grid-template-columns: minmax(12rem, .7fr) 1.3fr;
    gap: 1rem 2.5rem;
    padding-block: 3.3rem;
}
.text-link {
    display: inline-block;
    margin-top: .75rem;
    color: var(--red-dark);
    font-weight: 750;
    text-underline-offset: .26em;
}
.text-link:hover { color: var(--red); }
.participation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; padding-block: 3.4rem; }
.participation h2 { font-size: 1.45rem; margin-bottom: .65rem; }
.participation section { border-left: 3px solid var(--red); padding-left: 1.2rem; }
footer { background: #262326; color: #f4eded; font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1.4rem 3rem; padding-block: 2rem; }
.footer-title, footer h2 { color: #fff; font-size: 1.02rem; font-weight: 750; margin-bottom: .35rem; letter-spacing: 0; }
address { font-style: normal; }

@media (max-width: 62rem) {
    :root { --page: calc(100% - 3rem); }
    nav { gap: .35rem .95rem; }
    .project { grid-template-columns: 4rem 1fr; column-gap: 1rem; }
}
@media (max-width: 47rem) {
    :root { --page: calc(100% - 2rem); }
    .header-inner { align-items: flex-start; flex-direction: column; gap: .55rem; padding-block: .8rem .3rem; }
    .brand img { width: 8.5rem; }
    nav { gap: .25rem .95rem; }
    nav a { padding-block: .4rem; }
    .hero { grid-template-columns: 1fr; }
    .hero-media { aspect-ratio: 16 / 8; min-height: 11rem; }
    .projects { padding-block: 2.6rem 3rem; }
    .project-grid, .about-inner, .participation { grid-template-columns: 1fr; }
    .about-inner, .participation { padding-block: 2.5rem; }
}
@media (max-width: 25rem) {
    .topbar-inner, .section-heading { flex-wrap: wrap; }
    .section-heading { align-items: flex-start; }
    .topbar-inner { gap: .1rem .65rem; }
    .hero-copy { padding-inline: 1.3rem; }
    .project { grid-template-columns: 3rem 1fr; padding: 1rem; }
    .project-art span { font-size: 1.1rem; }
}

/* Tarjetas con logos institucionales */

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
}

.project-grid .project.project-with-logo {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    padding: 24px;
    gap: 18px;
    min-height: 0;
}

.project-with-logo .project-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 115px;
    padding: 10px 0;
    box-sizing: border-box;
    background: transparent;
}

.project-with-logo .project-logo img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
}

.project-with-logo .project-copy {
    flex: 1;
    padding: 0;
}

.project-with-logo .project-category {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 12px;
}

.project-with-logo .project-description {
    font-size: 14px;
    line-height: 1.75;
}

.project-with-logo .project-action {
    margin-top: auto;
    padding: 0;
}

.project-with-logo .project-access {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 12px;
    border-radius: 6px;
    background: #b90d2c;
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: background 0.2s ease;
}

.project-with-logo .project-access:hover {
    background: #950b24;
}

@media (max-width: 900px) {
    .project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .project-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Ajuste proporcional del logo PROSEC */

.project-with-logo .project-logo img[src$="/prosec.png"] {
    transform: scale(0.80);
}

/* Efecto hover de las tarjetas */

.project-grid .project.project-with-logo {
    transition: transform 0.25s ease,
                box-shadow 0.25s ease,
                border-color 0.25s ease;
}

@media (hover: hover) {
    .project-grid .project.project-with-logo:hover {
        transform: translateY(-6px);
        box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
        border-color: #b90d2c;
    }
}

.project-grid .project.project-with-logo:focus-within {
    border-color: #b90d2c;
}

@media (prefers-reduced-motion: reduce) {
    .project-grid .project.project-with-logo {
        transition: none;
    }

    .project-grid .project.project-with-logo:hover {
        transform: none;
    }
}

/* Tarjetas completamente clicables */

.project-grid .project.project-with-logo {
    position: relative;
}

.project-with-logo .project-action,
.project-with-logo .project-access {
    position: static;
}

.project-with-logo .project-access::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    cursor: pointer;
}

.project-with-logo:has(.project-access) {
    cursor: pointer;
}

.project-with-logo:focus-within {
    outline: 2px solid #b90d2c;
    outline-offset: 3px;
}

/* Logo UCSC en el footer */

.footer-institution {
    display: flex;
    align-items: center;
    gap: 24px;
}

.footer-institution .footer-ucsc-logo {
    display: block;
    width: 170px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .footer-institution {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .footer-institution .footer-ucsc-logo {
        width: 150px;
    }
}

/* Menu horizontal para dispositivos moviles */

@media (max-width: 768px) {
    .header-inner {
        min-width: 0;
    }

    .header-inner nav {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        gap: 18px;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        box-sizing: border-box;
    }

    .header-inner nav a {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}

/* Distribucion para cuatro proyectos */

@media (min-width: 1200px) {
    .project-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 641px) and (max-width: 1199px) {
    .project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .project-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
