/* Root Variables */
@font-face {
    font-family: 'Hagrid';
    src: url('../hagrid_font/Hagrid-Regular-trial.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

:root {
    --nav-glass-bg: rgba(255, 255, 255, 0.5);
    --nav-glass-border: rgba(255, 255, 255, 0.4);
    --accent-color: #f7b731;
    --text-color: #1a1a1a;
}

body.dark-mode {
    background-color: #151515;
    color: #f2f2f2;
    --text-color: #f2f2f2;
    --nav-glass-bg: rgba(30, 30, 30, 0.5);
    --nav-glass-border: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Mono', monospace;
    background-color: #e5e5e3;
    color: var(--text-color);
    text-transform: uppercase;
}

::selection {
    background-color: var(--accent-color);
    color: white;
}

/* Header & Navigation */
header {
    position: fixed;
    top: 1.25rem;
    left: 4.5rem;
    right: 4.5rem;
    margin: 0;
    z-index: 10000;
    background-color: var(--nav-glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--nav-glass-border);
    border-radius: 100px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2.5rem;
    font-weight: 700;
}

.logo {
    font-size: 0.95rem;
    letter-spacing: 1.5px;
    z-index: 20;
    white-space: nowrap;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 110;
}

.mobile-menu-btn .bar {
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
    pointer-events: none;
}

.mobile-menu-btn.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.mobile-menu-btn.active .bar:nth-child(2) {
    opacity: 0;
}
.mobile-menu-btn.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

nav {
    display: flex;
    gap: 2.5rem;
    align-items: center;
    z-index: 20;
}

nav a {
    font-family: 'Hagrid', sans-serif !important;
    font-weight: 400;
    font-size: 0.98rem;
    text-transform: none;
    text-decoration: none;
    color: var(--text-color);
    letter-spacing: 1px;
    transition: color 0.2s ease;
}

nav a:hover {
    color: var(--accent-color);
}

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0;
    margin-right: 1rem;
    transition: color 0.2s ease;
}

.theme-toggle:hover {
    color: var(--accent-color);
}

.theme-toggle svg {
    pointer-events: none;
}

.moon-icon {
    display: none;
    fill: #fdf5d3;
    color: #fdf5d3;
}

body.dark-mode .sun-icon {
    display: none;
}

body.dark-mode .moon-icon {
    display: block;
}


/* Subtle SVG Noise Grain Texture applied to body */
body::before {
    content: "";
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200vw;
    height: 200vh;
    opacity: 0.25;
    pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='3.5' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    z-index: 10;
    animation: static-noise 0.2s steps(4) infinite;
    transform-origin: center;
    scale: 1.5;
}

@keyframes static-noise {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(90deg); }
    50% { transform: rotate(180deg); }
    75% { transform: rotate(270deg); }
}

@media (max-width: 768px) {
    header {
        left: 1rem;
        right: 1rem;
        padding: 0.8rem 1.5rem;
        top: 1rem;
    }

    .mobile-menu-btn {
        display: flex;
        margin-left: 0.5rem;
    }

    #main-nav {
        position: absolute;
        top: calc(100% + 15px);
        right: 0;
        width: auto;
        min-width: 140px;
        background-color: #1a1a1a;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem;
        gap: 1.25rem;
        border-radius: 12px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.4);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px) scale(0.95);
        transform-origin: top right;
        transition: all 0.3s ease;
    }

    #main-nav.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
    }

    #main-nav a {
        color: #fff !important;
        font-size: 1rem;
    }

    .scroll-tracker {
        width: 40px;
    }
}

.scroll-container {
    width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.image-wrapper {
    width: 100%;
    margin: 0;
}

.main-image {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Scroll Tracker UI --- */
.scroll-tracker {
    position: fixed;
    top: 0;
    left: 0;
    width: 60px;
    height: 100vh;
    pointer-events: none;
    /* Allows clicking through it */
    z-index: 9999;
}

.scroll-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 10px;
    /* Thicker track */
    height: 100%;
    background-color: #f1f5f9;
    /* Subtle grey background for the scroll track */
    border-right: 1px solid #e2e8f0;
}

.scroll-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 10px;
    /* Thicker progress bar */
    height: 0%;
    /* This will be changed by JS */
    background-color: #ec4899;
    /* Bright Pink! */
}

.scroll-percent {
    position: absolute;
    left: 18px;
    /* Placed slightly to the right of the thicker bar */
    top: 0;
    /* Updated by JS */
    transform: translateY(-50%);
    /* Centers the text vertically with the tip of the line */
    color: #ec4899;
    /* Matching Pink text */
    font-family: sans-serif;
    font-size: 15px;
    /* Slightly larger font to match the thicker bar */
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Floating Back Button */
.floating-back-btn {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    z-index: 10000;
    background: transparent;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ec4899;
    padding: 0.8rem 1.4rem;
    border-radius: 100px;
    text-decoration: none;
    font-family: 'Hagrid', sans-serif !important;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-back-btn:hover {
    transform: translateY(-5px) scale(1.05);
    background: rgba(236, 72, 153, 0.15);
    border-color: #ec4899;
    box-shadow: 0 15px 40px rgba(236, 72, 153, 0.2);
}

@media (max-width: 900px) {
    .floating-back-btn {
        bottom: 1.5rem;
        right: 1.5rem;
        padding: 0.6rem 1rem;
        font-size: 0.75rem;
    }
}