:root {
    --ash: #120A0A;
    --brass: #CDB87D;
    --sand: #E3D7B4;
    --rust: #8B4513;
    --gold: #CC9933;
    --toxic: #bfff00;
    /* For the play button hover */
    --maxw: 1200px;
    --pad: clamp(20px, 5vw, 40px);
    --radius: 3px;
    --hero-icon-size: min(280px, 40vw);
    /* Adjusted for better visibility */
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    background: transparent;
    /* Vital for seeing the fixed background */
    color: var(--sand);
    font-family: "JetBrains Mono", monospace;
    line-height: 1.6;
}

html {
    background: var(--ash);
}

/* --- BACKGROUND LAYERS --- */
#site-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: url('../images/desert.jpg') center/cover no-repeat fixed;
    filter: brightness(0.45) sepia(0.4) contrast(1.1);
    will-change: transform;
}

#particles {
    position: fixed;
    inset: 0;
    z-index: 1;
    /* Above bg, below content */
    pointer-events: none;
    opacity: 0.6;
}

/* --- TYPOGRAPHY --- */
h1,
h2,
h3 {
    font-family: "Orbitron", sans-serif;
    font-weight: 700;
    color: var(--brass);
    margin: 0.3em 0 0.5em;
}

h1 {
    font-size: clamp(32px, 6vw, 64px);
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8);
    text-align: center;
}

.subtitle {
    text-align: center;
    color: var(--sand);
    font-size: clamp(14px, 3vw, 18px);
    font-style: italic;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.gold {
    color: var(--gold);
}

.muted {
    color: rgba(227, 215, 180, 0.6);
}
.dark {
    color: #1a1a1a;
}
.handwritten {
    font-family: 'Shadows Into Light', cursive;
    font-size: 1.15rem;
    line-height: 1.5;
    color: #222;
    /* Dark ink color */
}

/* --- LAYOUT --- */
.wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 var(--pad);
    position: relative;
    z-index: 2;
}

.section {
    padding: clamp(60px, 8vw, 100px) 0;
    position: relative;
}

.grid {
    display: grid;
    gap: clamp(30px, 5vw, 50px);
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* --- HERO & ANIMATION --- */
.hero {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding-top: 40px;
}

/* The Container for the Adobe Animate Canvas */
.hero-anim {
    position: relative;
    width: var(--hero-icon-size);
    height: var(--hero-icon-size);
    margin: 0 auto 20px;
    z-index: 5;
    /* Center everything inside */
    display: grid;
    place-items: center;
}

/* The Canvas itself */
.hero-anim canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* The Halo Ring behind it */
.halo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    /* Slightly larger than the icon */
    height: 120%;
    border: 1px solid var(--brass);
    border-radius: 50%;
    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
}

/* --- TATTERED CARDS & TILES --- */
.card,
.tile {
    background: #f4efe6 url('../images/paper_texture.jpg') repeat;
    background-size: 500px;
    padding: clamp(20px, 4vw, 30px);
    color: #1a1a1a;
    position: relative;
    box-shadow: 4px 6px 20px rgba(0, 0, 0, 0.6);
    transition: transform 0.3s ease, box-shadow 0.3s ease;

    /* The Torn Edge Look */
    clip-path: polygon(0% 2%, 2% 0%, 98% 1%, 100% 98%,
            98% 100%, 2% 99%, 0% 98%);
}
#journey-tracks {

    background-image: url('../images/the-clockwork-pilgrim.jpeg');
    background-size: cover;
    background-attachment: fixed;
    background-position: top;
    height: 100vh;
}
/* Random Stains */
.card::before,
.tile::before {
    content: "";
    position: absolute;
    top: 20%;
    left: 20%;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(139, 69, 19, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    filter: blur(2px);
}

/* THE HIGGLEDY PIGGLEDY ROTATION (Restored) */
.grid>*:nth-child(odd) {
    transform: rotate(-1.5deg);
}

.grid>*:nth-child(even) {
    transform: rotate(1.2deg);
}

.grid>*:nth-child(3n) {
    transform: rotate(2deg);
}

.grid>*:nth-child(3n+1) {
    transform: rotate(-2.5deg);
}

/* Hover effects tighten the chaos */
.grid>*:hover {
    transform: scale(1.02) rotate(0deg) translateY(-5px);
    box-shadow: 6px 12px 25px rgba(0, 0, 0, 0.8);
    z-index: 10;
}

/* --- TRACK TILES SPECIFIC --- */
.tile .thumb {
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(0, 0, 0, 0.2);
    margin-bottom: 15px;
    filter: sepia(0.6) contrast(1.1);
    transition: filter 0.3s;
}

.tile:hover .thumb {
    filter: sepia(0) contrast(1);
}

/* --- BUTTONS --- */
.btn {
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid var(--brass);
    color: var(--brass);
    padding: 12px 24px;
    font-family: "Orbitron", sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: var(--brass);
    color: #000;
    box-shadow: 0 0 25px rgba(205, 184, 125, 0.4);
    transform: translateY(-2px);
}

.btn-primary {
    border-color: var(--gold);
    color: var(--gold);
    border-width: 2px;
    font-weight: 700;
}

/* --- LORE NOTES (Yellow/Sticky style) --- */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

#routes {
    background-image: url('../images/the-pilgrim.jpeg');
    background-size: cover;
    background-attachment: fixed;
    background-position: top;
    height: 100vh;
}

.note {
    background: #D4CCAA;
    padding: 20px;
    box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.5);
    /* Extra rotation for notes */
    transform: rotate(var(--rot));
}

#signal-board {
    height: 50vh;
    vertical-align: auto;
}

/* .fragment-pin::after {
    content: "📍";
    position: absolute;
    top: -10px;
    right: 45%;
    font-size: 20px;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.3));
} */

/* --- FOOTER --- */
footer {
    padding: 80px 0 120px;
    text-align: center;
}

.rule {
    border-top: 1px dashed var(--brass);
    opacity: 0.3;
    margin: 40px 0;
}

/* Responsive Fixes */
@media (max-width: 768px) {
    h1 {
        font-size: 42px;
    }

    .hero-anim {
        width: 220px;
        height: 220px;
    }
}