:root {
    --bg: #000;
    --fg: #fff;
    --muted: rgba(255, 255, 255, 0.48);
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.3);
    --panel: #0a0a0a;
    --max: 1080px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--fg);
    font-family: "Josefin Sans", "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

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

::selection {
    background: #fff;
    color: #000;
}

/* ---------- top bar ---------- */

.topbar {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 26px max(24px, calc((100vw - var(--max)) / 2 + 24px));
}

.brand {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: lowercase;
}

.brand span {
    font-weight: 300;
    color: var(--muted);
}

/* ---------- layout ---------- */

.wrap {
    flex: 1;
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 16px 24px 80px;
}

/* ---------- script ---------- */

.script {
    animation: fade-up 0.8s 0.05s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.script h2 {
    margin-bottom: 12px;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--muted);
}

.code-row {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    overflow: hidden;
    transition: border-color 0.25s;
}

.code-row:hover {
    border-color: var(--line-strong);
}

.code {
    flex: 1;
    min-width: 0;
    padding: 20px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #eaeaea;
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.code::-webkit-scrollbar {
    height: 6px;
}

.code::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 3px;
}

.copy {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    border: 0;
    border-left: 1px solid var(--line);
    background: transparent;
    color: var(--fg);
    font-family: inherit;
    font-size: 0.74rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.copy:hover {
    background: rgba(255, 255, 255, 0.07);
}

.copy.done {
    background: #fff;
    color: #000;
}

/* ---------- links ---------- */

.links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 22px;
    animation: fade-up 0.8s 0.14s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    transition: background 0.25s, border-color 0.25s, transform 0.25s;
}

.link-card:hover {
    background: #101010;
    border-color: var(--line-strong);
    transform: translateY(-2px);
}

.link-card svg {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    opacity: 0.85;
}

.link-text {
    min-width: 0;
}

.link-text strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 400;
}

.link-text small {
    display: block;
    margin-top: 3px;
    font-size: 0.72rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- footer ---------- */

.foot {
    padding: 26px 24px 34px;
    text-align: center;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.3);
}

/* ---------- animation ---------- */

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0.001ms !important;
    }
}

/* ---------- responsive ---------- */

@media (max-width: 760px) {
    .topbar {
        padding: 20px;
    }

    .wrap {
        padding: 8px 20px 64px;
    }

    .links {
        grid-template-columns: 1fr;
    }

    .code-row {
        flex-direction: column;
    }

    .code {
        padding: 16px;
        font-size: 0.76rem;
    }

    .copy {
        border-left: 0;
        border-top: 1px solid var(--line);
        padding: 14px;
    }
}
