:root {
    --paper: #f8f5f7;
    --paper-strong: #ffffff;
    --ink: #16232b;
    --muted: #2b3a40;
    --coral: #e96878;
    --coral-dark: #a94158;
    --teal: #5bc4c7;
    --teal-dark: #146e74;
    --amber: #f1b84c;
    --blue: #4b8fb8;
    --space: #07131e;
    --space-soft: #0c2130;
    --space-ink: #e9f7f7;
    --line: rgba(22, 35, 43, 0.16);
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html {
    scroll-behavior: smooth;
}

@media (min-width: 701px) {
    html { scrollbar-gutter: stable; }
}

body {
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background: var(--paper-strong);
}

body.menu-open { overflow: hidden; }

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

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
    font: inherit;
}

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

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 3000;
    padding: 10px 14px;
    color: #ffffff;
    background: var(--coral-dark);
    transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

/* Shared loader presentation: a2p-loader.css. */

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    width: 100%;
    height: 76px;
    color: var(--space-ink);
    background: rgba(7, 19, 30, 0.86);
    border-bottom: 1px solid rgba(233, 247, 247, 0.12);
    backdrop-filter: blur(16px);
}

.nav-inner {
    width: min(1380px, calc(100% - 48px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: max-content;
    font-size: 18px;
    font-weight: 850;
}

.brand-mark {
    display: block;
    width: 76px;
    height: 60px;
    flex: 0 0 auto;
    object-fit: cover;
    object-position: center;
    filter: brightness(0.88) saturate(0.94) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.24));
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.nav-links > a,
.nav-group > button {
    min-height: 46px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    font-weight: 760;
    line-height: 1.4;
}

.nav-group > button::after {
    content: "";
    width: 6px;
    height: 6px;
    margin-left: 8px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.2s ease;
}

.nav-group.is-open > button::after {
    transform: translateY(2px) rotate(225deg);
}

.nav-links > a:hover,
.nav-links > a:focus-visible,
.nav-group > button:hover,
.nav-group > button:focus-visible,
.nav-group.current-section > button,
.nav-links [aria-current="page"] {
    border-bottom-color: var(--coral);
}

.nav-group { position: relative; }

.nav-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 250px;
    padding: 9px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--line);
    box-shadow: 0 18px 50px rgba(7, 19, 30, 0.16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.nav-menu-right {
    right: 0;
    left: auto;
}

.nav-menu a {
    min-height: 44px;
    padding: 8px 11px;
    display: flex;
    align-items: center;
    border-left: 2px solid transparent;
    font-size: 17px;
    font-weight: 680;
    line-height: 1.4;
}

.nav-menu a:hover,
.nav-menu a:focus-visible,
.nav-menu a[aria-current="page"] {
    color: var(--coral-dark);
    background: rgba(233, 104, 120, 0.08);
    border-left-color: var(--coral);
}

.nav-group.is-open .nav-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-cta {
    margin-left: 6px;
    color: #ffffff;
    background: var(--coral) !important;
    border: 0 !important;
}

.nav-cta:hover,
.nav-cta:focus-visible,
.nav-cta[aria-current="page"] {
    background: var(--coral-dark) !important;
}

.menu-toggle {
    width: 44px;
    height: 44px;
    padding: 0;
    display: none;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 23px;
    height: 2px;
    margin: 5px auto;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.page-hero {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    color: var(--space-ink);
    background-color: var(--space);
    background-image: url("https://static.igem.wiki/teams/6055/wiki/assets/inner-hero.avif");
    background-size: cover;
    background-position: 50% 48%;
}

.page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(3, 8, 20, 0.58);
}

.page-hero-inner {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 150px 0 64px;
}

.hero-kicker,
.section-kicker {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    color: var(--teal);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.hero-kicker::before,
.section-kicker::before {
    content: "";
    width: 34px;
    height: 2px;
    background: currentColor;
}

.page-hero h1 {
    max-width: 900px;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 72px;
    font-weight: 550;
    line-height: 0.98;
}

.page-hero .lead {
    max-width: 680px;
    margin: 24px 0 0;
    color: rgba(233, 247, 247, 0.76);
    font-size: 18px;
    line-height: 1.7;
}

.page-main {
    min-height: 50vh;
    background: var(--paper-strong);
}

.content-band {
    padding: 96px 0 110px;
}

.content-layout {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 72px;
}

.section-index {
    padding-top: 4px;
    border-top: 2px solid var(--ink);
}

.section-index strong {
    display: block;
    margin-top: 14px;
    color: var(--coral);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 52px;
    font-weight: 500;
    line-height: 1;
}

.section-index span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
}

.article-flow {
    max-width: 850px;
}

.article-flow h2,
.group-heading h2,
.directory-heading h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 48px;
    font-weight: 550;
    line-height: 1.05;
}

.article-flow > p:not(.section-kicker),
.group-heading p,
.directory-heading p {
    max-width: 760px;
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.8;
}

.detail-list {
    margin: 50px 0 0;
    border-top: 1px solid var(--line);
}

.detail-row {
    padding: 24px 0;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 28px;
    border-bottom: 1px solid var(--line);
}

.detail-row strong {
    color: var(--teal-dark);
    font-size: 13px;
    text-transform: uppercase;
}

.detail-row p {
    margin: 0;
    color: var(--ink);
    line-height: 1.7;
}

.related-band {
    padding: 72px 0 84px;
    background: var(--paper);
}

.related-inner {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
}

.related-inner h2 {
    margin: 0 0 34px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 34px;
    font-weight: 550;
}

.related-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.related-link {
    min-height: 86px;
    padding: 18px 2px 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    border-top: 2px solid var(--ink);
    font-weight: 800;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.related-link span:last-child {
    color: var(--coral);
    font-size: 20px;
}

.related-link:hover,
.related-link:focus-visible {
    color: var(--coral-dark);
    border-top-color: var(--coral);
}

.directory-band,
.team-band {
    padding: 96px 0 112px;
}

.directory-inner,
.team-inner {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
}

.directory-grid {
    margin-top: 56px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 54px 40px;
}

.directory-group {
    padding-top: 18px;
    border-top: 2px solid var(--ink);
}

.directory-group h3 {
    margin: 0 0 14px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 28px;
    font-weight: 550;
}

.directory-group a {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    border-bottom: 1px solid rgba(22, 35, 43, 0.09);
    font-size: 14px;
    font-weight: 680;
}

.directory-group a::after {
    content: "\2197";
    color: var(--coral);
}

.directory-group a:hover,
.directory-group a:focus-visible { color: var(--coral-dark); }

.team-group + .team-group { margin-top: 96px; }

.group-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 440px);
    align-items: end;
    gap: 60px;
}

.member-grid {
    margin-top: 48px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.member-card {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.member-portrait {
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--paper);
}

.member-portrait img {
    width: 62%;
    height: 62%;
    object-fit: contain;
    transition: transform 0.45s cubic-bezier(0.16, 0.8, 0.24, 1);
}

.member-card:hover .member-portrait img { transform: scale(1.045); }

.member-copy { padding: 22px; }

.member-copy .role {
    margin: 0 0 8px;
    color: var(--teal-dark);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.member-copy h3 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 25px;
    font-weight: 550;
}

.member-copy p {
    margin: 13px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.site-footer {
    color: rgba(233, 247, 247, 0.72);
    background: var(--space);
}

.footer-inner {
    width: min(1180px, calc(100% - 48px));
    min-height: 150px;
    margin: 0 auto;
    padding: 36px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.footer-inner p {
    margin: 0;
    font-size: 13px;
    line-height: 1.7;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--space-ink);
    flex-shrink: 0;
}

.footer-brand img {
    width: 50px;
    height: 62px;
    object-fit: contain;
}

.footer-brand span { color: var(--coral); }

.back-to-top {
    position: fixed;
    right: 18px;
    bottom: 20px;
    z-index: 90;
    padding: 8px;
    border-radius: 12px;
    background: var(--paper-strong);
    box-shadow: 0 4px 18px rgba(7, 19, 30, 0.16);
}

.back-to-top img {
    width: 34px;
    height: 40px;
    object-fit: contain;
}

.footer-brand:focus-visible,
.back-to-top:focus-visible {
    outline: 2px solid var(--coral);
    outline-offset: 4px;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 24px;
    color: var(--space-ink);
    font-size: 13px;
    font-weight: 780;
}

.footer-links a:hover,
.footer-links a:focus-visible { color: var(--coral); }

.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1080px) {
    .page-hero h1 { font-size: 62px; }
    .content-layout { gap: 50px; }
    .member-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1200px) {
    .site-nav { height: 68px; }
    .menu-toggle { display: block; }
    .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .nav-links {
        position: absolute;
        top: 68px;
        right: 0;
        bottom: auto;
        width: min(360px, 100%);
        height: calc(100vh - 68px);
        height: calc(100dvh - 68px);
        padding: 24px;
        display: block;
        overflow-y: auto;
        color: var(--ink);
        background: #ffffff;
        transform: translateX(100%);
        transition: transform 0.25s ease;
    }

    .nav-links.is-open { transform: translateX(0); }

    .nav-links > a,
    .nav-group > button {
        width: 100%;
        min-height: 50px;
        padding: 0;
        justify-content: space-between;
        border-bottom: 1px solid var(--line);
    }

    .nav-cta {
        margin: 20px 0 0;
        padding: 0 14px !important;
        justify-content: center !important;
    }

    .nav-menu {
        position: static;
        display: none;
        min-width: 0;
        padding: 4px 0 10px 14px;
        border: 0;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .nav-group.is-open .nav-menu { display: block; }

}

@media (max-width: 960px) {
    .page-hero { min-height: 470px; }
    .page-hero h1 { font-size: 56px; }
    .content-layout { grid-template-columns: 110px minmax(0, 1fr); gap: 36px; }
    .directory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .related-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .nav-inner { width: calc(100% - 28px); }
    .brand { font-size: 16px; }
    .brand-mark { width: 68px; height: 54px; }
    .page-hero {
        min-height: 430px;
        background-position: 52% 50%;
    }

    .page-hero-inner {
        width: calc(100% - 36px);
        padding: 126px 0 48px;
    }

    .page-hero h1 { font-size: 46px; line-height: 1; }
    .page-hero .lead { margin-top: 18px; font-size: 16px; line-height: 1.6; }
    .hero-kicker { margin-bottom: 14px; font-size: 11px; }

    .content-band,
    .directory-band,
    .team-band { padding: 72px 0 82px; }

    .content-layout,
    .directory-inner,
    .team-inner,
    .related-inner,
    .footer-inner {
        width: calc(100% - 36px);
    }

    .content-layout { grid-template-columns: 1fr; gap: 32px; }
    .section-index { display: flex; align-items: baseline; gap: 14px; }
    .section-index strong { margin-top: 12px; font-size: 42px; }
    .section-index span { margin-top: 0; }
    .article-flow h2,
    .group-heading h2,
    .directory-heading h2 { font-size: 38px; }
    .article-flow > p:not(.section-kicker),
    .group-heading p,
    .directory-heading p { font-size: 16px; line-height: 1.7; }

    .detail-list { margin-top: 38px; }
    .detail-row { grid-template-columns: 1fr; gap: 9px; padding: 20px 0; }
    .related-band { padding: 58px 0 68px; }
    .related-links { grid-template-columns: 1fr; gap: 18px; }
    .directory-grid { grid-template-columns: 1fr; gap: 38px; margin-top: 42px; }
    .group-heading { grid-template-columns: 1fr; gap: 12px; }
    .member-grid { grid-template-columns: 1fr; margin-top: 34px; }
    .team-group + .team-group { margin-top: 72px; }
    .footer-inner { align-items: flex-start; flex-direction: column; }
    .footer-links { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
