/* Custom CSS Variables for Earth's Palette */
:root {
    --color-deep-forest: #1A4D2E; /* Dark Green */
    --color-soil-brown: #5F4730;   /* Medium Brown */
    --color-ochre-sun: #E89F4C;    /* Warm Orange */
    --color-ocean-blue: #2F5D62;   /* Teal Blue */
    --color-sunset-orange: #C06C4C; /* Muted Orange */
    --color-off-white: #F8F4E3;    /* Light Creamy Background */
    --color-light-grey: #D3D3D3;   /* For subtle UI elements */
    --color-dark-grey: #333333;    /* Text on light backgrounds */
    --color-accent-copper: #B87333; /* For interactive elements, copper-like */
    --color-accent-bronze: #8C5C3D; /* For interactive elements, bronze-like */

    --font-heading: 'Georgia', serif; /* More classic, strong for headings */
    --font-body: 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; /* Clean, modern sans-serif */

    --header-height: 80px;
    --wild-path-width: 250px;
    --mobile-nav-width: 70%;
}

/* Base Styles & Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--color-dark-grey);
    background-color: var(--color-off-white);
    overflow-x: hidden; /* Prevent horizontal scroll from parallax/overflow */
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-deep-forest);
    margin-bottom: 0.8em;
    line-height: 1.2;
}

h1 { font-size: 3.2em; }
h2 { font-size: 2.5em; color: var(--color-soil-brown); }
h3 { font-size: 1.8em; }
p { font-size: 1.1em; margin-bottom: 1em; }

a {
    color: var(--color-ocean-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover {
    color: var(--color-sunset-orange);
}

img, video {
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Header & Navigation */
.main-header {
    background-color: rgba(var(--color-soil-brown), 0.9);
    color: var(--color-off-white);
    padding: 0 2em;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;
}

.main-header .logo {
    font-family: var(--font-heading);
    font-size: 1.8em;
    font-weight: bold;
    color: var(--color-off-white);
    letter-spacing: 1px;
}

.main-nav {
    display: flex;
    gap: 1.8em;
}

.main-nav a {
    color: var(--color-off-white);
    font-size: 1.1em;
    padding: 0.5em 0;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-ochre-sun);
    transition: width 0.3s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

.menu-toggle, .audio-toggle {
    background: none;
    border: none;
    color: var(--color-off-white);
    font-size: 1.8em;
    cursor: pointer;
    display: none; /* Hidden on desktop */
    padding: 0.5em;
}

.audio-toggle {
    font-size: 1.5em;
    margin-left: 1em;
}

.audio-toggle .hidden {
    display: none;
}

/* Main Content Area */
main {
    margin-top: var(--header-height); /* Offset for fixed header */
}

.section {
    padding: 6em 2em;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden; /* Crucial for parallax and section-specific designs */
}

.section-content {
    max-width: 1200px;
    width: 100%;
    text-align: center;
    z-index: 2; /* Ensure content is above backgrounds/overlays */
}

.subtitle {
    font-style: italic;
    color: var(--color-ocean-blue);
    margin-bottom: 2em;
    font-size: 1.2em;
}

/* --- Wild Path Tracker --- */
.wild-path-tracker {
    position: fixed;
    top: calc(var(--header-height) + 2em);
    left: 1em;
    width: var(--wild-path-width);
    background-color: rgba(var(--color-off-white), 0.95);
    border: 1px solid var(--color-light-grey);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 1.5em 1em;
    z-index: 900;
    transform: translateX(-100%); /* Initially off-screen */
    transition: transform 0.4s ease-out;
    opacity: 1;
}

body:not(.scrolled-past-hero) .wild-path-tracker { /* Show once scrolled past hero */
    transform: translateX(0);
    opacity: 1;
}
.wild-path-tracker h3 {
    font-family: var(--font-heading);
    color: var(--color-deep-forest);
    margin-bottom: 1em;
    font-size: 1.4em;
    border-bottom: 1px solid var(--color-light-grey);
    padding-bottom: 0.5em;
}

.wild-path-tracker ul {
    list-style: none;
    text-align: left;
}

.wild-path-tracker li {
    padding: 0.7em 0.5em;
    margin-bottom: 0.5em;
    font-size: 0.95em;
    color: var(--color-dark-grey);
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.wild-path-tracker li:hover {
    background-color: rgba(var(--color-ocean-blue), 0.1);
}

.wild-path-tracker li.active {
    background-color: var(--color-ocean-blue);
    color: var(--color-off-white);
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(var(--color-ocean-blue), 0.3);
}

/* Untamed Horizon: Living Panorama */
.untamed-horizon-section {
    min-height: 100vh;
    padding: 0;
    position: relative;
    color: var(--color-off-white);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    justify-content: center;
    text-align: center;
}

.living-panorama-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none; /* Allow interaction with elements below */
}

.living-panorama-video video {
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.parallax-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.4) 100%);
    z-index: 1;
}

.untamed-horizon-section h1 {
    color: var(--color-off-white);
    font-size: 4em;
    margin-bottom: 0.3em;
    letter-spacing: 2px;
}

.untamed-horizon-section p {
    color: var(--color-off-white);
    font-size: 1.5em;
    max-width: 800px;
    margin: 0 auto 3em;
}

.interactive-hotspots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allow events on hotspots */
    z-index: 3;
}

.hotspot {
    position: absolute;
    width: 40px;
    height: 40px;
    background-color: var(--color-accent-copper);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 0 0 5px rgba(var(--color-accent-copper), 0.5);
    transition: transform 0.3s ease, background-color 0.3s ease;
    border: 2px solid var(--color-off-white);
}

.hotspot:hover {
    transform: scale(1.1);
    background-color: var(--color-ochre-sun);
    box-shadow: 0 0 0 8px rgba(var(--color-ochre-sun), 0.6);
}

.hotspot span {
    color: var(--color-off-white);
    font-size: 0.8em;
    font-weight: bold;
    opacity: 1;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.hotspot:hover span {
    opacity: 1;
}

.hotspot-detail {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(var(--color-deep-forest), 0.9);
    color: var(--color-off-white);
    padding: 0.8em 1.2em;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 1;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.hotspot:hover .hotspot-detail {
    opacity: 1;
    visibility: visible;
}

/* Life's Intricate Weave: Ecosystem Flowchart */
.lifes-intricate-weave-section {
    background-color: var(--color-off-white);
    background-image: url('images/image_17.jpg'); /* Subtle background texture */
    background-size: cover;
    background-position: center;
    position: relative;
    padding-top: calc(var(--header-height) + 6em);
}
.lifes-intricate-weave-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(var(--color-off-white), 0.85); /* Semi-transparent overlay */
    z-index: 0;
}
.lifes-intricate-weave-section .section-content {
    position: relative;
    z-index: 1;
}

.ecosystem-flowchart {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto 50px auto 50px auto 50px auto; /* Auto rows for nodes, fixed height for connections */
    gap: 1em;
    margin: 3em auto;
    max-width: 900px;
    position: relative;
    padding: 2em;
    background-color: rgba(var(--color-off-white), 0.9);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--color-light-grey);
}

.node {
    background-color: var(--color-ocean-blue);
    color: var(--color-off-white);
    padding: 1.2em;
    border-radius: 10px;
    font-weight: bold;
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    min-height: 80px;
}

.node span {
    position: relative;
    z-index: 1;
}

.node:hover, .node:focus {
    transform: translateY(-5px) scale(1.02);
    background-color: var(--color-deep-forest);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.node-detail {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: rgba(var(--color-deep-forest), 0.95);
    color: var(--color-off-white);
    padding: 1em 1.5em;
    border-radius: 8px;
    font-size: 0.9em;
    white-space: normal;
    min-width: 250px;
    max-width: 350px;
    opacity: 1;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    text-align: left;
    font-weight: normal;
}

.node:hover .node-detail, .node:focus .node-detail {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.node.principal {
    grid-column: 2 / 3;
    background-color: var(--color-deep-forest);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}
.node.concept {
    grid-column: 2 / 3;
    background-color: var(--color-ocean-blue);
}
.node.category.node-left {
    grid-column: 1 / 2;
    background-color: var(--color-ochre-sun);
    color: var(--color-dark-grey);
}
.node.category.node-right {
    grid-column: 3 / 4;
    background-color: var(--color-sunset-orange);
}

/* Connections */
.connection {
    height: 50px; /* Vertical space for connections */
    position: relative;
    grid-column: 2 / 3;
    display: flex;
    justify-content: center;
    align-items: center;
}
.connection::before {
    content: '';
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--color-accent-bronze), var(--color-accent-copper));
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
    box-shadow: 0 0 5px rgba(var(--color-accent-copper), 0.5);
}
/* Horizontal connections for category nodes */
.connection-b::after {
    content: '';
    width: calc(100% + 2 * (1fr + 1em)); /* Span across the grid columns */
    height: 4px;
    background: linear-gradient(to right, var(--color-accent-bronze), var(--color-accent-copper));
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 2px;
    box-shadow: 0 0 5px rgba(var(--color-accent-copper), 0.5);
    z-index: 0;
}

.flowchart-explanation {
    margin-top: 3em;
    font-style: italic;
    color: var(--color-soil-brown);
}


/* Denizens of the Earth: Biodiversity Atlas */
.denizens-of-the-earth-section {
    background: linear-gradient(to bottom, var(--color-ocean-blue), var(--color-deep-forest));
    color: var(--color-off-white);
    padding-top: calc(var(--header-height) + 6em);
}
.denizens-of-the-earth-section h2, .denizens-of-the-earth-section p.subtitle {
    color: var(--color-off-white);
}

.biodiversity-atlas {
    position: relative;
    max-width: 1000px;
    margin: 3em auto;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(var(--color-light-grey), 0.3);
}

.atlas-map {
    width: 100%;
    height: auto;
    display: block;
    filter: brightness(0.8) contrast(1.1);
}

.region-marker {
    position: absolute;
    width: 30px;
    height: 30px;
    background-color: var(--color-accent-copper);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    box-shadow: 0 0 0 5px rgba(var(--color-accent-copper), 0.4);
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid var(--color-off-white);
}

.region-marker:hover, .region-marker.active {
    transform: translate(-50%, -50%) scale(1.2);
    background-color: var(--color-ochre-sun);
    box-shadow: 0 0 0 8px rgba(var(--color-ochre-sun), 0.6);
}

.habitat-cards-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2em;
    margin-top: 4em;
    padding: 0 2em;
    width: 100%;
}

.habitat-card {
    background-color: rgba(var(--color-off-white), 0.1);
    backdrop-filter: blur(5px);
    border-radius: 12px;
    padding: 1.5em;
    text-align: left;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(var(--color-light-grey), 0.2);
    transform: translateY(10px);
    opacity: 1;
    transition: transform 0.6s ease-out, opacity 0.6s ease-out;
    color: var(--color-off-white);
}

.habitat-card.visible {
    transform: translateY(0);
    opacity: 1;
}

.habitat-card img {
    border-radius: 8px;
    margin-bottom: 1em;
    width: 100%;
    height: 250px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.habitat-card h3 {
    color: var(--color-ochre-sun);
    margin-bottom: 0.5em;
    font-size: 1.6em;
}

.habitat-card p {
    font-size: 0.95em;
    margin-bottom: 0.7em;
    color: rgba(var(--color-off-white), 0.9);
}

.habitat-card audio {
    display: none; /* Controlled by button */
}

.play-sound-btn {
    background-color: var(--color-accent-copper);
    color: var(--color-off-white);
    border: none;
    padding: 0.8em 1.5em;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    margin-top: 1em;
}

.play-sound-btn:hover {
    background-color: var(--color-ochre-sun);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Re-Wilding Expeditions: Conservation Chronicle Timeline */
.re-wilding-expeditions-section {
    background-color: var(--color-off-white);
    background-image: url('images/image_17.jpg5'); /* Forest texture */
    background-size: cover;
    background-attachment: fixed; /* Parallax effect */
    background-position: center;
    position: relative;
    padding-top: calc(var(--header-height) + 6em);
}
.re-wilding-expeditions-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(var(--color-off-white), 0.85);
    z-index: 0;
}
.re-wilding-expeditions-section .section-content {
    position: relative;
    z-index: 1;
}
.re-wilding-expeditions-section h2, .re-wilding-expeditions-section p.subtitle {
    color: var(--color-deep-forest);
}

.conservation-chronicle-timeline {
    position: relative;
    max-width: 900px;
    margin: 4em auto;
    padding: 1em 0;
}

.timeline-trail {
    position: absolute;
    width: 8px;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(to bottom, var(--color-deep-forest), var(--color-soil-brown), var(--color-ocean-blue));
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(var(--color-deep-forest), 0.5);
    z-index: 0;
}

.timeline-entry {
    display: flex;
    justify-content: center;
    margin-bottom: 6em; /* Space between entries */
    position: relative;
    z-index: 1;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    background-color: var(--color-accent-copper);
    border-radius: 50%;
    border: 4px solid var(--color-off-white);
    box-shadow: 0 0 0 4px var(--color-accent-bronze), 0 0 15px rgba(0, 0, 0, 0.4);
    z-index: 2;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.timeline-content {
    background-color: var(--color-off-white);
    padding: 2em;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    width: 45%; /* Content width on either side of the line */
    text-align: left;
    position: relative;
    border: 1px solid var(--color-light-grey);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    will-change: transform;
}

.timeline-entry:nth-child(even) .timeline-content {
    margin-left: calc(50% + 40px); /* Offset to the right */
}

.timeline-entry:nth-child(odd) .timeline-content {
    margin-right: calc(50% + 40px); /* Offset to the left */
}

.timeline-entry:hover .timeline-content {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
}

.timeline-content h3 {
    color: var(--color-ocean-blue);
    margin-bottom: 1em;
    font-size: 1.8em;
}

.project-details {
    display: flex;
    gap: 1.5em;
    align-items: flex-start;
}

.project-details img {
    border-radius: 8px;
    width: 45%;
    height: 200px; /* Fixed height for consistency */
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.project-details .text-content {
    flex-grow: 1;
    width: 55%;
}

.project-details p {
    font-size: 0.95em;
    margin-bottom: 0.8em;
}
.project-details p strong {
    color: var(--color-deep-forest);
}

.image-caption {
    font-style: italic;
    font-size: 0.85em;
    color: var(--color-dark-grey);
    text-align: center;
    margin-top: 0.5em;
}

/* Whispers from the Canopy: Discovery Fragments Grid */
.whispers-from-the-canopy-section {
    background-color: var(--color-deep-forest);
    background-image: url('images/image_17.jpg6'); /* Canopy texture */
    background-size: cover;
    background-attachment: fixed;
    background-position: top center;
    position: relative;
    padding-top: calc(var(--header-height) + 6em);
}
.whispers-from-the-canopy-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(var(--color-deep-forest), 0.8);
    z-index: 0;
}
.whispers-from-the-canopy-section .section-content {
    position: relative;
    z-index: 1;
}
.whispers-from-the-canopy-section h2, .whispers-from-the-canopy-section p.subtitle {
    color: var(--color-off-white);
}

.discovery-fragments-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(250px, auto); /* Flexible row heights for mosaic */
    gap: 1.5em;
    margin-top: 4em;
    padding: 0 2em;
    max-width: 1200px;
    width: 100%;
    counter-reset: fragment-count; /* For potential infinite scroll loading */
}

.fragment {
    background-color: rgba(var(--color-off-white), 0.95);
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.fragment:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.fragment img, .fragment video {
    width: 100%;
    height: 200px; /* Default height */
    object-fit: cover;
    border-bottom: 1px solid var(--color-light-grey);
}
.fragment video {
    background-color: black; /* For browsers that don't show poster */
}

.fragment audio {
    width: calc(100% - 2em);
    margin: 1em;
    background-color: var(--color-light-grey);
    border-radius: 5px;
}

.fragment-caption {
    padding: 1.2em;
    text-align: left;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.fragment-caption h3 {
    font-size: 1.4em;
    margin-top: 0;
    margin-bottom: 0.6em;
    color: var(--color-soil-brown);
}

.fragment-caption p {
    font-size: 0.9em;
    line-height: 1.5;
    color: var(--color-dark-grey);
    margin-bottom: 1em;
}

.read-more-link {
    display: inline-block;
    color: var(--color-accent-copper);
    font-weight: bold;
    font-size: 0.9em;
    transition: color 0.3s ease;
}
.read-more-link:hover {
    color: var(--color-ochre-sun);
}

/* Mosaic sizing */
.fragment.wide-fragment {
    grid-column: span 2;
}

.fragment.tall-fragment {
    grid-row: span 2;
}
.fragment.tall-fragment img {
    height: 100%; /* Make image fill vertical space */
}
.fragment.tall-fragment .fragment-text-content {
    padding: 1.2em;
    text-align: left;
    height: auto;
}
.fragment.tall-fragment .fragment-text-content h3 {
    margin-bottom: 0.8em;
}
.fragment.tall-fragment .fragment-text-content p {
    margin-bottom: 1em;
}


/* Tributaries of Support: Confluence Junction */
.tributaries-of-support-section {
    background: linear-gradient(to top, var(--color-ocean-blue), var(--color-soil-brown));
    color: var(--color-off-white);
    padding-top: calc(var(--header-height) + 6em);
}
.tributaries-of-support-section h2, .tributaries-of-support-section p.subtitle {
    color: var(--color-off-white);
}

.confluence-junction {
    max-width: 1200px;
    margin: 4em auto;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 2em;
}

.main-river {
    background-color: rgba(var(--color-deep-forest), 0.9);
    color: var(--color-off-white);
    padding: 2.5em 3em;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 4em;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}
.main-river h3 {
    color: var(--color-off-white);
    font-size: 2.2em;
    margin-bottom: 0.5em;
    letter-spacing: 1px;
}
.main-river p {
    font-size: 1.1em;
    color: rgba(var(--color-off-white), 0.9);
}

.tributaries-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5em;
    width: 100%;
    position: relative;
    z-index: 1;
}

.tributary-card {
    background-color: rgba(var(--color-off-white), 0.15);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 2em;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(var(--color-light-grey), 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--color-off-white);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.tributary-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
    background-color: rgba(var(--color-off-white), 0.25);
}

.tributary-card .icon {
    width: 60px;
    height: 60px;
    background-color: var(--color-accent-copper);
    border-radius: 50%;
    margin-bottom: 1.5em;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    color: var(--color-off-white);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    background-size: 60%;
    background-repeat: no-repeat;
    background-position: center;
}

/* Placeholder icons using Lorem Picsum as textures / patterns for unique feel */
.icon.donate-icon { background-image: url('images/image_20.jpg'); }
.icon.volunteer-icon { background-image: url('images/image_21.jpg'); }
.icon.adopt-icon { background-image: url('images/image_22.jpg'); }
.icon.advocate-icon { background-image: url('images/image_23.jpg'); }
.icon.explore-icon { background-image: url('images/image_24.jpg'); }
.icon.partnership-icon { background-image: url('images/image_25.jpg'); }


.tributary-card h3 {
    color: var(--color-ochre-sun);
    font-size: 1.6em;
    margin-bottom: 0.8em;
}

.tributary-card p {
    font-size: 0.95em;
    margin-bottom: 1.5em;
    color: rgba(var(--color-off-white), 0.85);
}

.cta-link {
    display: inline-block;
    padding: 0.7em 1.5em;
    background-color: var(--color-accent-bronze);
    color: var(--color-off-white);
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9em;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.cta-link:hover {
    background-color: var(--color-ochre-sun);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Footer */
.main-footer {
    background-color: var(--color-soil-brown);
    color: var(--color-off-white);
    padding: 3em 2em;
    text-align: center;
    font-size: 0.9em;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5em;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.8em;
    font-weight: bold;
    color: var(--color-off-white);
    letter-spacing: 1px;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5em;
}

.footer-nav a {
    color: rgba(var(--color-off-white), 0.8);
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: var(--color-off-white);
    text-decoration: underline;
}

.footer-message p {
    font-style: italic;
    color: rgba(var(--color-off-white), 0.9);
    margin-top: 1em;
}

/* Scroll indicator for infinite scroll (conceptually) */
.scroll-indicator {
    margin-top: 3em;
    padding: 1em 2em;
    background-color: rgba(var(--color-off-white), 0.1);
    color: rgba(var(--color-off-white), 0.7);
    border-radius: 50px;
    font-size: 0.9em;
    font-style: italic;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 1024px) {
    h1 { font-size: 2.8em; }
    h2 { font-size: 2em; }
    p { font-size: 1em; }

    .wild-path-tracker {
        width: 200px;
        left: 0.5em;
        padding: 1em 0.8em;
    }
    .wild-path-tracker h3 { font-size: 1.2em; }
    .wild-path-tracker li { font-size: 0.9em; }

    .main-nav {
        gap: 1em;
    }

    .ecosystem-flowchart {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(7, auto) 50px auto; /* Adjust for vertical flow */
        max-width: 500px;
        padding: 1.5em;
    }
    .node, .node.principal, .node.concept, .node.category.node-left, .node.category.node-right {
        grid-column: 1 / -1; /* All nodes span full width */
        margin-bottom: 0.5em;
    }
    .connection {
        grid-column: 1 / -1;
        height: 30px;
    }
    .connection::before {
        left: 50%;
    }
    .connection-b::after { /* Remove horizontal line for mobile */
        width: 0;
    }

    .habitat-cards-container {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Allow stacking for smaller screens */
        padding: 0 1em;
    }

    .conservation-chronicle-timeline {
        padding: 0 1em;
    }
    .timeline-trail {
        left: 20px; /* Move trail to the left */
        transform: translateX(0);
    }
    .timeline-entry {
        justify-content: flex-start; /* Align all entries to the left */
        margin-bottom: 4em;
    }
    .timeline-dot {
        left: 20px;
        transform: translateX(-50%);
    }
    .timeline-content {
        width: calc(100% - 70px); /* Adjust width */
        margin-left: 70px !important; /* Force margin to the right of the trail */
        margin-right: 0 !important;
        padding: 1.5em;
    }
    .project-details {
        flex-direction: column;
        gap: 1em;
    }
    .project-details img {
        width: 100%;
        height: 180px;
    }
    .project-details .text-content {
        width: 100%;
    }

    .discovery-fragments-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Allow stacking */
        grid-auto-rows: minmax(200px, auto);
        padding: 0 1em;
    }
    .fragment.wide-fragment, .fragment.tall-fragment {
        grid-column: span 1; /* Reset spans on mobile */
        grid-row: span 1;
    }
    .fragment.tall-fragment img {
        height: 200px; /* Reset height */
    }

    .tributaries-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5em;
    }
}

@media (max-width: 768px) {
    .main-header {
        padding: 0 1em;
    }
    .main-nav {
        position: fixed;
        top: var(--header-height);
        right: 0;
        width: var(--mobile-nav-width);
        height: calc(100vh - var(--header-height));
        background-color: rgba(var(--color-deep-forest), 0.95);
        flex-direction: column;
        align-items: flex-start;
        padding: 2em;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
    }
    .main-nav.active {
        transform: translateX(0);
    }
    .main-nav a {
        width: 100%;
        padding: 1em 0;
        font-size: 1.2em;
        border-bottom: 1px solid rgba(var(--color-off-white), 0.1);
    }
    .menu-toggle {
        display: block; /* Show hamburger menu */
    }
    .audio-toggle {
        margin-right: 1em; /* Adjust spacing */
    }

    .wild-path-tracker {
        display: none; /* Hide tracker on small mobile for space */
    }
    main {
        padding-left: 0; /* No tracker offset */
    }

    .section {
        padding: 4em 1em;
    }

    .untamed-horizon-section h1 {
        font-size: 2.5em;
    }
    .untamed-horizon-section p {
        font-size: 1.2em;
    }
    .hotspot {
        width: 30px;
        height: 30px;
        box-shadow: 0 0 0 3px rgba(var(--color-accent-copper), 0.4);
    }
    .hotspot:hover {
        box-shadow: 0 0 0 6px rgba(var(--color-ochre-sun), 0.6);
    }
    .hotspot-detail {
        font-size: 0.8em;
        padding: 0.6em 1em;
        min-width: unset;
    }

    .habitat-cards-container {
        grid-template-columns: 1fr; /* Stack cards vertically */
        padding: 0;
    }

    .conservation-chronicle-timeline {
        max-width: 100%;
        padding: 0 0.5em;
    }
    .timeline-content {
        width: calc(100% - 60px);
        margin-left: 60px !important;
        padding: 1em;
    }
    .timeline-dot {
        left: 15px;
    }
    .timeline-trail {
        left: 15px;
    }
    .project-details img {
        height: 150px;
    }

    .discovery-fragments-grid {
        grid-template-columns: 1fr; /* Stack fragments vertically */
        padding: 0;
    }

    .tributaries-grid {
        grid-template-columns: 1fr; /* Stack tributaries vertically */
        gap: 1.2em;
    }
    .main-river {
        padding: 2em;
        margin-bottom: 3em;
    }
    .main-river h3 {
        font-size: 1.8em;
    }

    .footer-content {
        gap: 1em;
    }
    .footer-nav {
        flex-direction: column;
        gap: 0.5em;
    }
}

/* Specific transitions and animations */
.section-content h1, .section-content h2, .section-content p, .section-content .interactive-hotspots {
    opacity: 1;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}
.section.active .section-content h1, .section.active .section-content h2, .section.active .section-content p, .section.active .section-content .interactive-hotspots {
    opacity: 1;
    transform: translateY(0);
}
.untamed-horizon-section .hero-content h1 { transition-delay: 0.3s; }
.untamed-horizon-section .hero-content p { transition-delay: 0.6s; }
.untamed-horizon-section .interactive-hotspots { transition-delay: 0.9s; }

.ecosystem-flowchart .node {
    opacity: 1;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.lifes-intricate-weave-section.active .ecosystem-flowchart .node {
    opacity: 1;
    transform: translateY(0);
}
.lifes-intricate-weave-section.active .ecosystem-flowchart .node:nth-child(odd) { transition-delay: 0.2s; }
.lifes-intricate-weave-section.active .ecosystem-flowchart .node:nth-child(even) { transition-delay: 0.4s; }

.timeline-entry {
    opacity: 1;
    transform: translateX(-50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.timeline-entry:nth-child(odd) {
    transform: translateX(50px);
}
.re-wilding-expeditions-section.active .timeline-entry {
    opacity: 1;
    transform: translateX(0);
}
.re-wilding-expeditions-section.active .timeline-entry:nth-child(1) { transition-delay: 0.2s; }
.re-wilding-expeditions-section.active .timeline-entry:nth-child(2) { transition-delay: 0.5s; }
.re-wilding-expeditions-section.active .timeline-entry:nth-child(3) { transition-delay: 0.8s; }

.fragment {
    opacity: 1;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.whispers-from-the-canopy-section.active .fragment {
    opacity: 1;
    transform: translateY(0);
}
.whispers-from-the-canopy-section.active .fragment:nth-child(3n+1) { transition-delay: 0.1s; }
.whispers-from-the-canopy-section.active .fragment:nth-child(3n+2) { transition-delay: 0.3s; }
.whispers-from-the-canopy-section.active .fragment:nth-child(3n) { transition-delay: 0.5s; }

.tributary-card {
    opacity: 1;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.tributaries-of-support-section.active .tributary-card {
    opacity: 1;
    transform: translateY(0);
}
.tributaries-of-support-section.active .tributary-card:nth-child(1) { transition-delay: 0.1s; }
.tributaries-of-support-section.active .tributary-card:nth-child(2) { transition-delay: 0.3s; }
.tributaries-of-support-section.active .tributary-card:nth-child(3) { transition-delay: 0.5s; }
.tributaries-of-support-section.active .tributary-card:nth-child(4) { transition-delay: 0.7s; }
.tributaries-of-support-section.active .tributary-card:nth-child(5) { transition-delay: 0.9s; }
.tributaries-of-support-section.active .tributary-card:nth-child(6) { transition-delay: 1.1s; }
/* Safe visibility overrides (auto-added) */
:root, html, body, main, header, footer, section, .container, .content {
  opacity: 1 !important;
  visibility: visible !important;
}
