:root {
  color-scheme: dark;
  --bg: #202b18;
  --surface: #303d23;
  --surface-hover: #3b4b2a;
  --text: #f5eedb;
  --muted: #ccc4a6;
  --accent: #d5d97d;
  --accent-hover: #e8eaa1;
  --accent-ink: #252e16;
  --line: #596b3d;
  --warm: #efbc65;
  --control-bg: #26321c;
  --control-border: #9ca66b;
  --featured-border: #83934e;
  --hover-border: #b4be72;
  --error: #f7b3a0;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  scroll-padding-top: 24px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; text-underline-offset: 4px; }
button, input { font: inherit; color: var(--text); border-radius: 0; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .65; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
img { display: block; max-width: 100%; height: auto; }
picture { display: block; }
h1, h2, h3, p { margin: 0; }
.page { position: relative; z-index: 1; width: min(100% - 48px, 1040px); margin-inline: auto; }
.side-art { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: 8px; left: 16px; z-index: 10; padding: 12px 16px; background: var(--accent); color: var(--bg); transform: translateY(-160%); border-radius: 0; }
.skip-link:focus { transform: translateY(0); }
.site-header { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-block: 24px 20px; }
.wordmark { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-weight: 700; font-size: 18px; text-decoration: none; }
.wordmark img { flex: none; width: 28px; height: 28px; image-rendering: pixelated; }
.account { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 16px; min-width: 0; max-width: 100%; font-size: 13px; }
.account-name { overflow-wrap: anywhere; max-width: 24ch; }
.account-button { display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 0; background: transparent; text-decoration: none; font-weight: 600; }
.account-button span { color: var(--muted); }
.account-button:hover { border-color: var(--muted); }
.currency { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.currency picture { flex-shrink: 0; }
.currency img { width: 20px; height: 20px; }
.currency-label { color: var(--muted); }
.text-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 4px 6px; border: 0; background: none; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.text-button:hover:not(:disabled) { color: var(--text); }
.text-button:disabled { color: var(--muted); text-decoration: none; }
.account-message { flex-basis: 100%; text-align: right; color: var(--muted); font-size: 13px; }
.category-nav { display: flex; flex-wrap: wrap; column-gap: 28px; border-block: 1px solid var(--line); }
.category-nav a { display: inline-flex; align-items: center; min-height: 48px; color: var(--muted); font-size: 14px; text-decoration: none; }
.category-nav a:hover { color: var(--accent); }
.intro { display: grid; grid-template-columns: 112px minmax(0, 1fr) 100px; align-items: center; gap: 28px; padding-block: 32px; }
.mascot { width: 112px; }
.intro h1 { font-size: clamp(26px, 3vw, 36px); line-height: 1.2; letter-spacing: -.035em; font-weight: 650; }
.bee { width: 100px; border-radius: 0; overflow: hidden; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 16px; }
.section-heading h2 { font-size: 23px; line-height: 1.25; letter-spacing: -.025em; font-weight: 650; }
.section-aside { color: var(--muted); font-size: 13px; }
.featured-grid, .project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.featured-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.featured-link { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 18px; border: 1px solid var(--featured-border); border-top: 2px solid var(--accent); background: var(--surface); border-radius: 0; text-decoration: none; }
.project-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--text); font-size: 16px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.project-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.project-emoji { flex-shrink: 0; font-size: 1.1em; font-weight: 400; }
.project-name-text { min-width: 0; }
.featured-link .project-title { font-size: 18px; }
.featured-link .project-title > [aria-hidden="true"] { color: var(--accent); font-size: 18px; }
.project-description { display: block; color: var(--muted); font-size: 14px; line-height: 1.55; }
.featured-link:hover, .project-link:hover { background: var(--surface-hover); border-color: var(--hover-border); }
.featured-link:hover .project-title, .project-link:hover .project-title { color: var(--accent); }
.search-panel { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-top: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.search-field { width: min(100%, 420px); }
.search-field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.search-input-wrap { display: flex; align-items: center; gap: 10px; border: 1px solid var(--control-border); border-radius: 0; padding-inline: 12px 6px; background: var(--control-bg); }
.search-input-wrap svg { color: var(--muted); flex-shrink: 0; }
.search-input-wrap:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-input-wrap input { width: 100%; min-width: 0; min-height: 46px; border: 0; background: transparent; outline: 0; padding: 8px 0; }
.search-input-wrap input:focus-visible { outline: 0; }
.search-input-wrap input::placeholder { color: var(--muted); }
.search-input-wrap input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-input-wrap .text-button { flex-shrink: 0; font-size: 13px; }
.search-count { color: var(--muted); font-size: 13px; padding-bottom: 12px; }
.catalogue-section { padding-block: 32px; border-bottom: 1px solid var(--line); scroll-margin-top: 12px; }
.project-group + .project-group { margin-top: 24px; }
.project-group h3 { margin-bottom: 10px; font-size: 14px; font-weight: 500; color: var(--accent); }
.project-link { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 6px; min-height: 76px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 0; background: var(--surface); text-decoration: none; }
.in-progress .project-link { background: transparent; }
.in-progress .project-link:hover { background: var(--surface); }
.empty-search { padding-block: 56px; border-bottom: 1px solid var(--line); }
.empty-search h2 { font-size: 20px; }
.empty-search p { margin-top: 8px; color: var(--muted); }
.site-footer { display: flex; align-items: center; gap: 24px; padding-block: 32px; color: var(--muted); font-size: 13px; }
.mushroom-home { flex: 0 0 80px; border-radius: 0; overflow: hidden; }
.footer-title { margin-bottom: 4px; color: var(--text); font-size: 16px; font-weight: 600; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-links a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--accent); }
.back-to-top { display: inline-flex; align-items: center; min-height: 44px; margin-left: auto; flex-shrink: 0; }
.about-main { min-height: 55vh; }
.about-intro { grid-template-columns: 112px minmax(0, 1fr); }
.credits { padding-bottom: 32px; }
.credit-link { justify-content: center; gap: 10px; min-height: 120px; }
.credit-author { color: var(--text); font-weight: 600; }
.about-footer { border-top: 1px solid var(--line); }
.auth-dialog { width: min(420px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid var(--control-border); border-radius: 0; background: var(--surface); color: var(--text); overflow-y: auto; }
.auth-dialog::backdrop { background: rgb(0 0 0 / 75%); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.dialog-heading h2 { font-size: 22px; }
.close-button { display: grid; place-items: center; width: 44px; height: 44px; margin: -10px -10px -10px 0; flex-shrink: 0; border: 0; background: none; color: var(--muted); font-size: 28px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.auth-tabs button { flex: 1; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 0; background: transparent; font-size: 14px; }
.auth-tabs button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.auth-form label { display: block; margin: 16px 0 6px; font-size: 14px; }
.auth-form input { display: block; width: 100%; min-height: 46px; padding: 8px 12px; border: 1px solid var(--control-border); border-radius: 0; background: var(--control-bg); }
.auth-submit { width: 100%; min-height: 46px; margin-top: 24px; border: 0; border-radius: 0; background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.auth-submit:hover:not(:disabled) { background: var(--accent-hover); }
.form-message { margin-top: 12px; min-height: 21px; color: var(--error); font-size: 14px; }
.form-message.ok { color: var(--accent); }
.field-help { margin-top: 6px; color: var(--muted); font-size: 12px; }
.preview-notice { margin-bottom: 16px; padding: 10px 12px; border-left: 2px solid var(--warm); color: var(--muted); font-size: 13px; }
@media (min-width: 1280px) {
  /* The rails fit entirely in the margins, clear of links and keyboard focus. */
  .side-art { display: block; position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
  .side-art__rail {
    position: absolute;
    top: clamp(144px, 18vh, 200px);
    bottom: 24px;
    width: clamp(72px, calc((100vw - 1040px) / 2 - 48px), 180px);
    display: flex;
    flex-direction: column;
    gap: clamp(72px, 12vh, 136px);
    overflow: hidden;
    mask-image: linear-gradient(to bottom, #000 calc(100% - 48px), transparent);
  }
  .side-art__rail--left { left: max(24px, calc((100vw - 1040px) / 2 - 204px)); }
  .side-art__rail--right { right: max(24px, calc((100vw - 1040px) / 2 - 204px)); }
  .side-art__rail picture { flex: 0 0 auto; border: 1px solid var(--featured-border); box-shadow: 0 12px 28px rgb(0 0 0 / 22%); }
  .side-art__rail img { width: 100%; height: auto; }
  .intro { grid-template-columns: 112px minmax(0, 1fr); }
  .bee, .mushroom-home { display: none; }
}
@media (min-width: 640px) and (max-width: 959px) {
  .featured-grid, .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured-link:last-child { grid-column: 1 / -1; }
}
@media (max-width: 639px) {
  .page { position: relative; z-index: 1; width: calc(100% - 32px); }
  .site-header { padding-block: 16px 12px; gap: 8px 12px; }
  .wordmark { font-size: 17px; }
  .account { gap: 4px 12px; }
  .site-header:has(.currency:not([hidden])) .account { width: 100%; justify-content: flex-start; }
  .account-name { max-width: 100%; }
  .account-message { text-align: left; }
  .category-nav { column-gap: 20px; }
  .category-nav a { font-size: 13px; min-height: 44px; }
  .intro { grid-template-columns: 64px minmax(0, 1fr) 44px; gap: 12px; padding-block: 24px; }
  .mascot { width: 64px; }
  .about-intro { grid-template-columns: 64px minmax(0, 1fr); }
  .bee { width: 44px; }
  .intro h1 { font-size: 26px; }
  .section-heading { margin-bottom: 12px; }
  .section-heading h2 { font-size: 21px; }
  .section-aside { font-size: 12px; }
  .featured-grid, .project-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .featured-link { padding: 12px 14px; gap: 3px; }
  .featured-link .project-title { font-size: 16px; }
  .project-link { min-height: 64px; padding: 14px; gap: 4px; }
  .search-panel { margin-top: 24px; padding-bottom: 20px; gap: 10px; }
  .search-field { width: 100%; }
  .search-count { padding: 0; }
  .catalogue-section { padding-block: 24px; }
  .project-group + .project-group { margin-top: 20px; }
  .site-footer { flex-wrap: wrap; gap: 16px; padding-block: 24px; }
  .mushroom-home { flex-basis: 64px; }
  .site-footer > div { flex: 1; min-width: 0; }
  .back-to-top { margin-left: 80px; }
  .auth-dialog { padding: 20px; }
}
@media (prefers-reduced-motion: no-preference) {
  .project-link, .featured-link, .account-button { transition: border-color .15s, background-color .15s; }
}
