@import url("https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap");

:root {
    --background: #edf4ed;
    --surface: #e3ece3;
    --surface-raised: #f5f8f4;
    --text: #253229;
    --muted: #647269;
    --phosphor: #34734a;
    --phosphor-bright: #255e38;
    --pokemon-blue: #5b82b2;
    --pokemon-yellow: #8d6c08;
    --type-dark: #5a5366;
    --type-fire: #d45f43;
    --fire: #ad4824;
    --ember: #bd4141;
    --gold: #8b6818;
    --cool: #356d76;
    --line: #78907e;
    --border: 1px solid var(--line);
    --content: 1040px;
    --prose: 680px;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: "Source Code Pro", Consolas, monospace;
    font-size: 13px;
    line-height: 1.65;
    text-align: left;
    background-color: #8dbb7c;
    background-image:
        linear-gradient(to bottom, rgb(255 255 255 / 3%) 0%, rgb(44 83 56 / 8%) 100%),
        url("/assets/images/574726.jpg");
    background-attachment: fixed;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: max(1920px, 100vw) auto;
    image-rendering: pixelated;
}

body.viewer-open {
    overflow: hidden;
}

a {
    color: var(--fire);
    text-decoration: none;
}

a:hover,
a:focus-visible {
    color: var(--background);
    background: var(--fire);
}

button,
input {
    font: inherit;
}

button,
input,
a {
    border-radius: 0;
}

:focus-visible {
    outline: 1px solid var(--gold);
    outline-offset: 4px;
}

::selection {
    color: var(--background);
    background: var(--text);
}

.skip-link {
    position: fixed;
    left: 12px;
    top: -60px;
    z-index: 1200;
    padding: 6px 10px;
    background: var(--text);
    color: var(--background);
}

.skip-link:focus {
    top: 12px;
}

.site-shell {
    width: min(90%, var(--content));
    margin: 24px auto;
    padding: 0 28px 6px;
    border: 1px solid rgb(83 112 91 / 72%);
    background: rgb(244 248 243 / 88%);
    box-shadow: 0 0 0 1px rgb(255 255 255 / 64%), 0 18px 70px rgb(42 73 49 / 25%);
    -webkit-backdrop-filter: brightness(1.02) saturate(.8);
    backdrop-filter: brightness(1.02) saturate(.8);
}

.terminal-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 30px;
    margin: 0 -28px;
    padding: 0 10px;
    border-bottom: 1px solid rgb(83 112 91 / 64%);
    background: rgb(224 235 225 / 86%);
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.terminal-bar > :last-child {
    justify-self: end;
}

.terminal-lights {
    display: flex;
    gap: 7px;
}

.terminal-lights i {
    width: 8px;
    height: 8px;
    border: 1px solid transparent;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 38%);
}

.terminal-lights i:first-child {
    border-color: #df403b;
    background: #ff5f57;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 42%), 0 0 6px rgb(255 95 87 / 38%);
}

.terminal-lights i:nth-child(2) {
    border-color: #d89a17;
    background: #febc2e;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 42%), 0 0 6px rgb(254 188 46 / 34%);
}

.terminal-lights i:last-child {
    border-color: #18a332;
    background: #28c840;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 42%), 0 0 6px rgb(40 200 64 / 34%);
}

.site-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin: 30px 0 16px;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-lockup .pokeball-mark {
    flex: 0 0 auto;
    margin: 0;
}

.wordmark {
    display: inline-flex;
    flex-direction: column;
    color: var(--text);
    line-height: 1;
    letter-spacing: .08em;
}

.wordmark:hover,
.wordmark:focus-visible {
    color: var(--text);
    background: transparent;
}

.site-title {
    margin-bottom: 9px;
    color: #1f2c23;
    font-size: clamp(20px, 2.2vw, 27px);
    font-weight: 700;
    letter-spacing: .015em;
}

.wordmark-kicker {
    margin-left: 1px;
    color: var(--pokemon-yellow);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
}

.tagline {
    margin: 0 0 2px;
    color: var(--muted);
    text-align: right;
}

.menu {
    position: relative;
    margin-bottom: 30px;
    border-top: var(--border);
    border-bottom: var(--border);
    background: rgb(226 237 228 / 74%);
}

.menu::before {
    position: absolute;
    left: 0;
    top: 10px;
    color: var(--phosphor);
    content: "nav>";
}

.menu ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 3px 18px;
    margin: 0;
    padding: 9px 0 9px 48px;
    list-style: none;
}

.menu a {
    color: var(--text);
}

.menu a::before {
    color: var(--muted);
    content: "[";
}

.menu a::after {
    color: var(--muted);
    content: "]";
}

.menu a:hover,
.menu a:focus-visible,
.menu a[aria-current="page"] {
    color: var(--background);
    background: var(--text);
}

.pokeball-mark {
    position: relative;
    width: 42px;
    height: 42px;
    margin: auto;
    overflow: hidden;
    border: 3px solid #b8c3bb;
    border-radius: 50%;
    background: linear-gradient(to bottom, var(--ember) 0 44%, #202622 44% 56%, #e4e8e5 56% 100%);
    box-shadow: 0 0 12px rgb(223 91 87 / 18%);
}

.pokeball-mark::before {
    position: absolute;
    inset: 50% auto auto 50%;
    width: 12px;
    height: 12px;
    border: 3px solid #202622;
    border-radius: 50%;
    background: #d8dfda;
    content: "";
    transform: translate(-50%, -50%);
}

.pokeball-mark span {
    position: absolute;
    inset: 50% auto auto 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--pokemon-blue);
    transform: translate(-50%, -50%);
}

.prose {
    width: min(100%, var(--prose));
    margin-inline: auto;
}

.gba-hero {
    width: min(100%, 560px);
    margin: 34px auto 30px;
    text-align: center;
}

.gba-hero img {
    display: block;
    width: 100%;
    height: auto;
    margin-inline: auto;
    image-rendering: auto;
    filter: none;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    width: min(100%, var(--prose));
    margin: 0 auto 42px;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 14px;
    border: 1px solid currentColor;
    border-radius: 3px;
    font-weight: 700;
    text-align: center;
    transition: background 120ms ease;
}

.action-primary {
    border-color: #d94816;
    background: #f25b24;
    color: #fff;
}

.action-primary:hover,
.action-primary:focus-visible {
    background: #ff6a2f;
    color: #fff;
}

.action-secondary {
    border-color: #14912f;
    background: #20b843;
    color: #fff;
}

.action-secondary:hover,
.action-secondary:focus-visible {
    background: #2aca4e;
    color: #fff;
}

.intro,
.page-intro,
.page-copy {
    margin-top: 32px;
}

.intro,
.page-intro {
    position: relative;
    padding: 18px 20px 10px;
    border: 2px solid #809486;
    box-shadow: 0 0 0 2px #f4f8f3, 0 0 0 3px #a1b3a5;
    background: linear-gradient(135deg, rgb(91 130 178 / 6%), transparent 45%);
}

.intro::before,
.page-intro::before {
    position: absolute;
    right: 10px;
    top: -9px;
    padding: 0 6px;
    background: var(--background);
    color: var(--pokemon-yellow);
    font-size: 9px;
    content: "POKéDEX DATA";
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--phosphor);
    font-size: 11px;
    letter-spacing: .08em;
}

h1,
h2,
h3 {
    margin: 22px 0 16px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    border-top: 0;
    border-bottom: var(--border);
    padding: 7px 4px;
    background: linear-gradient(90deg, rgb(143 191 143 / 6%), transparent 75%);
}

h1::before,
h2::before,
h3::before {
    color: var(--phosphor);
    content: "$ ";
}

h1 {
    margin-top: 0;
}

h1::after,
h2::after,
h3::after {
    position: relative;
    top: 2px;
    display: inline-block;
    width: 5px;
    height: 14px;
    margin-left: 8px;
    background: var(--phosphor-bright);
    box-shadow: 0 0 5px rgb(182 215 168 / 45%);
    content: "";
    animation: cursor-blink 1s steps(2) infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    h1::after,
    h2::after,
    h3::after { animation: none; }
}

p {
    margin: 0 0 16px;
    overflow-wrap: anywhere;
}

strong {
    color: #17221b;
}

code {
    color: var(--cool);
    font-family: inherit;
}

ul,
ol {
    padding-left: 26px;
}

li {
    margin: 5px 0;
}

.page-copy ul {
    padding-left: 0;
    list-style: none;
}

.page-copy ul li::before {
    margin-right: 9px;
    color: var(--ember);
    content: "-";
}

.text-cta {
    display: inline-block;
    padding: 3px 5px;
    border: 1px solid var(--fire);
}

.text-cta::before,
.submit-button::before {
    margin-right: 5px;
    color: var(--pokemon-yellow);
    content: "▶";
}

.showcase-section {
    margin-top: 28px;
}

.gallery-intro {
    margin-top: 32px;
}

.showcase-section-first {
    margin-top: 18px;
}

.showcase-section > h2 {
    width: min(100%, var(--prose));
    margin-inline: auto;
}

.images-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 240px));
    justify-content: center;
    gap: 12px;
    margin: 22px auto 8px;
}

.showcase-image-button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: zoom-in;
}

.showcase-image-button:hover,
.showcase-image-button:focus-visible {
    background: transparent;
}

.showcase-image-button:focus-visible {
    outline-offset: 3px;
}

.showcase-image-button img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: contain;
    image-rendering: pixelated;
    border: 0;
    background: #e4ece4;
    filter: saturate(.94) contrast(1.03);
    transition: filter 120ms ease;
}

.showcase-image-button:hover img,
.showcase-image-button:focus-visible img {
    filter: saturate(1.08) contrast(1.05);
}

.image-viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgb(0 0 0 / 82%);
}

.image-viewer-overlay.is-open {
    display: flex;
}

.image-viewer-box {
    max-width: 100%;
    max-height: 100%;
    overflow: auto;
    padding: 8px;
    border: var(--border);
    background: var(--background);
}

.image-viewer-box img {
    display: block;
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 48px);
    image-rendering: pixelated;
}

.status-panel {
    margin: 18px 0;
    padding: 14px;
    border: var(--border);
    background: var(--surface-raised);
}

.status-panel p:last-child {
    margin-bottom: 0;
}

.status-warning {
    border-color: var(--gold);
}

.status-error {
    border-color: var(--ember);
    color: #8d2929;
}

.status-success {
    border-color: #8c9440;
}

.status-success h2 {
    margin-top: 6px;
}

.status-label {
    color: var(--phosphor-bright);
    font-weight: 700;
}

.version-list {
    margin: 18px 0;
}

.version-list div {
    display: grid;
    grid-template-columns: 90px 1fr;
    padding: 4px 0;
    border-bottom: 1px dotted #a3b1a6;
}

.version-list dt {
    color: var(--muted);
}

.version-list dd {
    margin: 0;
}

.download-form {
    position: relative;
    margin: 24px 0 30px;
}

.download-form > label {
    display: block;
    margin-bottom: 6px;
    color: var(--gold);
}

input[type="email"],
input[type="text"] {
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    background: #fbfdfb;
    color: var(--text);
    caret-color: var(--fire);
}

input[type="email"]:focus,
input[type="text"]:focus {
    border-color: var(--phosphor);
    box-shadow: inset 3px 0 0 var(--phosphor);
    outline: none;
}

.submit-button {
    margin-top: 16px;
    padding: 7px 9px;
    border: 1px solid var(--fire);
    background: transparent;
    color: var(--fire);
    cursor: pointer;
}

.submit-button:hover,
.submit-button:focus-visible {
    background: var(--fire);
    color: var(--background);
}

.submit-button:disabled {
    border-color: #555;
    color: #666;
    cursor: not-allowed;
}

.honeypot {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.instructions {
    margin-top: 34px;
}

.site-footer {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin: 34px auto 20px;
    padding-top: 12px;
    border-top: var(--border);
    color: var(--muted);
    font-size: 11px;
}

.site-footer::before {
    position: absolute;
    right: 0;
    top: -10px;
    padding-left: 7px;
    background: var(--background);
    color: var(--pokemon-yellow);
    font-size: 9px;
    content: "SAVING... DO NOT TURN OFF THE POWER";
}

.site-footer p {
    max-width: 520px;
    margin: 0;
    text-align: right;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 2px 12px;
}

@media (max-width: 800px) {
    .images-grid-2col {
        grid-template-columns: repeat(2, minmax(0, 240px));
    }

    .site-footer {
        display: block;
    }

    .site-footer p {
        margin-top: 12px;
        text-align: left;
    }

}

@media (max-width: 520px) {
    body {
        font-size: 12px;
    }

    .site-shell {
        width: min(94%, 400px);
        margin-block: 10px;
        padding-inline: 14px;
    }

    .terminal-bar {
        grid-template-columns: auto 1fr;
        margin-inline: -14px;
    }

    .terminal-bar > :nth-child(2) {
        justify-self: end;
    }

    .terminal-bar > :last-child {
        display: none;
    }

    .site-header {
        display: block;
        margin-top: 20px;
    }

    .tagline {
        margin-top: 10px;
        text-align: left;
    }

    .menu ul {
        justify-content: flex-start;
        gap: 5px 10px;
        padding-left: 40px;
    }

    .pokeball-mark {
        width: 34px;
        height: 34px;
    }

    .intro,
    .page-intro {
        padding-inline: 13px;
    }

    .images-grid-2col {
        grid-template-columns: minmax(0, 240px);
        gap: 12px;
    }

}
