/*
 * Foundation bootstrap from https://getbootstrap.com/docs/5.3/getting-started/introduction/, accessed 2024-06-05.
 * 

 * all images and assets lisenced by adobe except for sound assets all images and assets from adobe stock are under the stander lisence.
 * sound assets created by Sienna Updegraff using audio from pixabay.com with understanding of their lisensing agrements and use of the CC0 lisence.
 * all font files are lisenced by google fonts and are open source and free to use.

 * some assets and base model of this site was created by copilot AI and is under the MIT lisence and is free to use and modify.

 * play.html and game.js use assets from adobestock which is lisenced under the standard lisence and sound assets from pixabay.com and are used under the standard lisence and CC0 lisence.
 * Park Clean Up was created by Sienna Updegraff using the assets listed above and cleanded up using the help of copilot AI and is under the MIT lisence and is free to use and modify.

 


 */

/* Theme colors */
:root {
    --leaf: #8fbd67;
    --rose: #d96c72;
    --slate: #315746;
    --sage: #c4dda0;
    --orange: #93411e;
    --ink: #263b30;
    --paper: #f4f6ed;
    --action-color: var(--orange);
    --action-hover: #9c3d50;
    --action-text: #fff;
    --focus-ring: #ffbf47;
}

/* Fonts: local heading and body typefaces */
@font-face {
    font-family: 'Gorditas';
    src: url('../legal/fonts/Gorditas-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Gorditas';
    src: url('../legal/fonts/Gorditas-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Patrick Hand';
    src: url('../legal/fonts/PatrickHand-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Shared page background and body text */
body {
    background-color: var(--paper);
    background-image: repeating-linear-gradient(135deg, rgb(49 87 70 / 3%) 0 1px, transparent 1px 14px);
    color: var(--ink);
    font-family: 'Patrick Hand', cursive;
    font-size: 1.15rem;
    line-height: 1.45;
}

/* Homepage gallery heading accent */
.subdesign {
    text-decoration: underline;
    text-decoration-color: var(--leaf);
    text-decoration-thickness: 3px;
}

/* Shared site navigation */
.navbar {
    position: relative;
    z-index: 1;
    background: var(--slate);
    padding: 0.75rem clamp(1rem, 4vw, 3rem);
    box-shadow: 0 4px 16px rgb(38 59 48 / 18%);
}

.navbar-brand {
    color: #fff;
    font-family: "Gorditas", Georgia, serif;
    font-size: 1.35rem;
    font-weight: 700;
}

.navbar-brand:hover,
.navbar-brand:focus {
    color: var(--sage);
}

.navbar .nav-link {
    color: rgb(255 255 255 / 88%);
    font-weight: 600;
    padding-inline: 0.9rem;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus,
.navbar .nav-link.active {
    color: var(--sage);
}

.navbar-toggler {
    border-color: rgb(255 255 255 / 55%);
}

.navbar-toggler-icon {
    filter: invert(1);
}

.navbar .dropdown-menu {
    min-width: 12rem;
    padding: 0.4rem;
    border: 1px solid rgb(49 87 70 / 18%);
    border-radius: 6px;
    background: var(--paper);
    box-shadow: 0 10px 24px rgb(38 59 48 / 18%);
}

.navbar .dropdown-item {
    border-radius: 4px;
    color: var(--slate);
    font-family: 'Patrick Hand', cursive;
    font-size: 1.1rem;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
    background: var(--action-hover);
    color: var(--action-text);
}

/* Homepage hero */
.title {
    display: flex;
    min-height: 54vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 1.5rem;
    background: linear-gradient(90deg, rgb(24 52 38 / 78%), rgb(24 52 38 / 20%)),
        url("../images for Capstone/Americas/Land and water/grasslands.jpeg") center / cover no-repeat;
    color: #fff;
    text-shadow: 0 2px 14px rgb(0 0 0 / 30%);
}

.title h1,
.section h2,
main > .row > section:not(.section) h2,
.card-title {
    font-family: "Gorditas", Georgia, serif;
    font-weight: 400;
    font-style: normal;
}

.card-title {
    font-size: 1.25rem;
}

.title h1 {
    margin-bottom: 0.75rem;
    font-size: clamp(2.5rem, 5vw, 4.25rem);
    text-wrap: balance;
}

.title .lead {
    max-width: 42rem;
    margin-bottom: 0;
    font-size: 1.4rem;
    text-wrap: balance;
}

/* Homepage animal cards */
main#home-content {
    width: 100%;
    max-width: none;
    padding: 0;
    margin-inline: auto;
}

main#home-content > .row {
    width: calc(100% - 2rem);
    max-width: 1440px;
    padding-block: 1.5rem 2rem;
    margin-inline: auto;
}

main > .row > section:not(.section) > .card {
    height: 100%;
    border: 1px solid rgb(49 87 70 / 16%);
    border-top: 4px solid var(--sage);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 24px rgb(38 59 48 / 8%);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

main > .row > section:not(.section) > .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgb(38 59 48 / 13%);
}

main > .row > section:nth-child(2) > .card {
    border-top-color: var(--rose);
}

main > .row > section:nth-child(3) > .card {
    border-top-color: var(--orange);
}

main > .row > section:not(.section) > .card > .card-body {
    padding: 1.5rem;
}

.column-two-card-body {
    display: flex;
    flex-direction: column;
}

.column-two-image-link {
    display: block;
    margin-top: auto;
}

.column-two-card-body .column-two-image-link .card-img-top {
    max-height: 320px;
}

main > .row > section:not(.section) h2 {
    color: var(--slate);
    font-family: "Gorditas", Georgia, serif;
    font-size: 1.5rem;
}

main > .row > section:not(.section) p {
    line-height: 1.5;
}

.card .card {
    width: 100% !important;
    border: 0;
    border-radius: 4px;
    background: transparent;
}

.card-title {
    color: var(--slate);
}

.card .card-img-top {
    max-height: 230px;
    object-fit: contain;
}

/* Homepage Americas gallery band */
.section {
    width: 100%;
    margin-top: 1.5rem;
    padding: clamp(2rem, 5vw, 4rem) clamp(1.25rem, 4vw, 3.5rem);
    background-color: var(--slate);
    background-image: repeating-linear-gradient(45deg, rgb(255 255 255 / 3%) 0 1px, transparent 1px 18px);
    color: #fff;
}

.gallery-band {
    width: 100%;
    margin: 0;
}

.gallery-inner {
    width: min(100% - 2rem, 1440px);
    margin-inline: auto;
}

.gallery-next-link {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    width: fit-content;
    margin: 1.5rem auto 0;
    padding: 0.45rem 0.9rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    color: var(--action-text);
    font-weight: 700;
    text-decoration: none;
}

.gallery-heading {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 2rem;
}

.gallery-heading h2 {
    grid-column: 2;
    margin: 0;
    color: #fff;
    text-wrap: balance;
}

.gallery-top-button {
    grid-column: 3;
    justify-self: end;
}

/* Sprinkles animation and message dialog */
.sprinkles-dialog {
    width: min(440px, calc(100vw - 2rem));
    max-width: none;
    padding: 0;
    border: 2px solid var(--leaf);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 18px 55px rgb(0 0 0 / 35%);
}

.sprinkles-dialog::backdrop {
    background: rgb(20 30 25 / 70%);
}

.sprinkles-dialog-content {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 0.75rem;
    padding: 2rem;
    text-align: center;
}

.sprinkles-dialog-content h2 {
    margin: 0;
    padding-inline: 1.5rem;
    font-size: 1.5rem;
}

.sprinkles-dialog-close {
    position: absolute;
    top: 0.5rem;
    right: 0.65rem;
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid var(--action-color);
    border-radius: 50%;
    background-color: var(--action-color);
    color: var(--action-text);
    font-size: 1.75rem;
    line-height: 1;
    padding: 0;
}

.sprinkles-popout-animation {
    width: 180px;
    height: 180px;
    object-fit: contain;
}

.sprinkles-message {
    max-width: 32ch;
    margin: 0;
    padding: 0.85rem 1rem;
    border: 2px solid var(--leaf);
    border-radius: 8px;
    background: #f2f8e9;
    font-weight: 600;
}

.sprinkles-source-link {
    color: var(--slate);
    font-size: 1rem;
    text-underline-offset: 0.15em;
}

.section img {
    width: 100%;
    height: clamp(190px, 22vw, 290px);
    border: 3px solid rgb(255 255 255 / 72%);
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 10px 24px rgb(0 0 0 / 22%);
    transition: transform 200ms ease;
}

.section img:hover {
    transform: translateY(-3px);
}

/* Accessibility: stronger contrast and predictable keyboard feedback */
:root {
    --focus-ring: #ffbf47;
}

body {
    font-size: 1.15rem;
}

p,
li,
.card-text,
.habitat-copy p,
.world-region p,
.response-row p {
    line-height: 1.6;
}

.navbar .nav-link,
.navbar-brand,
.footer-nav a,
.site-footer p {
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus-visible,
.navbar-brand:hover,
.navbar-brand:focus-visible,
.footer-nav a:hover,
.footer-nav a:focus-visible {
    text-decoration: underline;
}

:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--focus-ring) !important;
    outline-offset: 4px !important;
    box-shadow: 0 0 0 2px #20372b !important;
}

.skip-link {
    border: 3px solid var(--focus-ring);
}

.buttons,
.navbar-toggler,
.sprinkles-dialog-close,
.sprinkles-number,
.gallery-next-link,
.habitat-index a {
    min-height: 44px;
}

.sprinkles-number,
.response-index {
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--action-color);
}

@media (forced-colors: active) {
    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }

    body,
    .card,
    .habitat-row,
    .world-region,
    .response-row,
    .conservation-note,
    dialog {
        background: Canvas !important;
        color: CanvasText !important;
        border-color: CanvasText !important;
    }

    a,
    button,
    [role="button"] {
        color: LinkText !important;
        border: 2px solid LinkText !important;
    }

    :focus-visible {
        outline: 4px solid Highlight !important;
        outline-offset: 4px !important;
    }

    .world-region-placeholder span,
    .navbar,
    .site-footer,
    .section,
    .gallery-band,
    .title {
        background: Canvas !important;
        color: CanvasText !important;
    }
}

/* Shared buttons and keyboard focus */
.buttons {
    border: 2px solid var(--action-color);
    border-radius: 6px;
    font-family: 'Patrick Hand', cursive;
    font-size: 1.15rem;
    font-weight: 400;
    padding: 0.45rem 1rem;
}

:focus-visible {
    outline: 3px solid var(--orange);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 2000;
    transform: translateY(-200%);
    padding: 0.65rem 1rem;
    border: 2px solid #fff;
    border-radius: 4px;
    background: #20372b;
    color: #fff;
    font-weight: 700;
}

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

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Shared footer foundation */
footer {
    background: #20372b !important;
    padding-block: 1.25rem !important;
}

footer p {
    margin: 0;
}

/* Regions page hero */
.regions-hero {
    position: relative;
    display: flex;
    min-height: 62vh;
    align-items: end;
    padding: clamp(2rem, 7vw, 6rem);
    background: linear-gradient(90deg, rgb(22 48 36 / 83%), rgb(22 48 36 / 10%)),
        url("../images for Capstone/Americas/Land and water/grasslands.jpeg") center 48% / cover no-repeat;
    color: #fff;
}

.regions-hero-copy {
    max-width: 700px;
}

.regions-hero h1,
.conservation-hero h1 {
    margin: 0 0 1rem;
    font-family: "Gorditas", Georgia, serif;
    font-size: clamp(2.4rem, 5vw, 4.5rem);
    line-height: 1.15;
    text-wrap: balance;
}

.regions-hero-copy > p:last-child,
.conservation-hero-copy > p:not(.page-kicker) {
    max-width: 38rem;
    margin-bottom: 0;
    font-size: 1.35rem;
}

.page-kicker,
.section-number {
    color: var(--orange);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sprinkles-number {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border: 1px solid var(--action-color);
    border-radius: 999px;
    background-color: var(--action-color);
    padding: 0.25rem 0.8rem;
    cursor: pointer;
    font-family: 'Patrick Hand', cursive;
    text-align: left;
    text-decoration: none;
}

.regions-hero .page-kicker,
.conservation-hero .page-kicker {
    color: var(--sage);
}

.regions-hero-note {
    position: absolute;
    right: clamp(1.25rem, 4vw, 4rem);
    bottom: 2rem;
    padding-left: 1rem;
    border-left: 2px solid var(--sage);
    font-size: 1rem;
    line-height: 1.2;
}

/* Regions page intro, habitat links, and image cards */
.regions-main,
.conservation-main {
    width: calc(100% - 2rem);
    max-width: 1200px;
    margin-inline: auto;
}

.habitat-intro {
    display: flex;
    justify-content: center;
    padding: 3rem 0 2rem;
    border-bottom: 1px solid rgb(49 87 70 / 25%);
}

.habitat-intro p {
    max-width: 52rem;
    margin: 0;
    font-size: 1.35rem;
    text-align: center;
}

.habitat-index {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid rgb(49 87 70 / 25%);
    background: var(--paper);
}

.habitat-index a,
.conservation-note a,
.site-footer a {
    color: var(--slate);
    font-weight: 700;
    text-decoration-color: var(--leaf);
    text-underline-offset: 4px;
}

.habitat-index a {
    flex: 0 0 auto;
    padding: 0.3rem 0.85rem;
    border: 1px solid var(--action-color);
    border-radius: 999px;
    text-decoration: none;
}

.habitat-list {
    padding-block: 1.5rem 4rem;
}

.world-regions {
    padding: 1rem 0 4rem;
    scroll-margin-top: 5rem;
}

.world-regions > .page-kicker,
.world-regions > h2 {
    text-align: center;
}

.world-regions > h2 {
    margin: 0.4rem 0 1.5rem;
    color: var(--slate);
    font-family: "Gorditas", Georgia, serif;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.world-region-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.world-region {
    padding: 1.25rem;
    border: 1px solid rgb(49 87 70 / 16%);
    border-top: 4px solid var(--sage);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 24px rgb(38 59 48 / 7%);
    scroll-margin-top: 5rem;
}

.world-region:nth-child(3n + 2) {
    border-top-color: var(--rose);
}

.world-region:nth-child(3n) {
    border-top-color: var(--orange);
}

.world-region h3 {
    margin: 0.4rem 0;
    color: var(--slate);
    font-family: "Gorditas", Georgia, serif;
    font-size: 1.3rem;
}

.world-region-placeholder {
    position: relative;
    display: block;
    width: 100%;
    height: 11rem;
    overflow: hidden;
    margin-bottom: 0.75rem;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: var(--slate);
    text-decoration: none;
}

.world-region-placeholder::before {
    display: none;
}

@media (max-width: 575.98px) {
    .world-region-placeholder {
        height: 12rem;
    }

    .world-region-placeholder span {
        white-space: normal;
    }
}

.world-region-placeholder img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.world-region-placeholder span {
    position: absolute;
    left: 50%;
    bottom: 0.75rem;
    transform: translateX(-50%);
    max-width: calc(100% - 1.5rem);
    padding: 0.45rem 0.8rem;
    border: 2px solid #fff;
    border-radius: 999px;
    background: rgb(32 55 43 / 94%);
    color: #fff;
    font-size: clamp(0.9rem, 1.5vw, 1.05rem);
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
}

.world-region-placeholder:hover img,
.world-region-placeholder:focus-visible img {
    transform: scale(1.025);
}

.world-region-placeholder img {
    transition: transform 180ms ease;
}

.world-region-placeholder:focus-visible {
    outline: 3px solid var(--orange);
    outline-offset: 4px;
}

/* Consistent colors and hover feedback for action controls */
.buttons,
.navbar-toggler,
.sprinkles-dialog-close,
.sprinkles-number,
.gallery-next-link,
.habitat-index a {
    background-color: var(--action-color);
    border-color: var(--action-color);
    border-radius: 999px;
    color: var(--action-text);
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

body .buttons:hover,
body .buttons:focus-visible,
body .navbar-toggler:hover,
body .navbar-toggler:focus-visible,
body .sprinkles-dialog-close:hover,
body .sprinkles-dialog-close:focus-visible,
body .sprinkles-number:hover,
body .sprinkles-number:focus-visible,
body .gallery-next-link:hover,
body .gallery-next-link:focus-visible,
body .habitat-index a:hover,
body .habitat-index a:focus-visible {
    border-color: var(--action-hover);
    background-color: var(--action-hover);
    color: var(--action-text);
}

.world-region p {
    margin: 0;
}

.habitat-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    gap: clamp(1.5rem, 5vw, 5rem);
    align-items: center;
    margin-bottom: 1.25rem;
    padding: clamp(1rem, 2.5vw, 2rem);
    border: 1px solid rgb(49 87 70 / 16%);
    border-top: 4px solid var(--sage);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 24px rgb(38 59 48 / 7%);
    scroll-margin-top: 5rem;
}

.habitat-row:nth-child(even) {
    border-top-color: var(--rose);
}

.habitat-row:nth-child(3n) {
    border-top-color: var(--orange);
}

.habitat-row-reverse .habitat-image {
    order: 2;
}

.habitat-image img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 6px;
    object-fit: cover;
}

.habitat-copy h2,
.conservation-statement h2,
.response-heading h2,
.conservation-note h2 {
    margin: 0.5rem 0 0.75rem;
    color: var(--slate);
    font-family: "Gorditas", Georgia, serif;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    line-height: 1.25;
    text-wrap: balance;
}

.habitat-copy p,
.response-row p,
.conservation-statement p,
.conservation-note p {
    max-width: 44rem;
    margin: 0;
    font-size: 1.2rem;
}

/* Conservation page hero and introduction */
.conservation-hero {
    position: relative;
    display: flex;
    min-height: 58vh;
    align-items: center;
    overflow: hidden;
    background: #20372b;
    color: #fff;
}

.conservation-hero-image {
    position: absolute;
    inset: 0;
}

.conservation-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 42%;
}

.conservation-hero-copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: center;
    width: min(100% - 2rem, 1200px);
    min-height: 58vh;
    margin-inline: auto;
    padding-block: clamp(2rem, 6vw, 6rem);
    color: #fff;
    text-shadow: 0 2px 14px rgb(0 0 0 / 30%);
}

.conservation-hero::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgb(24 52 38 / 82%), rgb(24 52 38 / 16%));
    content: "";
}

.conservation-hero h1 {
    max-width: 760px;
    color: #fff;
}

.conservation-hero-copy .page-kicker {
    margin-bottom: 0.85rem;
}

.conservation-hero-copy .buttons {
    margin-top: 1.5rem;
}

.conservation-main {
    padding-block: 4rem;
}

.conservation-statement {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 4rem;
    border-bottom: 1px solid rgb(49 87 70 / 25%);
    text-align: center;
}

.conservation-statement .section-number {
    padding-top: 0;
}

.conservation-statement h2 {
    margin-top: 0;
    font-size: clamp(1.8rem, 3.5vw, 3rem);
}

.conservation-statement p {
    max-width: 52rem;
}

/* Conservation response cards */
.response-section {
    padding-block: 4rem;
}

.response-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    text-align: center;
}

.response-heading h2 {
    margin: 0;
}

.response-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.response-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    padding: 1.25rem;
    border: 1px solid rgb(49 87 70 / 16%);
    border-top: 4px solid var(--sage);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 24px rgb(38 59 48 / 7%);
}

.response-row:nth-child(2) {
    border-top-color: var(--rose);
}

.response-row:nth-child(3) {
    border-top-color: var(--orange);
}

.response-index {
    align-self: flex-start;
    color: var(--action-text);
    font-size: 1rem;
    text-transform: capitalize;
}

.response-row img {
    order: -1;
    width: 100%;
    height: 190px;
    margin-bottom: 1rem;
    border-radius: 5px;
    object-fit: cover;
}

.response-row .sprinkles-number {
    margin-bottom: 0.85rem;
}

.response-row h3 {
    margin: 0 0 0.5rem;
    color: var(--slate);
    font-family: "Gorditas", Georgia, serif;
    font-size: 1.3rem;
}

/* Conservation closing message and shared page footer */
.conservation-note {
    padding: clamp(1.5rem, 4vw, 3.5rem);
    border-left: 6px solid var(--leaf);
    background: #e7eddc;
}

.conservation-note h2 {
    max-width: 36rem;
}

.conservation-note a {
    display: inline-block;
    margin-top: 1.25rem;
}

.conservation-note .conservation-return {
    color: #fff;
}

.site-sources {
    width: min(100% - 2rem, 1120px);
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 4rem) 0;
}

.site-sources h2 {
    color: var(--slate);
    font-family: "Gorditas", Georgia, serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.site-sources ol {
    padding-left: 1.5rem;
}

.site-sources li {
    padding-block: 0.25rem;
}

.site-sources a {
    color: var(--slate);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}

.sources-note {
    padding-top: 0.75rem;
    border-top: 1px solid rgb(49 87 70 / 24%);
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem clamp(1rem, 4vw, 3rem);
    background: #20372b;
    color: #fff;
}

.site-footer a {
    color: var(--sage);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem 1.25rem;
}

.footer-nav a[aria-current="page"] {
    color: #fff;
    text-decoration-thickness: 2px;
}

/* Play page and future browser-game surface */
.play-hero {
    display: grid;
    min-height: 34vh;
    place-items: center;
    padding: 3rem 1.5rem;
    background-color: #274b46;
    background-image: linear-gradient(90deg, transparent 50%, rgb(196 221 160 / 8%) 50%),
        linear-gradient(0deg, transparent 50%, rgb(196 221 160 / 8%) 50%);
    background-size: 32px 32px;
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 14px rgb(0 0 0 / 30%);
}

.play-hero h1 {
    margin-bottom: 0.6rem;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 800;
}

.play-hero p {
    max-width: 38rem;
    margin: 0 auto;
    font-size: 1.3rem;
}

.play-desktop-notice {
    display: none;
}

.play-main {
    width: min(100% - 2rem, 1120px);
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 4rem) 0;
}

.play-heading {
    margin-bottom: 1.25rem;
}

.play-heading .section-number {
    color: var(--orange);
}

.play-heading h2 {
    margin: 0.25rem 0 0;
    color: var(--slate);
    font-family: "Gorditas", Georgia, serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.play-heading > p {
    margin: 0.5rem 0 0;
    color: var(--slate);
}

.game-frame {
    overflow: hidden;
    border: 4px solid #20372b;
    border-radius: 0;
    background: #20372b;
    box-shadow: 8px 8px 0 rgb(38 59 48 / 22%);
}

.game-screen {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #e7eddc;
}

.game-screen canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: #dcebd4;
    image-rendering: auto;
    outline-offset: -5px;
}

.game-statusbar {
    display: flex;
    min-height: 3rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 1rem;
    border-bottom: 2px solid #536e54;
    background: #20372b;
}

.game-statusbar p {
    margin: 0;
    color: #f4f6ed;
    font-weight: 700;
}

.game-console {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.5rem 1.5rem;
    padding: 0.75rem 1rem;
    border-top: 2px solid #fff4d2;
    background: #d3dfac;
    color: #263b30;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: 0.85rem;
}

.game-console p {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0;
}

.game-console p:first-child {
    grid-column: 1;
    grid-row: 1;
}

.game-console p:last-child {
    grid-column: 2;
    grid-row: 1;
}

.game-console kbd {
    display: inline-grid;
    min-width: 1.65rem;
    min-height: 1.65rem;
    place-items: center;
    border: 2px solid #315746;
    border-bottom-width: 4px;
    border-radius: 0;
    background: #f4f6ed;
    color: #263b30;
    font: inherit;
    font-weight: 700;
}

.game-dialogue,
.game-finish {
    padding: 1rem clamp(1rem, 3vw, 1.5rem);
    border-top: 3px solid #d6a64c;
    background: #263f38;
    color: #f4f6ed;
}

.game-dialogue h3,
.game-finish h3 {
    margin: 0 0 0.35rem;
    color: #f4d995;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: 1.2rem;
    font-weight: 800;
}

.game-dialogue p,
.game-finish p {
    margin: 0 0 0.75rem;
}

.game-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.game-choices button {
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    border: 2px solid #d6a64c;
    border-radius: 0;
    background: #263f38;
    color: #f4f6ed;
    font: inherit;
    text-align: left;
}

.game-choices button:hover,
.game-choices button.is-selected {
    background: #d6a64c;
    color: #263b30;
    box-shadow: 4px 4px 0 #182c26;
}

.game-dialogue[hidden],
.game-finish[hidden] {
    display: none;
}

.game-dialogue-hint,
.game-finish-hint {
    margin: 0.8rem 0 0;
    color: #d3dfac;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: 0.85rem;
    font-weight: 700;
}

.game-finish {
    border-top: 4px solid #d6a64c;
    background: #d3dfac;
    color: #263b30;
}

.game-finish h3 {
    color: #315746;
}

.game-finish .section-number {
    margin-bottom: 0.4rem;
    color: #315746;
}

.game-finish-hint {
    color: #315746;
}

.game-credit {
    margin: 0.75rem 0 0;
    color: var(--slate);
    font-size: 0.95rem;
}

.game-credit a {
    color: var(--slate);
    font-weight: 700;
    text-underline-offset: 0.15em;
}

.game-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgb(32 55 43 / 94%);
    color: #f4f6ed;
    text-align: center;
}

.game-overlay[hidden] {
    display: none;
}

.game-overlay h2 {
    margin: 0.25rem 0 1.25rem;
    color: #f4d995;
    font-family: "Gorditas", Georgia, serif;
    font-size: clamp(2rem, 6vw, 4.5rem);
}

.game-overlay-kicker {
    margin: 0;
    color: #d3dfac;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.game-overlay-button {
    min-width: 11rem;
    margin: 0.25rem;
    padding: 0.75rem 1.25rem;
    border: 3px solid #f4d995;
    border-radius: 0;
    background: #d6a64c;
    color: #263b30;
    font: 800 1.1rem "Patrick Hand", cursive;
    cursor: pointer;
}

.game-overlay-button:hover,
.game-overlay-button:focus-visible {
    background: #f4d995;
}

.game-overlay-button-secondary {
    background: #f4f6ed;
}

@media (max-width: 991.98px) {
    .play-page > .play-hero,
    .play-page > .play-main,
    .play-page > .site-footer {
        display: none;
    }

    .play-desktop-notice {
        display: grid;
        min-height: 60vh;
        align-content: center;
        justify-items: center;
        padding: 2rem;
        color: var(--slate);
        text-align: center;
    }

    .play-desktop-notice h2 {
        font-family: "Gorditas", Georgia, serif;
        font-size: clamp(1.6rem, 5vw, 2.4rem);
    }

    .play-desktop-notice p {
        max-width: 34rem;
        margin: 0;
    }
}

/* Small-screen layout adjustments */
@media (max-width: 575.98px) {
    .navbar {
        padding-inline: 0.75rem;
    }

    .title {
        min-height: 42vh;
    }

    .title h1 {
        font-size: 2.55rem;
    }

    .section img {
        height: 220px;
    }

    .gallery-heading {
        grid-template-columns: 1fr;
        row-gap: 1rem;
    }

    .gallery-heading h2 {
        grid-column: 1;
    }

    .gallery-top-button {
        grid-column: 1;
        justify-self: center;
    }

    .sprinkles-dialog-content {
        padding: 1.5rem 1rem;
    }

    .regions-hero {
        min-height: 56vh;
        padding: 2rem 1.25rem 5rem;
    }

    .regions-hero-note {
        bottom: 1.25rem;
    }

    .habitat-row,
    .conservation-hero,
    .conservation-statement {
        grid-template-columns: 1fr;
    }

    .world-region-list {
        grid-template-columns: 1fr;
    }

    .habitat-index {
        justify-content: start;
        overflow-x: auto;
    }

    .habitat-index a {
        flex: 0 0 auto;
    }

    .habitat-row-reverse .habitat-image {
        order: 0;
    }

    .conservation-hero,
    .conservation-hero-copy {
        min-height: 38vh;
    }

    .conservation-hero-copy {
        width: calc(100% - 2.5rem);
        padding-block: 2rem 2.5rem;
    }

    .conservation-statement .section-number {
        grid-row: auto;
    }

    .game-statusbar {
        align-items: flex-start;
    }

    .game-console {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .game-console p:first-child,
    .game-console p:last-child {
        grid-column: 1;
        grid-row: auto;
    }

    .response-heading {
        display: block;
    }

    .response-list {
        grid-template-columns: 1fr;
    }

    .response-row img {
        height: 180px;
    }

    .site-footer {
        flex-direction: column;
    }

    .footer-nav {
        justify-content: flex-start;
    }
}

@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;
    }
}

/* Tablet response-card layout */
@media (min-width: 576px) and (max-width: 991.98px) {
    .response-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .world-region-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Shared sister-page presentation refinements */
.sources-hero {
    display: flex;
    min-height: 38vh;
    align-items: center;
    justify-content: center;
    padding: clamp(3rem, 7vw, 5.5rem) 1.5rem;
    background: linear-gradient(90deg, rgb(24 52 38 / 88%), rgb(24 52 38 / 38%)), url("../images for Capstone/Americas/Land and water/mixed woodlands.jpeg") center 58% / cover no-repeat;
    color: #fff;
    text-align: center;
}

.sources-hero-copy {
    max-width: 760px;
}

.sources-hero h1 {
    margin: 0.25rem 0 0.75rem;
    color: #fff;
    font-family: "Gorditas", Georgia, serif;
    font-size: clamp(2.25rem, 5vw, 4rem);
}

.sources-hero p:not(.page-kicker) {
    max-width: 38rem;
    margin: 0 auto;
    font-size: 1.25rem;
}

.sources-hero .page-kicker {
    color: var(--sage);
}

.sources-main {
    width: min(100% - 2rem, 1120px);
    margin-inline: auto;
    padding-block: clamp(2.5rem, 5vw, 4.5rem);
}

.sources-main .card {
    border: 1px solid rgb(49 87 70 / 16%);
    border-top: 4px solid var(--sage);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgb(38 59 48 / 7%);
}

.sources-main .card-body {
    padding: clamp(1.25rem, 3vw, 2rem);
}

.sources-main .card-title {
    margin-bottom: 1.25rem;
    font-family: "Gorditas", Georgia, serif;
}

.sources-main ol a {
    color: var(--slate);
    font-weight: 700;
    text-underline-offset: 0.15em;
}

.sources-main ol p {
    margin: 0.15rem 0 0;
    color: rgb(38 59 48 / 78%);
}

.sources-main .conservation-note {
    border-left: 0;
    border-top: 4px solid var(--rose);
    border-radius: 6px;
}

body.regions-page .habitat-row {
    box-shadow: 0 8px 24px rgb(38 59 48 / 7%);
}

body.regions-page .conservation-note {
    margin-bottom: 4rem;
}

/* Region-specific habitat page headers */
.regions-hero#africa {
    background: linear-gradient(90deg, rgb(22 48 36 / 83%), rgb(22 48 36 / 10%)),
        url("../images for Capstone/africa/africa.jpeg") center 48% / cover no-repeat;
}

.regions-hero#asia {
    background: linear-gradient(90deg, rgb(22 48 36 / 83%), rgb(22 48 36 / 10%)),
        url("../images for Capstone/asia/asia_moustains.jpeg") center 48% / cover no-repeat;
}

.regions-hero#europe {
    background: linear-gradient(90deg, rgb(22 48 36 / 83%), rgb(22 48 36 / 10%)),
        url("../images for Capstone/Europe/europe.jpeg") center 48% / cover no-repeat;
}

.regions-hero#oceania {
    background: linear-gradient(90deg, rgb(22 48 36 / 83%), rgb(22 48 36 / 10%)),
        url("../images for Capstone/oceania/oceania.jpeg") center 48% / cover no-repeat;
}

.regions-hero#antarctica {
    background: linear-gradient(90deg, rgb(22 48 36 / 83%), rgb(22 48 36 / 10%)),
        url("../images for Capstone/antartica/antartica.jpeg") center 48% / cover no-repeat;
}

.regions-hero#americas {
    background: linear-gradient(90deg, rgb(22 48 36 / 83%), rgb(22 48 36 / 10%)),
        url("../images for Capstone/Americas/Land and water/mixed woodlands.jpeg") center 48% / cover no-repeat;
}

.play-brand {
    margin: 0 0 0.25rem;
    font-family: "Gorditas", Georgia, serif;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

@media (prefers-contrast: more) {
    :root {
        --ink: #111111;
        --slate: #183629;
        --paper: #ffffff;
        --action-color: #7a2f14;
        --action-hover: #4a1f32;
    }

    body {
        background-image: none;
    }

    p,
    li,
    .card-text,
    .habitat-copy p,
    .world-region p,
    .response-row p {
        font-weight: 600;
    }

    .card,
    .habitat-row,
    .world-region,
    .response-row,
    .conservation-note,
    .sprinkles-dialog-content {
        border: 2px solid #183629;
    }
}

main a:not(.buttons):not(.btn):not(.nav-link):not(.dropdown-item):not(.world-region-placeholder):not(.gallery-next-link):not(.habitat-index a) {
    text-decoration: underline;
    text-decoration-thickness: 0.12em;
    text-underline-offset: 0.14em;
}