body {
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
}

header {
    background: var(--color-bg-section);
    padding: 1rem 0;
    text-align: center;
    border-bottom: 1px solid var(--color-accent);
}

header img {
    max-width: 100%;
    height: auto;
    max-height: 400px;
}

header h1 {
    font-family: var(--font-display);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 3rem;
}

@media (max-width: 600px) {
    header h1 {
        font-size: 2rem;
    }
}

h2 {
    font-family: var(--font-display);
    margin-top: 0;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

nav {
    margin-top: 0;
}

nav a {
    letter-spacing: 0.06em;
    font-family: var(--font-display);
    color: var(--color-accent);
    text-shadow: var(--glow);
    text-transform: uppercase;
    text-decoration: none;
    margin: 0 15px;
    font-size: 1em;
}

@media (min-width: 600px) {
    nav a {
        font-size: 1.3em;
    }
}

nav a:hover {
    text-decoration: underline;
}

/* Compact site bar — the header used across jen.run (home, the /tools landing,
   and as the chrome on the 404 page): a wordmark on the left, the nav on the
   right. The nav collapses behind a hamburger on narrow screens, toggled by a
   pure-CSS checkbox (no JS needed across the static pages). */
.site-bar {
    background: var(--color-bg-section);
    border-bottom: 1px solid var(--color-accent);
    padding: 0.55rem 1.25rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

.site-bar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    margin-right: auto;          /* pushes the nav / burger to the right */
}

.site-bar-pot {
    width: 40px;
    height: 40px;
    display: block;
    image-rendering: pixelated;  /* the pot mark is pixel art */
}

.site-bar-name {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-accent);
    text-shadow: var(--glow-strong);
    font-size: 1.35rem;
    line-height: 1.1;
}

.site-bar-nav {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.site-bar-nav a {
    font-family: var(--font-display-small);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-accent);
    text-shadow: var(--glow);
    text-decoration: none;
    font-size: 0.95rem;
}

.site-bar-nav a:hover {
    text-decoration: underline;
}

/* Hamburger button — hidden on wide screens, shown when the nav collapses. */
.site-nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    cursor: pointer;
}

.site-nav-burger span {
    display: block;
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background: var(--color-accent);
    box-shadow: var(--glow);
}

@media (max-width: 680px) {
    .site-nav-burger {
        display: flex;
    }

    .site-bar-nav {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
        padding-top: 0.4rem;
    }

    /* Checkbox precedes the nav in the DOM, so the sibling combinator can
       reveal the menu when the hamburger toggles it. */
    .site-nav-toggle:checked ~ .site-bar-nav {
        display: flex;
    }
}

section {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1rem;
    background: var(--color-bg-section);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
}

section p {
    margin-top: 0;
}

strong, b {
    font-weight: 700;
    font-synthesis: weight;
}

section p {
    a:link, a:visited, a:hover, a:active {
        color: var(--color-accent);
    }
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 15px;
}

@media (min-width: 600px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-more {
    font-family: var(--font-display-small);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--color-accent);
    white-space: nowrap;
}

.section-more:hover {
    text-decoration: underline;
}

.gallery-grid a {
    display: block;
    position: relative;
    line-height: 0;
    cursor: pointer;
}

.gallery-grid img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    object-position: center;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
}

/* Hover/focus overlay: greys the thumb a little and reveals the title. */
.gallery-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.gallery-grid a:hover .gallery-card-overlay,
.gallery-grid a:focus-visible .gallery-card-overlay {
    opacity: 1;
}

.gallery-card-title {
    font-family: var(--font-display);
    font-weight: bold;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1.15;
    letter-spacing: 0.04em;
    overflow-wrap: anywhere;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
}

footer {
    text-align: center;
    padding: 1rem 0;
    background: var(--color-bg-section);
    border-top: 1px solid var(--color-accent);
    color: var(--color-text);
    margin-top: 2rem;
    position: relative;
}

/* Brand wordmark in the copyright line — glows like the rest of the chrome. */
#footer-copy {
    font-family: var(--font-display);
    letter-spacing: 0.06em;
    color: var(--color-accent);
    text-shadow: var(--glow);
}

.footer-links {
    margin: 0.3rem 0 0;
    font-size: 0.8rem;
}

.footer-links a {
    color: var(--color-text);
    text-decoration: underline;
    opacity: 0.85;
}

.footer-links a:hover { opacity: 1; }

.event-entry {
    border-left: 3px solid var(--color-border);
    padding: 0.4rem 0 0.4rem 1rem;
    margin-bottom: 1.2rem;
}

.event-entry.upcoming {
    border-left-color: var(--color-accent);
}

.event-date {
    font-family: var(--font-display-small);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--color-text-faint);
    margin-bottom: 0.25rem;
}

.event-entry.upcoming .event-date {
    color: var(--color-accent);
}

.event-description {
    margin: 0;
}

/* mdToHtml emits block children (p / ul / h3); keep them tight inside the entry */
.event-description > :first-child { margin-top: 0; }
.event-description > :last-child { margin-bottom: 0; }

.event-description h3 {
    font-family: var(--font-display);   /* Minecrafter */
    color: var(--color-accent);
    font-size: 1.05rem;
    font-weight: normal;
    letter-spacing: 0.04em;
    margin: 1rem 0 0.4rem;
}

.event-description a:link,
.event-description a:visited,
.event-description a:hover,
.event-description a:active {
    color: var(--color-accent);
}

.events-past-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem 0;
    margin: 1rem 0 0.5rem;
    font-family: var(--font-display-small);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-dim);
}

.events-past-toggle:hover {
    color: var(--color-text-faint);
}

.events-toggle-arrow {
    font-style: normal;
    font-size: 0.85rem;
}

#contact form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#contact label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

#contact input,
#contact textarea {
    background: var(--color-bg-input);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-body);
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
}

#contact textarea {
    min-height: 8rem;
    resize: vertical;
}

#contact input:focus,
#contact textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

#contact button[type="submit"] {
    align-self: flex-start;
    background: var(--color-accent);
    color: #000;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1.25rem;
    font-family: var(--font-display-small);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

#contact button[type="submit"]:hover {
    background: var(--color-accent-hover);
}

.hidden {
    display: none !important;
}

.model-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 600px) {
    .model-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.model-card {
    display: flex;
    flex-direction: column;
    background: var(--color-bg-modal);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: var(--color-text);
    transition: border-color 0.2s ease;
}

.model-card:hover {
    border-color: var(--color-accent);
}

.model-card img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    display: block;
    background: var(--color-bg);
}

.model-card-text {
    padding: 0.75rem 1rem 0.9rem;
}

.model-card-text h3 {
    font-family: var(--font-display-small);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 0.25rem;
    color: var(--color-accent);
}

.model-card-text p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

.tool-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 600px) {
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--color-bg-modal);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    text-decoration: none;
    color: var(--color-text);
    transition: border-color 0.2s ease;
}

.tool-card:hover {
    border-color: var(--color-accent);
}

.tool-card img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.tool-card-text h3 {
    font-family: var(--font-display-small);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 0.2rem;
    color: var(--color-accent);
}

.tool-card-text p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

/* ── Phosphor flourishes ───────────────────────────────────────────────────
   Loaded only by the home + landing pages (individual tool pages use
   tool-base.css instead), so these never touch a tool's own UI. ─────────── */

/* Section / banner headings glow like lit phosphor. */
h2 {
    color: var(--color-accent);
    text-shadow: var(--glow);
}

.tool-card h3 {
    text-shadow: var(--glow-soft);
}

/* The card border lights up on hover, terminal-style. */
.tool-card:hover {
    box-shadow: inset 0 0 0 1px var(--color-accent), 0 0 8px rgba(51, 255, 102, 0.18);
}

/* Blinking block cursor — used after the wordmark / prompt lines. */
.cursor::after {
    content: '\2588';            /* █ */
    margin-left: 0.1em;
    color: var(--color-accent);
    text-shadow: var(--glow);
    animation: phosphor-blink 1.1s steps(1) infinite;
}

@keyframes phosphor-blink {
    50% { opacity: 0; }
}

/* Faint CRT scanlines over the whole page. Very low contrast — just texture —
   and non-interactive so it never eats clicks. */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0,
        rgba(0, 0, 0, 0) 2px,
        rgba(0, 0, 0, 0.18) 3px,
        rgba(0, 0, 0, 0) 4px
    );
    mix-blend-mode: multiply;
}

@media (prefers-reduced-motion: reduce) {
    .cursor::after { animation: none; }
}