/* =========================================================
 * Header / nav — sticky with backdrop blur, hamburger on mobile
 * ========================================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    margin: 0 -2rem;
    padding: 0 2rem;
}


/* Override theme's default `header { display: flex }` for our wrapped layout */
header.site-header {
    display: block;
    flex-wrap: initial;
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    margin: 0 -2rem;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
}

.site-header .main {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
}

.site-nav a {
    white-space: nowrap;
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 500;
    padding: 0.4rem 0.2rem;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.site-nav a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.site-nav__sep {
    display: inline-block;
    width: 1px;
    height: 1.1rem;
    background: var(--border);
    margin: 0 0.25rem;
}

.site-nav__lang {
    font-size: 0.85rem !important;
    color: var(--text-light) !important;
}

/* Hamburger button — hidden on desktop, shown on mobile */
.nav-toggle {
    display: none;
    background: var(--bg-alt);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    width: 42px;
    height: 42px;
    padding: 0;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.nav-toggle:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.nav-toggle:hover .nav-toggle__bar { background: #fff; }

.nav-toggle__bar {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease, background 0.15s ease;
    transform-origin: center;
}

.nav-toggle.is-open .nav-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle.is-open .nav-toggle__bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.nav-toggle.is-open .nav-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 1100px) {
    .site-nav { gap: 0.85rem; font-size: 0.9rem; }
}

@media (max-width: 900px) {
    .nav-toggle { display: inline-flex; }

    .site-nav {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        left: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: 14px;
        padding: 0.5rem;
        box-shadow: 0 10px 30px var(--shadow);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transform: translateY(-6px);
        pointer-events: none;
        transition: max-height 0.28s ease, opacity 0.2s ease, transform 0.2s ease;
    }

    .site-nav.is-open {
        max-height: calc(100vh - 80px);
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
        overflow: auto;
    }

    .site-nav a {
        display: block;
        padding: 0.85rem 1rem;
        border-bottom: 1px solid var(--border);
        white-space: normal;
        font-size: 1rem;
        font-weight: 500;
    }

    .site-nav a:last-of-type { border-bottom: none; }

    .site-nav a:hover {
        background: var(--bg-alt);
        border-bottom-color: var(--border);
        color: var(--accent);
    }

    .site-nav__sep {
        height: 1px;
        width: auto;
        margin: 0.4rem 0.25rem;
        background: var(--border);
    }
}

/* Lock body scroll while mobile nav is open */
body.nav-open { overflow: hidden; }

/* =========================================================
 * Page surface — clean and quiet.
 * The body is plain white. There's no page-wide pattern, no animated
 * dots, no tonal mesh. The hero is the *only* place that carries
 * brand color and motion; everything below is content-first and
 * stays out of the way.
 * ========================================================= */

body {
    background: var(--bg);
    overflow-x: hidden;
}

/* =========================================================
 * Section illustrations (drop-in slot for soco-st illustrations)
 *  - Place files under /static/images/illustrations/ and reference like:
 *    <div class="section-illust"><img src="/images/illustrations/study.svg" alt=""></div>
 * ========================================================= */

.section-illust {
    margin: 1.5rem auto;
    max-width: 320px;
    text-align: center;
}

.section-illust img {
    width: 100%;
    height: auto;
    max-height: 280px;
    object-fit: contain;
    /* Bare SVGs on a white page — no card, shadow, padding, or rounding. */
    background: none;
    border-radius: 0;
    box-shadow: none;
}

@media (min-width: 768px) {
    .section-illust--right {
        float: right;
        margin: 0 0 1rem 1.5rem;
        max-width: 240px;
        shape-outside: margin-box;
    }
    .section-illust--left {
        float: left;
        margin: 0 1.5rem 1rem 0;
        max-width: 240px;
        shape-outside: margin-box;
    }
    .section-illust--small {
        max-width: 180px;
    }
}

.section-illust--inline {
    display: inline-flex;
    margin: 0;
    max-width: 64px;
    vertical-align: middle;
}

/* Clear floats so the next section heading isn't pulled up next to the float */
@media (min-width: 768px) {
    .post h2,
    .post h3,
    .home-content h2,
    .home-content h3 {
        clear: both;
    }
}

/* =========================================================
 * Card / link motion polish — give existing components a coherent feel
 * ========================================================= */

.highlight-card,
.project-card,
.entry-card,
.member-card,
.content-card,
.paper-stats-card-link,
.cta-button,
.members-join-button {
    transition:
        transform 0.18s ease-out,
        box-shadow 0.18s ease-out,
        border-color 0.18s ease-out;
}

.highlight-card:hover,
.project-card:hover,
.entry-card:hover,
.content-card:hover,
.paper-stats-card-link:hover {
    border-color: var(--accent);
}

.highlight-icon,
.entry-icon,
.content-card-icon,
.paper-stat-icon {
    transition: transform 0.18s ease-out;
}

.highlight-card:hover .highlight-icon,
.entry-card:hover .entry-icon,
.content-card:hover .content-card-icon,
.paper-stats-card-link:hover .paper-stat-icon {
    transform: scale(1.06) rotate(-3deg);
}

/* Section title underline marker — accent → purple, matches brand palette */
.section-title::after {
    background: linear-gradient(90deg, var(--accent), var(--purple)) !important;
    width: 2.5rem !important;
    height: 3px !important;
    border-radius: 999px !important;
    opacity: 0.85;
}

/* Kill the lonely 1px border-top above the news section. The home page
   has a 2-column intro+news layout, so a border-top above News only spans
   the right column — visually broken. Removed entirely. */
.news-section {
    border-top: none !important;
}

/* Hero title (used on pages without a banner image) — was white from
   theme; now needs to be dark since the hero has no colored block. */
.hero-title {
    color: var(--text) !important;
    text-shadow: none !important;
}

/* News list — subtle highlight on hover (background only; no layout shift) */
.news-item {
    transition: background 0.15s ease-out;
    border-radius: 6px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}
.news-item:hover {
    background: var(--bg-alt);
}

/* =========================================================
 * Hero — the one place with brand color and motion.
 * A vibrant accent → primary → purple gradient block, with a single
 * soft "aurora" highlight that drifts inside it (the only animation
 * on the page). The bottom edge is masked so the hero fades smoothly
 * into the white page below — no harsh edge, no artifacts.
 * ========================================================= */
.hero,
.join-hero {
    color: white !important;
    padding: 5rem 2rem 5rem !important;
    margin: 0 -2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    /* Soft fade at the bottom so the hero merges with the white page.
       Only works because the page surface below is plain white — no
       dots/blobs to show through the faded zone. */
    -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 2.5rem), transparent 100%);
    mask-image: linear-gradient(to bottom, black calc(100% - 2.5rem), transparent 100%);
}
/* Mesh gradient — multiple radial gradients blend organically rather
   than the flat diagonal of a single linear gradient. Each color zone
   has its own anchor point, giving a richer, more "designed" surface. */
.hero {
    background:
        radial-gradient(72% 80% at 0% 0%,    rgba(76, 149, 188, 0.95) 0%, transparent 55%),
        radial-gradient(60% 70% at 100% 5%,  rgba(94, 66, 173, 0.90) 0%, transparent 60%),
        radial-gradient(85% 70% at 50% 100%, rgba(0, 63, 88, 0.90) 0%, transparent 65%),
        radial-gradient(45% 55% at 100% 100%, rgba(146, 110, 220, 0.60) 0%, transparent 65%),
        linear-gradient(135deg, var(--accent) 0%, var(--primary) 50%, var(--purple) 100%);
}
.join-hero {
    background:
        radial-gradient(70% 75% at 0% 0%,    rgba(0, 63, 88, 0.95) 0%, transparent 55%),
        radial-gradient(60% 70% at 100% 0%,  rgba(94, 66, 173, 0.85) 0%, transparent 60%),
        radial-gradient(80% 65% at 60% 100%, rgba(76, 149, 188, 0.80) 0%, transparent 65%),
        linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--purple) 100%);
}

/* Primary "aurora" highlight — a big soft white glow drifting diagonally. */
.hero::before,
.join-hero::before {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    inset: -25% !important;
    background: radial-gradient(
        ellipse 50% 60% at 30% 35%,
        rgba(255, 255, 255, 0.32) 0%,
        rgba(255, 255, 255, 0) 70%
    ) !important;
    pointer-events: none !important;
    z-index: 0 !important;
    animation: heroAurora1 14s ease-in-out infinite alternate !important;
    will-change: transform !important;
    /* reset anything the theme might have applied */
    width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
    transform: translate3d(-12%, -8%, 0) !important;
    background-size: auto !important;
    opacity: 1 !important;
}

/* Secondary aurora — smaller, opposite direction, different timing.
   Two light sources moving counter to each other reads as much richer
   than a single highlight, but stays GPU-cheap (still just transform). */
.hero::after,
.join-hero::after {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    inset: -30% !important;
    background: radial-gradient(
        ellipse 38% 48% at 72% 65%,
        rgba(255, 255, 255, 0.22) 0%,
        rgba(255, 255, 255, 0) 70%
    ) !important;
    pointer-events: none !important;
    z-index: 0 !important;
    animation: heroAurora2 19s ease-in-out infinite alternate-reverse !important;
    will-change: transform !important;
    width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
    transform: translate3d(10%, 8%, 0) !important;
    background-size: auto !important;
    opacity: 1 !important;
}

@keyframes heroAurora1 {
    0%   { transform: translate3d(-12%, -8%, 0); }
    100% { transform: translate3d(15%,  10%, 0); }
}
@keyframes heroAurora2 {
    0%   { transform: translate3d(10%,  8%, 0); }
    100% { transform: translate3d(-15%, -12%, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .hero::before, .hero::after,
    .join-hero::before, .join-hero::after {
        animation: none !important;
    }
}

/* Hero content sits above the aurora layer */
.hero > *,
.join-hero > * {
    position: relative;
    z-index: 1;
}

/* Logo: white-inverted on the colored hero in light mode.
   In dark mode the gradient is even darker, so white still works. */
.hero-banner {
    filter: brightness(0) invert(1) !important;
    max-height: 7rem !important;
}

/* Hero subtitle / title for non-banner pages — both white on the gradient */
.hero-subtitle {
    color: rgba(255, 255, 255, 0.88) !important;
    font-size: 1rem;
    margin-top: 0.75rem;
    letter-spacing: 0.04em;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.18);
}
.hero-title {
    color: white !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.22) !important;
}

/* Buttons — consistent ripple-ish lift */
.cta-button,
.members-join-button {
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 60%, var(--purple) 100%);
    background-size: 200% 200%;
    background-position: 0% 0%;
    color: #fff;
    border: none;
}
.cta-button:hover,
.members-join-button:hover {
    background-position: 100% 100%;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(76, 149, 188, 0.35);
    color: #fff;
}

/* =========================================================
 * Home flow sections (full-width below the intro/news grid)
 * ========================================================= */

.home-flow-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.home-flow-section:first-of-type {
    margin-top: 2.5rem;
}

/* "View all news" link below the news list */
.news-section-footer {
    margin-top: 1rem;
    text-align: right;
    font-family: "Roboto Mono", monospace;
    font-size: 0.85rem;
}

.news-section-footer a {
    border-bottom: 1px solid transparent;
}

.news-section-footer a:hover {
    border-bottom-color: var(--accent);
}

/* Make the home intro a bit more breathable so it pairs with news */
@media (min-width: 768px) {
    .home-content {
        padding: 1.5rem 0 0;
    }
}

/* =========================================================
 * Content cards section — heading is NOT a link; CTA is separate
 * ========================================================= */

.content-cards-section .home-section-title {
    margin-bottom: 0.4rem;
}

.content-cards-section-lede {
    color: var(--text-light);
    margin-top: -0.25rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.content-cards-section-cta {
    margin-top: 1.25rem;
    text-align: right;
    font-family: "Roboto Mono", monospace;
    font-size: 0.85rem;
}

.content-cards-section-cta a {
    border-bottom: 1px solid transparent;
}

.content-cards-section-cta a:hover {
    border-bottom-color: var(--accent);
}

/* =========================================================
 * Content cards (used on / and /content)
 * ========================================================= */

.content-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Override the global a:hover { border-bottom-color: var(--accent) } so the
 * card itself doesn't get a stray underline from the theme. */
a.content-card,
a.content-card:hover {
    border-bottom: none;
}

.content-card {
    display: flex;
    flex-direction: column;
    background: white;
    padding: 1.75rem 1.5rem 1.25rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow);
    border-top: 4px solid var(--accent);
    color: inherit;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow);
    color: inherit;
    text-decoration: none;
}

.content-card-icon {
    font-size: 1.8rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
    line-height: 1;
}

.content-card-tag {
    display: inline-block;
    align-self: flex-start;
    font-family: "Roboto Mono", monospace;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: var(--accent);
    background: var(--bg-alt);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
}

.content-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.45;
    margin-bottom: 0.6rem;
}

.content-card-description {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.7;
    margin: 0 0 1.25rem;
    flex-grow: 1;
}

.content-card-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-family: "Roboto Mono", monospace;
    font-size: 0.78rem;
    color: var(--text-light);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    word-break: break-all;
}

.content-card-cta i {
    color: var(--accent);
    font-size: 0.85rem;
}

/* =========================================================
 * Home flow sections (full-width below the intro/news grid)
 * ========================================================= */

.home-flow-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.home-flow-section:first-of-type {
    margin-top: 2.5rem;
}

/* "View all news" link below the news list */
.news-section-footer {
    margin-top: 1rem;
    text-align: right;
    font-family: "Roboto Mono", monospace;
    font-size: 0.85rem;
}

.news-section-footer a {
    border-bottom: 1px solid transparent;
}

.news-section-footer a:hover {
    border-bottom-color: var(--accent);
}

/* Make the home intro a bit more breathable so it pairs with news */
@media (min-width: 768px) {
    .home-content {
        padding: 1.5rem 0 0;
    }
}

/* =========================================================
 * Content cards section — heading is NOT a link; CTA is separate
 * ========================================================= */

.content-cards-section .home-section-title {
    margin-bottom: 0.4rem;
}

.content-cards-section-lede {
    color: var(--text-light);
    margin-top: -0.25rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.content-cards-section-cta {
    margin-top: 1.25rem;
    text-align: right;
    font-family: "Roboto Mono", monospace;
    font-size: 0.85rem;
}

.content-cards-section-cta a {
    border-bottom: 1px solid transparent;
}

.content-cards-section-cta a:hover {
    border-bottom-color: var(--accent);
}

/* =========================================================
 * Content cards (used on / and /content)
 * ========================================================= */

.content-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Override the global a:hover { border-bottom-color: var(--accent) } so the
 * card itself doesn't get a stray underline from the theme. */
a.content-card,
a.content-card:hover {
    border-bottom: none;
}

.content-card {
    display: flex;
    flex-direction: column;
    background: white;
    padding: 1.75rem 1.5rem 1.25rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow);
    border-top: 4px solid var(--accent);
    color: inherit;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow);
    color: inherit;
    text-decoration: none;
}

.content-card-icon {
    font-size: 1.8rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
    line-height: 1;
}

.content-card-tag {
    display: inline-block;
    align-self: flex-start;
    font-family: "Roboto Mono", monospace;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: var(--accent);
    background: var(--bg-alt);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
}

.content-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.45;
    margin-bottom: 0.6rem;
}

.content-card-description {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.7;
    margin: 0 0 1.25rem;
    flex-grow: 1;
}

.content-card-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-family: "Roboto Mono", monospace;
    font-size: 0.78rem;
    color: var(--text-light);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    word-break: break-all;
}

.content-card-cta i {
    color: var(--accent);
    font-size: 0.85rem;
}
