/* --- GLOBAL FOUNDATIONS --- */
body {
    margin: 0; padding: 0; background-color: #000;
    display: flex; justify-content: center; 
    /* Ensures the black background remains full height on all devices */
    min-height: 100vh; min-height: 100dvh; 
    overflow-x: hidden; font-family: 'Courier Prime', monospace;
}

a.global-link { 
    text-decoration: none; color: inherit; width: 100%; max-width: 800px; display: block; 
}

.viewport {
    position: relative; width: 100%; max-width: 800px; 
    /* The 'page' container now grows with content but never leaves gaps */
    min-height: 100vh; min-height: 100dvh; 
    background-color: #e2e1df; 
    background-image: 
        linear-gradient(rgba(0, 100, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 100, 255, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    display: flex; flex-direction: column;
    align-items: center; 
    justify-content: center; /* This ensures consistent vertical centering for all pages */
    box-shadow: inset 0 0 100px rgba(0,0,0,0.05);
    padding: clamp(40px, 8vh, 80px) 20px;
    box-sizing: border-box;
}

/* Branded Background (Index & Logistics) */
.viewport.branded {
    background-image: url('../images/background.webp'); 
    background-size: cover; background-position: center;
    filter: contrast(1.05);
    box-shadow: inset 0 0 150px rgba(0,0,0,0.8);
}

.continue-hint { 
    position: absolute; bottom: 25px; right: 25px;
    font-size: 0.75rem; color: rgba(0,0,0,0.4); 
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
}

/* --- INTEL / MANIFEST --- */
.manifest-wrapper { width: fit-content; max-width: 100%; }
h2 { text-transform: uppercase; margin: 0 0 20px 0; text-decoration: underline; font-weight: 700; color: #000; text-align: center; }

.objective { 
    font-weight: 700; border: 3px solid #000; padding: 12px 18px;
    margin: 0 auto 25px auto; transform: rotate(-0.5deg); width: fit-content; text-align: center;
}
.objective div { white-space: nowrap; font-size: 0.95rem; line-height: 1.3; }

.manifest-item { 
    font-size: clamp(0.85rem, 3.8vw, 1rem); line-height: 1.4; display: flex; 
    border-bottom: 1px solid rgba(0,0,0,0.1); padding: 6px 0; color: #000;
}
.manifest-item::before { content: "X"; margin-right: 12px; color: #bc2a2a; font-weight: 700; }
.manifest-item:nth-child(even) { font-weight: 700; }

/* --- STORY / PHASES --- */
.story-wrapper { width: fit-content; max-width: 100%; display: flex; flex-direction: column; align-items: center; }
.report-body { font-size: clamp(0.95rem, 4.2vw, 1.1rem); line-height: 1.6; color: #1a1a1a; max-width: 500px; }
.report-body p { margin-bottom: 18px; }
.report-body strong { color: #bc2a2a; font-weight: 700; }
.start-stamp { width: clamp(140px, 30vw, 180px); height: auto; margin: 0 auto 25px auto; opacity: 0.9; transform: rotate(-1deg); display: block; }

/* --- LOGISTICS --- */
.schedule-wrap { font-family: 'Stardos Stencil', serif; color: #F2F2F2; text-transform: uppercase; margin-bottom: 25px; text-align: center; }
.sched-line { font-size: clamp(1rem, 4.2vw, 1.2rem); margin-bottom: 5px; }
.sched-line.border { border-bottom: 1px solid rgba(242,242,242,0.3); padding-bottom: 5px; margin-bottom: 8px; }
.sched-detail { font-size: 1.1rem; font-weight: 700; color: #F2F2F2; letter-spacing: 0.05em; }

.signup-cta { 
    display: inline-block; /* Add this line */
    font-family: 'Stardos Stencil', serif; 
    font-size: clamp(1.8rem, 8vw, 2.8rem); 
    color: #F2F2F2; 
    text-decoration: none; 
    border: 3px solid #F2F2F2; 
    padding: 8px 25px; 
    margin-bottom: 30px; /* Now this will be strictly enforced */
    transition: 0.2s; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
    text-align: center;
}
.signup-cta:hover { background-color: #bc2a2a; border-color: #bc2a2a; }

.link-stack { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 280px; }
.tape-link { 
    background-color: #e2e1df; color: #000; text-decoration: none; padding: 10px 15px; 
    font-weight: 700; font-size: 0.85rem; text-transform: uppercase; box-shadow: 3px 3px 10px rgba(0,0,0,0.4); text-align: center;
}
.tape-link:nth-child(even) { transform: rotate(-1.2deg); }
.tape-link:nth-child(odd) { transform: rotate(1.2deg); }
.loop-link { background-color: #bc2a2a !important; color: #fff !important; }

/* Missing Logistics Groups */
.external-group { margin-top: 20px; border-top: 1px solid rgba(242,242,242,0.2); padding-top: 20px; display: flex; flex-direction: column; gap: 12px; width: 100%; }
.footer-intel { position: absolute; bottom: 20px; font-size: 0.6rem; color: rgba(242, 242, 242, 0.4); letter-spacing: 0.15em; text-transform: uppercase; }

/* --- PERSONNEL / GUIDE --- */
.guide-wrapper { width: fit-content; max-width: 500px; display: flex; flex-direction: column; }
.stamp { 
    position: absolute; top: 25px; right: 20px; border: 2px solid #bc2a2a; color: #bc2a2a; 
    padding: 4px 10px; font-family: 'Stardos Stencil', serif; text-transform: uppercase; 
    transform: rotate(8deg); font-size: 0.85rem; font-weight: 700;
}
.protocol-box { border: 3px solid #000; padding: 18px; margin: 10px 0 35px 0; font-size: 0.85rem; transform: rotate(-0.5deg); align-self: center; }
.protocol-box div { margin-bottom: 4px; font-weight: 700; }
.protocol-box span { color: #bc2a2a; text-transform: uppercase; letter-spacing: 0.1em; }

/* --- FAQ --- */
header { width: 100%; padding: 20px 40px 10px 40px; box-sizing: border-box; }
.faq-container { flex-grow: 1; overflow-y: auto; padding: 20px 40px; scrollbar-width: none; width: 100%; box-sizing: border-box; }
.faq-container::-webkit-scrollbar { display: none; }
.faq-q { color: #bc2a2a; font-weight: 700; text-transform: uppercase; margin-bottom: 8px; display: block; line-height: 1.3; }

/* FAQ Footer Fix */
.big-stick-footer { 
    z-index: 20; 
    width: 100%; 
    display: flex; 
    justify-content: center; /* Centers the signup bar on the screen */
}

.signup-bar { 
    display: block; 
    width: 100%; 
    max-width: 800px; /* Forces bar to match the page width */
    padding: 25px 0; 
    background-color: #bc2a2a; /* Solid Red */
    color: #fff; /* White Text */
    text-decoration: none; 
    font-family: 'Stardos Stencil', serif; 
    font-size: 1.8rem;
    text-align: center; 
    text-transform: uppercase; 
    letter-spacing: 0.25em; 
    border: none; /* Removed all borders for a seamless look */
}

/* Fix for iPhone 5/SE and small devices */
@media screen and (max-height: 600px) {
    .viewport {
        padding: 10px; /* Tighten the outer boundary */
    }

    .start-stamp {
        max-width: 80px; /* Shrink the 'DEPLOYMENT' image */
        margin-bottom: 5px;
    }

    .story-wrapper h2 {
        font-size: 1.2rem; /* Smaller heading */
        margin-bottom: 10px;
    }

    .report-body p {
        font-size: 0.9rem; /* Drop font size slightly */
        line-height: 1.3;
        margin-bottom: 8px; /* Tighten paragraph gaps */
    }

    .continue-hint {
        bottom: 10px; /* Pull the hint up from the edge */
    }
}