:root {
    --bg: #070908;
    --raise: rgba(16, 22, 18, 0.88);
    --raise-solid: #121815;
    --line: rgba(176, 214, 190, 0.14);
    --line-strong: rgba(176, 214, 190, 0.28);
    --text: #e8f3ec;
    --muted: #93a399;
    --green: #3ddc84;
    --green-deep: #8ef0b8;
    --green-dim: rgba(61, 220, 132, 0.12);
    --danger: #ff9b9b;
    --danger-dim: rgba(255, 120, 120, 0.12);
    --code: #050706;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    --sans: "Segoe UI", "Avenir Next", system-ui, sans-serif;
    --mono: Consolas, "Cascadia Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html {
    color-scheme: dark;
    scroll-behavior: smooth;
    max-width: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 1.05rem;
    line-height: 1.55;
}

::selection {
    background: rgba(61, 220, 132, 0.32);
    color: white;
}

.ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 48% 36% at 88% -8%, rgba(61, 220, 132, 0.2), transparent 62%),
        radial-gradient(ellipse 36% 28% at 0% 8%, rgba(61, 220, 132, 0.08), transparent 60%);
    z-index: 0;
}

.ambient::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(to bottom, #000 0%, transparent 72%);
}

.skip {
    position: absolute;
    left: 1rem;
    top: -4rem;
    background: var(--green);
    color: #062214;
    padding: 0.5rem 0.8rem;
    z-index: 20;
    border-radius: 8px;
    font-weight: 700;
}

.skip:focus { top: 1rem; }

.site-header,
main,
.site-footer {
    position: relative;
    z-index: 1;
}

.wrap {
    width: min(1080px, calc(100% - 2rem));
    max-width: 100%;
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(16px);
    background: rgba(7, 9, 8, 0.72);
    border-bottom: 1px solid var(--line);
}

.bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 4.25rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: -0.03em;
    font-size: 1.05rem;
}

.brand-name span { color: var(--green); }

.mark {
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 5px;
    background:
        linear-gradient(#062214, #062214) padding-box,
        var(--green);
    box-shadow: 0 0 0 4px var(--green-dim), 0 0 18px rgba(61, 220, 132, 0.45);
    position: relative;
}

.mark::after {
    content: "";
    position: absolute;
    left: 0.28rem;
    top: 0.32rem;
    width: 0.48rem;
    height: 0.28rem;
    border-left: 2px solid var(--green);
    border-bottom: 2px solid var(--green);
    transform: rotate(-45deg);
}

.nav { display: flex; gap: 0.5rem; align-items: center; }

.nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.92rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
}

.nav a:hover { color: var(--text); }

.nav-strong {
    color: var(--text) !important;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.03);
}

main { padding: 1.5rem 0 4rem; }

.hero { padding: 2.6rem 0 0.4rem; max-width: 40rem; }

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0.28rem 0.7rem 0.28rem 0.55rem;
    border: 1px solid rgba(61, 220, 132, 0.35);
    background: var(--green-dim);
    color: var(--green-deep);
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pulse {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.7);
    animation: pulse 1.8s ease-out infinite;
}

@keyframes pulse {
    70% { box-shadow: 0 0 0 8px rgba(61, 220, 132, 0); }
    100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}

h1, h2, h3 { letter-spacing: -0.04em; }

h1 {
    margin: 0 0 1rem;
    font-size: clamp(2.4rem, 6vw, 4.4rem);
    line-height: 1.02;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.lede, .muted { color: var(--muted); }

.lede {
    margin: 0;
    max-width: 38rem;
    font-size: 1.15rem;
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 2.4rem;
}

.steps article {
    position: relative;
    overflow: hidden;
    padding: 1.15rem 1.15rem 1.2rem;
    background: var(--raise);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.step-no {
    display: block;
    margin-bottom: 1.4rem;
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--green);
}

.steps h2, .section-head h2, .release h3 {
    font-weight: 700;
}

.steps h2 {
    margin: 0 0 0.4rem;
    font-size: 1.25rem;
}

.steps p, .desc, .copy-note, .section-head p {
    color: var(--muted);
}

.steps p { margin: 0; }

.releases { margin-top: 2.8rem; }

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.section-head h2, .admin-list h2 {
    margin: 0;
    font-size: 1.7rem;
}

.section-head p { margin: 0; font-family: var(--mono); font-size: 0.82rem; }

.stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.release, .panel, .card {
    background: var(--raise);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.release, .card {
    min-width: 0;
    max-width: 100%;
    padding: 1.15rem;
}

.release-top, .card-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.release h3, .card h3 {
    margin: 0;
    font-size: 1.35rem;
}

.version {
    flex: none;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: #062214;
    background: var(--green);
    border-radius: 999px;
    padding: 0.28rem 0.6rem;
    font-weight: 700;
}

.meta {
    margin: 0.3rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.desc {
    margin: 0.85rem 0 0;
    white-space: pre-wrap;
}

.code-panel {
    margin-top: 1rem;
    min-width: 0;
    max-width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    overflow: hidden;
    background: var(--code);
}

.code-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    min-width: 0;
    padding: 0.55rem 0.6rem 0.55rem 0.85rem;
    background: #0e1411;
    border-bottom: 1px solid var(--line);
}

.dots { display: inline-flex; gap: 0.35rem; }

.dots i {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    display: block;
    background: #2c3832;
}

.dots i:first-child { background: #ff6b6b; }
.dots i:nth-child(2) { background: #e7c36a; }
.dots i:nth-child(3) { background: var(--green); }

.filename {
    flex: 1 1 8rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--muted);
}

.code-actions {
    margin-left: auto;
    display: flex;
    gap: 0.4rem;
    flex: none;
}

.code-panel pre {
    margin: 0;
    max-width: 100%;
    max-height: 22rem;
    overflow: auto;
    padding: 1rem 1.1rem 1.15rem;
    tab-size: 4;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.code-panel code {
    font-family: var(--mono);
    font-size: 0.82rem;
    line-height: 1.6;
    color: #d7f6e4;
    white-space: inherit;
}

.code-panel pre::-webkit-scrollbar { width: 10px; height: 10px; }
.code-panel pre::-webkit-scrollbar-thumb {
    background: #243028;
    border-radius: 99px;
    border: 2px solid var(--code);
}

.copy-note {
    margin: 0;
    padding: 0.55rem 0.9rem 0.7rem;
    border-top: 1px solid var(--line);
    font-size: 0.82rem;
}

.button, button { font: inherit; }

.button, .button-secondary, .button-danger, .copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 10px;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.92rem;
}

.copy-btn, .button {
    background: var(--green);
    color: #062214;
}

.copy-btn:hover, .button:hover { background: #62e89e; }

.copy-btn.is-copied { background: #dffbea; }

.button-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--line-strong);
}

.button-secondary:hover { border-color: var(--green); color: var(--green-deep); }

.button-danger {
    background: var(--danger-dim);
    color: var(--danger);
    border-color: rgba(255, 155, 155, 0.25);
}

.empty {
    padding: 1.3rem;
    border: 1px dashed var(--line-strong);
    border-radius: 16px;
    color: var(--muted);
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 1.3rem 0 1.6rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.footer-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.footer-row p { margin: 0; }
.footer-row p:first-child { color: var(--text); font-weight: 700; }

.flash {
    margin: 0 0 1rem;
    padding: 0.8rem 0.95rem;
    border-radius: 12px;
    border: 1px solid transparent;
}

.flash-ok {
    background: var(--green-dim);
    color: var(--green-deep);
    border-color: rgba(61, 220, 132, 0.28);
}

.flash-err {
    background: var(--danger-dim);
    color: var(--danger);
    border-color: rgba(255, 155, 155, 0.28);
}

.panel {
    margin-top: 0.4rem;
    padding: 1.2rem;
}

.page-admin .hero { padding-top: 1.4rem; max-width: 40rem; }
.page-admin h1 { font-size: clamp(2.3rem, 5vw, 3.4rem); }
.page-admin .panel { max-width: 560px; }

.who { margin-top: 0.2rem; }

.admin-list { margin-top: 2rem; }
.admin-list h2 { margin-bottom: 0.8rem; }

form { display: grid; gap: 0.9rem; }

label {
    display: grid;
    gap: 0.4rem;
    font-size: 0.92rem;
    font-weight: 700;
}

input, textarea {
    width: 100%;
    font: inherit;
    color: var(--text);
    background: #0b0f0d;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
}

textarea { resize: vertical; min-height: 7rem; }

input::placeholder, textarea::placeholder { color: #6d7b72; }

input:focus, textarea:focus, .copy-btn:focus-visible, .button:focus-visible, .button-secondary:focus-visible, .button-danger:focus-visible, a:focus-visible {
    outline: 2px solid rgba(61, 220, 132, 0.55);
    outline-offset: 2px;
    border-color: var(--green);
}

.form-actions, .card-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.card-actions { margin-top: 1rem; }

.file-input { font-size: 0.95rem; font-weight: 500; }

@media (max-width: 800px) {
    .steps { grid-template-columns: 1fr; }
    .hero { padding-top: 1.6rem; }
    h1 { font-size: clamp(2.5rem, 12vw, 3.6rem); }
    .footer-row, .section-head { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
    .code-bar, .release-top, .card-top, .code-actions, .form-actions, .card-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .code-actions { margin-left: 0; }
    .copy-btn, .button, .button-secondary, .button-danger { width: 100%; }
    .filename { order: -1; }
}
