/*
 * Rimba Kita â€” COS10026 Assignment 1, Semester 2, 2026
 * Author: student team placeholders; authored with Codex assistance.
 * Purpose: one shared, responsive stylesheet for the entire static website.
 * Organisation: base, typography, header/navigation, buttons, shared layout,
 * home, explorer/cards, identify/community, forms, profiles, documentation,
 * responsive rules, reduced motion.
 * Change the colours in :root to adjust the site's palette consistently.
 */

/* 01 / Base */
:root {
    --forest: #173f35;
    --forest-dark: #102e27;
    --ink: #23392f;
    --muted: #5b6b60;
    --paper: #f7f7f0;
    --white: #ffffff;
    --lime: #d5edaa;
    --line: #d8ded3;
    --soft-green: #edf1e6;
    --error: #9d3028;
    --focus: #8b5d16;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 2rem;
}

body {
    margin: 0;
    color: var(--ink);
    background-color: var(--paper);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1rem;
    line-height: 1.65;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

figure {
    margin: 0;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
summary,
label,
a {
    touch-action: manipulation;
}

a {
    color: var(--forest);
    text-underline-offset: 0.22em;
    text-decoration-thickness: 1px;
    transition: color 180ms, background-color 180ms, border-color 180ms;
}

a:hover {
    color: #476b32;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 5px;
}

::selection {
    background: var(--lime);
    color: var(--forest-dark);
}

:target {
    scroll-margin-top: 1rem;
}

#main {
    min-height: 65vh;
    animation: page-enter 220ms ease-out;
}

@keyframes page-enter {
    from { opacity: 0.7; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 02 / Typography */
h1,
h2,
h3 {
    margin-top: 0;
    color: var(--forest-dark);
    line-height: 1.15;
}

h1 {
    font: normal 500 clamp(2.8rem, 5.4vw, 5.4rem) / 1.06 Georgia, "Times New Roman", serif;
    letter-spacing: -0.045em;
    margin-bottom: 1.5rem;
}

/* The service-page shorthand explicitly includes variant, weight, size and family. */
.service-page h1 {
    font: normal normal 500 clamp(2.6rem, 4.5vw, 4.6rem) / 1.1 Georgia, "Times New Roman", serif;
}

h2 {
    font: 400 clamp(1.9rem, 3vw, 3rem) / 1.17 Georgia, "Times New Roman", serif;
    letter-spacing: -0.03em;
    margin-bottom: 1.1rem;
}

h3 {
    font-size: 1.13rem;
    line-height: 1.35;
    margin-bottom: 0.75rem;
}

p {
    margin: 0 0 1.1rem;
}

ul,
ol {
    padding-left: 1.35rem;
}

li {
    margin-bottom: 0.4rem;
}

dt {
    font-weight: 700;
    color: var(--forest);
    margin-top: 1rem;
}

dd {
    margin: 0.3rem 0 1rem;
    color: var(--muted);
}

.eyebrow {
    color: var(--forest);
    font-size: 0.7rem;
    line-height: 1.5;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
}

.eyebrow a {
    text-decoration: none;
}

.lead {
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1.75;
    max-width: 46rem;
}

.source-note,
figcaption {
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.source-note a,
figcaption a {
    color: inherit;
}

figcaption {
    padding: 0.6rem 0.8rem;
}

.section-intro {
    max-width: 49rem;
    color: var(--muted);
    margin-bottom: 2rem;
}

.common-name {
    color: var(--muted);
    font-size: 0.83rem;
}

code {
    font-size: 0.87em;
    overflow-wrap: anywhere;
}

/* 03 / Header */
.site-header {
    position: relative;
    z-index: 20;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    width: 91%;
    max-width: 1320px;
    margin: auto;
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    color: var(--forest);
    text-decoration: none;
    font-size: 1.55rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.07em;
    white-space: nowrap;
}

.brand > span:not(.brand-mark) {
    font-weight: 400;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 40px;
    margin-right: 0.55rem;
    font-size: 2.45rem;
    line-height: 1;
    font-weight: 400;
}

.account-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.8rem;
}

.account-links > a:not(.button) {
    text-decoration: none;
    white-space: nowrap;
}

/* 04 / Accessible dropdown navigation â€” E2 */
.nav-list,
.dropdown-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-list {
    display: flex;
    gap: 1.6rem;
    align-items: center;
}

.nav-list li {
    margin: 0;
}

.nav-list > li > a {
    position: relative;
    display: block;
    padding: 1.9rem 0;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
}

.nav-list > li > a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 1.3rem;
    height: 2px;
    background-color: var(--forest);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 180ms;
}

.nav-list > li > a:hover::after,
.nav-list > li > a:focus::after,
.nav-list > li > a[aria-current="page"]::after {
    transform: scaleX(1);
}

.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: -1.25rem;
    width: 235px;
    padding: 0.65rem;
    background-color: var(--white);
    border: 1px solid var(--line);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 14px 30px #173f351a;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transform-origin: top left;
    /* Visibility changes immediately so rapid keyboard tabs reach the links. */
    transition: opacity 180ms, transform 180ms;
}

.nav-dropdown:hover > .dropdown-menu,
.nav-dropdown:focus-within > .dropdown-menu,
.nav-dropdown > a:focus + .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 45px;
    padding: 0.7rem 0.8rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
}

.dropdown-menu a:hover,
.dropdown-menu a:focus,
.dropdown-menu a[aria-current="page"] {
    background-color: var(--soft-green);
}

.dropdown-menu span {
    color: var(--muted);
    font-size: 0.7rem;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 50;
    padding: 0.8rem 1rem;
    background: var(--forest);
    color: var(--white);
}

.skip-link:focus {
    top: 0.5rem;
}

/* 05 / Buttons and feedback */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1.1rem;
    min-height: 50px;
    padding: 0.9rem 1.35rem;
    border: 1px solid var(--forest);
    border-radius: 7px;
    background-color: var(--forest);
    color: var(--white);
    font-size: 0.83rem;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    cursor: pointer;
    transition: transform 180ms, background-color 180ms, border-color 180ms, box-shadow 180ms;
}

.button > span[aria-hidden="true"] {
    display: inline-block;
    transition: transform 180ms;
}

.button:hover > span[aria-hidden="true"],
.button:focus-visible > span[aria-hidden="true"] {
    transform: translate(3px, -3px);
}

.button:hover,
.button:focus-visible {
    color: var(--white);
    background-color: #285847;
    border-color: #285847;
    box-shadow: 0 5px 15px #173f3526;
    transform: translateY(-2px);
}

.button:active {
    transform: translateY(1px);
    box-shadow: none;
}

.button-secondary {
    background-color: transparent;
    color: var(--forest);
    border-color: #8a9c8c;
}

.button-secondary:hover,
.button-secondary:focus-visible {
    background-color: var(--soft-green);
    color: var(--forest);
    border-color: var(--forest);
}

.button-small {
    min-height: 42px;
    padding: 0.7rem 1rem;
    font-size: 0.75rem;
}

.button-quiet {
    background-color: transparent;
    color: var(--forest);
    border-color: transparent;
}

.button-row,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
    margin: 1.8rem 0;
}

.text-link {
    display: inline-block;
    padding: 0.35rem 0;
    text-decoration: none;
    border-bottom: 1px solid var(--forest);
    font-size: 0.83rem;
    font-weight: 600;
    transition: transform 180ms, border-color 180ms, color 180ms;
}

.text-link:hover,
.text-link:focus-visible {
    transform: translateX(3px);
    border-color: #759059;
}

.text-link:active {
    transform: translateY(1px);
}

/* 06 / Shared layouts */
.container {
    width: 89%;
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
}

.section-space {
    padding-top: 4.5rem;
    padding-bottom: 4.5rem;
}

.page-intro {
    padding-top: 4.5rem;
    padding-bottom: 2.6rem;
}

.page-intro .lead {
    margin-bottom: 0;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 0.8rem;
}

.section-heading h2 {
    margin-bottom: 0.5rem;
}

.count-tag {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    color: var(--forest);
    background: var(--soft-green);
    border: 1px solid var(--line);
    border-radius: 30px;
    font-size: 0.68rem;
    white-space: nowrap;
}

.split-feature,
.related-species {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4rem;
    padding-top: 2rem;
    padding-bottom: 4rem;
}

.split-feature img,
.related-species img {
    width: 100%;
    height: 360px;
    object-fit: cover;
    border-radius: 14px;
}

.reading-section {
    max-width: 850px;
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.reading-section h2 {
    margin-top: 2rem;
    font-size: 2rem;
}

.reading-section p {
    color: var(--muted);
}

.table-scroll {
    overflow-x: auto;
    max-width: 100%;
    margin: 1.5rem 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--white);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.86rem;
}

caption {
    text-align: left;
    color: var(--muted);
    font-size: 0.8rem;
    padding: 1rem 1.25rem;
}

th,
td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

thead {
    background: var(--soft-green);
}

tbody tr:last-child th,
tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background-color: #f5f7f0;
}

table a {
    text-decoration: none;
}

table a:hover {
    text-decoration: underline;
}

details {
    padding: 1.2rem 0;
    border-top: 1px solid var(--line);
}

details:last-child {
    border-bottom: 1px solid var(--line);
}

summary {
    font-weight: 700;
    cursor: pointer;
    padding: 0.25rem;
}

details[open] summary {
    margin-bottom: 0.8rem;
    color: var(--forest);
}

.community-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    margin-top: 3rem;
    margin-bottom: 4rem;
    padding: 3.3rem;
    border-radius: 14px;
    background-color: var(--forest);
    color: var(--white);
}

.community-banner h2 {
    color: var(--white);
    max-width: 620px;
}

.community-banner .eyebrow {
    color: var(--lime);
}

.community-banner p:last-child {
    margin-bottom: 0;
    color: #d8e4d8;
}

.community-banner .button {
    flex-shrink: 0;
    background-color: var(--lime);
    color: var(--forest-dark);
    border-color: var(--lime);
}

.community-banner .button:hover {
    background-color: #e6f5cf;
}

/* 07 / Homepage */
.home-hero {
    display: grid;
    grid-template-columns: 1.08fr 1fr;
    align-items: center;
    gap: 3rem;
    padding-top: 3.4rem;
    padding-bottom: 3.6rem;
}

.hero-copy {
    padding: 1rem 0;
}

.home-hero h1 em {
    color: #527149;
    font-weight: 400;
}

.home-hero .eyebrow {
    font-size: 0.66rem;
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 0.5rem;
    background: #5c7847;
    border-radius: 50%;
}

.hero-footnote {
    font-size: 0.76rem;
    color: var(--muted);
    margin: 1.7rem 0 0;
}

.hero-visual {
    position: relative;
    padding-bottom: 1.5rem;
}

.hero-forest {
    overflow: hidden;
    border-radius: 15px 90px 15px 15px;
}

.hero-forest img {
    height: 500px;
    width: 100%;
    object-fit: cover;
}

.hero-forest figcaption {
    background-color: var(--soft-green);
    font-size: 0.6rem;
    padding-right: 11rem;
}

.hero-visual::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 500px;
    border-radius: 15px 90px 15px 15px;
    background-image: linear-gradient(180deg, transparent 45%, #102e2799);
    pointer-events: none;
}

.hero-label {
    position: absolute;
    z-index: 1;
    bottom: 7.5rem;
    left: 1.8rem;
    color: var(--white);
    display: grid;
    gap: 0.3rem;
}

.hero-label .eyebrow {
    color: #e6eedc;
    font-size: 0.57rem;
    margin: 0;
}

.hero-label strong {
    font: 400 1.8rem Georgia, serif;
}

.hero-label > span:last-child {
    font-size: 0.68rem;
}

.hero-index {
    position: absolute;
    z-index: 2;
    bottom: 0;
    right: 1.1rem;
    width: 160px;
    padding: 1.2rem 1.3rem;
    border: 1px solid #c1d295;
    border-radius: 9px;
    background-color: var(--lime);
    color: var(--forest-dark);
    text-decoration: none;
    box-shadow: 0 8px 20px #102e2722;
    transition: transform 180ms, background-color 180ms;
}

.hero-index:hover,
.hero-index:focus-visible {
    transform: translateY(-3px);
    background-color: #e1f1c4;
}

.hero-index:active {
    transform: translateY(1px);
}

.hero-index span {
    display: block;
    font-size: 0.62rem;
    line-height: 1.8;
}

.hero-index strong {
    display: block;
    font: 400 1.8rem Georgia, serif;
    margin: 0.6rem 0;
}

.collection-strip {
    background-color: var(--soft-green);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.collection-strip > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.7rem 0;
}

.collection-strip p {
    font-size: 0.83rem;
    margin: 0;
}

.collection-strip div > div {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.collection-strip div > div strong {
    font: 400 2.7rem Georgia, serif;
}

.collection-strip div > div span {
    font-size: 0.72rem;
    line-height: 1.4;
    max-width: 4rem;
    color: var(--muted);
}

.strip-note {
    color: var(--muted);
    text-align: right;
}

.family-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.3rem;
}

.how-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.how-section > div > p:not(.eyebrow) {
    color: var(--muted);
}

.step-list {
    margin: 0;
    list-style: none;
    padding: 0;
}

.step-list li {
    display: flex;
    gap: 1.5rem;
    padding: 1.4rem 0;
    border-top: 1px solid var(--line);
}

.step-list li > span {
    font: 400 1.7rem Georgia, serif;
    color: #718361;
}

.step-list p {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0;
}

.project-video {
    padding-bottom: 3rem;
}

.project-video h2 {
    font-size: 1.4rem;
}

.project-video p {
    font-size: 0.82rem;
}

/* 08 / Explorer and required floats */
.taxonomy-tabs {
    display: flex;
    gap: 2rem;
    border-bottom: 1px solid var(--line);
}

.taxonomy-tabs a {
    display: block;
    padding: 1rem 0;
    border-bottom: 2px solid transparent;
    font-size: 0.8rem;
    text-decoration: none;
}

.taxonomy-tabs a:hover,
.taxonomy-tabs a[aria-current="page"] {
    border-color: var(--forest);
}

.path-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.path-card {
    padding: 2rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--white);
}

.large-number {
    display: block;
    font: 400 3rem Georgia, serif;
    color: #738866;
    margin-bottom: 2rem;
}

.path-card h3 {
    font: 400 1.7rem Georgia, serif;
}

.path-card p {
    min-height: 5rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.family-detail {
    display: grid;
    grid-template-columns: 0.8fr 1fr;
    align-items: center;
    gap: 4rem;
    padding: 4rem 0;
    border-bottom: 1px solid var(--line);
}

.family-detail img {
    height: 330px;
    width: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.family-detail h2 {
    overflow-wrap: anywhere;
}

.genus-section {
    padding: 3.5rem 0;
    border-bottom: 1px solid var(--line);
}

.genus-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.8rem;
}

.genus-pair .plant-card {
    display: grid;
    grid-template-columns: 0.8fr 1fr;
}

.genus-pair .image-frame img {
    height: 280px;
}

/* A full-width parent preserves the rubric's viewport interpretation of 30%.
   At small widths the responsive override deliberately removes the float. */
.field-notes {
    display: flow-root;
    width: 100%;
    padding: 3.5rem 0;
    margin: 3rem 0 0;
    background: var(--soft-green);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.field-aside {
    width: 30%;
    float: right;
    border: 1px solid #90a580;
    padding: 2rem;
    margin: 0 5.5% 1.5rem 2.5%;
    border-radius: 10px;
    background-color: #f9faf5;
}

.field-aside p {
    font-size: 0.9rem;
}

.field-aside h3 {
    font: 400 1.8rem Georgia, serif;
}

.notes-copy {
    margin-left: 5.5%;
    width: 54%;
    max-width: 790px;
}

.notes-copy p,
.notes-copy li,
.notes-copy dd {
    font-size: 0.91rem;
}

.notes-copy h3 {
    margin-top: 1.8rem;
}

/* 09 / Botanical cards: flexible bodies align the destination links. */
.plant-card,
.family-card,
.observation-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--white);
    transition: transform 220ms, box-shadow 220ms, border-color 220ms;
}

.plant-card:hover,
.plant-card:focus-within,
.family-card:hover,
.family-card:focus-within,
.observation-card:hover,
.observation-card:focus-within {
    transform: translateY(-6px);
    border-color: #9cad93;
    box-shadow: 0 16px 30px #173f3524;
}

.image-frame {
    overflow: hidden;
    background: #e3e8dc;
}

.image-frame img {
    width: 100%;
    height: 215px;
    object-fit: cover;
    transition: transform 260ms;
}

.plant-card:hover .image-frame img,
.plant-card:focus-within .image-frame img,
.family-card:hover .image-frame img,
.family-card:focus-within .image-frame img,
.observation-card:hover .image-frame img,
.observation-card:focus-within .image-frame img {
    transform: scale(1.055);
}

.card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 1.15rem 1.2rem 1.3rem;
}

.card-body > p:not(.eyebrow):not(.source-note) {
    font-size: 0.82rem;
}

.card-body .eyebrow {
    font-size: 0.61rem;
    margin-bottom: 0.65rem;
}

.card-body h3 {
    font: 400 1.35rem / 1.22 Georgia, serif;
    overflow-wrap: anywhere;
}

.card-body > .text-link {
    align-self: flex-start;
    margin-top: auto;
}

.card-body h3 a {
    text-decoration: none;
}

.card-body .location {
    color: var(--muted);
    font-size: 0.75rem;
}

.card-bottom {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.card-bottom .text-link {
    font-size: 0.71rem;
}

.taxonomy-link {
    font-size: 0.72rem;
    padding: 0.25rem 0.55rem;
    border-radius: 4px;
    background: var(--soft-green);
    text-decoration: none;
}

.taxonomy-link:hover {
    background: var(--lime);
}

.family-card .card-body {
    padding-top: 0.8rem;
}

.family-card h3 {
    font-size: 1.22rem;
}

.family-card figcaption {
    font-size: 0.65rem;
}

.family-card .image-frame img {
    height: 215px;
}

/* Native radio inputs remain in the keyboard sequence â€” E3.
   Inputs, labels, status and grid are siblings inside the fieldset. */
.species-filter {
    position: relative;
    min-width: 0;
    padding: 0;
    margin: 1.5rem 0;
    border: 0;
}

.species-filter legend {
    padding: 0 0 0.75rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.filter-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.species-filter > label {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 44px;
    padding: 0.55rem 0.85rem;
    margin: 0 0.35rem 0.65rem 0;
    border: 1px solid #9cae96;
    border-radius: 24px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background-color 180ms, color 180ms, border-color 180ms, transform 180ms;
}

.species-filter > label span {
    font-size: 0.65rem;
    opacity: 0.8;
}

.species-filter > label:hover {
    background: var(--soft-green);
    transform: translateY(-1px);
}

.species-filter > label:active {
    transform: translateY(1px);
}

.filter-input:checked + label {
    background: var(--forest);
    border-color: var(--forest);
    color: var(--white);
    box-shadow: inset 0 0 0 1px var(--forest);
}

.filter-input:focus-visible + label {
    outline: 3px solid var(--focus);
    outline-offset: 4px;
}

.species-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.4rem;
}

/* Explicit family rules: hide only the cards outside the selected family. */
#family-dipterocarpaceae:checked ~ .species-grid .plant-card:not(.dipterocarpaceae) {
    display: none;
}

#family-lauraceae:checked ~ .species-grid .plant-card:not(.lauraceae) {
    display: none;
}

#family-burseraceae:checked ~ .species-grid .plant-card:not(.burseraceae) {
    display: none;
}

#family-myristicaceae:checked ~ .species-grid .plant-card:not(.myristicaceae) {
    display: none;
}

.species-grid .plant-card {
    animation: card-enter 220ms ease-out;
}

@keyframes card-enter {
    from { opacity: 0.3; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.filter-status {
    color: var(--muted);
    font-size: 0.76rem;
    padding: 0.7rem 0;
}

.filter-status > span {
    display: none;
}

#family-all:checked ~ .filter-status .status-all,
#family-dipterocarpaceae:checked ~ .filter-status .status-dipterocarpaceae,
#family-lauraceae:checked ~ .filter-status .status-lauraceae,
#family-burseraceae:checked ~ .filter-status .status-burseraceae,
#family-myristicaceae:checked ~ .filter-status .status-myristicaceae {
    display: inline;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.8rem;
    font-size: 0.8rem;
}

.species-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
    padding-top: 1.5rem;
    padding-bottom: 3rem;
}

.species-detail .image-frame {
    border-radius: 12px;
}

.species-detail img {
    height: 520px;
}

.species-detail h2 {
    margin-top: 1.5rem;
}

.record-facts dt {
    font-size: 0.8rem;
}

.record-facts dd {
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.7rem;
    font-size: 0.9rem;
}

/* 10 / Identification */
.identify-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
    align-items: start;
    padding: 1.5rem 0 4rem;
}

.upload-area {
    padding: 2.5rem 1.25rem;
    border: 1px dashed #829a70;
    background: #f4f7ee;
    border-radius: 10px;
    text-align: center;
    transition: border-color 180ms, background-color 180ms;
}

.upload-area:focus-within {
    border-color: var(--forest);
    background-color: var(--soft-green);
}

.upload-area label {
    display: block;
    font-weight: 700;
}

.upload-area p {
    font-size: 0.82rem;
    color: var(--muted);
}

.upload-icon {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    margin: 0 auto 1.25rem;
    background: var(--soft-green);
    border: 1px solid var(--line);
    border-radius: 50%;
    font-size: 2rem;
}

.upload-area input {
    margin: 1rem 0;
    font-size: 0.78rem;
}

.upload-area small {
    display: block;
}

.search-panel {
    padding: 1rem 0;
}

.search-panel form {
    margin: 1.5rem 0;
}

.search-panel button {
    margin-top: 1rem;
}

.search-panel h3 {
    margin-top: 2.2rem;
}

.example-result {
    padding: 2rem;
    background: var(--soft-green);
    border-radius: 14px;
    margin-bottom: 4rem;
}

/* 11 / Community */
.observation-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.observer {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 1rem;
}

.observer h3 {
    font-size: 0.83rem;
    margin: 0 0 0.25rem;
}

.observer div > span {
    font-size: 0.62rem;
    color: var(--muted);
    display: block;
    line-height: 1.45;
}

.avatar {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    font-size: 0.65rem;
    border-radius: 50%;
    background: var(--soft-green);
    color: var(--forest);
}

.observer .count-tag {
    margin-left: auto;
    font-size: 0.52rem;
    padding: 0.25rem 0.4rem;
}

blockquote {
    margin: 1rem 0;
    padding-left: 0.9rem;
    border-left: 2px solid #a8b995;
    font-size: 0.89rem;
    color: var(--muted);
}

/* 12 / Forms â€” E4 */
.form-layout {
    display: grid;
    grid-template-columns: 1.45fr 0.8fr;
    gap: 3.5rem;
    align-items: start;
    padding-top: 1.5rem;
    padding-bottom: 5rem;
}

.form-panel {
    padding: 2rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--white);
}

.form-panel h2 {
    font-size: 1.9rem;
}

.form-instructions {
    font-size: 0.8rem;
}

.notice {
    padding: 0.85rem 1rem;
    border-left: 3px solid #8caa62;
    background: var(--soft-green);
    font-size: 0.79rem;
    line-height: 1.65;
    margin-bottom: 1.5rem;
}

/* This open dialog is deliberately non-modal and sits in normal page flow.
   Submitting method=dialog closes it after native form validation succeeds.
   The adjacent completion panel is then revealed without scripts. */
.form-dialog {
    position: static;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: none;
    border: 0;
    color: inherit;
    background: transparent;
}

.form-dialog[open] {
    display: block;
}

.form-dialog[open] ~ .form-receipt {
    display: none;
}

.form-receipt {
    padding: 1.5rem 0;
}

.form-receipt h3 {
    font: 400 1.8rem Georgia, serif;
}

.form-receipt .text-link {
    margin-top: 1rem;
}

.success-mark {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    background: var(--soft-green);
    color: var(--forest);
    border-radius: 50%;
    font-size: 1.5rem;
    margin-bottom: 1.4rem;
}

form fieldset {
    min-width: 0;
    padding: 1.5rem 0 2rem;
    margin: 1.25rem 0;
    border: 0;
    border-top: 1px solid var(--line);
}

form legend {
    padding: 0 0.7rem 0 0;
    font-weight: 700;
    color: var(--forest);
    font-size: 0.92rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.3rem 1.1rem;
}

.form-group {
    min-width: 0;
}

.full-width {
    grid-column: 1 / -1;
}

.form-group label,
.search-panel label {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.required {
    color: #805323;
}

input:not([type="radio"]):not([type="checkbox"]),
select,
textarea {
    width: 100%;
    min-height: 47px;
    padding: 0.8rem 0.9rem;
    border: 1px solid #9cae9c;
    border-radius: 6px;
    background-color: #fdfefb;
    color: var(--ink);
    font-size: 0.84rem;
    transition: border-color 180ms, box-shadow 180ms, background-color 180ms;
}

textarea {
    resize: vertical;
    min-height: 145px;
}

input::placeholder,
textarea::placeholder {
    color: #6d786e;
    opacity: 1;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--forest);
    background-color: var(--white);
    box-shadow: 0 0 0 3px #d5edaa88;
}

/* :invalid is neutral before interaction; native error messages still work
   in browsers that do not yet understand :user-invalid. */
.form-group input:invalid,
.form-group select:invalid,
.form-group textarea:invalid {
    box-shadow: none;
}

.form-group input:valid:focus,
.form-group select:valid:focus,
.form-group textarea:valid:focus {
    border-color: #46723a;
    box-shadow: 0 0 0 3px #d5edaa88;
}

.form-group input:user-valid,
.form-group select:user-valid,
.form-group textarea:user-valid {
    border-color: #46723a;
}

.form-group input:user-invalid,
.form-group select:user-invalid,
.form-group textarea:user-invalid {
    border-color: var(--error);
    background-color: #fff8f5;
}

.field-error {
    display: none;
    margin-top: 0.4rem;
    color: var(--error);
    font-size: 0.73rem;
}

.form-group input:user-invalid ~ .field-error,
.form-group select:user-invalid ~ .field-error,
.form-group textarea:user-invalid ~ .field-error {
    display: block;
}

small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    line-height: 1.6;
    color: var(--muted);
}

input[type="file"] {
    font-size: 0.72rem;
    padding: 0.55rem;
}

input::file-selector-button {
    min-height: 34px;
    padding: 0.4rem 0.65rem;
    border: 1px solid #9cad93;
    border-radius: 4px;
    background: var(--soft-green);
    color: var(--forest);
    cursor: pointer;
    margin-right: 0.5rem;
    transition: background-color 180ms, border-color 180ms;
}

input::file-selector-button:hover {
    background: var(--lime);
}

input[type="radio"],
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--forest);
    flex-shrink: 0;
}

.choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.choice-row label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 0.73rem;
    cursor: pointer;
}

.choice-row label:hover {
    background: var(--soft-green);
}

.check-label {
    display: block;
    padding: 0.7rem 0;
    font-size: 0.78rem;
    cursor: pointer;
}

.check-label input {
    margin-right: 0.45rem;
    vertical-align: middle;
}

.form-story img {
    height: 330px;
    width: 100%;
    object-fit: cover;
    border-radius: 12px 60px 12px 12px;
}

.form-story .eyebrow {
    margin-top: 2rem;
}

.form-story h2 {
    font-size: 2.1rem;
}

.form-story > p:not(.eyebrow),
.form-story dl {
    font-size: 0.88rem;
    color: var(--muted);
}

/* 13 / Individual profiles */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    padding: 2rem 0 5rem;
}

.profile-card {
    padding: 2rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--white);
}

.profile-card img {
    width: 130px;
    height: 130px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 2rem;
}

.profile-content {
    display: flow-root;
    padding-top: 1rem;
    padding-bottom: 2rem;
}

/* These profile declarations directly implement the individual-task rubric. */
.profile-name {
    text-align: center;
    font-weight: bold;
    font-size: 200%;
}

.student-number {
    font-family: Arial, sans-serif;
    text-align: center;
}

.profile-course {
    color: rgb(44, 91, 57);
    text-align: center;
}

.profile-photo {
    float: right;
    border: 5px groove #9aab8c;
    padding: 20px;
    margin: 1rem 0 2rem 2rem;
    width: 240px;
    height: auto;
}

.profile-table th {
    text-align: center;
    font-weight: bold;
}

.profile-table td {
    background-color: #f0f4e8;
}

.profile-table tfoot td {
    text-align: center;
}

/* 14 / Documentation */
.enhancement-section {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 3rem;
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
    border-top: 1px solid var(--line);
}

.enhancement-number {
    font: 400 4.5rem Georgia, serif;
    color: #8a9d79;
}

.enhancement-section > div {
    max-width: 780px;
}

.enhancement-section h3 {
    margin-top: 1.8rem;
}

.source-entry {
    border-top: 1px solid var(--line);
    padding: 2rem 0;
}

.source-entry h2 {
    font-size: 1.6rem;
}

.source-entry p {
    font-size: 0.88rem;
}

.landscape img {
    width: 100%;
    border-radius: 12px;
}

.sitemap-list {
    columns: 2;
    column-gap: 3rem;
}

.sitemap-list li {
    break-inside: avoid;
    padding: 0.3rem 0;
}

/* 15 / Footer */
.site-footer {
    width: 100%;
    clear: both;
    background: #e9ede2;
    border-top: 1px solid var(--line);
    padding: 3.5rem 5.5% 1.25rem;
    text-align: center;
    font-style: italic;
}

.footer-top {
    max-width: 1240px;
    margin: auto;
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
    gap: 2rem;
}

.footer-top h2 {
    font: 700 0.78rem Arial, sans-serif;
    letter-spacing: 0;
    margin-top: 0.4rem;
    margin-bottom: 1rem;
}

.footer-top p,
.footer-top li {
    font-size: 0.73rem;
    color: var(--muted);
}

.footer-top p {
    margin-top: 1rem;
}

.footer-top ul {
    list-style: none;
    padding: 0;
}

.footer-top a {
    text-decoration: none;
}

.footer-top a:hover {
    text-decoration: underline;
}

.footer-bottom {
    margin: 2rem auto 0;
    padding-top: 1.2rem;
    border-top: 1px solid #cbd4c2;
    font-size: 0.7rem;
    text-align: center;
    max-width: 1240px;
}

/* 16 / Expedition composition — five pages, one connected field guide.
   All content stays visible without hover. States add emphasis, not access. */
.hero-stage {
    background: var(--forest-dark);
    color: var(--white);
    padding-bottom: 2rem;
    border-bottom: 8px solid var(--lime);
}

.hero-stage .home-hero {
    padding-top: 4rem;
    gap: 4rem;
}

.hero-stage h1,
.hero-stage .eyebrow {
    color: var(--white);
}

.hero-stage h1 em {
    color: var(--lime);
}

.hero-stage .lead,
.hero-stage .hero-footnote {
    color: #d0ddce;
}

.hero-stage .hero-copy .button {
    background: var(--lime);
    border-color: var(--lime);
    color: var(--forest-dark);
}

.hero-stage .hero-copy .button-secondary {
    background: transparent;
    border-color: #9bad9d;
    color: var(--white);
}

.hero-stage .hero-copy .button:hover,
.hero-stage .hero-copy .button:focus-visible {
    background: #e9f5d7;
    color: var(--forest-dark);
}

.hero-stage .hero-visual {
    border-top: 1px solid #77937e;
    padding-top: 1.4rem;
}

.hero-stage .hero-visual::after {
    top: 1.4rem;
    border-radius: 45% 45% 0 0;
}

.hero-stage .hero-forest {
    border-radius: 45% 45% 0 0;
}

.hero-stage .hero-index {
    border-radius: 0 18px 0 18px;
    transform: rotate(3deg);
}

.hero-stage .hero-index:hover,
.hero-stage .hero-index:focus-visible {
    transform: rotate(0) translateY(-4px);
}

.hero-stage .hero-index:active {
    transform: rotate(0) translateY(1px);
}

.expedition-trail {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid #57715e;
}

.expedition-trail a {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    padding: 1.4rem 1.5rem;
    color: var(--white);
    border-left: 1px solid #57715e;
    text-decoration: none;
    transition: background-color 220ms, transform 220ms;
}

.expedition-trail a:first-child {
    border-left: 0;
}

.expedition-trail a > span:first-child {
    grid-column: 1 / -1;
    color: var(--lime);
    letter-spacing: 0.13em;
    font-size: 0.65rem;
}

.expedition-trail strong {
    font: 400 1.4rem Georgia, serif;
}

.expedition-trail a:hover,
.expedition-trail a:focus-visible {
    background: #284f40;
    transform: translateY(-4px);
}

.expedition-home .collection-strip {
    background: #e4ebd7;
}

.expedition-home .how-section {
    padding-top: 3.5rem;
    border-top: 1px solid #9aaf88;
}

/* Stages read as connected stops, with the active destination filled. */
.taxonomy-tabs {
    display: grid;
    grid-template-columns: 0.8fr repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    padding-bottom: 1rem;
}

.taxonomy-tabs a {
    position: relative;
    padding: 1rem;
    background: var(--soft-green);
    border-bottom: 3px solid #b5c4a5;
    transition: background-color 180ms, color 180ms, transform 180ms;
}

.taxonomy-tabs a::after {
    content: "→";
    position: absolute;
    right: 0.8rem;
}

.taxonomy-tabs a:last-child::after {
    content: "↗";
}

.taxonomy-tabs a:hover,
.taxonomy-tabs a:focus-visible {
    background: var(--lime);
    transform: translateY(-3px);
}

.taxonomy-tabs a[aria-current="page"] {
    background: var(--forest);
    color: var(--white);
    border-color: var(--lime);
}

.journey-page .path-grid {
    position: relative;
    gap: 2rem;
    align-items: start;
    padding-top: 1.5rem;
}

.journey-page .path-grid::before {
    content: "";
    position: absolute;
    top: 3rem;
    left: 5%;
    right: 5%;
    border-top: 2px solid #91a780;
    transform: rotate(9deg);
}

.journey-page .path-card {
    position: relative;
    background: #e6eddc;
    border-radius: 0 36px 0 0;
    border-top: 4px solid #7a9566;
    transition: transform 220ms, box-shadow 220ms;
}

.journey-page .path-card:nth-child(2) {
    margin-top: 3rem;
}

.journey-page .path-card:nth-child(3) {
    margin-top: 6rem;
    background: var(--lime);
}

.journey-page .path-card:hover,
.journey-page .path-card:focus-within {
    transform: translateY(-7px);
    box-shadow: 0 14px 26px #173f351a;
}

.journey-page .large-number {
    font-size: 5rem;
    line-height: 1;
    color: #476a43;
    margin-bottom: 1.5rem;
}

.journey-page .split-feature {
    border-top: 1px solid #9aaf88;
    padding-top: 3rem;
}

/* A visible accent follows the eye from the photograph to its plant name. */
.plant-card .card-body,
.observation-card .card-body {
    border-top: 3px solid transparent;
    transition: border-color 220ms, background-color 220ms;
}

.plant-card:hover .card-body,
.plant-card:focus-within .card-body,
.observation-card:hover .card-body,
.observation-card:focus-within .card-body {
    border-top-color: #7d9a50;
    background-color: #f5f8ef;
}

.card-body .taxonomy-link {
    transition: transform 180ms, background-color 180ms;
}

.plant-card:hover .taxonomy-link,
.plant-card:focus-within .taxonomy-link {
    transform: translateX(3px);
    background: var(--lime);
}

/* The existing radio/sibling filtering rules above remain the source of truth. */
.collection-page .species-filter {
    padding: 1.4rem;
    background: #eaf0e1;
    border: 1px solid #bcccb0;
    border-radius: 16px;
}

.collection-page .species-filter legend {
    padding: 0 0.6rem;
    font-size: 0.95rem;
}

.species-filter > label {
    background: var(--white);
    min-height: 48px;
    border-radius: 6px;
}

.species-filter > label::before {
    content: "";
    width: 7px;
    height: 7px;
    border: 1px solid currentColor;
    border-radius: 50%;
}

.filter-input:checked + label::before {
    background: var(--lime);
    border-color: var(--lime);
}

.species-filter > label span {
    padding: 0.1rem 0.4rem;
    background: var(--soft-green);
    color: var(--forest-dark);
    border-radius: 3px;
    opacity: 1;
}

.filter-status {
    padding: 1rem 1.2rem;
    margin: 0.7rem 0 1.4rem;
    background: var(--forest);
    color: var(--white);
    border-left: 5px solid var(--lime);
    font-size: 0.9rem;
    transition: background-color 220ms;
}

#family-dipterocarpaceae:checked ~ .filter-status { background: #395d37; }
#family-lauraceae:checked ~ .filter-status { background: #285950; }
#family-burseraceae:checked ~ .filter-status { background: #665033; }
#family-myristicaceae:checked ~ .filter-status { background: #5e4350; }

/* A selected family becomes a larger, four-record collection. */
#family-dipterocarpaceae:checked ~ .species-grid,
#family-lauraceae:checked ~ .species-grid,
#family-burseraceae:checked ~ .species-grid,
#family-myristicaceae:checked ~ .species-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* The three anchors describe choices; they never imply recognition progress. */
.discovery-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.discovery-steps a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-height: 60px;
    padding: 0.8rem;
    background: var(--soft-green);
    text-decoration: none;
    font-size: 0.83rem;
    border-bottom: 2px solid #a3b894;
}

.discovery-steps span {
    font: 400 1.6rem Georgia, serif;
}

.discovery-steps a:hover,
.discovery-steps a:focus-visible {
    background: var(--lime);
}

.discovery-page .search-panel {
    padding: 2rem;
    background: #e8eedf;
    border-radius: 0 36px 0 0;
}

.upload-area {
    position: relative;
    border-width: 2px;
    background-image: linear-gradient(135deg, #edf3e3, #fafcf6);
}

.upload-area:hover,
.upload-area:focus-within {
    border-color: var(--forest);
    background-color: #e1ebd4;
    box-shadow: inset 0 0 0 5px #dce8ce;
}

.upload-icon {
    border-radius: 12px;
    transition: transform 220ms, background-color 220ms;
}

.upload-area:hover .upload-icon,
.upload-area:focus-within .upload-icon {
    transform: translateY(-5px);
    background: var(--lime);
}

.file-ready {
    display: none;
    padding: 0.8rem;
    border-left: 3px solid #52713c;
    text-align: left;
}

#plant-photo:valid ~ .file-ready {
    display: block;
    background: var(--soft-green);
    color: var(--forest-dark);
}

.discovery-page .example-result {
    border-left: 6px solid #8ba967;
    border-radius: 0 36px 0 0;
}

.discovery-page #upload:target,
.discovery-page #name-search:target,
.discovery-page #example-result:target {
    outline: 3px solid #8ba967;
    outline-offset: 8px;
}

/* A wide first observation sets the scene; two shorter notes follow it. */
.observation-stream {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    border-left: 2px solid #afc29e;
    padding-left: 2rem;
}

.observation-stream .observation-card:first-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
}

.observation-stream .observation-card:first-child .observer {
    grid-column: 1 / -1;
    background: #e7eedc;
}

.observation-stream .observation-card:first-child .image-frame img {
    height: 340px;
}

.observation-stream .card-body {
    padding: 1.6rem;
}

.observation-stream blockquote {
    font: 400 1.15rem / 1.6 Georgia, serif;
    color: var(--forest);
    border-left: 3px solid #8ba967;
}

.observation-stream .avatar {
    background: var(--forest);
    color: var(--white);
}

.stream-page .page-intro {
    border-bottom: 1px solid #9aaf88;
}

/* 17 / Responsive composition â€” E1 */
@media (min-width: 1600px) {
    .field-aside {
        margin-right: 5.5%;
    }

    .notes-copy {
        margin-left: 8%;
        width: 48%;
    }
}

@media (max-width: 1100px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
        padding: 1.1rem 0 0;
    }

    .header-inner > nav {
        order: 3;
        width: 100%;
    }

    .nav-list {
        justify-content: center;
    }

    .nav-list > li > a {
        padding: 1rem 0;
    }

    .nav-list > li > a::after {
        bottom: 0.6rem;
    }

    .home-hero {
        gap: 2rem;
    }

    .home-hero h1 {
        font-size: clamp(3rem, 6.5vw, 4.2rem);
    }

    .hero-forest img,
    .hero-visual::after {
        height: 450px;
    }

    /* Keep the guide badge clear of the photograph caption on laptops. */
    .hero-index {
        top: 1rem;
        bottom: auto;
    }

    .hero-forest figcaption {
        padding-right: 0.8rem;
    }

    .family-detail {
        gap: 2rem;
    }

    .family-grid,
    .species-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .genus-pair .plant-card {
        display: flex;
    }

    .genus-pair .image-frame img {
        height: 250px;
    }

    .strip-note {
        display: none;
    }

    .how-section {
        gap: 3rem;
    }

    .form-layout {
        grid-template-columns: 1.35fr 0.75fr;
        gap: 2rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .community-banner {
        gap: 2rem;
        padding: 2.5rem;
    }

    .observation-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .field-aside {
        padding: 1.5rem;
    }

    .path-grid {
        gap: 1rem;
    }

    .path-card {
        padding: 1.5rem;
    }
}

/* Tablet forms need a full reading width before phone layouts take over. */
@media (max-width: 900px) {
    .hero-stage .home-hero {
        gap: 2rem;
    }

    .expedition-trail strong {
        font-size: 1.1rem;
    }

    .discovery-steps {
        gap: 0.5rem;
    }

    .observation-stream {
        padding-left: 1rem;
    }

    .form-layout,
    .identify-layout {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-photo {
        float: none;
        margin: 1.5rem auto;
    }
}

@media (max-width: 700px) {
    .hero-stage .home-hero {
        padding-top: 2.4rem;
    }

    .expedition-trail {
        grid-template-columns: 1fr;
    }

    .expedition-trail a {
        border-left: 2px solid #77937e;
        border-bottom: 1px solid #57715e;
        padding: 1rem;
    }

    .expedition-trail a:first-child {
        border-left: 2px solid #77937e;
    }

    .taxonomy-tabs a {
        padding: 0.8rem 0.35rem;
        font-size: 0.68rem;
    }

    .taxonomy-tabs a::after {
        display: none;
    }

    .journey-page .path-grid {
        border-left: 2px solid #91a780;
        padding-left: 1rem;
    }

    .journey-page .path-grid::before {
        display: none;
    }

    .journey-page .path-card:nth-child(2),
    .journey-page .path-card:nth-child(3) {
        margin-top: 0;
    }

    .collection-page .species-filter {
        padding: 0.85rem;
    }

    .species-filter > label {
        gap: 0.4rem;
        margin-right: 0.15rem;
        padding: 0.6rem;
    }

    #family-dipterocarpaceae:checked ~ .species-grid,
    #family-lauraceae:checked ~ .species-grid,
    #family-burseraceae:checked ~ .species-grid,
    #family-myristicaceae:checked ~ .species-grid {
        grid-template-columns: 1fr;
    }

    .discovery-steps {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .discovery-steps a {
        min-height: 48px;
        padding: 0.5rem 0.8rem;
    }

    .discovery-page .search-panel {
        padding: 1.5rem;
    }

    .observation-stream .observation-card:first-child {
        display: flex;
    }

    .observation-stream .observation-card:first-child .image-frame img {
        height: 290px;
    }

    .observation-stream .card-body {
        padding: 1.2rem;
    }

    .nav-list > li > a[aria-current="page"] {
        color: var(--forest-dark);
        background: var(--lime);
        border-radius: 4px;
        padding-left: 0.3rem;
    }

    html {
        scroll-padding-top: 1rem;
    }

    :target {
        scroll-margin-top: 1rem;
    }

    .container {
        width: 90%;
    }

    .header-inner {
        width: 90%;
        padding-top: 1rem;
    }

    .brand {
        font-size: 1.4rem;
    }

    .account-links {
        gap: 0.6rem;
        font-size: 0.73rem;
    }

    .account-links .button {
        min-height: 40px;
        padding: 0.6rem 0.65rem;
        font-size: 0.65rem;
        gap: 0.5rem;
        max-width: 120px;
    }

    .nav-list {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.4rem 0.7rem;
        padding: 0.6rem 0;
    }

    .nav-list > .nav-dropdown {
        grid-column: 1 / -1;
        order: 5;
        display: flex;
        align-items: center;
        gap: 0.8rem;
    }

    .nav-list > li > a {
        padding: 0.6rem 0;
        font-size: 0.77rem;
    }

    .nav-list > li > a::after {
        bottom: 0.3rem;
    }

    .nav-dropdown {
        position: static;
    }

    /* The narrow-screen submenu is always available: no hover dependency. */
    .dropdown-menu {
        position: static;
        display: flex;
        gap: 0.35rem;
        width: auto;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .nav-list > .nav-dropdown > a {
        display: inline-flex;
    }

    .dropdown-menu a {
        font-size: 0.7rem;
        padding: 0.4rem 0.5rem;
        min-height: 42px;
        border: 1px solid var(--line);
    }

    .dropdown-menu span {
        display: none;
    }

    .home-hero {
        grid-template-columns: 1fr;
        padding-top: 2rem;
        gap: 2rem;
    }

    .home-hero h1 {
        font-size: clamp(2.9rem, 11vw, 4.2rem);
    }

    .hero-copy {
        padding: 0;
    }

    .hero-copy .lead {
        font-size: 1rem;
    }

    .hero-forest img,
    .hero-visual::after {
        height: 390px;
    }

    .hero-label {
        left: 1.3rem;
        bottom: 8rem;
    }

    .hero-forest figcaption {
        padding-right: 0.7rem;
        padding-bottom: 1rem;
    }

    .hero-index {
        right: 0.85rem;
        width: 140px;
        padding: 1rem;
    }

    .hero-index strong {
        font-size: 1.6rem;
    }

    .collection-strip > div {
        gap: 1.2rem;
        flex-wrap: wrap;
    }

    .collection-strip > div > p:first-child {
        width: 100%;
    }

    .collection-strip div > div {
        gap: 0.65rem;
    }

    .collection-strip div > div strong {
        font-size: 2.2rem;
    }

    .collection-strip div > div span {
        font-size: 0.63rem;
        max-width: 3rem;
    }

    .family-grid,
    .species-grid,
    .form-grid,
    .path-grid,
    .genus-pair,
    .observation-grid,
    .profile-grid,
    .form-layout,
    .identify-layout,
    .family-detail,
    .species-detail,
    .split-feature,
    .related-species,
    .how-section {
        grid-template-columns: 1fr;
    }

    .section-space {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    .page-intro {
        padding-top: 2.5rem;
        padding-bottom: 1.5rem;
    }

    .section-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .family-card .image-frame img,
    .image-frame img {
        height: 260px;
    }

    .card-body h3 {
        font-size: 1.55rem;
    }

    .card-body {
        padding: 1.3rem;
    }

    .card-body > p:not(.eyebrow):not(.source-note) {
        font-size: 0.88rem;
    }

    .how-section,
    .family-detail,
    .species-detail,
    .split-feature,
    .related-species {
        gap: 2rem;
    }

    .community-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.2rem;
        padding: 2rem 1.5rem;
        margin-top: 2rem;
    }

    .taxonomy-tabs {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .taxonomy-tabs a {
        padding: 0.75rem 0;
        font-size: 0.68rem;
    }

    .family-detail {
        padding: 2.5rem 0;
    }

    .field-aside {
        float: none;
        width: 90%;
        margin: 0 auto 2rem;
        padding: 1.5rem;
    }

    .notes-copy {
        width: 90%;
        max-width: none;
        margin: auto;
    }

    .field-notes {
        padding: 2.5rem 0;
    }

    table {
        min-width: 570px;
    }

    .profile-table {
        min-width: 460px;
    }

    .species-filter > label {
        font-size: 0.78rem;
    }

    .species-detail img {
        height: 390px;
    }

    .form-panel {
        padding: 1.5rem 1.15rem;
    }

    .form-story img {
        height: 260px;
    }

    .example-result {
        padding: 1.5rem;
    }

    .enhancement-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .enhancement-number {
        font-size: 3rem;
    }

    .sitemap-list {
        columns: 1;
    }

    .footer-top {
        grid-template-columns: 1fr 1fr;
    }

    .footer-top > div {
        grid-column: 1 / -1;
    }

    .footer-top nav:last-child {
        grid-column: 1 / -1;
    }
}

/* 18 / Motion accessibility: no information depends on movement. */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

