/* Forgis Labs — base stylesheet
   Shared across the homepage and all project pages.
   Project-specific styles can be added inline or in their own file. */

/* ── Forgis brand typefaces ─────────────────────
   Three families cover every glyph on the site:
     Forgis Body   — Helvetica Now Display (body, UI, navigation)
     Forgis Title  — At Aero Retina       (display headlines, italic accents)
     Forgis Digits — PP Fraktion Mono     (mono labels, stat numerals, code)
   Weight ranges are used so any numeric weight 100–500 maps to the
   regular cut and 600–900 maps to the bold cut. */

@font-face {
    font-family: 'Forgis Body';
    src: url('../fonts/forgis-body-regular.ttf') format('truetype');
    font-weight: 100 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Forgis Body';
    src: url('../fonts/forgis-body-italic.ttf') format('truetype');
    font-weight: 100 500;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Forgis Body';
    src: url('../fonts/forgis-body-bold.ttf') format('truetype');
    font-weight: 600 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Forgis Body';
    src: url('../fonts/forgis-body-bold-italic.ttf') format('truetype');
    font-weight: 600 900;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Forgis Title';
    src: url('../fonts/forgis-title.otf') format('opentype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Forgis Digits';
    src: url('../fonts/forgis-digits-regular.otf') format('opentype');
    font-weight: 100 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Forgis Digits';
    src: url('../fonts/forgis-digits-bold.otf') format('opentype');
    font-weight: 600 900;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: dark;

    /* Brand tokens */
    --tiger: #ff5a00;
    --fire: #ff4d00;
    --flicker: #dc4b07;
    --steel: #878f92;
    --gunmetal: #122128;
    --panel: #202e35;

    /* Functional tokens */
    --bg: var(--gunmetal);
    --bg-soft: var(--panel);
    --bg-muted: #1a262d;
    --border: #2a3a42;
    --border-strong: #3a4d57;
    --text: #f5f5f5;
    --text-muted: var(--steel);
    --text-faint: #5b656a;
    --accent: var(--tiger);
    --accent-soft: #2c1505;
    --radius: 8px;
    --radius-lg: 14px;
    --maxw: 1100px;
    --content-w: 720px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 18px rgba(0, 0, 0, 0.35);
    --sans:
        'Forgis Body', 'Helvetica Now Display', -apple-system, BlinkMacSystemFont, 'Segoe UI',
        system-ui, sans-serif;
    --serif: 'Forgis Title', 'At Aero Retina', 'Times New Roman', Georgia, serif;
    --mono:
        'Forgis Digits', 'PP Fraktion Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

    /* Type scale — exactly three sizes used site-wide.
     Differentiation everywhere else is via weight, color, letter-spacing,
     and case, never via additional sizes. */
    --fs-display: clamp(2.25rem, 5.5vw, 4.25rem);
    --fs-body: 1rem;
    --fs-caption: 0.72rem;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: var(--fs-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    position: relative;
}
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.035;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border-strong);
    transition:
        color 0.15s ease,
        border-color 0.15s ease;
}
a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

p {
    margin: 0 0 1em;
}

h1,
h2,
h3,
h4 {
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0 0 0.5em;
}
h1 {
    font-size: var(--fs-display);
    letter-spacing: -0.035em;
}
h2 {
    font-size: var(--fs-body);
}
h3 {
    font-size: var(--fs-body);
}

code,
pre {
    font-family: var(--mono);
    font-size: var(--fs-body);
}
pre {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
    line-height: 1.5;
}
code:not(pre code) {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.1em 0.35em;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 3rem 0;
}

/* ── Layout ───────────────────────────────────── */

.container {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 1.5rem;
}
.content {
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Header / nav ─────────────────────────────── */

.site-header {
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: saturate(180%) blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    max-width: var(--maxw);
    margin: 0 auto;
}
.brand {
    font-weight: 600;
    letter-spacing: -0.02em;
    font-size: var(--fs-body);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.brand-mark {
    height: 26px;
    width: 26px;
    display: inline-block;
    object-fit: contain;
    filter: invert(1) hue-rotate(180deg);
}
.nav-links {
    display: flex;
    gap: 1.5rem;
    font-size: var(--fs-body);
}
.nav-links a {
    border: none;
    color: var(--text-muted);
}
.nav-links a:hover {
    color: var(--accent);
}

/* ── Hero ─────────────────────────────────────── */

.hero {
    padding: 10rem 0 9rem;
    border-bottom: 1px solid var(--border);
    position: relative;
    isolation: isolate;
    overflow: hidden;
}
.hero .container {
    max-width: var(--maxw);
    position: relative;
    z-index: 1;
}
.hero .container > * {
    opacity: 0;
    animation: fadeUp 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.hero .container > *:nth-child(1) {
    animation-delay: 0.05s;
}
.hero .container > *:nth-child(2) {
    animation-delay: 0.2s;
}
.hero .container > *:nth-child(3) {
    animation-delay: 0.35s;
}
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Single soft accent glow off-centre, replacing the previous
   hairline grid. Quiet, atmospheric, no pattern to compete with the
   typography. */
.hero-glow {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 80% 18%, rgba(255, 90, 0, 0.1), transparent 55%),
        radial-gradient(circle at 10% 90%, rgba(255, 90, 0, 0.04), transparent 60%);
}
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    font-family: var(--mono);
    font-size: var(--fs-caption);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 2.25rem;
}
.hero-eyebrow::before {
    content: '';
    width: 36px;
    height: 1px;
    background: var(--accent);
}
.hero-title {
    font-family: var(--serif);
    font-size: var(--fs-display);
    font-weight: 400;
    margin: 0 0 2.25rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
    max-width: 18ch;
}
.hero-title em {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
    letter-spacing: -0.01em;
    padding-inline-end: 0.12em;
}
.hero-lede {
    font-size: var(--fs-body);
    color: var(--text-muted);
    max-width: 56ch;
    margin: 0;
    line-height: 1.62;
}
@media (prefers-reduced-motion: reduce) {
    .hero .container > * {
        animation: none;
        opacity: 1;
    }
}

/* ── Sections ─────────────────────────────────── */

.section {
    padding: 6rem 0;
    position: relative;
}
.section + .section {
    border-top: 1px solid var(--border);
}
.section-head {
    display: grid;
    grid-template-columns: minmax(60px, auto) 1fr;
    gap: 1.5rem 2.5rem;
    align-items: start;
    margin-bottom: 3rem;
    padding-bottom: 0;
    border-bottom: none;
}
.section-num {
    font-family: var(--mono);
    font-size: var(--fs-body);
    letter-spacing: 0.12em;
    color: var(--accent);
    padding-top: 0.45rem;
    font-weight: 500;
}
.section-eyebrow {
    display: block;
    font-family: var(--mono);
    font-size: var(--fs-caption);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 1rem;
}
.section-head h2 {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(1.65rem, 2.8vw, 2.25rem);
    font-weight: 400;
    letter-spacing: -0.015em;
    text-transform: none;
    line-height: 1.2;
}

/* ── Mission / thesis ─────────────────────────── */

.mission {
    position: relative;
}
.mission .container {
    position: relative;
}
.mission .section-num::after {
    content: '';
    display: block;
    width: 1px;
    height: 2.5rem;
    background: var(--accent);
    margin-top: 1rem;
}
.mission .section-eyebrow {
    color: var(--accent);
}
.mission .section-head h2 {
    font-family: var(--serif);
    font-size: clamp(1.85rem, 3.5vw, 2.75rem);
    font-weight: 400;
    letter-spacing: -0.015em;
    line-height: 1.15;
    margin: 0;
    max-width: 22ch;
}
.mission-body {
    max-width: 720px;
}
.mission-lede {
    font-size: var(--fs-body);
    line-height: 1.6;
    color: var(--text);
    letter-spacing: -0.005em;
    font-weight: 400;
    margin: 0 0 2.25rem;
}
.mission-lede em {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
    font-size: 1.1em;
    padding-inline-end: 0.12em;
}
.mission-body p:not(.mission-lede) {
    position: relative;
    font-family: var(--mono);
    font-size: var(--fs-caption);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    max-width: none;
    margin: 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.mission-body p:not(.mission-lede)::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 1px;
    background: var(--accent);
    vertical-align: middle;
    margin-right: 0.85rem;
    position: relative;
    top: -2px;
}

/* ── Project grid ─────────────────────────────── */

.projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}
.project-card {
    display: flex;
    flex-direction: column;
    padding: 1.75rem 1.75rem 1.5rem;
    min-height: 280px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-soft);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(24px);
    transition:
        transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1),
        opacity 0.5s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}
.project-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .project-card {
        opacity: 1;
        transform: none;
    }
}
.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 36px;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.project-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    color: inherit;
}
.project-card:hover::after {
    transform: scaleX(4);
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--mono);
    font-size: var(--fs-caption);
    color: var(--text-faint);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}
.project-meta span:last-child {
    color: var(--text-muted);
    padding: 0.18rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: var(--fs-caption);
}
.project-card h3 {
    font-size: var(--fs-body);
    font-weight: 700;
    margin: 0 0 0.65rem;
    letter-spacing: -0.01em;
}
.project-card p {
    color: var(--text-muted);
    font-size: var(--fs-body);
    line-height: 1.55;
    margin: 0 0 1.5rem;
    flex-grow: 1;
}
.project-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
}
.project-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.card-arrow {
    font-family: var(--mono);
    font-size: var(--fs-caption);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: gap 0.25s ease;
}
.project-card:hover .card-arrow {
    gap: 0.7rem;
}
.tag {
    font-family: var(--mono);
    font-size: var(--fs-caption);
    padding: 0.22rem 0.6rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.tag::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.7;
}
.tag.tag-paper {
    color: #93c5fd;
    background: #0f1a30;
    border-color: #1c2c4d;
}
.tag.tag-code {
    color: #86efac;
    background: #0d1f17;
    border-color: #18402a;
}
.tag.tag-hf {
    color: #fbbf24;
    background: #251a06;
    border-color: #3d2c0e;
}

/* ── Project page ─────────────────────────────── */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--mono);
    font-size: var(--fs-body);
    color: var(--text-muted);
    border: none;
    margin-bottom: 2rem;
}
.back-link:hover {
    color: var(--accent);
}

.project-header {
    padding: 5rem 0 3rem;
}
.project-eyebrow {
    font-family: var(--mono);
    font-size: var(--fs-caption);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}
.project-title {
    font-family: var(--serif);
    font-size: var(--fs-display);
    font-weight: 400;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.project-tagline {
    font-size: var(--fs-body);
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 0 2rem;
}
.project-authors {
    font-size: var(--fs-body);
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}
.project-authors em {
    font-style: normal;
    color: var(--text);
}

/* ── Action buttons (Paper / Code / HF) ───────── */

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 2rem 0 0;
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--bg);
    color: var(--text);
    font-size: var(--fs-body);
    font-weight: 500;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}
.btn:hover {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}
.btn-primary {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}
.btn-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn svg {
    width: 16px;
    height: 16px;
}
.btn[aria-disabled='true'],
.btn-primary[aria-disabled='true'] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background: var(--bg);
    color: var(--text);
    border-color: var(--border-strong);
}

/* ── Project body / sections ──────────────────── */

.project-body {
    padding: 2rem 0 6rem;
}
.project-body h2 {
    margin-top: 3rem;
    font-size: clamp(1.4rem, 2.4vw, 1.85rem);
    font-weight: 700;
    text-transform: none;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.project-body h2:first-child {
    margin-top: 0;
}
.project-body figure {
    margin: 2rem 0;
    text-align: center;
}
.project-body figure img {
    max-width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.project-body figcaption {
    font-size: var(--fs-body);
    color: var(--text-muted);
    margin-top: 0.6rem;
}
.callout {
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    padding: 1rem 1.25rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 1.5rem 0;
    color: var(--text);
}

/* ── Citation block ───────────────────────────── */

.citation {
    margin-top: 3rem;
}
.citation pre {
    font-size: var(--fs-body);
}

/* ── Contact form ─────────────────────────────── */

.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
}
@media (max-width: 760px) {
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1.25rem;
    margin: 0;
}
.contact-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.contact-field--full {
    grid-column: 1 / -1;
}
.contact-label {
    font-family: var(--mono);
    font-size: var(--fs-caption);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-faint);
}
.contact-form input,
.contact-form select,
.contact-form textarea {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    background: var(--bg-soft);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-family: var(--sans);
    font-size: var(--fs-body);
    line-height: 1.4;
    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--text-faint);
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg);
}
.contact-form textarea {
    resize: vertical;
    min-height: 7rem;
    font-family: var(--sans);
}
.contact-form select {
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 12px) 50%;
    background-size: 6px 6px;
    background-repeat: no-repeat;
    padding-right: 2rem;
    cursor: pointer;
}
.contact-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}
.contact-form .btn {
    cursor: pointer;
}
.contact-form .btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}
.contact-form .btn:hover svg {
    transform: translateX(3px);
}
.contact-status {
    font-family: var(--mono);
    font-size: var(--fs-caption);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-faint);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.contact-status.is-active {
    opacity: 1;
    color: var(--accent);
}

.contact-aside {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    border-left: 1px solid var(--border);
    padding-left: 2rem;
}
@media (max-width: 760px) {
    .contact-aside {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--border);
        padding-top: 2rem;
    }
}
.contact-aside-block {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.contact-aside-label {
    font-family: var(--mono);
    font-size: var(--fs-caption);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
}
.contact-aside-link {
    font-family: var(--mono);
    font-size: var(--fs-body);
    color: var(--text);
    border: none;
    transition: color 0.2s ease;
    word-break: break-word;
}
.contact-aside-link:hover {
    color: var(--accent);
}
.contact-aside-text {
    margin: 0;
    font-size: var(--fs-body);
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 36ch;
}

@media (max-width: 540px) {
    .contact-form {
        grid-template-columns: 1fr;
    }
}

/* ── Footer ───────────────────────────────────── */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 4rem 0 2.5rem;
    font-size: var(--fs-body);
    color: var(--text-muted);
    margin-top: 4rem;
}
.site-footer .container {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 3rem;
    align-items: start;
}
.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.footer-brand .brand {
    font-size: var(--fs-body);
    margin-bottom: 0.25rem;
}
.footer-brand p {
    margin: 0;
    font-size: var(--fs-body);
    color: var(--text-muted);
    max-width: 32ch;
    line-height: 1.55;
}
.footer-col h4 {
    font-family: var(--mono);
    font-size: var(--fs-caption);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-faint);
    font-weight: 500;
    margin: 0 0 1rem;
}
.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.footer-col a {
    color: var(--text-muted);
    border: none;
    font-size: var(--fs-body);
    display: inline-block;
    transition:
        color 0.2s ease,
        transform 0.2s ease;
}
.footer-col a:hover {
    color: var(--accent);
    transform: translateX(2px);
}
.footer-connect a {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}
.footer-connect a svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}
.footer-connect a:hover svg {
    opacity: 1;
}
.site-footer .footer-bottom {
    grid-column: 1 / -1;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--fs-body);
    color: var(--text-faint);
    font-family: var(--mono);
    letter-spacing: 0.05em;
}
.site-footer a {
    color: var(--text-muted);
    border: none;
}
.site-footer a:hover {
    color: var(--accent);
}
@media (max-width: 700px) {
    .site-footer .container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .site-footer .footer-bottom {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

/* ── Team grid ────────────────────────────────── */

.team-grid {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
    gap: 0.85rem;
    max-width: 940px;
    margin: 0 auto;
}
.team-member {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    opacity: 0;
    transform: translateY(18px);
    transition:
        opacity 0.55s ease,
        transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1),
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}
.team-member.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.team-member:hover,
.team-member:focus-within {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow:
        0 14px 28px rgba(0, 0, 0, 0.32),
        0 0 0 1px rgba(255, 90, 0, 0.08) inset;
}
.team-photo {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--bg-muted);
}
.team-photo::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 35%;
    background: linear-gradient(180deg, transparent 0%, rgba(18, 33, 40, 0.85) 100%);
    opacity: 0.8;
    transition: opacity 0.35s ease;
    pointer-events: none;
}
.team-member:hover .team-photo::after,
.team-member:focus-within .team-photo::after {
    opacity: 1;
}
.team-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(0.25) contrast(1.02);
    transition:
        filter 0.45s ease,
        transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.team-member:hover .team-photo img,
.team-member:focus-within .team-photo img {
    filter: grayscale(0) contrast(1.04) saturate(1.05);
    transform: scale(1.05);
}
.team-index {
    position: absolute;
    top: 0.65rem;
    left: 0.7rem;
    z-index: 2;
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    color: var(--text-faint);
    background: rgba(18, 33, 40, 0.6);
    backdrop-filter: blur(8px);
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    transition:
        color 0.25s ease,
        border-color 0.25s ease;
}
.team-member:hover .team-index,
.team-member:focus-within .team-index {
    color: var(--accent);
    border-color: var(--accent);
}
.team-info {
    position: relative;
    padding: 0.7rem 0.8rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}
.team-name {
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.team-role,
.team-link {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    min-width: 0;
}
.team-role {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.35;
    letter-spacing: -0.005em;
}
.team-role span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.team-logo {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    margin-top: 0.2em;
    object-fit: contain;
    border: none;
    border-radius: 3px;
    background: var(--bg-soft);
    filter: grayscale(1) contrast(1.05);
}
.team-link {
    margin-top: auto;
    padding-top: 0.4rem;
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.02em;
    color: var(--text-faint);
    border: none;
    transition: color 0.2s ease;
}
.team-link span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.team-link::before {
    content: '';
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    margin-top: 0.18em;
    background-color: currentColor;
    opacity: 0.75;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'><path d='M20.45 20.45h-3.55v-5.57c0-1.33-.03-3.04-1.85-3.04-1.86 0-2.14 1.45-2.14 2.95v5.66H9.36V9h3.41v1.56h.05c.47-.9 1.64-1.85 3.37-1.85 3.6 0 4.27 2.37 4.27 5.46v6.28zM5.34 7.43a2.06 2.06 0 1 1 0-4.12 2.06 2.06 0 0 1 0 4.12zM7.12 20.45H3.56V9h3.56v11.45zM22.22 0H1.77C.79 0 0 .77 0 1.72v20.56C0 23.23.79 24 1.77 24h20.45c.98 0 1.78-.77 1.78-1.72V1.72C24 .77 23.2 0 22.22 0z'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'><path d='M20.45 20.45h-3.55v-5.57c0-1.33-.03-3.04-1.85-3.04-1.86 0-2.14 1.45-2.14 2.95v5.66H9.36V9h3.41v1.56h.05c.47-.9 1.64-1.85 3.37-1.85 3.6 0 4.27 2.37 4.27 5.46v6.28zM5.34 7.43a2.06 2.06 0 1 1 0-4.12 2.06 2.06 0 0 1 0 4.12zM7.12 20.45H3.56V9h3.56v11.45zM22.22 0H1.77C.79 0 0 .77 0 1.72v20.56C0 23.23.79 24 1.77 24h20.45c.98 0 1.78-.77 1.78-1.72V1.72C24 .77 23.2 0 22.22 0z'/></svg>");
}
.team-link:hover {
    color: var(--accent);
}
.team-link:hover::before {
    opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
    .team-member {
        opacity: 1;
        transform: none;
    }
    .team-member:hover,
    .team-member:focus-within {
        transform: none;
    }
}

/* ── Collaborators (horizontal marquee) ───────── */

.collab-marquee {
    position: relative;
    overflow: hidden;
    padding: 2.25rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}
.collab-track {
    display: flex;
    align-items: center;
    gap: 3.25rem;
    width: max-content;
    animation: collab-marquee 70s linear infinite;
}
.collab-marquee:hover .collab-track,
.collab-marquee:focus-within .collab-track {
    animation-play-state: paused;
}
@keyframes collab-marquee {
    to {
        transform: translate3d(-50%, 0, 0);
    }
}
.collab-item {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    flex-shrink: 0;
}
.collab-item img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
    filter: grayscale(1) contrast(1.05) brightness(1.1);
}
.collab-item span {
    font-family: var(--mono);
    font-size: var(--fs-caption);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
    transition: color 0.3s ease;
}
.collab-item:hover span {
    color: var(--text);
}
@media (prefers-reduced-motion: reduce) {
    .collab-track {
        animation: none;
    }
}

/* ── Join section (Write your thesis with us) ─── */

.join-section {
    position: relative;
}
.join-section .section-num::after {
    content: '';
    display: block;
    width: 1px;
    height: 2.5rem;
    background: var(--accent);
    margin-top: 1rem;
}
.join-section .section-eyebrow {
    color: var(--accent);
}
.join-title {
    font-family: var(--serif);
    font-size: clamp(1.85rem, 3.5vw, 2.75rem);
    font-weight: 400;
    letter-spacing: -0.015em;
    line-height: 1.15;
    margin: 0;
    max-width: 22ch;
}
.join-body {
    max-width: 720px;
}
.join-lede {
    font-size: var(--fs-body);
    color: var(--text);
    margin: 0 0 2.25rem;
    line-height: 1.6;
    max-width: 56ch;
}
.join-actions {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    flex-wrap: wrap;
}
.join-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.25rem;
    font-family: var(--sans);
    font-size: var(--fs-body);
    font-weight: 600;
    letter-spacing: -0.005em;
    border-radius: 999px;
    text-transform: none;
}
.join-cta-button svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}
.join-cta-button:hover svg {
    transform: translateX(4px);
}
.join-secondary {
    font-family: var(--mono);
    font-size: var(--fs-caption);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    border: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}
.join-secondary:hover {
    color: var(--accent);
}

/* ── Responsive tweaks ────────────────────────── */

@media (max-width: 600px) {
    .hero {
        padding: 4rem 0 3rem;
    }
    .section {
        padding: 3rem 0;
    }
    .project-header {
        padding: 3rem 0 2rem;
    }
    .nav {
        padding: 0.85rem 1.25rem;
    }
    .nav-links {
        gap: 1rem;
    }
}
