/* Theme tokens: change these to restyle the whole application. */
:root {
    --bg: #f8f9f5;
    --panel: #fff;
    --ink: #20271f;
    --muted: #71776b;
    --line: #dfe3d9;
    --accent: #c2ee72;
    --soft: #eef1e9;
    --dark: #222b22;
    --shadow: 0 18px 65px #1b291318;
    color-scheme: light
}

:root[data-theme=dark] {
    --bg: #0f172a;
    --panel: #172236;
    --ink: #f8fafc;
    --muted: #a2aec2;
    --line: #334155;
    --accent: #a7e464;
    --soft: #1e293b;
    --dark: #09101e;
    --shadow: 0 18px 65px #0005;
    color-scheme: dark
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.6 Arial, Helvetica, sans-serif
}

button,
input,
select,
textarea {
    font: inherit
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent
}

button,
a {
    touch-action: manipulation
}

button {
    cursor: pointer
}

button:disabled {
    cursor: not-allowed;
    opacity: .45
}

a {
    color: inherit;
    text-decoration: none
}

button {
    color: inherit
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid #85ae3f;
    outline-offset: 3px
}

[hidden] {
    display: none !important
}

.skip {
    position: absolute;
    top: -100px
}

.skip:focus {
    top: 5px;
    background: var(--accent);
    padding: 10px;
    z-index: 100
}

.topbar {
    max-width: 1500px;
    margin: auto;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding: 0 4%;
    gap: 28px
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 24px;
    letter-spacing: -1px
}

.brand-dot {
    color: #779d34
}

.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1px;
    background: var(--accent);
    color: #20271f;
    width: 37px;
    height: 37px;
    border-radius: 10px;
    font-size: 24px;
    letter-spacing: -3px
}

.brand-mark span {
    font-size: 17px;
    align-self: flex-start;
    letter-spacing: 0
}

nav {
    display: flex;
    gap: 24px
}

.nav-link {
    border: 0;
    background: none;
    font-size: 13px;
    color: var(--muted);
    padding: 12px 0
}

.nav-link.active {
    color: var(--ink);
    box-shadow: 0 2px var(--ink)
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding: 12px 19px;
    border: 1px solid var(--line);
    border-radius: 7px;
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    background: var(--panel)
}

.button.dark {
    background: var(--dark);
    color: #fff;
    border-color: var(--dark)
}

.button:hover {
    filter: brightness(.94)
}

.button.accent {
    background: var(--accent);
    color: #20271f
}

.subtle {
    background: transparent
}

.icon-button {
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 20px;
    display: grid;
    place-items: center
}

.text-button {
    background: none;
    border: 0;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 600
}

.text-button:hover {
    text-decoration: underline
}

main {
    max-width: 1380px;
    margin: auto;
    padding: 0 3%
}

.hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 70px;
    padding: 68px 0 62px;
    border-bottom: 1px solid var(--line)
}

.eyebrow,
.mono {
    font: 10px/1.5 'Courier New', monospace;
    letter-spacing: 1.5px;
    font-weight: 600
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted)
}

.eyebrow>span:last-child:not(.live-dot) {
    margin-left: auto
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #729b39
}

.hero h1 {
    font-size: clamp(36px, 4.6vw, 64px);
    line-height: 1.1;
    letter-spacing: -3.5px;
    font-weight: 500;
    margin: 24px 0
}

.hero h1 em {
    font-style: normal;
    position: relative;
    z-index: 0
}

.hero h1 em:before {
    content: '';
    position: absolute;
    bottom: 4px;
    height: 16px;
    background: var(--accent);
    left: -3px;
    right: -7px;
    z-index: -1;
    opacity: .8
}

.hero p {
    color: var(--muted);
    line-height: 1.8;
    font-size: 14px
}

.hero-actions {
    display: flex;
    gap: 28px;
    margin-top: 28px;
    align-items: center
}

.hero-stats {
    display: flex;
    gap: 28px;
    margin-top: 34px;
    color: var(--muted);
    font-size: 11px
}

.hero-stats strong {
    color: var(--ink);
    font-size: 21px;
    display: block;
    line-height: 1.2
}

.hero-stats>span {
    border-right: 1px solid var(--line);
    padding-right: 28px
}

.hero-stats>span:last-child {
    border: 0
}

.hero-art {
    background: #e5eddb;
    border: 1px solid #d9e0d1;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    min-height: 325px;
    background-image: linear-gradient(#b4c6a32b 1px, transparent 1px), linear-gradient(90deg, #b4c6a32b 1px, transparent 1px);
    background-size: 25px 25px;
    color: #34442b
}

.art-top,
.art-bottom {
    position: absolute;
    left: 23px;
    right: 23px;
    display: flex;
    justify-content: space-between;
    font: 9px 'Courier New', monospace;
    letter-spacing: 1.4px;
    z-index: 2
}

.art-top {
    top: 23px
}

.art-bottom {
    bottom: 23px
}

.art-top>span:last-child {
    font: 28px Arial
}

.orbit {
    position: absolute;
    border: 1px solid #b6c5a5;
    border-radius: 50%;
    width: 280px;
    height: 280px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%)
}

.orbit-two {
    width: 360px;
    height: 360px
}

.code-tile {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(-9deg);
    width: 180px;
    height: 194px;
    background: #c4ef79;
    border: 1px solid #9fbf66;
    border-radius: 12px;
    box-shadow: 12px 15px 0 #bdd39977;
    padding: 20px
}

.code-icon {
    font: 42px 'Courier New', monospace
}

.code-tile>span:last-child {
    display: block;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
    margin-top: 14px
}

.floating-chip {
    position: absolute;
    padding: 9px 15px;
    background: #fff;
    color: #2c3922;
    box-shadow: 0 7px 20px #253a1114;
    border: 1px solid #d7e1cc;
    border-radius: 6px;
    font: 11px 'Courier New', monospace;
    transform: rotate(-5deg)
}

.chip-one {
    top: 27%;
    left: 5%
}

.chip-two {
    bottom: 26%;
    right: 4%;
    transform: rotate(6deg)
}

.directory {
    padding: 45px 0
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-end;
    margin-bottom: 27px
}

h2 {
    font-size: 27px;
    line-height: 1.25;
    letter-spacing: -1px;
    font-weight: 500;
    margin: 10px 0
}

h2>span,
.workspace h1>span {
    color: #84ad43
}

.directory-layout {
    display: grid;
    grid-template-columns: 192px 1fr;
    gap: 35px
}

.sidebar>.eyebrow {
    margin: 10px 0 15px
}

#categories {
    display: grid;
    gap: 3px
}

.category {
    border: 0;
    background: transparent;
    text-align: left;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--muted)
}

.category.active {
    background: var(--accent);
    color: #25331a;
    font-weight: 600
}

.category:hover {
    background: var(--soft)
}

.sidebar-note {
    margin-top: 30px;
    border-top: 1px solid var(--line);
    padding: 22px 8px
}

.sidebar-note>span {
    font-size: 28px
}

.sidebar-note h3 {
    font-size: 14px
}

.sidebar-note p {
    font-size: 12px;
    color: var(--muted)
}

.toolbar {
    display: flex;
    gap: 12px
}

.search {
    border: 1px solid var(--line);
    background: var(--panel);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    flex: 1;
    border-radius: 7px
}

.search>span {
    font-size: 24px
}

.search input {
    background: none;
    border: 0;
    width: 100%;
    padding: 11px 0;
    font-size: 12px;
    color: var(--ink);
    outline-offset: 0
}

select {
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 10px;
    border-radius: 7px;
    color: var(--ink);
    font-size: 12px
}

.filter-row {
    display: flex;
    justify-content: space-between;
    margin: 18px 0 22px;
    gap: 12px
}

.tabs {
    display: flex;
    gap: 5px;
    flex-wrap: wrap
}

.tabs button {
    background: none;
    border: 0;
    border-radius: 5px;
    padding: 7px 12px;
    font-size: 11px;
    color: var(--muted)
}

.tabs button.active {
    background: var(--soft);
    color: var(--ink);
    font-weight: bold
}

.filter-row>.text-button {
    font-size: 10px;
    color: var(--muted)
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px
}

.card {
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .15s, box-shadow .15s
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px #172b1410
}

.card-visual {
    height: 112px;
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-bottom: 1px solid var(--line)
}

.card-visual:before,
.card-visual:after {
    content: '';
    position: absolute;
    width: 145px;
    height: 145px;
    border: 1px solid #ffffff90;
    border-radius: 30%;
    transform: rotate(35deg);
    left: -35px;
    top: -70px
}

.card-visual:after {
    left: auto;
    right: -25px;
    top: 35px
}

.visual-project {
    background: #e4eadf;
    color: #49623c
}

.visual-apk {
    background: #e2e8f0;
    color: #51667e
}

.visual-resource {
    background: #eee6db;
    color: #907044
}

.visual-icon {
    font: 36px 'Courier New', monospace;
    letter-spacing: -3px
}

.visual-type {
    position: absolute;
    left: 12px;
    top: 10px;
    font: 8px 'Courier New', monospace;
    letter-spacing: 1.2px
}

.featured {
    position: absolute;
    right: 10px;
    top: 8px;
    font-size: 9px;
    background: #ffffffc9;
    color: #445b31;
    padding: 2px 6px;
    border-radius: 4px
}

.card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column
}

.card-owner {
    font: 9px 'Courier New', monospace;
    color: var(--muted);
    overflow-wrap: anywhere
}

.card-title {
    display: block;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 5px 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -.4px;
    overflow-wrap: anywhere
}

.card-title:hover {
    text-decoration: underline
}

.card-body p {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.7;
    margin: 5px 0 14px;
    flex: 1;
    overflow-wrap: anywhere
}

.tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap
}

.tag {
    font-size: 9px;
    background: var(--soft);
    border: 1px solid var(--line);
    padding: 2px 6px;
    border-radius: 4px
}

.card-foot {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10px;
    color: var(--muted)
}

.card-foot button {
    background: none;
    border: 0;
    font-size: 12px
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 28px 0 0
}

.pagination .button {
    font-size: 11px;
    padding: 8px 12px
}

.contribute {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--accent);
    color: #25331a;
    border-radius: 12px;
    padding: 35px 40px;
    margin: 15px 0 45px
}

.contribute .eyebrow {
    color: #506638
}

.contribute h2 {
    font-size: 30px
}

.contribute .button {
    flex-shrink: 0
}

footer {
    max-width: 1380px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid var(--line);
    padding: 28px 3%
}

footer .brand {
    font-size: 20px
}

footer p {
    font-size: 11px;
    color: var(--muted)
}

footer .mono {
    font-size: 8px;
    color: var(--muted)
}

.connection-note {
    padding: 10px 16px;
    margin-top: 15px;
    border: 1px solid var(--line);
    background: var(--soft);
    font-size: 12px;
    border-radius: 6px
}

.empty {
    grid-column: 1/-1;
    text-align: center;
    padding: 60px 20px;
    border: 1px dashed var(--line);
    border-radius: 10px;
    color: var(--muted)
}

.workspace {
    padding: 65px 0;
    min-height: 65vh
}

.workspace h1 {
    font-size: 43px;
    letter-spacing: -2px;
    line-height: 1.1
}

.workspace>p {
    color: var(--muted)
}

.workspace-list {
    display: grid;
    gap: 15px;
    margin: 25px 0
}

.workspace-row {
    padding: 20px;
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 10px
}

.workspace-row h3 {
    margin: 5px 0
}

.workspace-row p {
    color: var(--muted);
    font-size: 13px;
    white-space: pre-wrap;
    overflow-wrap: anywhere
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px
}

.status {
    font: 10px 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--soft);
    padding: 5px 8px;
    border-radius: 4px
}

.status.approved {
    background: #e5f1d5;
    color: #405f28
}

.status.rejected {
    background: #f6e4dc;
    color: #8a422e
}

dialog {
    background: var(--panel);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 15px;
    width: min(760px, 94vw);
    max-height: 90vh;
    box-shadow: var(--shadow);
    padding: 38px
}

dialog::backdrop {
    background: #14210f66;
    backdrop-filter: blur(4px)
}

.close {
    position: absolute;
    right: 14px;
    top: 14px
}

dialog h2 {
    font-size: 30px;
    padding-right: 20px;
    margin-top: 12px
}

dialog p {
    color: var(--muted);
    font-size: 13px
}

form {
    display: grid;
    gap: 16px;
    margin-top: 20px
}

label.field {
    display: grid;
    gap: 6px;
    font-size: 12px;
    font-weight: 600
}

label.field input,
label.field textarea,
label.field select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg);
    color: var(--ink);
    font-size: 13px
}

textarea {
    resize: vertical;
    min-height: 90px
}

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

.check {
    font-size: 12px;
    display: flex;
    align-items: flex-start;
    gap: 9px
}

.check input {
    margin-top: 5px
}

.form-message {
    color: #b04b30;
    font-size: 12px;
    white-space: pre-wrap
}

.detail-description {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.8;
    font-size: 14px;
    margin: 24px 0
}

.detail-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    font-size: 12px;
    padding: 18px;
    background: var(--soft);
    border-radius: 8px;
    overflow-wrap: anywhere
}

.detail-meta b {
    display: block;
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 3px
}

.notice {
    padding: 12px;
    background: var(--soft);
    border-radius: 6px;
    font-size: 12px;
    margin: 15px 0
}

.comment {
    border-top: 1px solid var(--line);
    padding: 14px 0;
    overflow-wrap: anywhere
}

.comment small {
    color: var(--muted);
    font-size: 10px
}

.comment p {
    white-space: pre-wrap
}

#toast {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90vw;
    padding: 13px 24px;
    background: var(--ink);
    color: var(--bg);
    box-shadow: var(--shadow);
    border-radius: 8px;
    z-index: 20;
    font-size: 13px
}

.prose li {
    margin: 10px 0;
    font-size: 13px
}

.danger {
    color: #b44932
}

@media(min-width:1500px) {
    .topbar {
        padding: 0 60px
    }

    main {
        padding: 0 25px
    }
}

@media(max-width:1100px) {
    nav {
        gap: 12px
    }

    .topbar {
        gap: 15px
    }

    .hero {
        gap: 30px
    }

    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .directory-layout {
        grid-template-columns: 170px 1fr;
        gap: 22px
    }

    .brand {
        font-size: 21px
    }

    footer {
        flex-wrap: wrap
    }
}

@media(max-width:760px) {
    .topbar {
        height: auto;
        min-height: 80px;
        padding: 18px 5%;
        flex-wrap: wrap
    }

    .topbar nav {
        order: 3;
        width: 100%;
        justify-content: space-between
    }

    .header-actions {
        gap: 7px
    }

    .header-actions .button {
        padding: 8px 11px;
        font-size: 11px
    }

    .brand {
        font-size: 20px
    }

    .brand-mark {
        width: 30px;
        height: 30px
    }

    main {
        padding: 0 5%
    }

    .hero {
        grid-template-columns: 1fr;
        padding: 38px 0;
        gap: 30px
    }

    .hero h1 {
        font-size: 47px;
        letter-spacing: -2.8px
    }

    .hero p {
        font-size: 13px
    }

    .hero-art {
        min-height: 280px
    }

    .hero-stats {
        gap: 16px
    }

    .hero-stats>span {
        padding-right: 16px
    }

    .directory {
        padding-top: 30px
    }

    .section-heading {
        display: block
    }

    .section-heading .mono {
        display: block;
        margin-top: 12px
    }

    h2 {
        font-size: 25px
    }

    .directory-layout {
        display: block
    }

    .sidebar>.eyebrow,
    .sidebar-note {
        display: none
    }

    #categories {
        display: flex;
        overflow-x: auto;
        gap: 5px;
        padding-bottom: 15px;
        margin-bottom: 10px
    }

    .category {
        white-space: nowrap;
        border: 1px solid var(--line)
    }

    .grid {
        gap: 12px
    }

    .card-body {
        padding: 12px
    }

    .toolbar {
        gap: 7px
    }

    .toolbar select {
        max-width: 115px
    }

    .filter-row {
        flex-wrap: wrap
    }

    .contribute {
        display: block;
        padding: 25px
    }

    .contribute h2 {
        font-size: 26px;
        margin-bottom: 20px
    }

    footer {
        padding: 25px 5%;
        gap: 14px
    }

    footer p {
        margin: 0
    }

    footer .mono {
        width: 100%
    }

    .desktop-only {
        display: none
    }

    dialog {
        padding: 28px 20px
    }

    .form-row {
        grid-template-columns: 1fr
    }

    .workspace {
        padding: 35px 0
    }

    .workspace h1 {
        font-size: 36px
    }
}

@media(max-width:420px) {
    .grid {
        grid-template-columns: 1fr
    }

    .card-visual {
        height: 130px
    }

    .hero h1 {
        font-size: 40px
    }

    .hero-actions {
        gap: 20px
    }

    .hero-stats {
        font-size: 10px
    }

    .header-actions .icon-button {
        width: 28px;
        height: 28px
    }

    .brand-mark {
        display: none
    }

    .search input {
        font-size: 11px
    }

    .tabs button {
        padding: 7px 9px
    }
}

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