/* ---------------------------------------------------------------
   Germán Harvey Alférez Salinas, Ph.D. — Modern site
   --------------------------------------------------------------- */

:root {
    --navy:       #0b1b34;
    --navy-2:     #112a52;
    --navy-soft:  #1e3a6b;
    --ink:        #1a2237;
    --body:       #3b4256;
    --muted:      #6b7280;
    --line:       #e5e7eb;
    --bg:         #fbfaf7;
    --card:       #ffffff;
    --gold:       #b8893a;
    --gold-2:     #d4a85a;
    --gold-soft:  #f4ead4;
    --teal:       #0f766e;
    --link:       #1e3a8a;
    --link-hover: #b8893a;
    --radius:     14px;
    --shadow-sm:  0 1px 2px rgba(11, 27, 52, 0.04), 0 1px 3px rgba(11, 27, 52, 0.06);
    --shadow-md:  0 4px 12px rgba(11, 27, 52, 0.06), 0 8px 24px rgba(11, 27, 52, 0.06);
    --shadow-lg:  0 10px 30px rgba(11, 27, 52, 0.10), 0 20px 60px rgba(11, 27, 52, 0.08);
    --maxw:       1180px;
    --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-serif: "Source Serif 4", "Source Serif Pro", "Iowan Old Style", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

/* Visually hidden — invisible to readers, indexed by search engines */
.visually-hidden {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

html { scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--body);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }

a {
    color: var(--link);
    text-decoration: none;
    transition: color .15s ease;
}
a:hover { color: var(--link-hover); }

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    color: var(--ink);
    line-height: 1.2;
    margin: 0 0 .6em;
    font-weight: 600;
    letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; }

/* ------------- Layout ------------- */

.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 28px;
}

section {
    padding: 80px 0;
}

section + section { border-top: 1px solid var(--line); }

.section-title {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 36px;
}

.section-title h2 { margin: 0; }

.section-kicker {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 600;
}

/* ------------- Navigation ------------- */

.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(251, 250, 247, 0.92);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--line);
}

.nav-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--ink);
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 4px var(--gold-soft);
}

.brand:hover { color: var(--ink); }

.nav-links {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--ink);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}

.nav-links a:hover, .nav-links a.active {
    background: var(--navy);
    color: #fff;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--line);
    width: 40px; height: 40px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center; justify-content: center;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
    content: '';
    display: block;
    width: 18px; height: 2px;
    background: var(--ink);
    position: relative;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after  { position: absolute; top:  6px; }

/* ------------- Hero ------------- */

.hero {
    position: relative;
    padding: 80px 0 60px;
    overflow: hidden;
    background:
        radial-gradient(1200px 600px at 110% -10%, rgba(184,137,58,0.10), transparent 60%),
        radial-gradient(800px 500px at -10% 0%, rgba(15, 118, 110, 0.07), transparent 60%),
        linear-gradient(180deg, #f7f4ec 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--line);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    grid-template-areas:
        "text    portrait"
        "cta     portrait";
    column-gap: 56px;
    row-gap: 28px;
    align-items: start;
}

.hero-text    { grid-area: text; }
.hero-cta     { grid-area: cta; }
.portrait-wrap { grid-area: portrait; align-self: center; }

.hero h1 {
    font-size: clamp(2.2rem, 4.5vw, 3.4rem);
    margin-bottom: 12px;
    color: var(--ink);
}

.hero .eyebrow {
    color: var(--gold);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 18px;
    display: inline-block;
}

.hero .lead {
    font-size: 1.15rem;
    color: var(--body);
    margin-bottom: 28px;
    max-width: 620px;
}

.hero-meta {
    display: flex; flex-wrap: wrap; gap: 8px 12px;
    margin-bottom: 28px;
}

.chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.chip svg { width: 14px; height: 14px; }

.cta-row {
    display: flex; flex-wrap: wrap; gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform .12s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: var(--navy);
    color: #fff;
    box-shadow: var(--shadow-md);
}
.btn-primary:hover { background: var(--navy-2); color: #fff; transform: translateY(-1px); }

.btn-outline {
    background: transparent;
    color: var(--ink);
    border-color: var(--ink);
}
.btn-outline:hover {
    background: var(--ink);
    color: #fff;
}

.btn-ghost {
    background: #fff;
    color: var(--ink);
    border-color: var(--line);
    box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }

.btn svg { width: 16px; height: 16px; }

/* Portrait card */
.portrait-wrap {
    position: relative;
    justify-self: center;
}

.portrait-frame {
    position: relative;
    width: min(100%, 360px);
    aspect-ratio: 2 / 3;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--card);
    transform: rotate(-1.5deg);
}
.portrait-frame img {
    width: 100%; height: 100%; object-fit: cover;
    object-position: center top;
}

.portrait-deco {
    position: absolute;
    border-radius: 22px;
    inset: 18px -18px -18px 18px;
    border: 2px solid var(--gold);
    z-index: -1;
}

/* ------------- Stats bar ------------- */

.stats {
    background: var(--navy);
    color: #fff;
    padding: 40px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
}

.stat .num {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    color: var(--gold-2);
    font-weight: 600;
    line-height: 1;
    margin-bottom: 6px;
}
.stat .label {
    color: rgba(255,255,255,0.78);
    font-size: 0.88rem;
    letter-spacing: 0.04em;
}

/* ------------- Cards ------------- */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #d6dbe5;
}

.card .icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: var(--gold-soft);
    color: var(--gold);
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
}
.card .icon svg { width: 22px; height: 22px; }

.card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.card p { margin: 0; color: var(--body); }

/* ------------- Two-column with sidebar ------------- */

.page {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 48px;
    padding: 60px 0;
}

.page-main h1 { margin-top: 0; }

.sidebar {
    position: sticky;
    top: 90px;
    align-self: start;
}

.sidebar-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
}

.sidebar-card h4 {
    font-family: var(--font-sans);
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--gold);
    letter-spacing: 0.16em;
    margin-bottom: 14px;
    font-weight: 700;
}

.sidebar-card p { font-size: 0.92rem; margin-bottom: 8px; }
.sidebar-card .label { color: var(--muted); font-size: 0.8rem; }

.sidebar-card .links {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 2px;
}
.sidebar-card .links a {
    display: block;
    padding: 6px 0;
    color: var(--ink);
    font-size: 0.92rem;
    border-bottom: 1px solid #f1eee5;
}
.sidebar-card .links a:hover { color: var(--gold); }

/* ------------- Publications / lists ------------- */

.pub-section { margin-bottom: 44px; }

.pub-section h3 {
    font-family: var(--font-serif);
    color: var(--ink);
    border-bottom: 2px solid var(--gold);
    display: inline-block;
    padding-bottom: 4px;
    margin-bottom: 18px;
}

.pub-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: pub;
}

.pub-list li {
    position: relative;
    padding: 14px 0 14px 38px;
    border-bottom: 1px solid #efece2;
    font-size: 0.95rem;
    line-height: 1.6;
    counter-increment: pub;
}
.pub-list li:last-child { border-bottom: none; }

.pub-list li::before {
    content: counter(pub);
    position: absolute;
    left: 0; top: 16px;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--gold-soft);
    color: var(--gold);
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.75rem;
    display: flex; align-items: center; justify-content: center;
}

.pub-list em { color: var(--ink); font-style: italic; }

.pub-list a { word-break: break-word; }

/* ------------- Timeline / projects ------------- */

.timeline {
    border-left: 2px solid var(--gold);
    padding: 6px 0 6px 24px;
    margin: 0;
    list-style: none;
}

.timeline li {
    position: relative;
    padding: 14px 0 14px 16px;
}

.timeline li::before {
    content: '';
    position: absolute;
    width: 12px; height: 12px;
    background: var(--gold);
    border-radius: 50%;
    left: -31px;
    top: 22px;
    box-shadow: 0 0 0 4px var(--bg);
}

.timeline .yr {
    display: inline-block;
    color: var(--gold);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.timeline h4 { margin: 0 0 6px; color: var(--ink); }

/* ------------- News list ------------- */

.news-list {
    list-style: none; padding: 0; margin: 0;
}

.news-list li {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.news-list li:last-child { border-bottom: none; }

.news-list .marker {
    flex-shrink: 0;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--gold);
    margin-top: 11px;
}

.news-list .text { flex: 1; }

.news-list .src {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 2px;
}

/* ------------- Highlight block ------------- */

.feature {
    background: linear-gradient(180deg, #fff 0%, #f7f4ec 100%);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 40px;
    box-shadow: var(--shadow-sm);
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 36px;
    align-items: center;
}

.feature .badge {
    display: inline-block;
    background: var(--gold);
    color: #fff;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
    margin-bottom: 14px;
}

.feature img {
    border-radius: 14px;
    box-shadow: var(--shadow-md);
}

/* ------------- Footer ------------- */

.footer {
    background: var(--navy);
    color: rgba(255,255,255,0.78);
    padding: 50px 0 30px;
    margin-top: 60px;
}

.footer a { color: var(--gold-2); }
.footer a:hover { color: #fff; }

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 36px;
    margin-bottom: 30px;
}

.footer h4 {
    color: #fff;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.footer ul { list-style: none; padding: 0; margin: 0; }
.footer ul li { padding: 4px 0; font-size: 0.9rem; }

.socials { display: flex; gap: 10px; margin-top: 10px; }
.socials a {
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #fff;
    transition: background .15s ease;
}
.socials a:hover { background: var(--gold); color: #fff; }
.socials svg { width: 16px; height: 16px; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 18px;
    font-size: 0.82rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* ------------- Page header (subpages) ------------- */

.page-header {
    background:
        radial-gradient(800px 300px at 100% 0%, rgba(184,137,58,0.10), transparent 60%),
        linear-gradient(180deg, #f7f4ec 0%, var(--bg) 100%);
    padding: 60px 0 40px;
    border-bottom: 1px solid var(--line);
}
.page-header .eyebrow {
    color: var(--gold);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: inline-block;
}
.page-header h1 { margin-bottom: 10px; }
.page-header p  { max-width: 740px; color: var(--body); font-size: 1.05rem; }

/* ------------- University logo cards ------------- */

.uni-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 22px;
}

.uni-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    display: flex;
    flex-direction: column;
}
.uni-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #d6dbe5;
}

.uni-logo {
    height: 90px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 18px;
    padding: 6px 0;
}

.uni-logo img {
    max-height: 90px;
    max-width: 70%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.uni-card h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.uni-card .country {
    font-size: 0.82rem;
    color: var(--gold);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.uni-card p {
    margin: 0;
    font-size: 0.93rem;
    color: var(--body);
}

.uni-card p + p { margin-top: 12px; }

.uni-card strong { color: var(--ink); }

/* ------------- Awards ------------- */

.award-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.award-item {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 18px;
    align-items: start;
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 3px solid var(--gold);
    border-radius: 12px;
    padding: 18px 22px;
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease;
}

.award-item:hover {
    transform: translateX(2px);
    box-shadow: var(--shadow-md);
}

.award-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--gold-soft);
    color: var(--gold);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.award-icon svg { width: 22px; height: 22px; }

.award-body h4 {
    margin: 0 0 4px;
    color: var(--ink);
    font-size: 1.05rem;
}

.award-body .award-meta {
    color: var(--gold);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.award-body p {
    margin: 0;
    color: var(--body);
    font-size: 0.95rem;
}

.award-body a { word-break: break-word; }

/* ------------- Misc ------------- */

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all .15s ease;
}
.tag:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

.divider {
    height: 1px;
    background: var(--line);
    margin: 36px 0;
}

.muted { color: var(--muted); }

.text-center { text-align: center; }

ul.clean { list-style: none; padding: 0; margin: 0; }
ul.clean li { padding: 8px 0; border-bottom: 1px solid #efece2; }
ul.clean li:last-child { border-bottom: none; }

.embed-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}
.embed-wrap iframe {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}

/* ------------- Responsive ------------- */

@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "text"
            "portrait"
            "cta";
        row-gap: 20px;
    }
    .portrait-wrap { justify-self: center; }
    .portrait-frame {
        width: 140px;
        aspect-ratio: 2 / 3;
        transform: none;
        border-radius: 14px;
    }
    .portrait-deco { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .page { grid-template-columns: 1fr; gap: 36px; }
    .sidebar { position: static; }
    .feature { grid-template-columns: 1fr; padding: 28px; }
    .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    section { padding: 56px 0; }
    .nav-toggle { display: inline-flex; }
    .nav-links {
        position: absolute;
        top: 64px;
        left: 16px; right: 16px;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 14px;
        box-shadow: var(--shadow-md);
        flex-direction: column;
        padding: 10px;
        display: none;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 12px 14px; }
    .container { padding: 0 18px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .feature { padding: 24px; }
    .page-main { font-size: 0.96rem; }
}
