:root {
    --primary-font: 'Nunito', sans-serif;
    --heading-font: 'Bubblegum Sans', cursive;

    --text-dark: #333;
    --text-light: #fff;
    --glass-bg: rgba(255, 255, 255, 0.2);
    --glass-bg-dark: rgba(0, 0, 0, 0.35);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

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

body {
    font-family: var(--primary-font);
    color: var(--text-dark);
    line-height: 1.6;
    /* Static default if needed, HTML files override this */
    background-color: #0F2027;
}

h1,
h2,
h3,
h4,
.logo {
    font-family: var(--heading-font);
    font-weight: normal;
}

/* -------------------------------------------------------------------------- */
/* INTERACTIVE HOMEPAGE CANVAS STYLES                                         */
/* -------------------------------------------------------------------------- */

/* Interactive Canvas Full Screen Background */
body#canvas-home {
    background-color: #0F2027;
    overflow: hidden; /* Prevent scrolling if the wrapper is huge */
}

.canvas-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1; /* Behind icons */
    pointer-events: none;
}

/* Base Interactive Icon */
.interactive-icon {
    width: 200px;
    /* Base size, adapts well to most screens */
    height: auto;
    filter: drop-shadow(0px 10px 15px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
    /* subtle continuous floating animation */
    animation: hover-bob 3s ease-in-out infinite alternate;
}

@keyframes hover-bob {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-10px);
    }
}

/* -------------------------------------------------------------------------- */
/* INTERACTIVE GROUPING (Playing together)                                    */
/* -------------------------------------------------------------------------- */



/* Character Links Container - Centered Anchor */
.canvas-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: max(100vw, 177.77vh);
    height: max(56.25vw, 100vh);
    container-type: size;
    overflow: hidden;
    z-index: 10;
}

.character-link {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    z-index: 20;
    transition: z-index 0.3s ease;
}

.icon-label {
    font-family: var(--heading-font);
    color: #fff;
    font-size: 1.5vw;
    text-align: center;
    line-height: 1.1;
    text-shadow: 0.1vw 0.1vw 0.3vw rgba(0, 0, 0, 0.6);
    margin: 0.5vw;
    transition: all 0.3s ease;
}

/* Base Interactive Icon */
.interactive-icon {
    width: auto;
    filter: drop-shadow(0px 10px 15px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
    animation: hover-bob 3s ease-in-out infinite alternate;
}

@keyframes hover-bob {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-10px);
    }
}

/* Logo */
.logo-char {
    transform: translate(-51.3cqw, -27.7cqw) rotate(0deg);
    z-index: 10;
    pointer-events: none; /* Turn off invisible hitbox so clicks pass through! */
}

.logo-char .interactive-icon {
    animation-delay: 0s;
    width: 103.0cqw;
}

/* Books */
.books-char {
    transform: translate(6.1cqw, -11.9cqw) rotate(10deg);
    z-index: 25;
}

.books-char .interactive-icon {
    animation-delay: 0s;
    width: 9.0cqw;
}

/* About */
.about-char {
    transform: translate(-17.1cqw, -13.3cqw) rotate(-5deg);
    z-index: 22;
}

.about-char .interactive-icon {
    animation-delay: 0.5s;
    width: 10.0cqw;
}

/* Portfolio/Events */
.portfolio-char {
    transform: translate(-10.1cqw, 4.5cqw) rotate(4deg);
    z-index: 20;
}

.portfolio-char .interactive-icon {
    animation-delay: 1.2s;
    width: 22.5cqw;
}

/* Contact/Social */
.contact-char {
    transform: translate(-8.6cqw, 3.9cqw) rotate(-4deg);
    z-index: 23;
}

.contact-char .interactive-icon {
    animation-delay: 0.8s;
    width: 6.5cqw;
}

.character-link:hover {
    z-index: 30;
}

.character-link:hover .interactive-icon {
    transform: scale(1.15) translateY(-20px) rotate(-3deg);
    filter: drop-shadow(0px 15px 25px rgba(255, 255, 255, 0.6));
}

.character-link:hover .icon-label {
    transform: scale(1.1) translateY(-10px);
    text-shadow: 0 0 15px rgba(255, 255, 255, 1);
}



/* -------------------------------------------------------------------------- */
/* CONTENT PAGES (Books, About, Contact, Portfolio)                           */
/* -------------------------------------------------------------------------- */

.content-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

.page-header {
    width: 100%;
    padding: 30px 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center the title */
    position: relative;
    /* So the back button can be absolute left */
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
}

.page-header h2 {
    font-size: 3.5rem;
    color: #fff;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.4);
    margin: 0;
}

.back-btn {
    position: absolute;
    left: 50px;
    font-size: 1.1rem !important;
}

.page-content {
    flex: 1;
    padding: 60px 5vw;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.center-content {
    justify-content: center;
}

/* Reusing previous styles for cards/buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 800;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-family: var(--primary-font);
}

.primary-btn {
    background: #ffde59;
    color: #333;
    box-shadow: 0 4px 15px rgba(255, 222, 89, 0.4);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 222, 89, 0.6);
}

.dark-btn {
    background: #2a0845;
    color: #fff;
}

.dark-btn:hover {
    background: #667eea;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

.secondary-btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    width: 100%;
    max-width: 1200px;
}

.book-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.4s ease;
}

.book-card:hover {
    transform: translateY(-10px);
}

.book-cover {
    height: 350px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-size: cover;
    background-position: center;
}

.placeholder-cover {
    color: #fff;
    font-family: var(--heading-font);
    font-size: 1.8rem;
    text-align: center;
    padding: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.book-info {
    padding: 30px;
    color: #fff;
    text-align: center;
    background: rgba(0, 0, 0, 0.15);
}

.book-info h3 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.book-info p {
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Interactive Illustration Buy Link */
.book-illustration-link {
    display: block;
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.book-illustration-link:hover {
    transform: scale(1.05) rotate(-2deg);
}

.click-hint {
    display: block;
    font-family: var(--primary-font);
    font-size: 1.1rem;
    margin-top: 10px;
    font-weight: 800;
    color: #fff;
    opacity: 0.9;
    animation: pop-text 2s infinite alternate;
}

@keyframes pop-text {
    0% {
        transform: scale(1);
        text-shadow: 0 0 5px rgba(255, 255, 255, 0.4);
    }

    100% {
        transform: scale(1.1);
        text-shadow: 0 0 15px rgba(255, 255, 255, 0.9);
    }
}

/* About / Contact Blocks */
.about-container,
.contact-box {
    background: var(--glass-bg-dark);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 40px;
    padding: 50px;
    box-shadow: var(--shadow);
    color: #fff;
    max-width: 900px;
    width: 100%;
}

.contact-form {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.contact-form input {
    padding: 15px 25px;
    border-radius: 50px;
    border: none;
    width: 60%;
    font-family: var(--primary-font);
    font-size: 1.1rem;
}


/* Responsive Fixes for Canvas */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .back-btn {
        position: relative;
        left: 0;
    }

    .contact-form {
        flex-direction: column;
    }

    .contact-form input {
        width: 100%;
    }

    .canvas-title h1 {
        font-size: 3rem;
    }
    
    .canvas-title {
        top: 100px;
        transform: translateX(-50%);
    }
}