:root {
    --scail-ink: #182533;
    --scail-muted: #566575;
    --scail-red: #8c1515;
    --scail-red-dark: #5f0c16;
    --scail-red-light: #b1040e;
    --scail-cardinal: #8c1515;
    --scail-paper: #f5f7f8;
    --scail-border: #dce3e7;
    --scail-navbar-height: 72px;
}

html {
    scroll-behavior: auto;
    scroll-padding-top: var(--scail-navbar-height);
}

body {
    color: var(--scail-ink);
    background: #fff;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.7;
}

a {
    color: #8c1515;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid #e7a83e;
    outline-offset: 3px;
}

.navbar {
    min-height: 72px;
    padding: 0.35rem 1rem;
    margin-bottom: 0;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid rgba(24, 37, 51, 0.08);
    box-shadow: 0 5px 22px rgba(24, 37, 51, 0.07);
}

.navbar-brand {
    margin-right: 1.5rem;
}

.brand-img {
    width: auto;
    max-width: 144px;
    max-height: 92px;
}

.navbar-nav .nav-link {
    padding: 0.4rem 0.38rem;
    color: var(--scail-ink);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus,
.navbar-nav .nav-item.active .nav-link {
    color: var(--scail-red);
}

.header {
    position: relative;
    display: flex;
    min-height: min(690px, 88vh);
    height: auto;
    align-items: center;
    overflow: hidden;
    background: var(--scail-cardinal) url("../imgs/header.jpg") center / cover no-repeat;
}

.header .overlay {
    background: linear-gradient(105deg, rgba(77, 0, 0, 0.97) 0%, rgba(140, 21, 21, 0.94) 55%, rgba(177, 4, 14, 0.88) 100%);
    opacity: 1;
}

.header .carousel {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    margin-top: 76px;
    padding: 90px 0 78px;
}

.hero-content {
    color: #fff;
}

.hero-eyebrow {
    margin-bottom: 1.1rem;
    color: #f0c878;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

.hero-content h1 {
    max-width: 760px;
    margin-bottom: 1.3rem;
    color: #fff;
    font-size: clamp(2.8rem, 7vw, 5.7rem);
    font-weight: 750;
    letter-spacing: -0.055em;
    line-height: 1.02;
}

.hero-summary {
    max-width: 670px;
    margin-bottom: 1.8rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: clamp(1.06rem, 2vw, 1.3rem);
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.4rem;
}

.hero-button {
    padding: 0.8rem 1.25rem;
    border: 1px solid #fff;
    border-radius: 4px;
    background: #fff;
    color: var(--scail-ink);
    font-weight: 700;
}

.hero-button:hover {
    background: #f0c878;
    border-color: #f0c878;
    color: var(--scail-ink);
}

.hero-partner-button {
    background: #f0c878;
    border-color: #f0c878;
    color: var(--scail-ink);
}

.hero-partner-button:hover {
    background: #ffd98a;
    border-color: #ffd98a;
    color: var(--scail-ink);
}

.hero-text-link {
    color: #fff;
    font-weight: 700;
}

.hero-text-link:hover {
    color: #f0c878;
}

.hero-topics {
    margin: 2.6rem 0 0;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.88rem;
    letter-spacing: 0.04em;
}

.hero-topics span {
    padding: 0 0.45rem;
    color: var(--scail-red-light);
}

.section {
    padding: clamp(2.25rem, 4vw, 3.5rem) 10px;
    scroll-margin-top: 76px;
}

.section:nth-child(odd) {
    background-color: var(--scail-paper);
}

.section-title {
    margin-bottom: 0.65rem;
    color: var(--scail-ink);
    font-size: clamp(1.8rem, 3vw, 2.55rem);
    font-weight: 750;
    letter-spacing: -0.035em;
}

.section-intro {
    max-width: 760px;
    margin: 0 0 2rem;
    color: var(--scail-muted);
    font-size: 1.08rem;
}

#about p:not(.section-intro) {
    max-width: 940px;
}

#about .widget {
    max-width: 940px;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    border: 1px solid var(--scail-border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(24, 37, 51, 0.05);
}

#about .widget .infos-wrapper {
    display: flex;
    flex: 0 1 150px;
    min-height: 74px;
    align-items: center;
    justify-content: center;
}

#about .widget .infos-wrapper p {
    margin: 0;
}

#about .widget .infos-wrapper a {
    display: flex;
    width: 84px;
    height: 34px;
    align-items: center;
    justify-content: center;
}

#about .widget a[aria-label="Schmidt Sciences website"],
#about .widget a[aria-label="Intuit website"] {
    width: 94px;
    height: 38px;
}

#about .widget a[aria-label="Intuit website"] {
    width: 104px;
    height: 42px;
}

#about .widget img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#news ul {
    display: grid;
    gap: 0.85rem;
    max-width: 1000px;
    padding-left: 0;
    list-style: none;
}

#news li {
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--scail-border);
    border-left: 4px solid var(--scail-red);
    border-radius: 5px;
    background: #fff;
}

.news-archive {
    max-width: 1000px;
    margin-top: 1.25rem;
}

.news-archive summary {
    width: fit-content;
    padding: 0.55rem 0;
    color: var(--scail-red);
    cursor: pointer;
    font-weight: 700;
}

.news-archive ul {
    margin-top: 0.7rem;
}

#applications .card {
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--scail-border) !important;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(24, 37, 51, 0.06);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

#applications > .container > .row {
    row-gap: 1.5rem;
}

#foundations .card::before {
    color: var(--scail-red);
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.13em;
    line-height: 1.3;
    text-transform: uppercase;
}

#foundations .card::before {
    display: block;
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    margin-bottom: 0.45rem;
}

#applications .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(24, 37, 51, 0.12);
}

#foundations .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(24, 37, 51, 0.09);
}

#applications .card-img-top {
    height: 156px;
    object-fit: cover;
}

.card-illustration {
    display: block;
    background: #f5f2ed;
}

#foundations .card-illustration {
    display: block;
    width: 64px;
    height: 64px;
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    object-fit: contain;
    border-radius: 10px;
    background: #f5f2ed;
    transition: transform 160ms ease;
}

#foundations .card:hover .card-illustration {
    transform: scale(1.04);
}

.theme-illustration {
    display: block;
    width: 100%;
    max-width: 112px;
    height: auto;
    margin: 0.35rem auto;
    border-radius: 8px;
}

#publications [aria-labelledby="publications-by-theme"] dt.col-sm-1 {
    flex: 0 0 16.666667%;
    max-width: 16.666667%;
}

#publications [aria-labelledby="publications-by-theme"] dd.col-sm-11 {
    flex: 0 0 83.333333%;
    max-width: 83.333333%;
}

.course-illustration {
    display: block;
    width: 60px;
    height: 60px;
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    margin: 0;
    border-radius: 8px;
    background: #f5f2ed;
    transition: transform 160ms ease;
}

#teaching .course-card:hover .course-illustration {
    transform: scale(1.04);
}

#teaching .course-card {
    height: 100%;
    border-radius: 10px;
    text-align: left;
}

#teaching .row {
    row-gap: 1.5rem;
}

#teaching .course-card .card-body {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    align-content: start;
    align-items: start;
    gap: 0.85rem 1rem;
    padding: 1.5rem;
}

#teaching .course-card .title {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    margin: 0;
}

#teaching .course-card .s-font,
#teaching .course-card .course-links {
    grid-column: 1 / -1;
}

#teaching .course-card .s-font {
    margin: 0;
}

.course-links {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.course-link {
    display: inline-flex;
    width: 100%;
    max-width: 460px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1rem;
    border: 2px solid var(--scail-cardinal);
    border-radius: 6px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.course-book-link {
    background: var(--scail-cardinal);
    color: #fff;
}

.course-book-link:hover,
.course-book-link:focus-visible {
    background: #7a1717;
    border-color: #7a1717;
    color: #fff;
    transform: translateY(-1px);
}

.course-site-link {
    background: #fff;
    color: var(--scail-cardinal);
}

.course-site-link:hover,
.course-site-link:focus-visible {
    background: #f8eeee;
    color: var(--scail-cardinal);
    transform: translateY(-1px);
}

#applications .card-body {
    padding: 1.25rem;
}

#foundations > .container > .row {
    row-gap: 1.5rem;
}

#foundations {
    counter-reset: foundation-topic;
}

#foundations .card {
    height: 100%;
    max-width: none;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: 1rem;
    align-content: start;
    counter-increment: foundation-topic;
    padding: 1.4rem 1.5rem;
    border: 1px solid var(--scail-border) !important;
    border-top: 3px solid #c8d1d7 !important;
    border-radius: 0 0 8px 8px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(24, 37, 51, 0.045);
    text-align: left;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

#foundations .card::before {
    content: "Foundation / " counter(foundation-topic, decimal-leading-zero);
}

#foundations .card-body {
    display: flex;
    width: 100%;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    grid-column: 2;
    grid-row: 2;
    padding: 0 !important;
}

#foundations .card .title {
    margin: 0.05rem 0 0.65rem;
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.4;
}

.topic-toggle {
    margin: auto 0 0.35rem;
    padding: 0.15rem 0;
    border: 0;
    background: transparent;
    color: var(--scail-red);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.35;
    transition: color 160ms ease;
}

.topic-toggle:hover {
    background: transparent;
    color: var(--scail-red);
}

.topic-publications-link {
    display: inline-flex;
    align-items: center;
    margin-top: 0.85rem;
    padding: 0.5rem 0.8rem;
    border: 1px solid rgba(140, 21, 21, 0.28);
    border-radius: 4px;
    background: #fff;
    font-size: 0.88rem;
    font-weight: 650;
    text-decoration: none;
}

.topic-publications-link:hover {
    border-color: var(--scail-red);
    background: #fbf3f3;
}

#foundations .card.expanded {
    max-height: none;
}

#foundations .card.expanded .topic-toggle {
    margin-top: 0.1rem;
}

#foundations .card-content {
    margin-top: 0.8rem;
}

#foundations .tabs {
    gap: 0.35rem;
    flex-wrap: wrap;
}

#foundations .tab-link {
    border-radius: 4px;
    color: var(--scail-ink);
}

#foundations .tab-link.active {
    background: var(--scail-cardinal);
    color: #fff;
}

#teaching,
#contact {
    background: var(--scail-cardinal);
    color: #fff;
}

#teaching .section-title,
#contact .section-title {
    color: #fff;
}

#people .textmonial-item {
    height: 100%;
    padding: 1rem;
    border: 1px solid var(--scail-border);
    border-radius: 9px;
    background: #fff;
}

#people .row {
    row-gap: 1rem;
    margin-bottom: 1rem;
}

#people .avatar {
    width: 112px;
    height: 112px;
    min-width: 112px;
    min-height: 112px;
    margin-right: 1rem;
    object-fit: cover;
}

#people .des {
    min-width: 0;
    padding: 0.5rem 0;
}

#people .name {
    color: var(--scail-ink);
    font-size: 1.06rem;
}

#people .xs-font {
    color: var(--scail-muted);
    font-weight: 500;
}

.publication-search {
    max-width: 720px;
    margin: 1.5rem 0;
}

.publication-search label {
    margin-bottom: 0.45rem;
    font-weight: 700;
}

.publication-search .form-control {
    min-height: 48px;
    border: 1px solid #aebbc4;
    border-radius: 5px;
    font-size: 1rem;
}

.search-status {
    min-height: 1.5rem;
    margin: 0.45rem 0 0;
    color: var(--scail-muted);
    font-size: 0.9rem;
}

#publications .tabs {
    gap: 0.5rem;
    border-bottom: 1px solid var(--scail-border);
}

#publications .tab-link {
    padding: 0.7rem 1rem;
    border-radius: 5px 5px 0 0;
    color: var(--scail-ink);
    font-weight: 700;
}

#publications .tab-link.active {
    background: var(--scail-cardinal);
    color: #fff;
}

#publications dt h3 {
    color: var(--scail-red);
    font-weight: 750;
    scroll-margin-top: 100px;
}

#publications ol {
    padding-left: 1.35rem;
}

#publications ol li {
    padding: 0.5rem 0 0.7rem 0.15rem;
    border-bottom: 1px solid #e9edef;
}

#publications ol li::marker {
    color: #8c1515;
    font-weight: 700;
}

#publications ol li a:first-child {
    font-weight: 650;
}

#publications [hidden] {
    display: none !important;
}

#publications dt[hidden],
#publications dd[hidden] {
    display: none !important;
}

#contact,
#contact * {
    color: #fff;
}

#contact {
    padding-top: 5.5rem;
    background:
        radial-gradient(ellipse at 90% 12%, rgba(255, 255, 255, 0.08), transparent 32rem),
        var(--scail-cardinal);
}

#contact .contact-heading {
    max-width: 720px;
    margin-bottom: 2.5rem;
}

#contact .contact-eyebrow {
    margin-bottom: 0.65rem;
    color: #f0c878;
    font-size: 0.76rem;
    font-weight: 750;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

#contact .section-title {
    margin-bottom: 0.7rem;
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    letter-spacing: -0.045em;
}

#contact .contact-intro {
    max-width: 620px;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1.1rem;
    line-height: 1.65;
}

#contact .contact-details {
    row-gap: 1rem;
}

#contact .contact-item {
    display: flex;
    min-height: 146px;
    align-items: flex-start;
    gap: 1.1rem;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

#contact .contact-item:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.32);
    background: rgba(255, 255, 255, 0.1);
}

#contact .contact-icon {
    display: inline-flex;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.1);
    color: #f0c878;
    font-size: 1.1rem;
}

#contact .contact-icon i {
    color: #f0c878;
}

#contact .contact-label {
    margin: 0 0 0.4rem;
    color: #f0c878;
    font-size: 0.74rem;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

#contact address {
    margin: 0;
    font-size: 1.05rem;
    font-style: normal;
    line-height: 1.65;
}

#contact .contact-email {
    font-size: 1.15rem;
    font-weight: 700;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
}

#contact .contact-note {
    margin: 0.4rem 0 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.86rem;
    line-height: 1.45;
}

#contact .footer {
    padding: 1.5rem 0;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        padding: 0.6rem 0 1rem;
    }

    .navbar-nav .nav-link {
        padding: 0.4rem 0;
    }

    .header {
        min-height: 620px;
    }
}

@media (min-width: 768px) {
    #foundations .col-lg-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    #applications .col-lg-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 575.98px) {
    .header {
        min-height: 590px;
    }

    .header .carousel {
        padding: 70px 0 55px;
    }

    .hero-topics span {
        padding: 0 0.15rem;
    }

    #people .avatar {
        width: 82px;
        height: 82px;
        min-width: 82px;
        min-height: 82px;
    }

    #contact {
        padding-top: 4rem;
    }

    #contact .contact-item {
        min-height: 0;
        padding: 1.15rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
