/* Green Swamp Software: shares its look with Green Swamp Tools (greenswamptools.com), a night-observing console.
   The moon photo is the signature: the hero on Home, and a faint glow behind the other pages.
   Type: Barlow for text, Barlow Condensed for titles. Dark only. */

:root {
    color-scheme: dark;

    --sky: #070b0e;          /* page */
    --panel: #10181c;        /* cards */
    --panel-raised: #172226; /* hover, tiles inside cards */
    --well: #0a1114;         /* inputs, image frames */
    --line: #22313a;
    --line-strong: #34474f;
    --moon: #e8e6df;         /* text */
    --mare: #9aa4a6;         /* secondary text */
    --green: #52b788;        /* actions */
    --green-hover: #6cc89b;
    --green-ink: #06130d;    /* text on green */
    --yellow: #f2c84b;       /* page titles, highlights */
    --red: #ef6461;          /* errors */

    --font: "Barlow", "Segoe UI", system-ui, sans-serif;
    --font-display: "Barlow Condensed", "Barlow", "Segoe UI", system-ui, sans-serif;
    --font-code: "Cascadia Mono", Consolas, ui-monospace, monospace;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --max: 1120px;
}

* { box-sizing: border-box; }

html { background: var(--sky); scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.55;
    color: var(--moon);
    background: var(--sky);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; color: var(--moon); }
h1 { margin: 0 0 .5rem; font-size: clamp(2rem, 4.5vw, 2.75rem); font-weight: 700; color: var(--yellow); letter-spacing: -.005em; }
h2 { margin: 0 0 .85rem; font-size: 1.4rem; font-weight: 600; }
h3 { margin: 0 0 .5rem; font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
p:last-child { margin-bottom: 0; }
img { max-width: 100%; height: auto; }

a { color: var(--green); text-underline-offset: .15em; }
a:hover { color: #7fd1a8; }
code { font-family: var(--font-code); font-size: .85em; background: var(--well); border: 1px solid var(--line); padding: .05em .35em; border-radius: 4px; }
strong { font-weight: 600; }

:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
h1:focus, h1:focus-visible { outline: none; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: 1rem; top: -3rem; z-index: 100; padding: .5rem .9rem;
    background: var(--yellow); color: #111; font-weight: 600; border-radius: var(--radius-sm);
}
.skip-link:focus { top: .5rem; }

.hint { color: var(--mare); font-size: .95rem; }
.ext { font-size: .85em; }

/* ---------- Shell ---------- */

.app-shell { position: relative; display: flex; flex-direction: column; min-height: 100vh; }

/* Inner pages: the moon as a faint glow in the top right. */
.app-shell::before {
    content: ""; position: fixed; z-index: -1; top: -6rem; right: 0;
    width: min(640px, 75vw); aspect-ratio: 500 / 508;
    background: url("images/moon.jpg") 75% center / contain no-repeat;
    opacity: .16;
    -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 100%);
    mask-image: radial-gradient(closest-side, #000 55%, transparent 100%);
    pointer-events: none;
}
.app-shell:has(.home)::before { display: none; }

.app-header {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0 1.5rem; min-height: 3.75rem;
    background: rgba(7, 11, 14, .86); border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.app-header a { text-decoration: none; }

.brand {
    display: flex; align-items: center; gap: .65rem; color: var(--moon); white-space: nowrap; text-decoration: none;
    font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; letter-spacing: .01em;
}
.brand:hover { color: #fff; }
/* A crescent drawn in CSS: the lit limb of the moon. */
.brand-mark {
    width: 1.35rem; height: 1.35rem; border-radius: 50%; flex: none;
    box-shadow: inset -.42rem .08rem 0 0 var(--yellow);
    transform: rotate(-20deg);
}

.nav-links { display: flex; align-items: stretch; gap: .25rem; align-self: stretch; }
.nav-link {
    position: relative; display: flex; align-items: center; gap: .45rem; padding: 0 .85rem;
    color: var(--mare); font-weight: 500; white-space: nowrap; transition: color .15s;
}
.nav-link:hover, .nav-link.active { color: var(--moon); }
.nav-link.active::after {
    content: ""; position: absolute; left: .85rem; right: .85rem; bottom: -1px; height: 2px;
    background: var(--green); border-radius: 2px 2px 0 0;
}
.nav-icon { display: none; font-size: 1rem; }

/* Menu button (narrow screens): a visually hidden checkbox with a label drawn as three bars. */
.nav-toggle-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.nav-toggle {
    display: none; place-items: center; width: 2.5rem; height: 2.5rem; border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm); color: var(--moon); cursor: pointer;
}
.nav-toggle-input:focus-visible + .nav-toggle { outline: 2px solid var(--yellow); outline-offset: 2px; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 1.1rem; height: 2px; background: currentColor; border-radius: 1px;
    transition: transform .2s, background .2s;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle-input:checked + .nav-toggle .nav-toggle-bars { background: transparent; }
.nav-toggle-input:checked + .nav-toggle .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle-input:checked + .nav-toggle .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
    .app-header { flex-wrap: wrap; padding: .6rem 1rem; }
    .nav-toggle { display: grid; }
    .nav-links { display: none; flex-basis: 100%; flex-direction: column; gap: 0; padding: .25rem 0 .5rem; }
    .nav-toggle-input:checked ~ .nav-links { display: flex; }
    .nav-link { padding: .7rem .5rem; border-radius: var(--radius-sm); }
    .nav-link:hover { background: var(--panel-raised); }
    .nav-icon { display: inline; }
    .nav-link.active::after { left: 0; right: auto; top: .6rem; bottom: .6rem; width: 3px; height: auto; border-radius: 0 2px 2px 0; }
}

.app-main { flex: 1 0 auto; width: 100%; max-width: var(--max); margin: 0 auto; padding: 2.25rem 1.5rem 3.5rem; }
.app-main > section, .app-main > div, .app-main > figure { margin-bottom: 2.25rem; }
.app-main > :last-child { margin-bottom: 0; }

.app-footer { width: calc(100% - 3rem); max-width: calc(var(--max) - 3rem); margin: 0 auto; border-top: 1px solid var(--line); color: var(--mare); font-size: .93rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1.5rem 2rem; padding: 2rem 0 1.5rem; }
.footer-brand p { max-width: 22rem; margin: .6rem 0 0; }
.footer-clear { color: var(--yellow); font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; }
.app-footer h2 { margin: 0 0 .6rem; font-size: .8rem; font-family: var(--font); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--mare); }
.app-footer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .35rem; }
.app-footer a:not(.brand) { color: var(--mare); text-decoration: none; }
.app-footer a:not(.brand):hover { color: var(--moon); text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; padding: 1rem 0 2rem; border-top: 1px solid var(--line); font-size: .87rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }

@media (max-width: 700px) {
    .app-main { padding: 1.5rem 1rem 2.5rem; }
    .app-footer { width: calc(100% - 2rem); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}

/* ---------- Page header ---------- */

.page-hero {
    display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; align-items: center;
    margin: 0 0 2.25rem;
}
.page-hero h1 { margin: 0; line-height: 1.05; }
.page-hero-icon {
    grid-row: span 2; align-self: start; display: grid; place-items: center;
    width: 3.5rem; height: 3.5rem; border-radius: 12px; font-size: 1.75rem;
    background: var(--panel); border: 1px solid var(--line);
}
.page-hero-lead { grid-column: 2; max-width: 44rem; margin: .5rem 0 0; color: var(--mare); font-size: 1.1rem; line-height: 1.55; }
.page-hero-actions { grid-column: 2; }
@media (max-width: 600px) {
    .page-hero { grid-template-columns: 1fr; row-gap: .75rem; }
    .page-hero-icon { grid-row: auto; width: 3rem; height: 3rem; font-size: 1.5rem; }
    .page-hero-lead, .page-hero-actions { grid-column: 1; margin-top: 0; }
}

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; margin-bottom: 1rem; }
.section-head h2 { margin: 0; font-size: 1.6rem; }
.section-head .hint { margin: 0; }

/* ---------- Buttons ---------- */

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin-top: 1.25rem; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .55rem 1.05rem; border-radius: var(--radius-sm); cursor: pointer;
    border: 1px solid var(--line-strong); background: var(--panel-raised); color: var(--moon);
    font: inherit; font-weight: 500; line-height: 1.3; text-decoration: none; white-space: nowrap;
    transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--mare); color: #fff; }
.btn-primary { background: var(--green); border-color: var(--green); color: var(--green-ink); font-weight: 600; }
.btn-primary:hover { background: var(--green-hover); border-color: var(--green-hover); color: var(--green-ink); }
.btn-lg { padding: .7rem 1.6rem; font-size: 1.05rem; font-weight: 600; }

/* ---------- Cards ---------- */

.card {
    background: var(--panel); color: var(--moon); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.35rem 1.5rem;
}
.card > h2:first-child { margin-top: -.1rem; }
@media (max-width: 600px) { .card { padding: 1.1rem 1rem; } }

.card-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 1.25rem; }

/* ---------- Home ---------- */

.app-main:has(> .home) { padding-top: 0; }
.home { display: flex; flex-direction: column; gap: 3rem; }

.home-hero {
    display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .8fr); align-items: center; gap: 1.5rem;
    padding-top: 2rem;
}
.home-intro { display: flex; flex-direction: column; gap: 1rem; }
.eyebrow { margin: 0; color: var(--green); font-size: .85rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.home-title {
    margin: 0; color: var(--yellow);
    font-family: var(--font-display); font-weight: 700; line-height: .92; letter-spacing: -.015em;
    font-size: clamp(2.9rem, 7vw, 5rem);
}
.home-tagline { margin: 0; max-width: 34rem; color: var(--moon); font-size: clamp(1.05rem, 1.6vw, 1.2rem); line-height: 1.55; }
.home-intro .actions { margin-top: .5rem; }

.home-moon {
    justify-self: center; display: block; width: 100%; max-width: 380px; height: auto;
    -webkit-mask-image: radial-gradient(closest-side, #000 82%, transparent 100%);
    mask-image: radial-gradient(closest-side, #000 82%, transparent 100%);
    mix-blend-mode: lighten;
    animation: moonrise 1.4s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes moonrise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

@media (max-width: 860px) {
    .home { gap: 2.25rem; }
    .home-hero { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 0; }
    .home-moon { grid-row: 1; max-width: 220px; margin-top: .5rem; }
}

/* Product cards: screenshot on top, text below. */
.showcase { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.showcase-card {
    display: flex; flex-direction: column; overflow: hidden;
    border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel);
    color: var(--moon); text-decoration: none; transition: border-color .15s, background .15s, transform .2s;
}
.showcase-card:hover { border-color: var(--line-strong); background: var(--panel-raised); color: var(--moon); transform: translateY(-2px); }
.showcase-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; border-bottom: 1px solid var(--line); background: var(--well); }
.showcase-body { display: flex; flex-direction: column; gap: .45rem; padding: 1.2rem 1.4rem 1.3rem; flex: 1; }
.showcase-title { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; line-height: 1.1; }
.showcase-desc { flex: 1; color: var(--mare); }
.showcase-cta { color: var(--green); font-weight: 600; }
.showcase-card:hover .showcase-cta { text-decoration: underline; }
@media (max-width: 760px) { .showcase { grid-template-columns: minmax(0, 1fr); } }

.chip-list { display: flex; flex-wrap: wrap; gap: .45rem; margin: .5rem 0 0; padding: 0; list-style: none; }
.chip-list li {
    padding: .2rem .7rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--well);
    font-size: .9rem; font-weight: 500; white-space: nowrap;
}
.chip-list .chip-more { border-style: dashed; color: var(--mare); }

.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.gallery-item {
    position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3;
    border-radius: var(--radius); border: 1px solid var(--line); background: var(--well);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-caption {
    position: absolute; inset: auto 0 0 0; padding: 1.5rem .8rem .6rem;
    background: linear-gradient(transparent, rgba(7, 11, 14, .9));
    color: var(--moon); font-family: var(--font-display); font-size: 1.05rem; font-weight: 600;
}
@media (max-width: 860px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Partners and press: logos on light plates, since several are dark-on-transparent. */
.press { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.press-item {
    display: flex; flex-direction: column; gap: .75rem; padding: 1rem;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
    color: var(--mare); text-decoration: none; font-size: .93rem; transition: border-color .15s, color .15s;
}
.press-item:hover { border-color: var(--line-strong); color: var(--moon); }
.press-item img { height: 64px; width: 100%; object-fit: contain; padding: .6rem; border-radius: var(--radius-sm); background: #f4f2ec; }
@media (max-width: 760px) { .press { grid-template-columns: minmax(0, 1fr); } }

.author { display: flex; align-items: center; gap: 1.25rem; }
.author img { flex: none; width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line-strong); }
.author h2 { margin-bottom: .35rem; }
.author p { color: var(--mare); }
@media (max-width: 520px) { .author { flex-direction: column; align-items: flex-start; } }

/* GS Server page: developers */
.credits { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 1rem; }
.credits li {
    display: flex; flex-direction: column; gap: .2rem;
    padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-raised);
}
.credit-name { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--moon); }
.credit-role { color: var(--mare); font-size: .93rem; }
.credits a { font-size: .93rem; margin-top: .2rem; }

/* ---------- Link tiles (community) ---------- */

.link-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 1rem; }
.link-tile {
    display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr auto; column-gap: .9rem; row-gap: .3rem;
    padding: 1.25rem 1.35rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel);
    color: var(--moon); text-decoration: none; transition: background .15s, border-color .15s;
}
.link-tile:hover { background: var(--panel-raised); border-color: var(--line-strong); color: var(--moon); }
.link-tile-icon {
    grid-row: span 3; display: grid; place-items: center; width: 2.6rem; height: 2.6rem;
    border-radius: 9px; background: var(--well); border: 1px solid var(--line); font-size: 1.3rem;
}
.link-tile-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; line-height: 1.15; }
.link-tile-desc { color: var(--mare); }
.link-tile-cta { margin-top: .4rem; font-weight: 600; color: var(--green); }
.link-tile:hover .link-tile-cta { text-decoration: underline; }

/* ---------- Donate ---------- */

.donate-banner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem;
    padding: 1.6rem 1.75rem; border-radius: var(--radius-lg);
    border: 1px solid rgba(82, 183, 136, .35);
    background: linear-gradient(120deg, rgba(82, 183, 136, .14), rgba(242, 200, 75, .06) 70%), var(--panel);
}
.donate-banner h2 { margin: 0 0 .3rem; font-size: 1.6rem; color: var(--yellow); }
.donate-banner p { margin: 0; max-width: 40rem; color: var(--mare); }

.donate-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .9rem; max-width: 40rem; margin-inline: auto; padding: 2rem 1.75rem; }
.donate-card img { width: 220px; padding: .75rem 1rem; border-radius: var(--radius-sm); background: #f4f2ec; }
.donate-card h2 { margin: .25rem 0 0; color: var(--yellow); font-size: 1.75rem; }
.donate-card p { margin: 0; color: var(--mare); }

/* ---------- Product pages ---------- */

.screenshot { margin: 0; padding: .6rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .8); }
.screenshot img { display: block; width: 100%; border-radius: var(--radius-sm); }
.screenshot-compact { max-width: 760px; margin-inline: auto; } /* smaller than the page width, and never wider than the picture */

.feature-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 760px) { .feature-groups { grid-template-columns: minmax(0, 1fr); } }
.feature-group h3 { font-size: 1.3rem; margin-bottom: .75rem; }
.check-list { margin: 0; padding: 0; list-style: none; display: grid; gap: .45rem; }
.check-list li { position: relative; padding-left: 1.6rem; color: var(--moon); }
.check-list li::before {
    content: ""; position: absolute; left: .2rem; top: .4rem; width: .45rem; height: .8rem;
    border: solid var(--green); border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* ---------- Downloads ---------- */

.release-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 1.25rem; }
.release { display: flex; flex-direction: column; gap: .5rem; }
.release-head { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin: 0; font-size: 1.5rem; }
.release-version { color: var(--yellow); }
.release-badge {
    margin-left: .25rem; padding: .1rem .65rem; border-radius: 999px;
    font-family: var(--font); font-size: .8rem; font-weight: 600; line-height: 1.5; letter-spacing: .04em; text-transform: uppercase;
    background: rgba(82, 183, 136, .13); border: 1px solid rgba(82, 183, 136, .45); color: var(--green);
}
.release-beta { border-style: dashed; }
.release-beta .release-badge { background: rgba(242, 200, 75, .1); border-color: rgba(242, 200, 75, .45); color: var(--yellow); }
.release-files { display: grid; gap: .6rem; margin: .4rem 0 .2rem; padding: 0; list-style: none; }
.release-files li { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .85rem; }
.release-files .btn { white-space: normal; overflow-wrap: anywhere; text-align: left; }
.release-notes { margin-top: auto; padding-top: .35rem; font-weight: 500; }

/* ---------- Screenshots ---------- */

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.shot {
    display: flex; flex-direction: column; height: 100%; overflow: hidden; scroll-margin-top: 5rem;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
    color: var(--moon); text-decoration: none; transition: border-color .15s, background .15s, transform .2s;
}
.shot:hover { border-color: var(--line-strong); background: var(--panel-raised); color: var(--moon); transform: translateY(-2px); }
.shot:focus-visible { outline-offset: -2px; }
.shot img { display: block; width: 100%; aspect-ratio: 5 / 3; object-fit: cover; object-position: top left; border-bottom: 1px solid var(--line); background: var(--well); }
.shot-title { padding: .85rem 1.1rem 0; font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; line-height: 1.15; }
.shot-caption { padding: .25rem 1.1rem 1rem; color: var(--mare); font-size: .95rem; }

/* Full-size viewer: hidden until its id is the address's #fragment. */
.lightbox {
    position: fixed; inset: 0; z-index: 200; display: none; margin: 0 !important; /* not the page's section spacing */
    align-items: center; justify-content: center; padding: 3.5rem 4.5rem;
}
.lightbox:target { display: flex; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(4, 7, 9, .92); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); cursor: zoom-out; }
.lightbox-figure { position: relative; margin: 0; max-width: min(1100px, 100%); display: flex; flex-direction: column; gap: .75rem; }
.lightbox-figure img {
    display: block; width: auto; max-width: 100%; max-height: calc(100vh - 11rem); margin: 0 auto;
    border-radius: var(--radius-sm); border: 1px solid var(--line-strong); box-shadow: 0 30px 80px -20px #000;
    animation: lightbox-in .2s ease-out;
}
@keyframes lightbox-in { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
.lightbox-figure figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .6rem; justify-content: center; text-align: center; color: var(--mare); }
.lightbox-figure figcaption strong { color: var(--yellow); font-family: var(--font-display); font-size: 1.25rem; }
.lightbox-count { flex-basis: 100%; font-size: .85rem; }
.lightbox-btn {
    position: absolute; display: grid; place-items: center; width: 2.75rem; height: 2.75rem;
    border-radius: 50%; border: 1px solid var(--line-strong); background: var(--panel-raised);
    color: var(--moon); font-size: 1.6rem; line-height: 1; text-decoration: none; transition: background .15s, border-color .15s;
}
.lightbox-btn:hover { background: var(--panel); border-color: var(--mare); color: #fff; }
.lightbox-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-close { top: 1rem; right: 1rem; font-size: 1.1rem; }
@media (max-width: 700px) {
    .lightbox { padding: 4rem .75rem 5rem; }
    .lightbox-prev, .lightbox-next { top: auto; bottom: 1rem; transform: none; }
    .lightbox-prev { left: calc(50% - 3.25rem); }
    .lightbox-next { right: calc(50% - 3.25rem); }
}
/* Stop the page behind the viewer from scrolling. */
html:has(.lightbox:target) { overflow: hidden; }

/* ---------- Help videos ---------- */

.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.video {
    display: flex; flex-direction: column; overflow: hidden;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
}
.video-frame {
    position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0;
    border-bottom: 1px solid var(--line); background: #000; overflow: hidden;
}
.video-frame img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease, opacity .2s; opacity: .85; }
a.video-frame:hover img { transform: scale(1.04); opacity: 1; }
a.video-frame:focus-visible { outline-offset: -3px; }
/* Play button: a green disc with a triangle, in the corner so it doesn't hide titles printed on the thumbnail. */
.video-play {
    position: absolute; left: .75rem; bottom: .75rem; width: 3rem; height: 3rem;
    border-radius: 50%; background: var(--green); box-shadow: 0 8px 30px rgba(0, 0, 0, .55);
    transition: transform .15s, background .15s;
}
.video-play::after {
    content: ""; position: absolute; left: 54%; top: 50%; transform: translate(-50%, -50%);
    border-style: solid; border-width: .55rem 0 .55rem .9rem; border-color: transparent transparent transparent var(--green-ink);
}
a.video-frame:hover .video-play { transform: scale(1.08); background: var(--green-hover); }
.video-duration {
    position: absolute; right: .5rem; bottom: .5rem; padding: .05rem .45rem; border-radius: 4px;
    background: rgba(7, 11, 14, .85); color: var(--moon); font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.video-body { display: flex; flex-direction: column; gap: .3rem; flex: 1; padding: .9rem 1.1rem 1rem; }
.video-body h3 { margin: 0; font-size: 1.25rem; }
.video-body .hint { margin: 0; }
.video-meta { margin: auto 0 0; padding-top: .35rem; color: var(--mare); font-size: .88rem; }

/* ---------- Manual ---------- */

.manual-chapters {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 1rem;
    margin: 0; padding: 0; list-style: none;
}
.manual-chapter {
    display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; column-gap: .85rem; row-gap: .25rem;
    height: 100%; padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
    color: var(--moon); text-decoration: none; transition: background .15s, border-color .15s;
}
.manual-chapter:hover { background: var(--panel-raised); border-color: var(--line-strong); color: var(--moon); }
.manual-chapter-number {
    grid-row: span 2; display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 8px;
    background: var(--well); border: 1px solid var(--line); color: var(--yellow);
    font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.manual-chapter-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; line-height: 1.15; }
.manual-chapter-summary { color: var(--mare); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Chapter page: article with the chapter list beside it. */
.app-main:has(> .manual) { max-width: 1240px; }
.manual { display: grid; grid-template-columns: minmax(0, 1fr) 15.5rem; gap: 2.5rem; align-items: start; }
.manual-article { min-width: 0; max-width: 50rem; }
.manual-article h1 { display: flex; align-items: baseline; gap: .6rem; margin-bottom: 1.25rem; }
.manual-title-number { color: var(--mare); font-size: .6em; font-weight: 600; }

.manual-nav {
    position: sticky; top: 5rem; max-height: calc(100vh - 6rem); overflow-y: auto;
    padding: 1rem .75rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
}
.manual-nav h2 { margin: 0 .5rem .5rem; font-family: var(--font); font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--mare); }
.manual-nav ol { margin: 0; padding: 0; list-style: none; }
.manual-nav a {
    display: flex; gap: .55rem; padding: .3rem .5rem; border-radius: var(--radius-sm);
    color: var(--mare); font-size: .93rem; text-decoration: none; line-height: 1.35;
}
.manual-nav a:hover { background: var(--panel-raised); color: var(--moon); }
.manual-nav a.current { background: rgba(82, 183, 136, .13); color: var(--moon); font-weight: 600; }
.manual-nav-number { flex: none; width: 1.3rem; text-align: right; color: var(--line-strong); font-variant-numeric: tabular-nums; }
.manual-nav a.current .manual-nav-number { color: var(--green); }

.manual-onpage {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .5rem; margin: 0 0 1.75rem; padding: .75rem 1rem;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); font-size: .92rem;
}
.manual-onpage > span { margin-right: .25rem; color: var(--mare); font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.manual-onpage a { padding: .1rem .55rem; border-radius: 999px; border: 1px solid var(--line-strong); text-decoration: none; }
.manual-onpage a:hover { border-color: var(--green); }

/* The chapter text (rendered from Markdown). */
.manual-body { font-size: 1.02rem; line-height: 1.65; }
.manual-body > :first-child { margin-top: 0; }
.manual-body h2 { margin: 2.25rem 0 .75rem; padding-top: .5rem; font-size: 1.6rem; color: var(--yellow); scroll-margin-top: 5rem; }
.manual-body h3 { margin: 1.75rem 0 .5rem; font-size: 1.25rem; scroll-margin-top: 5rem; }
.manual-body p { margin: 0 0 .9rem; }
.manual-body ul, .manual-body ol { margin: 0 0 1rem; padding-left: 1.4rem; }
.manual-body li { margin-bottom: .3rem; }
.manual-body li > ul, .manual-body li > ol { margin: .3rem 0 0; }
.manual-body img { display: block; height: auto; margin: 1rem 0 1.25rem; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--well); }
/* Icons and buttons sit in the text, at the size they are in the program. */
.manual-body img.icon { display: inline-block; vertical-align: middle; margin: 0 .5rem .15rem 0; border: 0; border-radius: 4px; background: none; }
.manual-body pre {
    margin: 0 0 1.25rem; padding: 1rem 1.1rem; overflow-x: auto; max-height: 70vh;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--well);
    font-family: var(--font-code); font-size: .84rem; line-height: 1.5; color: #cfd8d4;
}
.manual-body pre code { padding: 0; border: 0; background: none; font-size: inherit; }
.manual-body table { width: 100%; margin: 0 0 1.25rem; border-collapse: collapse; font-size: .93rem; }
.manual-body th, .manual-body td { padding: .45rem .65rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.manual-body th { background: var(--panel); }
.manual-body strong { color: #fff; }

.manual-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.manual-pager a {
    display: flex; flex-direction: column; gap: .15rem; padding: .85rem 1.1rem;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
    color: var(--moon); font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; text-decoration: none;
}
.manual-pager a:hover { border-color: var(--green); background: var(--panel-raised); color: var(--moon); }
.manual-pager span { color: var(--green); font-family: var(--font); font-size: .85rem; font-weight: 600; }
.manual-pager-next { grid-column: 2; text-align: right; }

@media (max-width: 960px) {
    .manual { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
    .manual-nav { position: static; max-height: none; }
}
@media (max-width: 520px) {
    .manual-pager { grid-template-columns: 1fr; }
    .manual-pager-next { grid-column: 1; }
}

/* A section reached from a search result or an "On this page" link: briefly marked. */
.manual-body :is(h2, h3):is(:target, .is-target) { animation: target-flash 2.4s ease-out; border-radius: 4px; }
@keyframes target-flash { 0%, 30% { background: rgba(242, 200, 75, .18); box-shadow: 0 0 0 .35rem rgba(242, 200, 75, .18); } 100% { background: transparent; box-shadow: 0 0 0 .35rem transparent; } }

/* API listing: one code block, each member anchored so search results can point at it. */
.manual-body pre.api-listing { max-height: none; }
.api-member { display: block; margin: 0 -1.1rem .9rem; padding: 0 1.1rem; scroll-margin-top: 5rem; border-left: 3px solid transparent; }
.api-member:is(:target, .is-target) { background: rgba(242, 200, 75, .1); border-left-color: var(--yellow); animation: none; }

/* ---------- Manual search ---------- */

.manual-search { position: relative; display: flex; gap: .5rem; }
.manual-search input {
    flex: 1; min-width: 0; padding: .6rem .8rem .6rem 2.3rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    background: var(--well); color: var(--moon); font: inherit; transition: border-color .15s, box-shadow .15s;
}
.manual-search input::placeholder { color: var(--mare); opacity: .8; }
.manual-search input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(82, 183, 136, .2); }
/* Magnifying glass drawn in CSS. */
.manual-search-icon {
    position: absolute; left: .8rem; top: 50%; width: .85rem; height: .85rem; transform: translateY(-62%);
    border: 2px solid var(--mare); border-radius: 50%; pointer-events: none;
}
.manual-search-icon::after {
    content: ""; position: absolute; right: -.38rem; bottom: -.32rem; width: .42rem; height: 2px;
    background: var(--mare); transform: rotate(45deg); border-radius: 1px;
}
.manual-search-lg input { padding-top: .75rem; padding-bottom: .75rem; font-size: 1.05rem; }
.manual-search-lg .btn { padding-inline: 1.4rem; }
.manual-search-index { max-width: 40rem; margin: -.75rem 0 2rem; }
.manual-search-sm { margin: 0 0 1rem; }
.manual-search-sm .btn { display: none; } /* Enter submits; the sidebar has no room for a button */
.manual-search-sm input { padding-top: .45rem; padding-bottom: .45rem; font-size: .93rem; }

.manual-search-page { max-width: 50rem; }
.manual-search-page .manual-search { margin: .5rem 0 1.5rem; }
.search-count { color: var(--mare); }
.search-results { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.search-result {
    display: flex; flex-direction: column; gap: .2rem; padding: .9rem 1.15rem;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
    color: var(--moon); text-decoration: none; transition: background .15s, border-color .15s;
}
.search-result:hover { background: var(--panel-raised); border-color: var(--line-strong); color: var(--moon); }
.search-result-path { color: var(--mare); font-size: .85rem; }
.search-result-chapter { color: var(--green); font-weight: 600; }
.search-result-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; line-height: 1.2; }
.search-result-snippet { color: var(--mare); font-size: .95rem; }
.search-result mark { background: rgba(242, 200, 75, .2); color: var(--yellow); border-radius: 3px; padding: 0 .1em; }
.search-empty { padding: 1.25rem 1.4rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.search-empty h2 { font-size: 1.3rem; }

/* ---------- Forum topics (groups.io) ---------- */

.forum-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; align-items: start; }
@media (max-width: 860px) { .forum-grid { grid-template-columns: minmax(0, 1fr); } }
.forum-grid .section-head { flex-direction: column; align-items: flex-start; }
.topics { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.topic {
    display: flex; flex-direction: column; gap: .2rem; padding: .8rem 1rem;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
    color: var(--moon); text-decoration: none; transition: background .15s, border-color .15s;
}
.topic:hover { background: var(--panel-raised); border-color: var(--line-strong); color: var(--moon); }
.topic-subject { font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.topic-summary {
    color: var(--mare); font-size: .92rem; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.topic-meta { display: flex; flex-wrap: wrap; gap: .1rem .45rem; color: var(--mare); font-size: .84rem; }
.topic-replies { color: var(--green); font-weight: 600; font-variant-numeric: tabular-nums; }
.topic-badge {
    display: inline-block; margin-right: .4rem; padding: 0 .5rem; border-radius: 999px; vertical-align: .1em;
    border: 1px solid rgba(242, 200, 75, .45); background: rgba(242, 200, 75, .1); color: var(--yellow);
    font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.topics-compact { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.topics-more { display: flex; }
.topics-more-tile {
    flex: 1; display: flex; flex-direction: column; justify-content: center; gap: .25rem; padding: .8rem 1.1rem;
    border: 1px solid rgba(82, 183, 136, .5); border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(82, 183, 136, .22), rgba(82, 183, 136, .08));
    color: var(--moon); text-decoration: none; transition: background .15s, border-color .15s, transform .15s;
}
.topics-more-tile:hover { border-color: var(--green); background: rgba(82, 183, 136, .28); color: #fff; transform: translateY(-1px); }
.topics-more-title { color: var(--green); font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; }
.topics-more-tile:hover .topics-more-title { color: var(--green-hover); }
.topics-more-text { color: var(--mare); font-size: .9rem; }
.forum-cta {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem;
    margin-top: 1.25rem; padding: 1.1rem 1.4rem; border-radius: var(--radius-lg);
    border: 1px solid rgba(82, 183, 136, .35);
    background: linear-gradient(120deg, rgba(82, 183, 136, .14), rgba(242, 200, 75, .05) 70%), var(--panel);
}
.forum-cta p { margin: 0; max-width: 34rem; color: var(--mare); }
.forum-cta strong { display: block; color: var(--moon); font-size: 1.05rem; }
.forum-cta .actions { margin: 0; }

/* ---------- Documents ---------- */

.doc-list-numbered { list-style: decimal inside; }
.doc-list-numbered li { padding: .3rem .6rem; color: var(--mare); }
.doc-files { margin: 0; padding: 0; list-style: none; display: grid; gap: .6rem; }
.doc-files li { display: flex; flex-direction: column; }
.doc-files a { font-weight: 500; }

.docs { display: grid; gap: 1.25rem; }
.doc-book-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1rem; }
.doc-book-head h2 { margin: 0; font-size: 1.5rem; }
.doc-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: .25rem 1rem; }
.doc-list li { padding: .4rem .6rem; border-radius: var(--radius-sm); }
.doc-list li:has(.doc-sub) { grid-column: 1 / -1; background: var(--well); border: 1px solid var(--line); padding: .65rem .8rem; }
.doc-list a { font-weight: 500; text-decoration: none; }
.doc-list a:hover { text-decoration: underline; }
.doc-sub { display: block; margin-top: .25rem; color: var(--mare); font-size: .9rem; }

/* ---------- Support ---------- */

.support-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.support-side { display: grid; gap: 1.25rem; }
.support-side h2 { font-size: 1.25rem; }
@media (max-width: 860px) { .support-grid { grid-template-columns: minmax(0, 1fr); } }

.form { display: grid; gap: 1rem; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: minmax(0, 1fr); } }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 500; }
.req { color: var(--yellow); }
.optional { color: var(--mare); font-weight: 400; font-size: .9rem; }
.field input, .field textarea {
    width: 100%; padding: .6rem .75rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    background: var(--well); color: var(--moon); font: inherit; transition: border-color .15s;
}
.field textarea { resize: vertical; min-height: 9rem; }
.field input:hover, .field textarea:hover { border-color: var(--mare); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(82, 183, 136, .2); }
.field .invalid { border-color: var(--red); }
.validation-message { color: var(--red); font-size: .9rem; }
.form .actions { margin-top: .25rem; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.notice { padding: .9rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 1rem; }
.notice p { margin: .25rem 0 0; color: var(--mare); }
.notice-ok { background: rgba(82, 183, 136, .13); border-color: rgba(82, 183, 136, .45); }
.notice-error { background: rgba(239, 100, 97, .13); border-color: rgba(239, 100, 97, .45); }

/* ---------- Prose (Privacy) ---------- */

.prose { max-width: 48rem; }
.prose h2 { margin-top: 1.5rem; font-size: 1.3rem; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--mare); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Statistics ---------- */

.stats-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stats-tile { display: flex; flex-direction: column; gap: .2rem; }
.stats-tile-value { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; line-height: 1; color: var(--yellow); font-variant-numeric: tabular-nums; }
.stats-tile-label { color: var(--mare); font-size: .9rem; }
@media (max-width: 700px) { .stats-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.stats-table-wrap { overflow-x: auto; }
.stats-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.stats-table th, .stats-table td { padding: .55rem .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.stats-table thead th { color: var(--mare); font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.stats-table tbody th { font-weight: 500; min-width: 14rem; }
.stats-table tbody th a { text-decoration: none; }
.stats-table tbody th a:hover { text-decoration: underline; }
.stats-table .num { text-align: right; white-space: nowrap; }
.stats-table tbody tr:last-child > * { border-bottom: 0; }
.stats-bar { display: block; height: 4px; margin-top: .35rem; border-radius: 2px; background: var(--well); }
.stats-bar > span { display: block; height: 100%; border-radius: 2px; background: var(--green); }
.stats-note { margin: 1rem 0 0; }
@media (max-width: 600px) {
    .stats-table th, .stats-table td { padding: .5rem .4rem; }
    .stats-table tbody th { min-width: 8.5rem; }
}
