/* ========================================= */
/* --- THE TWUNK UNDER TWILIGHT PORTAL --- */
/* ========================================= */

/* 1. The Diner Background Override */
body.tut-body {
    background-image: url('/assets/images/retro-diner-bg.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Keeps background still while paper scrolls */
    background-color: #111; /* Fallback */
}

/* Add a slight dark tint so the diner background doesn't overpower the paper */
body.tut-body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(17, 17, 17, 0.65); /* Noir tint */
    z-index: -1;
}

/* 2. The Storybook Text */
.storybook-text {
    font-family: 'Special Elite', monospace;
    font-size: 1.15rem;
    line-height: 1.8;
    color: #2b2b2b; /* Typewriter ink */
    margin-bottom: 1.5rem;
}

.storybook-text p {
    margin-bottom: 2rem;
}

/* 3. The Graceful Drop Cap */
.tut-drop-cap {
    font-family: 'Covered By Your Grace', cursive;
    font-size: 4.5rem;
    float: left;
    line-height: 0.8;
    margin-right: 12px;
    margin-top: 5px;
}

/* 4. Lester's Animated Tiger Stripes */
.lester-bold {
    font-family: var(--font-accent); /* Keeps it heavy and readable */
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    /* Diagonal repeating orange and deep black/brown stripes */
    background: repeating-linear-gradient(
        45deg,
        #ff8c00 0px,
        #ff8c00 12px,
        #1a0d00 12px,
        #1a0d00 24px
    );
    background-size: 200% 200%;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: tiger-stripe-move 4s linear infinite;
    /* Subtle orange glow */
    filter: drop-shadow(0px 2px 2px rgba(255, 140, 0, 0.3));
}

/* 5. Kirby's Glittery Unicorn Magic */
.kirby-bold {
    font-family: var(--font-accent);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    /* A shimmering spectrum of pinks, purples, and white hot sparkles */
    background: linear-gradient(
        110deg,
        #ff66b2 0%, 
        #ffb3ff 20%, 
        #ffffff 40%, 
        #cc99ff 60%, 
        #00e676 80%, /* A tiny flash of emerald for Harperville */
        #ff66b2 100%
    );
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: unicorn-sparkle 2.5s linear infinite;
    /* Subtle pink glow */
    filter: drop-shadow(0px 2px 4px rgba(255, 102, 178, 0.4));
}

/* --- ANIMATION KEYFRAMES --- */
@keyframes tiger-stripe-move { 
    to { background-position: 100% 100%; } 
}
@keyframes unicorn-sparkle { 
    to { background-position: 200% center; } 
}

/* Portal specific button layout */
.tut-chapter-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
}
.tut-chapter-btn {
    width: 100%;
    max-width: 300px;
    text-align: center;
}
/* ========================================= */
/* --- 2007 ERA TEXT MESSAGES --- */
/* ========================================= */

/* --- KIRBY'S MOTOROLA RAZR (T9 LCD) --- */
.kirby-text {
    font-family: 'VT323', monospace;
    background-color: #d8eefe; /* Pale LCD backlight blue */
    color: #0f172a; 
    padding: 15px 20px;
    margin: 2rem auto; 
    border: 3px solid #cbd5e1; /* Silver plastic bezel */
    border-radius: 4px; /* Sharp corners */
    box-shadow: inset 0 0 10px rgba(0,0,0,0.15), 0 4px 6px rgba(0,0,0,0.05); /* Sunken glass effect */
    width: 90%;
    max-width: 350px; 
    line-height: 1.3;
    font-size: 1.3rem; 
    text-transform: uppercase; /* Forced T9 style */
}

.kirby-text-header {
    display: block;
    font-weight: bold;
    font-size: 1rem;
    border-bottom: 1px dotted #94a3b8;
    padding-bottom: 5px;
    margin-bottom: 10px;
    color: #334155;
}

/* --- LESTER'S BLACKBERRY (QWERTY Smartphone) --- */
.lester-text {
    font-family: 'Tahoma', 'Verdana', sans-serif; /* Authentic 2007 corporate OS feel */
    background-color: #ffffff; /* Crisp white high-res screen */
    color: #000000;
    padding: 0; /* Padding removed so the blue header touches the edges */
    margin: 2rem auto; 
    border: 2px solid #222222; /* Dark, sleek BlackBerry casing */
    border-radius: 8px; /* Slightly softer corners */
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 350px; 
    line-height: 1.4;
    font-size: 0.95rem; /* Standard, crisp readable size */
    overflow: hidden; /* Keeps the blue header neatly inside the rounded corners */
}

.lester-text-header {
    display: flex;
    justify-content: space-between; /* Pushes the time to the right side */
    background-color: #1a5276; /* Signature BlackBerry OS dark blue top bar */
    color: #ffffff;
    font-weight: bold;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-bottom: 1px solid #000;
}

.lester-text-body {
    padding: 15px;
}
/* ========================================= */
/* --- SCENE BREAKS (NEON GLASS TUBES) --- */
/* ========================================= */

.scene-break {
    border: none;
    height: 6px; /* Thick enough to show the animation clearly */
    width: 50%; /* Keeps it centered and elegant */
    max-width: 250px; 
    margin: 4rem auto; /* Plenty of breathing room above and below */
    border-radius: 10px; /* Gives it the rounded, glass tube shape */
    opacity: 0.9;
}

/* --- LESTER'S TIGER NEON --- */
.lester-break {
    /* Exact same gradient as his drop cap */
    background: repeating-linear-gradient(
        45deg,
        #ff8c00 0px,
        #ff8c00 12px,
        #1a0d00 12px,
        #1a0d00 24px
    );
    background-size: 200% 200%;
    animation: tiger-stripe-move 4s linear infinite;
    
    /* The outer orange glow + the inner white reflection of the "glass" */
    box-shadow: 0 0 12px rgba(255, 140, 0, 0.7), inset 0 0 4px rgba(255, 255, 255, 0.3); 
}

/* --- KIRBY'S UNICORN NEON --- */
.kirby-break {
    /* Exact same gradient as his drop cap */
    background: linear-gradient(
        110deg,
        #ff66b2 0%, 
        #ffb3ff 20%, 
        #ffffff 40%, 
        #cc99ff 60%, 
        #00e676 80%, 
        #ff66b2 100%
    );
    background-size: 200% auto;
    animation: unicorn-sparkle 2.5s linear infinite;
    
    /* The outer pink glow + the inner white reflection of the "glass" */
    box-shadow: 0 0 15px rgba(255, 102, 178, 0.7), inset 0 0 5px rgba(255, 255, 255, 0.6); 
}
/* ========================================= */
/* --- FLOATING BACK TO TOP BUTTON --- */
/* ========================================= */

.tut-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 990; /* Keeps it above the paper, but below the mobile menu overlay */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    gap: 5px;
    color: #00f3ff; /* Electric Neon Blue */
    transition: all 0.3s ease;
    opacity: 0.8; /* Slightly transparent until hovered */
}

/* The Askew Neon Star */
.tut-back-to-top i {
    font-size: 1.8rem;
    transform: rotate(15deg); /* Tilts the star slightly askew */
    /* The Neon Glow Effect */
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.6), 0 0 15px rgba(0, 243, 255, 0.4);
    transition: all 0.3s ease;
}

/* The Small Rubik Text */
.tut-back-to-top span {
    font-family: var(--font-accent); /* Rubik */
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-noir); /* Crisp white/off-white */
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8); /* Ensures it's readable over the diner background */
}

/* The Hover State: Cranks up the neon and straightens the star */
.tut-back-to-top:hover {
    opacity: 1;
    transform: translateY(-5px); /* Bounces up slightly */
}

.tut-back-to-top:hover i {
    transform: rotate(0deg) scale(1.1); /* Straightens out and grows */
    text-shadow: 0 0 10px #00f3ff, 0 0 25px #00f3ff, 0 0 35px #00f3ff; /* Blinding neon flare */
}

/* Ensures the scrolling is smooth when they click it */
html {
    scroll-behavior: smooth;
}

/* Mobile Adjustment so it doesn't block text on tiny screens */
@media (max-width: 768px) {
    .tut-back-to-top {
        bottom: 15px;
        right: 15px;
    }
    .tut-back-to-top i {
        font-size: 1.5rem;
    }
}
/* ========================================= */
/* --- LEGAL ANTI-PIRACY BLURB --- */
/* ========================================= */

.tut-copyright-blurb {
    background-color: rgba(45, 27, 46, 0.95); /* Deep, opaque plum */
    color: #f4f0e6; /* Crisp off-white text for high contrast */
    border: 1px solid rgba(255, 102, 178, 0.4); /* Faint Harperville pink border */
    padding: 15px 25px;
    margin: 3rem auto 2rem auto; /* Centers the block with space above and below */
    width: 90%;
    max-width: 600px;
    text-align: center;
    font-family: var(--font-accent); /* Keeps it formal with the Rubik font */
    font-size: 0.85rem;
    line-height: 1.6;
    letter-spacing: 0.5px;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5); /* Floats it slightly off the page */
}

/* Gives the FBI clause a little extra visibility */
.tut-copyright-blurb strong {
    color: #ffb3ff; 
    font-weight: 500;
}
/* ========================================= */
/* --- APPLE MUSIC "TWUNES" MODAL --- */
/* ========================================= */

.twunes-btn-container {
    display: flex;
    justify-content: center;
    margin: 30px 0 10px 0;
}

/* The Stylized Button */
.twunes-btn {
    position: relative;
    background: transparent;
    border: 2px solid #00f3ff; /* Neon Blue */
    color: #111; /* Dark ink to contrast against the paper */
    font-family: var(--font-accent);
    text-transform: uppercase;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 10px rgba(0, 243, 255, 0.1), 0 0 10px rgba(0, 243, 255, 0.2);
}

.twunes-btn:hover {
    background: #00f3ff;
    color: #111;
    box-shadow: inset 0 0 10px rgba(0, 243, 255, 0.5), 0 0 20px rgba(0, 243, 255, 0.6);
    transform: translateY(-2px);
}

/* Floating Musical Notes */
.twunes-btn::before, .twunes-btn::after {
    position: absolute;
    font-size: 1.5rem;
    pointer-events: none; /* Stops them from blocking clicks */
}

/* Top Left Pink Note */
.twunes-btn::before {
    content: '♫';
    top: -15px;
    left: -15px;
    color: var(--accent-pink);
    animation: floatNote1 2s ease-in-out infinite alternate;
}

/* Bottom Right Green Note */
.twunes-btn::after {
    content: '♪';
    bottom: -15px;
    right: -15px;
    color: var(--accent-green);
    animation: floatNote2 2.5s ease-in-out infinite alternate;
}

@keyframes floatNote1 {
    0% { transform: translateY(0) rotate(-10deg); }
    100% { transform: translateY(-8px) rotate(15deg); text-shadow: 0 0 8px rgba(255, 102, 178, 0.6); }
}

@keyframes floatNote2 {
    0% { transform: translateY(0) rotate(10deg); }
    100% { transform: translateY(8px) rotate(-15deg); text-shadow: 0 0 8px rgba(0, 230, 118, 0.6); }
}

/* --- THE MODAL OVERLAY --- */
.twunes-modal {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(17, 17, 17, 0.9); /* Dark Noir tint */
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px; /* Crucial padding so it never touches the screen edge on an iPhone 6 */
    backdrop-filter: blur(5px);
}

.twunes-modal.show {
    display: flex;
    animation: fadeInModal 0.3s ease forwards;
}

@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* The Box Holding the iFrame */
.twunes-modal-content {
    position: relative;
    width: 100%;
    max-width: 660px;
    background: #111;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.3);
    border: 1px solid #00f3ff;
}

/* The Neon Blue X Button */
.twunes-close {
    position: absolute;
    top: -45px; /* Floats just above the player so it doesn't block Apple's UI */
    right: 0px;
    background: transparent;
    border: none;
    color: #00f3ff;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.6), 0 0 15px rgba(0, 243, 255, 0.4);
    transition: transform 0.3s ease, text-shadow 0.3s ease;
}

.twunes-close:hover {
    transform: scale(1.1) rotate(90deg); /* Cool spin effect on hover */
    text-shadow: 0 0 15px #00f3ff, 0 0 25px #00f3ff;
}