/* ========================================
   SOU CS Capstone Website Styles
   Colors: Black, Red (#C8102E), White
   ======================================== */

:root {
    /* SOU Brand Colors */
    --sou-red: #C8102E;
    --sou-red-dark: #A00D25;
    --sou-red-light: #E8334A;
    --sou-red-on-dark: #EF4559;   /* SOU red, brightened for text on black (WCAG AA 4.7:1) */
    --sou-black: #1A1A1A;
    --sou-white: #FFFFFF;
    --sou-gray-100: #F5F5F5;
    --sou-gray-200: #E8E8E8;
    --sou-gray-300: #D1D1D1;
    --sou-gray-600: #666666;
    --sou-gray-800: #333333;
    
    /* Typography */
    --font-heading: 'Source Serif 4', Georgia, serif;
    --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing */
    --section-padding: 5rem 2rem;
    --container-max: 1100px;  /* shared content width: header, hero, projects, footer */
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
}

/* ========================================
   Reset & Base
   ======================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    min-height: 100vh;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--sou-black);
    background-color: var(--sou-white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    color: inherit;
    text-decoration: none;
}

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

/* ========================================
   Header
   ======================================== */

   .site-logo {
    height: 40px;
    width: auto;
}


.site-header {
    background-color: var(--sou-black);
    color: var(--sou-white);
    padding: 0.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-placeholder {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sou-red-on-dark);
}

.logo-subtext {
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.9;
}

.main-nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-weight: 600;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--sou-red-on-dark);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover,
.nav-link.active {
    color: var(--sou-red-on-dark);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    transform: translateY(-1px);
}

/* ========================================
   Hero Section
   ======================================== */

.hero {
    background-color: var(--sou-black);
    color: var(--sou-white);
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
}

.hero-container {
    max-width: var(--container-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-image {
    position: relative;
    z-index: 2;
}

.hero-image img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero h1 .accent {
    color: var(--sou-red-on-dark);
}

.hero-description {
    font-size: 1.2rem;
    max-width: 600px;
    opacity: 0.9;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.cta-button {
    display: inline-block;
    background-color: var(--sou-red);
    color: var(--sou-white);
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(200, 16, 46, 0.3);
}

.cta-button:hover {
    background-color: var(--sou-red-dark);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(200, 16, 46, 0.4);
}

.cta-button:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.3);
}

.hero-accent {
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--sou-red) 0%, transparent 70%);
    opacity: 0.15;
    pointer-events: none;
}

/* ========================================
   Projects Section
   ======================================== */

.projects-section {
    padding: var(--section-padding);
    max-width: calc(var(--container-max) + 4rem);  /* + side padding, so content matches header */
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--sou-black);
}

.section-header p {
    color: var(--sou-gray-600);
    font-size: 1.1rem;
}

/* Search box */
.project-search {
    max-width: 520px;
    margin: 2rem auto 0;
}

.project-search input {
    width: 100%;
    padding: 0.85rem 1.25rem;
    font: inherit;
    font-size: 1rem;
    border: 1px solid var(--sou-gray-300);
    border-radius: 999px;
    background: var(--sou-white);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-search input:focus {
    outline: 3px solid var(--sou-red);
    outline-offset: 2px;
    border-color: var(--sou-red);
}

.search-status {
    text-align: center;
    color: var(--sou-gray-600);
    margin-bottom: 2rem;
}

/* Collapsible year sections (<details>/<summary>) */
.year-block {
    margin-bottom: 2.5rem;
}

.year-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--sou-black);
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--sou-red);
    margin-bottom: 2rem;
    display: flex;          /* full width, so the red line spans the row */
    align-items: baseline;
    gap: 0.75rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.year-heading {
    font: inherit;
    color: inherit;
    margin: 0;
}

.year-title::-webkit-details-marker {
    display: none;
}

.year-title::after {
    content: '';
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid var(--sou-gray-600);
    border-bottom: 2px solid var(--sou-gray-600);
    transform: translateY(-0.2rem) rotate(45deg);
    transition: transform 0.2s ease;
}

.year-block:not([open]) .year-title {
    margin-bottom: 0;
}

.year-block:not([open]) .year-title::after {
    transform: translateY(0) rotate(-45deg);
}

.year-title:hover {
    color: var(--sou-red);
}

.year-title:focus-visible {
    outline: 2px solid var(--sou-red);
    outline-offset: 4px;
}

.year-count {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--sou-gray-600);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--sou-white);
    border: 1px solid var(--sou-gray-200);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 8px 16px rgba(200, 16, 46, 0.1);
    border-color: var(--sou-red-light);
}

.card-image {
    aspect-ratio: 16/9;
    background-color: var(--sou-gray-100);
    overflow: hidden;
}

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

.placeholder-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sou-gray-600);
    font-size: 0.9rem;
    background: linear-gradient(135deg, var(--sou-gray-100) 0%, var(--sou-gray-200) 100%);
}

.card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-content h4 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--sou-black);
    transition: color var(--transition-fast);
}

.project-card:hover .card-content h4 {
    color: var(--sou-red);
}

.card-content p {
    color: var(--sou-gray-600);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    /* Show at most two lines on cards; the full description is on the project page */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

/* Push the team line to the bottom so cards in a row line up */
.card-content .team-names {
    margin-top: auto;
}

.card-content p:empty {
    display: none;
}

.team-names {
    font-size: 0.85rem;
    color: var(--sou-gray-600);
    font-style: italic;
}

/* ========================================
   About Section
   ======================================== */

.about-section {
    background-color: var(--sou-gray-100);
    padding: var(--section-padding);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--sou-black);
}

.about-content p {
    color: var(--sou-gray-800);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.contact-info {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--sou-gray-300);
}

.text-link {
    color: var(--sou-red);
    font-weight: 600;
    transition: color var(--transition-fast);
}

.text-link:hover {
    color: var(--sou-red-dark);
    text-decoration: underline;
}

/* ========================================
   Footer
   ======================================== */

.site-footer {
    background-color: var(--sou-black);
    color: var(--sou-white);
    padding: 2rem;
    text-align: center;
}

.footer-content {
    max-width: var(--container-max);
    margin: 0 auto;
}

.footer-content p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 2rem;
    margin-bottom: 1rem;
}

.footer-links a {
    font-weight: 600;
    color: var(--sou-white);
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--sou-red-on-dark);
    text-decoration: underline;
}

/* ========================================
   Individual Project Page Styles
   ======================================== */

.project-hero {
    background-color: var(--sou-black);
    color: var(--sou-white);
    padding: 4rem 2rem;
}

.project-hero-content {
    max-width: var(--container-max);
    margin: 0 auto;
}

.breadcrumb {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.breadcrumb a {
    color: var(--sou-red-light);
    transition: opacity var(--transition-fast);
}

.breadcrumb a:hover {
    opacity: 0.8;
}

.project-hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    font-size: 1rem;
    opacity: 0.9;
}

.project-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-content {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 4rem 2rem;
}

.video-section {
    margin-bottom: 4rem;
}

.video-section h2,
.description-section h2,
.materials-section h2,
.team-section h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--sou-black);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--sou-red);
    display: inline-block;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background-color: var(--sou-gray-100);
    border-radius: 8px;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sou-gray-600);
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--sou-gray-100) 0%, var(--sou-gray-200) 100%);
    border-radius: 8px;
}

.description-section {
    margin-bottom: 4rem;
}

.description-section p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--sou-gray-800);
    margin-bottom: 1rem;
}

.materials-section {
    margin-bottom: 4rem;
}

.materials-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.material-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background-color: var(--sou-gray-100);
    border-radius: 8px;
    color: var(--sou-black);
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.material-item:hover {
    background-color: var(--sou-white);
    border-color: var(--sou-red);
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.material-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.team-section {
    margin-bottom: 4rem;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.team-member {
    text-align: center;
    padding: 1.5rem;
    background-color: var(--sou-gray-100);
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.team-member:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.team-member-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--sou-gray-300);
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--sou-gray-600);
}

.team-member h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.team-member p {
    font-size: 0.85rem;
    color: var(--sou-gray-600);
}

/* ========================================
   Home Page Extras
   Gray page background, stats card, sticky year buttons,
   and faint topographic lines in the side margins.
   ======================================== */

body.home-page main {
    position: relative;
    background-color: var(--sou-gray-100);
}

/* Contour lines, shown only in the empty margins beside the content column.
   The mask stops at the content edge, so on narrow screens they disappear. */
body.home-page main::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.11;
    background:
        url('images/topo-left.svg') left top / 460px auto repeat-y,
        url('images/topo-right.svg') right top / 460px auto repeat-y;
    -webkit-mask-image: linear-gradient(to right,
        #000 0, transparent calc((100% - var(--container-max)) / 2),
        transparent calc((100% + var(--container-max)) / 2), #000 100%);
            mask-image: linear-gradient(to right,
        #000 0, transparent calc((100% - var(--container-max)) / 2),
        transparent calc((100% + var(--container-max)) / 2), #000 100%);
}

body.home-page .hero,
body.home-page .stats-strip,
body.home-page .projects-section {
    position: relative;
    z-index: 1;
}

body.home-page .stats-strip {
    z-index: 2;
}

body.home-page .project-card {
    border-color: transparent;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Stats card overlapping the bottom of the hero */
.stats-strip {
    padding: 0 2rem;
    margin-top: -3rem;
}

.stats-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding: 2rem;
    text-align: center;
    background: var(--sou-white);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--sou-red);
}

.stat-label {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sou-gray-600);
}

/* Year buttons that stick below the header (top is set in index.html to the header height) */
.year-chips {
    position: sticky;
    top: 61px;
    z-index: 50;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.85rem 0;
    margin: -1.5rem 0 2rem;
    background-color: var(--sou-gray-100);
    transition: box-shadow 0.2s ease;
}

.year-chips.stuck {
    box-shadow: 0 8px 12px -10px rgba(0, 0, 0, 0.25);
}

.year-chip {
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.45rem 1.15rem;
    border-radius: 999px;
    border: 1px solid var(--sou-gray-300);
    background: var(--sou-white);
    color: var(--sou-gray-800);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.year-chip:hover {
    border-color: var(--sou-red);
    color: var(--sou-red);
}

.year-chip.active {
    background: var(--sou-red);
    border-color: var(--sou-red);
    color: var(--sou-white);
}

.year-chip:focus-visible {
    outline: 2px solid var(--sou-red);
    outline-offset: 2px;
}

/* Expand all / Collapse all */
.year-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.35rem;
    margin: -1.25rem 0 0.5rem;
    color: var(--sou-gray-600);
}

.text-button {
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--sou-gray-600);
    background: none;
    border: 0;
    padding: 0.25rem 0.35rem;
    cursor: pointer;
    border-radius: 4px;
}

.text-button:hover {
    color: var(--sou-red);
    text-decoration: underline;
}

.text-button:focus-visible {
    outline: 2px solid var(--sou-red);
    outline-offset: 2px;
}

.search-status:empty {
    display: none;
}

/* Clicking a year button scrolls the heading to just below the sticky bars */
.year-block {
    scroll-margin-top: var(--sticky-offset, 140px);
}

/* ========================================
   Project page: previous / next links
   ======================================== */

.project-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--sou-gray-200);
}

.project-pager:empty {
    display: none;
}

.pager-link {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--sou-gray-200);
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.pager-next {
    align-items: flex-end;
    text-align: right;
}

.pager-link:hover {
    border-color: var(--sou-red);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.pager-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sou-gray-600);
}

.pager-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--sou-black);
    transition: color 0.2s ease;
}

.pager-link:hover .pager-title {
    color: var(--sou-red);
}

.pager-year {
    font-size: 0.9rem;
    color: var(--sou-gray-600);
}

/* ========================================
   Technology tags (project pages)
   ======================================== */

.tech-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.9rem;
}

.tech-tags a {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sou-gray-800);
    background: var(--sou-white);
    border: 1px solid var(--sou-gray-300);
    border-radius: 999px;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.tech-tags a:hover {
    border-color: var(--sou-red);
    color: var(--sou-red);
}

/* ========================================
   Awards & recognition
   ======================================== */

.award-icon {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

/* Badge on project cards */
.award-badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
    padding: 0.2rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sou-red-dark);
    background: #FCEBEE;
    border-radius: 999px;
}

/* Callout under the title on project pages */
.recognition-callout {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin: 1.5rem 0 0;
    padding: 1rem 1.25rem;
    background: #FCEBEE;
    border-left: 4px solid var(--sou-red);
    border-radius: 8px;
    color: var(--sou-black);
}

.recognition-callout .award-icon {
    width: 1.6rem;
    height: 1.6rem;
    color: var(--sou-red);
    margin-top: 0.1rem;
}

.recognition-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sou-red-dark);
    margin-bottom: 0.15rem;
}

.recognition-callout ul {
    list-style: none;
    font-weight: 600;
    line-height: 1.5;
}

/* ========================================
   Embedded presentation slides
   ======================================== */

.slides-container {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--sou-gray-100);
    border: 1px solid var(--sou-gray-200);
    border-radius: 8px;
    overflow: hidden;
}

.slides-container iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.slides-note {
    margin-top: 0.6rem;
    font-size: 0.9rem;
    color: var(--sou-gray-600);
}

.slides-note a {
    color: var(--sou-red-dark);
    font-weight: 600;
    text-decoration: underline;
}

/* ========================================
   Not found (project page and 404 page)
   ======================================== */

.not-found {
    padding: 3rem 0 2rem;
    max-width: 640px;
}

.not-found h1 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 2.75rem);
    margin-bottom: 1rem;
}

.not-found p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--sou-gray-800);
    margin-bottom: 1rem;
}

.not-found .cta-button {
    margin-top: 0.75rem;
}

/* ========================================
   Narrow pages (project detail, about)
   Add class="narrow-page" to <body> to use a 900px column;
   the header and footer shrink to match automatically.
   ======================================== */

body.narrow-page {
    --container-max: 900px;
}

/* ========================================
   About Page
   ======================================== */

.about-page {
    width: 100%;
    max-width: calc(var(--container-max) + 4rem);
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
}

.about-page h1 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 1.25rem;
}

.about-lead {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--sou-gray-800);
}

.about-page h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    margin: 3rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--sou-red);
    display: inline-block;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.benefit-card {
    background: var(--sou-gray-100);
    border-left: 4px solid var(--sou-red);
    border-radius: 8px;
    padding: 1.5rem;
}

.benefit-card h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.benefit-card p {
    color: var(--sou-gray-800);
    line-height: 1.7;
}

.prep-note {
    margin-top: 2rem;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--sou-gray-800);
}

/* Past sponsors list (collapsible) */
.sponsors-details > summary {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin: 3rem 0 1.5rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.sponsors-details > summary::-webkit-details-marker {
    display: none;
}

.sponsors-details > summary h2 {
    margin: 0;
}

/* Chevron: points right when closed, down when open (same as the year sections) */
.sponsors-details > summary::after {
    content: '';
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid var(--sou-gray-600);
    border-bottom: 2px solid var(--sou-gray-600);
    transform: translateY(-0.2rem) rotate(45deg);
    transition: transform 0.2s ease;
}

.sponsors-details:not([open]) > summary::after {
    transform: translateY(0) rotate(-45deg);
}

.sponsors-details > summary:hover h2 {
    color: var(--sou-red);
}

.sponsors-count {
    font-size: 0.95rem;
    color: var(--sou-gray-600);
}

.sponsors-intro {
    font-size: 1.05rem;
    color: var(--sou-gray-800);
    margin-bottom: 1.5rem;
}

.sponsors-groups {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1.5rem 2.5rem;
    align-items: start;
}

.sponsor-group h3 {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sou-gray-600);
    margin-bottom: 0.5rem;
}

.sponsor-group ul {
    list-style: none;
}

.sponsor-group a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--sou-gray-200);
    transition: color 0.2s ease;
}

.sponsor-name {
    font-weight: 600;
}

.sponsor-count {
    flex-shrink: 0;
    font-size: 0.85rem;
    color: var(--sou-gray-600);
}

.sponsor-group a:hover .sponsor-name {
    color: var(--sou-red);
    text-decoration: underline;
}

.sponsor-cta {
    margin-top: 3.5rem;
    background: var(--sou-black);
    color: var(--sou-white);
    border-radius: 12px;
    padding: 2.5rem;
}

.sponsor-cta h2 {
    color: var(--sou-white);
    margin-top: 0;
}

.sponsor-cta p {
    font-size: 1.1rem;
    line-height: 1.7;
    opacity: 0.9;
    margin-bottom: 1.25rem;
}

.sponsor-contacts {
    list-style: none;
    font-size: 1.05rem;
    line-height: 1.9;
    margin-bottom: 1.75rem;
}

.sponsor-contacts a {
    color: var(--sou-white);
    text-decoration: underline;
    text-decoration-color: var(--sou-red-light);
    text-underline-offset: 3px;
}

.sponsor-contacts a:hover {
    color: var(--sou-red-light);
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .project-pager {
        grid-template-columns: 1fr;
    }

    .stats-inner {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
        padding: 1.5rem;
    }

    .stat-number {
        font-size: 2.1rem;
    }

    .year-chips {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .sponsors-groups {
        grid-template-columns: 1fr;
    }

    .sponsor-cta {
        padding: 2rem 1.5rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .main-nav {
        gap: 1.5rem;
    }

    .hero {
        padding: 3rem 1.5rem 5rem;   /* extra bottom room for the overlapping stats card */
    }

    .stats-strip {
        padding: 0 1.5rem;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-image {
        order: -1;
    }
    
    .projects-section {
        padding: 3rem 1.5rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .project-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .materials-list {
        grid-template-columns: 1fr;
    }
    
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .main-nav {
        gap: 1rem;
        font-size: 0.9rem;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
    }
}

a.project-card {
    text-decoration: none;
    color: inherit;
    display: block;
}
/* Keep the projects heading clear of the sticky header when linked to directly */
#projects {
    scroll-margin-top: 70px;
}

/* ========================================
   Accessibility
   ======================================== */

/* "Skip to main content" link: hidden until a keyboard user tabs to it */
.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 1000;
    padding: 0.75rem 1.25rem;
    background: var(--sou-white);
    color: var(--sou-black);
    font-weight: 700;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

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

/* Clear focus ring for keyboard users on every link and control */
a:focus-visible,
summary:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--sou-red);
    outline-offset: 3px;
}

.site-header a:focus-visible,
.site-footer a:focus-visible,
.hero a:focus-visible {
    outline-color: var(--sou-white);
}

.project-card:focus-visible {
    outline-offset: 4px;
}

/* Respect "reduce motion" system settings */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }

    .project-card:hover,
    .cta-button:hover,
    .pager-link:hover,
    .team-member:hover,
    .material-item:hover,
    .nav-link:hover {
        transform: none;
    }
}

/* The skip link moves focus to <main>; don't draw a ring around the whole page */
main:focus {
    outline: none;
}
