* {
    box-sizing: border-box;
}

:root, [data-theme="paper"] {
    --bg: #fff;
    --fg: #222;
    --strong: #333;
    --secondary: #555;
    --desc: #444;
    --border: #888;
    --code-bg: #f5f5f0;
    --selection-bg: #1a1a2e;
    --selection-fg: #fff;
}
[data-theme="carbon"] {
    --bg: #0f1115;
    --fg: #d8d8d8;
    --strong: #e8e8e8;
    --secondary: #aaa;
    --desc: #bbb;
    --border: #555;
    --code-bg: #1a1d23;
    --selection-bg: #d8d8d8;
    --selection-fg: #0f1115;
}
[data-theme="solar"] {
    --bg: #f5ecd4;
    --fg: #2d2a24;
    --strong: #1a1813;
    --secondary: #6b6354;
    --desc: #4d4636;
    --border: #a89878;
    --code-bg: #ebe1c4;
    --selection-bg: #2d2a24;
    --selection-fg: #f5ecd4;
}
[data-theme="midnight"] {
    --bg: #0a1428;
    --fg: #d8cdb4;
    --strong: #ece2c8;
    --secondary: #948766;
    --desc: #b8ab8c;
    --border: #3a4566;
    --code-bg: #131e36;
    --selection-bg: #d8cdb4;
    --selection-fg: #0a1428;
}

::selection {
    background: var(--selection-bg);
    color: var(--selection-fg);
}

body {
    max-width: 700px;
    margin: 0 auto;
    padding: 40px 20px;
    background: var(--bg);
    color: var(--fg);
    font-family: ui-monospace, Menlo, Consolas, 'Courier New', monospace;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
}

a {
    color: var(--fg);
}

a:focus-visible,
button:focus-visible,
.install-prompt-details summary:focus-visible {
    outline: 1px solid var(--fg);
    outline-offset: 4px;
}

.theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10;
    min-height: 44px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
}

.theme-toggle:hover {
    border-color: var(--fg);
}

main {
    width: 100%;
    max-width: 74ch;
    margin-right: auto;
    margin-left: auto;
}

h1 {
    margin: 0 0 8px;
    color: var(--strong);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.lead {
    margin: 0;
    padding: 0 0 24px;
    border-bottom: 1px solid var(--border);
    color: var(--desc);
}

.section-heading {
    margin: 0 0 12px;
    color: var(--secondary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1.5;
    text-transform: uppercase;
}

.skill-row {
    padding: 10px 0;
    border-top: 1px solid var(--border);
}

.skill-row:first-child {
    border-top: 0;
}

.skill-title {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--strong);
    font-weight: 700;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.skill-title:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.skill-summary {
    margin: 0;
    color: var(--desc);
}

.content-section {
    margin-top: 32px;
}

.install-section {
    margin-top: 24px;
}

.install-copy-group {
    margin: 0 0 16px;
}

.install-prompt-payload {
    display: block;
    width: 100%;
    height: min(45vh, 22rem);
    min-height: 9rem;
    max-height: 45vh;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 0;
    background: var(--code-bg);
    color: var(--fg);
    font: 11px/1.6 ui-monospace, Menlo, Consolas, 'Courier New', monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    resize: vertical;
}

.install-prompt-payload[hidden] {
    display: none;
}

.install-prompt-payload:focus-visible {
    outline: 1px solid var(--fg);
    outline-offset: 2px;
}

.content-section > p {
    max-width: 74ch;
    margin: 0 0 16px;
    color: var(--desc);
}

.content-section > p:last-child {
    margin-bottom: 0;
}

.content-section a {
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.content-section a:hover {
    text-decoration: none;
}

.copy-button {
    flex: 0 1 auto;
    min-width: 44px;
    max-width: 50%;
    min-height: 44px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    color: var(--fg);
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    line-height: 1.4;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.copy-button:hover {
    border-color: var(--fg);
}

.usage-example {
    margin: 0;
    padding: 10px;
    border: 1px solid var(--border);
    background: var(--code-bg);
    color: var(--fg);
    font: inherit;
    font-size: 11px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: normal;
}

.usage-example code {
    padding: 0;
    background: none;
    font: inherit;
}

.copy-status {
    min-height: 1.5em;
    margin: 8px 0 0;
    color: var(--secondary);
    font-size: 11px;
}

.copy-help {
    margin: 8px 0 0;
    color: var(--secondary);
    font-size: 11px;
}

.expectations {
    margin: 0;
    padding: 0 0 0 20px;
    color: var(--desc);
}

.expectations li {
    margin: 0 0 8px;
    padding-left: 4px;
}

.expectations li:last-child {
    margin-bottom: 0;
}

code {
    padding: 1px 4px;
    background: var(--code-bg);
    color: var(--fg);
    font-family: inherit;
    font-size: 13px;
    overflow-wrap: anywhere;
}

@media (max-width: 500px) {
    body {
        padding: 24px 16px;
    }

    .theme-toggle {
        display: none;
    }

    h1 {
        font-size: 18px;
    }

    .content-section {
        margin-top: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
    }
}
