:root {
    --bg: #1a1b26;
    --bg-dark: #16161e;
    --bg-highlight: #292e42;
    --bg-card: #1f2335;
    --fg: #c0caf5;
    --fg-dark: #a9b1d6;
    --comment: #565f89;
    --blue: #7aa2f7;
    --cyan: #7dcfff;
    --green: #9ece6a;
    --magenta: #bb9af7;
    --purple: #9d7cd8;
    --orange: #ff9e64;
    --yellow: #e0af68;
    --red: #f7768e;
    --teal: #1abc9c;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--fg);
    font-family: 'Inter', sans-serif;
    line-height: 1.65;
}

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

a:hover {
    color: var(--blue);
}

:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1000;
    padding: 0.65rem 0.9rem;
    border-radius: 6px;
    background: var(--blue);
    color: var(--bg-dark);
    font-weight: 600;
    transform: translateY(-160%);
    transition: transform 0.15s;
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--bg-highlight);
    background: var(--bg-dark);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(1100px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1rem 0;
}

.brand {
    color: var(--blue);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
}

.brand-dots {
    display: inline-flex;
    gap: 3px;
    margin-left: 0.35rem;
    vertical-align: middle;
}

.brand-dots span {
    width: 7px;
    height: 7px;
    border-radius: 2px;
}

.primary-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.primary-nav a {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    color: var(--fg-dark);
    font-size: 0.82rem;
    text-decoration: none;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
    background: var(--bg-highlight);
    color: var(--fg);
}

.page-shell {
    width: min(960px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 3.5rem 0 5rem;
}

.hero {
    margin-bottom: 3rem;
}

.eyebrow {
    margin-bottom: 0.4rem;
    color: var(--cyan);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    color: var(--fg);
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.3;
}

h1 {
    max-width: 850px;
    margin-bottom: 0.8rem;
    font-size: clamp(2rem, 5vw, 3.25rem);
}

h2 {
    margin-bottom: 0.9rem;
    font-size: clamp(1.35rem, 3vw, 1.8rem);
}

h3 {
    margin-bottom: 0.45rem;
    font-size: 1rem;
}

.lede {
    max-width: 760px;
    color: var(--fg-dark);
    font-size: 1.05rem;
}

.section {
    margin-top: 3.25rem;
}

.section-intro {
    max-width: 760px;
    margin-bottom: 1.2rem;
    color: var(--fg-dark);
}

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

.card {
    padding: 1.25rem;
    border: 1px solid var(--bg-highlight);
    border-radius: 10px;
    background: var(--bg-card);
}

.card p,
.card li {
    color: var(--fg-dark);
    font-size: 0.9rem;
}

.card ul,
.card ol {
    margin: 0.7rem 0 0 1.25rem;
}

.card-link {
    display: inline-block;
    margin-top: 0.8rem;
    font-size: 0.85rem;
    text-decoration: none;
}

.variant-swatch {
    height: 90px;
    margin-bottom: 0.9rem;
    border: 1px solid var(--bg-highlight);
    border-radius: 8px;
}

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

.color-card {
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--bg-highlight);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--fg);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.color-card:hover {
    border-color: var(--blue);
}

.color-block {
    height: 70px;
}

.color-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
}

.color-name {
    color: var(--fg-dark);
    font-size: 0.75rem;
}

.hex {
    color: var(--fg);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
}

.code-wrap {
    position: relative;
    margin-top: 1rem;
}

pre {
    overflow-x: auto;
    padding: 1.2rem;
    border: 1px solid var(--bg-highlight);
    border-radius: 8px;
    background: var(--bg-dark);
    color: var(--fg-dark);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    line-height: 1.55;
}

.copy-btn {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--bg-highlight);
    border-radius: 5px;
    background: var(--bg-card);
    color: var(--fg);
    font: inherit;
    font-size: 0.72rem;
    cursor: pointer;
}

.copy-btn:hover {
    border-color: var(--blue);
}

.source-note {
    margin-top: 1rem;
    padding-left: 0.9rem;
    border-left: 3px solid var(--purple);
    color: var(--fg-dark);
    font-size: 0.86rem;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--bg-highlight);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

th,
td {
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid var(--bg-highlight);
    text-align: left;
    vertical-align: top;
    font-size: 0.86rem;
}

th {
    color: var(--cyan);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

td {
    color: var(--fg-dark);
}

tr:last-child td {
    border-bottom: 0;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.2rem;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--bg-highlight);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--fg);
    font-size: 0.84rem;
    text-decoration: none;
}

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

.site-footer {
    border-top: 1px solid var(--bg-highlight);
    background: var(--bg-dark);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    width: min(960px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.5rem 0;
    color: var(--fg-dark);
    font-size: 0.82rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.footer-links a {
    text-decoration: none;
}

@media (max-width: 700px) {
    .header-inner,
    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-shell {
        padding-top: 2.4rem;
    }

    .grid,
    .color-grid {
        grid-template-columns: 1fr;
    }
}
