.species-page { --species-radius: 20px; }

.species-hero { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr); min-height: 500px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--species-radius); background: var(--surface); box-shadow: var(--shadow); }
.species-hero__media { position: relative; min-width: 0; background: var(--wash); }
.species-hero__media .thumbnail { position: absolute; inset: 0; border: 0; border-radius: 0; background: var(--wash); }
.species-hero__media .thumbnail > a { height: 100%; }
.species-hero__media .thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.species-hero__media .caption { position: absolute; right: 1rem; bottom: 1rem; border: 1px solid #ffffff26; border-radius: 999px; background: #14251dcc; padding: .4rem .75rem; color: #e9eee8; font-size: .6rem; line-height: 1.3; backdrop-filter: blur(8px); }
.species-hero__media .caption a { color: #fff; }
.species-hero__placeholder { display: grid; min-height: 420px; place-items: center; background: radial-gradient(circle at 50% 45%, var(--surface), var(--wash) 68%); color: var(--line-strong); }
.species-hero__placeholder-icon { width: 96px; height: 96px; stroke-width: 1; }
.species-hero__identity { display: flex; min-width: 0; flex-direction: column; justify-content: center; padding: clamp(2.5rem, 5vw, 4.8rem); }
.species-hero__identity h1 { margin-top: 1.3rem; font-family: var(--font-display); font-size: clamp(3.5rem, 6vw, 5.8rem); font-weight: 400; letter-spacing: -.04em; line-height: .96; overflow-wrap: anywhere; }
.species-hero__identity h2 { margin-top: 1rem; color: var(--muted); font-family: var(--font-display); font-size: clamp(1.25rem, 2vw, 1.7rem); font-style: italic; font-weight: 400; line-height: 1.3; }
.species-aliases { display: grid; gap: .2rem; margin-top: 1.6rem; color: var(--ink-soft); font-size: .82rem; line-height: 1.6; }
.species-aliases span { color: var(--muted); font-size: .57rem; font-weight: 650; letter-spacing: .15em; text-transform: uppercase; }
.species-hero__song { margin-top: 2rem; }
.species-song-button { display: flex; width: 100%; min-height: 66px; align-items: center; gap: .8rem; border: 1px solid transparent; border-radius: 11px; background: var(--accent); padding: .65rem 1rem; color: var(--accent-ink); text-align: left; transition: background .18s, transform .18s; }
.species-song-button:hover { background: var(--accent-hover); color: var(--accent-ink); transform: translateY(-1px); }
.species-song-button__icon { display: grid; width: 38px; height: 38px; flex-shrink: 0; place-items: center; border: 1px solid color-mix(in srgb, var(--accent-ink) 18%, transparent); border-radius: 50%; background: color-mix(in srgb, var(--accent-ink) 10%, transparent); }
.species-song-button__copy { display: grid; }
.species-song-button small { color: color-mix(in srgb, var(--accent-ink) 68%, transparent); font-size: .55rem; letter-spacing: .13em; line-height: 1.3; text-transform: uppercase; }
.species-song-button strong { font-size: .84rem; font-weight: 700; line-height: 1.5; }
.species-song-button__wave { display: flex; height: 26px; align-items: center; gap: 3px; margin-left: auto; opacity: .48; }
.species-song-button__wave i { width: 2px; height: 35%; border-radius: 999px; background: currentColor; }
.species-song-button__wave i:nth-child(2), .species-song-button__wave i:nth-child(4) { height: 70%; }
.species-song-button__wave i:nth-child(3) { height: 100%; }
.species-song-button[data-status="playing"] .species-song-button__wave i { animation: species-song-wave .7s ease-in-out infinite alternate; }
.species-song-button[data-status="playing"] .species-song-button__wave i:nth-child(2) { animation-delay: -.2s; }
.species-song-button[data-status="playing"] .species-song-button__wave i:nth-child(3) { animation-delay: -.4s; }
.species-song-button[data-status="playing"] .species-song-button__wave i:nth-child(4) { animation-delay: -.1s; }
.species-song-button[data-status="playing"] .species-song-button__wave i:nth-child(5) { animation-delay: -.3s; }

.species-hero__explore { margin-top: 1.35rem; }
.species-hero__explore-label { display: block; margin-bottom: .7rem; color: var(--muted); font-size: .58rem; font-weight: 650; letter-spacing: .15em; text-transform: uppercase; white-space: nowrap; }
.species-hero__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.species-hero__action { display: flex; min-width: 0; height: 58px; align-items: center; gap: .7rem; border: 1px solid var(--line-strong); border-radius: 10px; background: transparent; padding: .55rem .8rem; color: var(--ink); text-align: left; text-decoration: none; transition: border-color .18s, background .18s, transform .18s; }
.species-hero__action:hover { border-color: var(--accent); background: var(--wash); color: var(--ink); transform: translateY(-1px); }
.species-hero__action-icon { display: grid; width: 34px; height: 34px; flex-shrink: 0; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.species-hero__action > span:last-child { display: grid; min-width: 0; }
.species-hero__action small { overflow: hidden; color: var(--muted); font-size: .52rem; letter-spacing: .1em; line-height: 1.3; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.species-hero__action strong { overflow: hidden; font-size: .75rem; font-weight: 650; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }

.species-sticky-header { position: fixed; z-index: 50; top: 0; right: 0; left: 0; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: 0 12px 32px #07110b1a; opacity: 0; pointer-events: none; transform: translateY(-100%); transition: opacity .2s ease, transform .25s ease; backdrop-filter: blur(14px); }
.species-sticky-header.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.species-sticky-header__inner { display: flex; min-height: 68px; align-items: center; gap: .85rem; color: var(--ink); text-decoration: none; }
.species-sticky-header__inner:hover { color: var(--ink); }
.species-sticky-header__inner img, .species-sticky-header__placeholder { width: 40px; height: 40px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--wash); object-fit: cover; }
.species-sticky-header__placeholder { display: grid; place-items: center; color: var(--muted); }
.species-sticky-header__name { display: flex; min-width: 0; flex: 1; align-items: baseline; gap: .75rem; }
.species-sticky-header__name strong { overflow: hidden; font-family: var(--font-display); font-size: 1.45rem; font-weight: 400; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.species-sticky-header__name em { overflow: hidden; color: var(--muted); font-family: var(--font-display); font-size: .82rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.species-sticky-header__return { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .62rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; }

.species-layout { display: grid; grid-template-columns: minmax(0, 1fr) 245px; align-items: start; gap: clamp(2.5rem, 5vw, 5rem); margin-top: 3.5rem; }
.species-content { min-width: 0; }
.species-section { scroll-margin-top: 5.5rem; }
.species-section + .species-section { margin-top: 5rem; }
.species-section__heading { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
.species-section__heading .eyebrow { margin-bottom: .45rem; }
.species-section__heading h2 { font-family: var(--font-display); font-size: clamp(2.3rem, 4vw, 3.2rem); font-weight: 400; letter-spacing: -.02em; line-height: 1.05; }
.species-section__icon { width: 28px; height: 28px; margin-bottom: .25rem; color: var(--muted); stroke-width: 1.4; }
.species-section__count { margin-bottom: .25rem; color: var(--muted); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.species-notes { max-width: 760px; font-size: 1.03rem; line-height: 1.9; }
.species-notes > p:first-child { color: var(--ink); font-size: 1.15rem; }

.species-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.species-gallery .thumbnail { height: 100%; }
.species-gallery .thumbnail img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.species-gallery .caption { border-top: 1px solid var(--line); background: var(--surface); }

.species-videos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.species-video-card { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.species-video-card__image { position: relative; display: block; aspect-ratio: 16 / 10; background-position: center; background-size: cover; }
.species-video-card__image::after { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, #10201980); content: ""; }
.species-video-card__play { position: absolute; z-index: 1; left: 1rem; bottom: 1rem; display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid #ffffff70; border-radius: 50%; background: #f8f7f2e8; color: #263d32; }
.species-video-card__body { padding: 1rem; }
.species-video-card__body p { color: var(--ink); font-family: var(--font-display); font-size: 1.25rem; line-height: 1.3; }
.species-video-card__body small { display: block; margin-top: .4rem; color: var(--muted); font-size: .65rem; }
.species-video-card__body small a { color: inherit; }

.species-related { min-width: 0; }
.species-related__inner { position: sticky; top: 1.5rem; }
.species-related h2 { margin-block: .45rem 1rem; font-family: var(--font-display); font-size: 1.8rem; font-weight: 400; line-height: 1.1; }
.species-related__list { display: grid; border-top: 1px solid var(--line); }
.species-related__list > a { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: .75rem; border-bottom: 1px solid var(--line); padding-block: .75rem; color: var(--ink); text-decoration: none; }
.species-related__list > a:hover { color: var(--accent); }
.species-related img { width: 48px; height: 48px; border-radius: 50%; background: var(--wash); object-fit: cover; }
.species-related__list span { display: grid; min-width: 0; }
.species-related__list strong { font-size: .75rem; font-weight: 650; line-height: 1.35; }
.species-related__list em { overflow: hidden; margin-top: .12rem; color: var(--ink-soft); font-family: var(--font-sans); font-size: .76rem; font-style: italic; font-weight: 500; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.species-related__list svg { color: var(--muted); }

.species-section .distribution-map { margin-bottom: 0; }

.species-advisor-rules { margin-top: 2.5rem; border-block: 1px solid var(--line); }
.species-advisor-rules > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; align-items: center; gap: 1rem; padding: 1rem 0; color: var(--ink); cursor: pointer; list-style: none; }
.species-advisor-rules > summary::-webkit-details-marker, .species-advisor-rule > summary::-webkit-details-marker { display: none; }
.species-advisor-rules__title { display: grid; gap: .12rem; }
.species-advisor-rules__title small { color: var(--muted); font-size: .62rem; font-weight: 650; letter-spacing: .12em; line-height: 1.4; text-transform: uppercase; }
.species-advisor-rules__title strong { font-size: .95rem; font-weight: 650; line-height: 1.4; }
.species-advisor-rules__count { color: var(--muted); font-size: .74rem; letter-spacing: .03em; white-space: nowrap; }
.species-advisor-rules__count i, .species-advisor-rule > summary i { padding-inline: .25rem; font-style: normal; }
.species-advisor-rules__chevron { display: block; width: 18px; height: 18px; place-self: center; color: var(--muted); stroke-width: 1.75; transition: transform .18s ease; }
.species-advisor-rules[open] > summary .species-advisor-rules__chevron { transform: rotate(180deg); }
.species-advisor-rules__body { padding: .35rem 0 1.5rem; }
.species-advisor-rules__body > p { max-width: 630px; color: var(--muted); font-size: .84rem; line-height: 1.65; }
.species-advisor-rule-sets { display: grid; gap: .65rem; margin-top: .85rem; }
.species-advisor-rule-set { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.species-advisor-rule-set > header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; background: color-mix(in srgb, var(--wash) 45%, var(--surface)); padding: .7rem 1rem; }
#main-content .species-advisor-rule-set > header h3 { margin: 0; border: 0; padding: 0; font-family: var(--font-display); font-size: 1.3rem; font-weight: 400; letter-spacing: -.01em; line-height: 1.15; }
.species-advisor-rule-set > header span { color: var(--muted); font-size: .67rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.species-advisor-rule-list { border-top: 1px solid var(--line); }
.species-advisor-rule + .species-advisor-rule { border-top: 1px solid var(--line); }
.species-advisor-rule > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 14px; align-items: center; gap: .75rem; padding: .7rem .9rem; cursor: pointer; list-style: none; }
.species-advisor-rule > summary:hover { background: var(--wash); }
.species-advisor-rule > summary strong { font-size: .8rem; font-weight: 650; }
.species-advisor-rule > summary span { color: var(--muted); font-size: .7rem; }
.species-advisor-rule > summary span:last-child { font-size: .9rem; text-align: center; transition: transform .18s ease; }
.species-advisor-rule[open] > summary span:last-child { transform: rotate(45deg); }
.species-advisor-rule__body { border-top: 1px solid var(--line); background: var(--wash); padding: .8rem 1rem 1rem; }
.species-advisor-rule__body dl { display: grid; gap: 0; }
.species-advisor-rule__body dl > div { display: grid; grid-template-columns: minmax(150px, .48fr) minmax(0, 1fr); gap: 1rem; border-bottom: 1px solid var(--line); padding: .48rem 0; }
.species-advisor-rule__body dt { color: var(--ink-soft); font-size: .75rem; font-weight: 650; line-height: 1.5; }
.species-advisor-rule__body dd { color: var(--muted); font-size: .75rem; line-height: 1.5; }
.species-advisor-rule__body footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; margin-top: .8rem; color: var(--muted); font-size: .64rem; line-height: 1.5; }
.species-advisor-rule__body code { color: var(--ink-soft); overflow-wrap: anywhere; }

@keyframes species-song-wave {
    from { transform: scaleY(.45); }
    to { transform: scaleY(1); }
}

@media (max-width: 1000px) {
    .species-hero { grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr); min-height: 440px; }
    .species-hero__identity { padding: 2.5rem; }
    .species-hero__identity h1 { font-size: clamp(3.2rem, 7vw, 4.7rem); }
    .species-layout { grid-template-columns: minmax(0, 1fr) 210px; gap: 2.5rem; }
}

@media (max-width: 760px) {
    .species-hero { grid-template-columns: 1fr; }
    .species-hero__media { min-height: auto; aspect-ratio: 4 / 3; }
    .species-hero__identity { padding: 2.25rem; }
    .species-hero--no-photo .species-hero__media { display: none; }
    .species-layout { grid-template-columns: 1fr; margin-top: 2.5rem; }
    .species-related { margin-top: 4rem; }
    .species-related__inner { position: static; }
    .species-related__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }
}

@media (max-width: 520px) {
    .species-hero { border-radius: 14px; }
    .species-hero__identity { padding: 1.6rem; }
    .species-hero__identity h1 { margin-top: 1rem; font-size: clamp(3rem, 15vw, 4rem); }
    .species-section + .species-section { margin-top: 3.5rem; }
    .species-section__heading { align-items: start; }
    .species-section__heading h2 { font-size: 2.35rem; }
    .species-gallery, .species-videos { grid-template-columns: 1fr; }
    .species-related__list { grid-template-columns: 1fr; }
    .species-sticky-header__inner { min-height: 58px; }
    .species-sticky-header__inner img, .species-sticky-header__placeholder { width: 34px; height: 34px; }
    .species-sticky-header__name strong { font-size: 1.2rem; }
    .species-sticky-header__name em, .species-sticky-header__return { display: none; }
    .species-advisor-rules { margin-top: 2rem; }
    .species-advisor-rules > summary { grid-template-columns: minmax(0, 1fr) 14px; }
    .species-advisor-rules__count { display: none; }
    .species-advisor-rule > summary { grid-template-columns: minmax(0, 1fr) 14px; }
    .species-advisor-rule > summary span:nth-child(2) { display: none; }
    .species-advisor-rule__body dl > div { grid-template-columns: 1fr; gap: .15rem; }
}

@media (prefers-reduced-motion: reduce) {
    .species-sticky-header { transition: none; }
    .species-song-button[data-status="playing"] .species-song-button__wave i { animation: none; }
}
