/* Intro Typing Styling */
#intro-screen {
    position: fixed;
    inset: 0; /* fills the visible viewport; 100vh is taller than the screen on mobile Safari */
    box-sizing: border-box;
    background-color: black;
    color: green;
    display: flex;
    align-items: center;  /* Ensures vertical centering */
    justify-content: center;  /* Ensures horizontal centering */
    font-size: 24px;
    font-family: monospace;
    text-align: center;
    padding: 20px;
    z-index: 9999;
}
/* Intro line: typed text with a block cursor following it */
#intro-line {
    margin: 0;
    max-width: min(90vw, 900px);
    line-height: 1.5;
}
.intro-cursor {
    display: inline-block;
    width: 0.6em;
    height: 1.1em;
    margin-left: 1px;
    vertical-align: text-bottom;
    background: currentColor; /* same green as the text */
    animation: intro-blink 1s steps(1) infinite;
}
#intro-screen.typing .intro-cursor { animation: none; }
@keyframes intro-blink { 50% { opacity: 0; } }
/* Ensure text is responsive */
#intro-text {
    max-width: 90vw; /* Prevents text cutoff */
    word-wrap: break-word; /* Ensures long words wrap */
    white-space: pre-line; /* Wraps naturally and keeps the intro's line breaks */
    line-height: 1.5; /* Improves readability */
}
/* Highlight used when the intro "selects" its text before clearing it */
.intro-selection {
    background: #3a6ea5;
    color: #fff;
}
/* Hide intro screen smoothly */
.hidden {
    opacity: 0;
    transition: opacity 1s ease-in-out;
}
/* Skip Button */
#skip-button {
    position: fixed;
    bottom: calc(30px + env(safe-area-inset-bottom));
    right: calc(30px + env(safe-area-inset-right));
    background: none;
    color: white;
    border: 1px solid white;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    font-family: monospace;
    transition: 0.3s;
    z-index: 10000;
}
#skip-button:hover {
    background: white;
    color: black;
}

/* While the intro plays: black page, no scrolling, nothing but the intro visible.
   Mobile browsers draw page content under their translucent toolbars, so the
   rest of the page has to be hidden, not just covered. */
html.intro-active,
html.intro-active body {
    background: #000 !important;
    overflow: hidden;
}
html.intro-active body > :not(#intro-screen) {
    visibility: hidden;
}

/* Mobile adjustments */
@media screen and (max-width: 600px) {
    #intro-screen {
        font-size: 18px; /* Slightly smaller text */
        padding: 10px;
        display: flex;
        align-items: center;  /* Keeps text vertically centered */
        justify-content: center;
    }
    #intro-text {
        max-width: 90vw;
        word-wrap: break-word;
        white-space: pre-line;
        line-height: 1.5;
    }
}
/* Ensure no horizontal scrolling */
body {
    overflow-x: hidden; /* Prevents scrolling past the viewport */
    max-width: 100%; /* Ensures content doesn't exceed viewport */
}
/* Modern Header Navigation Fix */
#modern-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Ensures items don't overflow on small screens */
    width: 100%; /* Makes sure nav spans full width */
    padding: 10px 20px;
    box-sizing: border-box; /* Prevents overflow from extra padding */
}
/* Make sure buttons and links don't go off-screen */
#modern-header nav ul {
    display: flex;
    flex-wrap: wrap; /* Ensures items stay within bounds */
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    justify-content: flex-end; /* Keeps links aligned but within bounds */
}
/* Fix Contact and Dark Mode button spacing */
#modern-header nav ul li {
    margin: 0 10px; /* Prevents them from touching the screen edges */
    white-space: nowrap; /* Prevents text from wrapping awkwardly */
}
/* Ensure buttons don't get pushed too far */
#dark-mode-toggle {
    max-width: 100%; /* Prevents it from getting too wide */
    padding: 8px 12px;
    white-space: nowrap;
}
/* Mobile-specific fixes */
@media screen and (max-width: 600px) {
    #modern-header nav ul {
        justify-content: center; /* Center-aligns on smaller screens */
    }
    #modern-header nav ul li {
        margin: 5px; /* Adds spacing */
    }
    
    #header-container {
        width: 100%;
        box-sizing: border-box;
        padding: 0;
    }
    
}


/* ==========================================================
   forcepu.sh theme
   ========================================================== */
:root {
    --paper: #f2eee3;
    --surface: #fbf9f3;
    --ink: #1a1c1f;
    --muted: #5c6066;
    --accent: #e5383b;
    --accent-dark: #a4161a;
    --link: #1f4fd1;
    --bar: #1a1c1f;
    --bar-ink: #f2eee3;
    --term-bg: #0d1117;
    --term-fg: #39ff88;
    --term-dim: #8b949e;
}

/* Dark mode applies to the modern look only; retro mode keeps its own palette */
body.dark-mode:not(.retro-mode) {
    --paper: #121417;
    --surface: #1c1f24;
    --ink: #e9e6dc;
    --muted: #a3a7ad;
    --link: #8fb3ff;
    --bar: #000;
    --bar-ink: #e9e6dc;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.5;
    transition: background 0.3s, color 0.3s;
}

a { color: var(--link); }

code {
    font-family: "Courier New", monospace;
    background: rgba(127, 127, 127, 0.15);
    padding: 1px 5px;
    border-radius: 3px;
}

/* Headers */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bar);
    color: var(--bar-ink);
    padding: 15px 30px;
}

#modern-header { display: none; }
body:not(.retro-mode) #modern-header { display: flex; }
body:not(.retro-mode) #retro-header { display: none; }
#modern-header, #retro-header { transition: opacity 0.3s ease-in-out; }

/* Keep the nav bar pinned to the top while scrolling.
   The home page wraps both headers in #header-container; other pages don't. */
#header-container,
body > #modern-header,
body > #retro-header {
    position: sticky;
    top: 0;
    z-index: 9500; /* over page content and Ponzi Buddy (9000), under the intro/modals (9999+) */
}
/* In-page jumps (/#about, /#pushlog) land below the pinned bar; retro-bar.js sets --nav-h */
html { scroll-padding-top: calc(var(--nav-h, 0px) + 8px); }

.wordmark {
    margin: 0;
    font-family: "Courier New", monospace;
    font-size: 28px;
    letter-spacing: -0.5px;
}
.wordmark span { color: var(--accent); }

nav ul { list-style: none; display: flex; }
nav ul li { margin: 0 10px; }

nav ul li a, #dark-mode-toggle, .nav-button {
    color: var(--bar-ink);
    text-decoration: none;
    cursor: pointer;
}

#dark-mode-toggle, .nav-button {
    background: none;
    border: 1px solid currentColor;
    border-radius: 4px;
}
.nav-button { font: inherit; padding: 6px 12px; white-space: nowrap; }

/* Terminal banner */
.terminal-banner {
    display: flex;
    justify-content: center;
    padding: 64px 16px 32px;
}

.terminal-window {
    width: 100%;
    max-width: 720px;
    background: var(--term-bg);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.terminal-titlebar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #22272e;
    color: var(--term-dim);
    font: 12px "Courier New", monospace;
}
.terminal-titlebar span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #ff5f56;
}
.terminal-titlebar span:nth-child(2) { background: #ffbd2e; }
.terminal-titlebar span:nth-child(3) { background: #27c93f; margin-right: 8px; }

.terminal-body {
    margin: 0;
    padding: 18px 20px;
    min-height: 170px;
    color: var(--term-fg);
    font: 15px/1.6 "Courier New", monospace;
    white-space: pre-wrap;
    word-break: break-word;
}
.terminal-body .prompt { color: var(--accent); }
.cursor { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Hero */
.hero {
    position: relative;
    text-align: center;
    padding: 72px 20px;
    color: #fff;
    background:
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 2px, transparent 2px 4px),
        linear-gradient(135deg, var(--accent-dark), var(--accent) 55%, #ff8a3d);
}
.hero h2 {
    margin: 0 0 8px;
    font-size: clamp(32px, 6vw, 56px);
    font-family: "Courier New", monospace;
}
.hero p { margin: 0 0 24px; font-size: 20px; }

.cta {
    display: inline-block;
    background: #fff;
    color: var(--accent-dark);
    padding: 12px 24px;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    transition: transform 0.15s;
}
.cta:hover { transform: translateY(-2px); }

/* Content sections */
.content {
    text-align: center;
    padding: 50px 16px;
    max-width: 760px;
    margin: 0 auto;
}

#push-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}
#push-form input, #push-form button {
    padding: 10px 12px;
    font: 15px "Courier New", monospace;
    border-radius: 5px;
    border: 1px solid var(--muted);
}
#push-form input {
    flex: 1 1 260px;
    max-width: 420px;
    background: var(--surface);
    color: var(--ink);
}
#push-form button {
    background: var(--accent);
    border-color: var(--accent-dark);
    color: #fff;
    cursor: pointer;
}
#push-form button:hover { background: var(--accent-dark); }

.push-list {
    list-style: none;
    padding: 0;
    margin: 24px auto 0;
    max-width: 560px;
    text-align: left;
    font-family: "Courier New", monospace;
}
.push-list li { padding: 4px 0; word-break: break-word; }
.push-list code { color: var(--accent); background: none; padding: 0; }
.push-note { color: var(--muted); font-size: 13px; }

/* Footer */
footer {
    text-align: center;
    background: var(--bar);
    color: var(--bar-ink);
    padding: 10px 16px;
    font-size: 14px;
}

/* Simple article pages (CozyFit) */
.page {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}
.page img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

@media screen and (max-width: 600px) {
    header { padding: 12px 16px; }
    .terminal-banner { padding-top: 24px; }
    .terminal-body { font-size: 13px; }
}

.plain-link { color: inherit; text-decoration: none; }
.terminal-body .plain-link { text-decoration: underline; }

/* ==========================================================
   Home page background: retro art by default, modern art after "Modernize"
   ========================================================== */
body.home {
    background: #06101c url("/images/forcepush.png") center top / cover no-repeat fixed;
}
body.home.retro-mode {
    background-image: url("/images/forcepush_retro.png");
}

/* Leave room for the artwork's logo; park the terminal on the right */
body.home .terminal-banner {
    min-height: 62vh;
    align-items: center;
    justify-content: flex-end;
    padding: 64px 5vw 48px;
    box-sizing: border-box;
}
body.home .terminal-window { max-width: 560px; }

/* Text sections sit on solid panels so they stay readable over the art */
body.home .content {
    background: var(--paper);
    border-radius: 10px;
    margin: 40px auto;
    box-sizing: border-box;
    width: calc(100% - 32px);
}

/* Narrow screens and touch devices: show the art as a banner under the header
   (iOS ignores fixed backgrounds, and a page-wide background would sit behind the header) */
@media screen and (max-width: 900px), (hover: none) {
    body.home,
    body.home.retro-mode {
        background-image: none;
    }
    body.home .terminal-banner {
        min-height: 0;
        justify-content: center;
        padding: calc(56.25vw + 8px) 16px 32px;
        background: url("/images/forcepush.png") center top / 100% auto no-repeat;
    }
    body.home.retro-mode .terminal-banner {
        background-image: url("/images/forcepush_retro.png");
    }
    body.home .terminal-window { max-width: 720px; }
}

/* ==========================================================
   Small screens: these come after the desktop rules so they win
   ========================================================== */
@media screen and (max-width: 600px) {
    /* Modern header: wordmark on top, one centered row of links */
    #modern-header { flex-direction: column; gap: 4px; padding: 10px 12px; }
    #modern-header nav { padding: 0; }
    #modern-header nav ul { justify-content: center; }
    #modern-header nav ul li { margin: 4px 6px; font-size: 15px; }
    #modern-header #dark-mode-toggle,
    #modern-header .nav-button { padding: 2px 8px; }
    .wordmark { font-size: 24px; }
}

/* Respect reduced-motion settings */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

