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

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

:root {
    --bg: #0f0f11;
    --surface: #1a1a1f;
    --border: #2a2a32;
    --text: #e8e8f0;
    --muted: #9a9aab;
    /* The app icon's indigo */
    --accent: #6366f1;
    --accent-hover: #a5b4fc;
}

body {
    font-family:
        system-ui,
        -apple-system,
        sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

h1,
h2,
h3 {
    letter-spacing: -0.02em;
}

/* Nav */

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 960px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
}

.nav .brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    text-decoration: none;
}

.nav nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav nav > a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.nav nav > a:hover {
    color: var(--text);
}

.github-link {
    display: flex;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.github-link:hover {
    opacity: 1;
}

.github-link img {
    filter: invert(1);
}

/* Sections */

section,
footer {
    max-width: 960px;
    margin: 0 auto;
    padding: 4.5rem 1.5rem;
}

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    text-align: center;
    /* Roomy, with no screenshot under it now; Install still shows on a laptop's first screen */
    padding-top: 7rem;
    padding-bottom: 6rem;
}

h1 {
    font-size: 2.75rem;
    font-weight: 700;
}

/* As on skrapa.iambrian.com: thin, large, and filled with a text -> accent -> text fade */
.hero h1 {
    max-width: 20ch;
    font-size: clamp(2.4rem, 6vw, 3.75rem);
    font-weight: 200;
    line-height: 1.1;
    letter-spacing: -0.03em;
    text-wrap: balance;
    background: linear-gradient(120deg, var(--text) 20%, var(--accent-hover) 50%, var(--text) 80%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    max-width: 34rem;
    font-size: 1.15rem;
    color: var(--muted);
}

/* The before and after: the port you type today, the address the app gives it */
.hero-swap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: clamp(1rem, 2.8vw, 1.4rem);
}

.hero-swap code {
    font-size: 1em;
    padding: 0.35em 0.75em;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.hero-swap .from {
    color: var(--muted);
    text-decoration: line-through;
    text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent);
}

.hero-swap .to {
    color: var(--accent-hover);
    border-color: color-mix(in srgb, var(--accent) 60%, transparent);
    box-shadow: 0 0 28px color-mix(in srgb, var(--accent) 35%, transparent);
}

.hero-swap .arrow {
    display: inline-block;
    color: var(--muted);
}

/* Too narrow for one line: stack them, the arrow pointing down */
@media (max-width: 520px) {
    .hero-swap {
        flex-direction: column;
        gap: 0.4rem;
    }

    .hero-swap .arrow {
        transform: rotate(90deg);
    }
}

/* Read by screen readers, not shown */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    transition:
        transform 0.1s,
        border-color 0.15s,
        background 0.15s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
}

.screenshot {
    /* Keeps the aspect ratio when max-width shrinks an image that has width/height attributes */
    height: auto;
    margin-top: 0.5rem;
    /* Window captures carry their own rounded, transparent corners, so the shadow follows the alpha */
    filter: drop-shadow(0 16px 32px rgb(0 0 0 / 0.55));
}

.prose .screenshot {
    margin: 1.25rem 0 1.75rem;
}

.features h2,
.usage h2,
.install h2,
.build-locally h2 {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.75rem;
}

.feature {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.75rem 1.5rem;
}

.feature h3 {
    font-size: 1.05rem;
    margin-bottom: 0.6rem;
}

.feature p {
    color: var(--muted);
    font-size: 0.92rem;
}

.feature a {
    color: var(--accent);
    text-decoration: none;
}

.feature a:hover {
    text-decoration: underline;
}

/* Install: a section like Build from source (centred heading, centred command), with
   Bash / Manual tabs over one centred column */

.install .tabs {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    max-width: 42rem;
    margin: 0 auto 2rem;
    border-bottom: 1px solid var(--border);
}

.tab {
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--muted);
    background: none;
    border: 0;
    /* Square, and sitting on the list's own line so the selected tab's replaces it */
    border-radius: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 0.6rem 1.5rem;
    cursor: pointer;
}

.tab:hover {
    color: var(--text);
}

.tab[aria-selected='true'] {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.install .tab-panel {
    max-width: 42rem;
    margin: 0 auto;
}

/* The command and its note, centred like Build from source's */
.install .code-block {
    margin: 0 auto;
    text-align: left;
}

.install .sub {
    margin-top: 1.25rem;
}

/* Manual: the download button centred, the steps below it in the prose column */
.install .btn {
    margin-bottom: 2rem;
}

.install .prose {
    margin: 0 auto;
}

.install .prose ol {
    gap: 1rem;
}

/* Usage guide: prose beside the settings screenshot, stacked on narrow screens */

.usage-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
    gap: 4rem;
    align-items: start;
}

.usage-layout .prose {
    max-width: none;
}

.usage .prose h3 {
    margin: 2.5rem 0 0.6rem;
}

.usage .prose h3:first-child {
    margin-top: 0;
}

.usage .prose p {
    margin-bottom: 1rem;
}

.usage .prose ul {
    gap: 0.6rem;
    margin: 0.75rem 0 1.25rem;
}

.usage-layout > .screenshot {
    position: sticky;
    top: 2rem;
    margin-top: 0;
}

.install,
.build-locally {
    text-align: center;
}

/* Straight after the hero, with none of the usual section gap above */
.install {
    padding-top: 0;
}

.lede {
    color: var(--muted);
    margin-bottom: 1.75rem;
}

/* Centred under its heading; fit-content (below) sets the width */
.build-locally .code-block {
    text-align: left;
    margin: 2.5rem auto 0;
}

.build-locally .sub {
    margin-top: 1.25rem;
}

/* Less breathing room on phones, where the same padding would eat the screen */
@media (max-width: 760px) {
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    .hero {
        gap: 1.5rem;
        padding-top: 4.5rem;
        padding-bottom: 4rem;
    }

    .usage-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 2.5rem;
    }

    .usage-layout > .screenshot {
        position: static;
        max-width: min(100%, 420px);
        margin: 0 auto;
    }
}

/* Prose (long-form content) */

.prose {
    max-width: 42rem;
    text-align: left;
    line-height: 1.7;
}

.prose h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 1.75rem 0 0.5rem;
}

.prose h2:first-child,
.prose h3:first-child {
    margin-top: 0;
}

.prose h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.25rem 0 0.4rem;
}

.prose p {
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.prose ul,
.prose ol {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0.5rem 0 1rem;
    padding-left: 1.25rem;
}

.prose li {
    color: var(--muted);
}

.prose li .code-block {
    margin: 0.5rem 0;
}

.prose code {
    color: var(--text);
}

.prose strong {
    color: var(--text);
}

kbd {
    font-family: inherit;
    font-size: 0.8em;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 0.05rem 0.35rem;
    white-space: nowrap;
}

/* Code blocks */

/* As wide as the command (plus the Copy button's room), never wider than the column,
   so a long one still wraps on a phone */
.code-block {
    position: relative;
    width: fit-content;
    max-width: 100%;
}

.code-block pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    /* The right side leaves room for the Copy button, which sits over it */
    padding: 1rem 5.25rem 1rem 1.25rem;
    overflow-x: auto;
}

.code-block code {
    color: var(--text);
    font-weight: 400;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.copy-btn {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
    border-radius: 6px;
}

/* Table */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0 1.5rem;
    font-size: 0.9rem;
}

th,
td {
    text-align: left;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--muted);
    font-weight: 600;
}

td {
    color: var(--muted);
}

/* Shared bits */

.center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
    padding: 2rem 1.5rem 4rem;
    max-width: 960px;
    margin: 0 auto;
}

button {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.15s;
}

button:hover {
    border-color: var(--accent);
}

code {
    font-family: ui-monospace, monospace;
    font-size: 0.85em;
}

.sub {
    font-size: 0.85rem;
    color: var(--muted);
}

.sub a,
.back {
    color: var(--accent);
    text-decoration: none;
}

.sub a:hover,
.back:hover {
    text-decoration: underline;
}

footer {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    padding-top: 2rem;
    padding-bottom: 4rem;
}

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

footer a:hover {
    text-decoration: underline;
}

/* Version, credit, Skrapa. Equal outer columns keep the credit centred whatever the
   version's length. */
.site-footer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: baseline;
    gap: 1rem;
}

.site-footer p:first-child {
    text-align: left;
}

.site-footer p:last-child {
    text-align: right;
}

/* The credit's heart, in the accent colour, sized and seated like a letter (inline, past the
   svg reset at the top) */
.heart {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    fill: var(--accent);
}

/* Stacked and centred on a phone */
@media (max-width: 560px) {
    .site-footer {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .site-footer p:first-child,
    .site-footer p:last-child {
        text-align: center;
    }
}

