@import "./theme/theme.css";

:root {
    --color-code-bg: color-mix(in oklab, var(--palette-black), var(--palette-white) 4%);
    --color-code-fg: var(--palette-white);
    --width: 1080px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-size: 17px;
    line-height: 1.6;
}

.wrap {
    max-width: var(--width);
    margin: 0 auto;
    padding: 0 16px;
}

.skip {
    position: absolute;
    left: -9999px;
}

.skip:focus {
    left: 16px;
    top: 12px;
    background: var(--color-surface);
    padding: 6px 12px;
    z-index: 10;
}

.site-header {
    border-bottom: 1px solid var(--color-border);
}

.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 64px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    font-weight: 700;
    font-size: 19px;
    text-decoration: none;
    letter-spacing: -0.01em;
}

.brand img {
    width: 28px;
    height: 28px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 15px;
}

.site-nav a {
    color: var(--color-text-muted);
    text-decoration: none;
}

.site-nav a:hover {
    color: var(--color-fg);
}

.hero {
    padding: 88px 0 72px;
}

h1 {
    margin: 0;
    max-width: 14ch;
    font-size: clamp(2.5rem, 6vw + 0.5rem, 4.25rem);
    line-height: 1.04;
    letter-spacing: -0.035em;
    font-weight: 800;
}

.lede {
    max-width: 58ch;
    margin: 24px 0 0;
    color: var(--color-text-muted);
    font-size: clamp(1.1rem, 1vw + 0.9rem, 1.3rem);
}

.hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
    color: var(--color-text-muted);
    font-size: 15px;
}

.hero-points li::before {
    content: "✓";
    margin-right: 8px;
    color: var(--palette-green);
    font-weight: 700;
}

section {
    padding: 72px 0;
}

section + section {
    border-top: 1px solid var(--color-border);
}

h2 {
    margin: 0;
    max-width: 22ch;
    font-size: clamp(1.75rem, 2.5vw + 1rem, 2.5rem);
    line-height: 1.15;
    letter-spacing: -0.025em;
    font-weight: 750;
}

.pillars {
    display: grid;
    gap: 72px;
}

.pillar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 40px;
    align-items: center;
}

.pillar h3 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.25;
    letter-spacing: -0.015em;
}

.pillar p {
    margin: 12px 0 0;
    color: var(--color-text-muted);
}

.pillar ul {
    margin: 16px 0 0;
    padding-left: 20px;
    color: var(--color-text-muted);
}

.pillar li + li {
    margin-top: 6px;
}

.pillar li strong {
    color: var(--color-fg);
    font-weight: 600;
}

.panel {
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-surface);
    padding: 20px;
    font-size: 15px;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--palette-green);
}

.dot.recording {
    background: #d94a4a;
    animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
    50% {
        opacity: 0.35;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dot.recording {
        animation: none;
    }

    html {
        scroll-behavior: auto;
    }
}

.steps {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.steps li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
    min-width: 0;
}

.steps .kind {
    flex: none;
    min-width: 64px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--color-accent-text);
    font-weight: 600;
}

.steps .what {
    min-width: 0;
    overflow-wrap: anywhere;
}

.steps .check .kind {
    color: color-mix(in oklab, var(--palette-green), var(--color-fg) 20%);
}

.code {
    position: relative;
    margin: 0;
    border-radius: 12px;
    background: var(--color-code-bg);
    color: var(--color-code-fg);
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.65;
}

.code pre {
    margin: 0;
    padding: 18px 20px;
    overflow-x: auto;
}

.code .comment {
    color: color-mix(in oklab, var(--palette-white) 55%, var(--palette-black));
}

.code .ok {
    color: #6fcf8e;
}

.code .key {
    color: #8fcaf0;
}

.code .str {
    color: #e8c07a;
}

.copy {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border: 1px solid color-mix(in oklab, var(--palette-white) 25%, transparent);
    border-radius: 6px;
    background: transparent;
    color: var(--palette-white);
    font: 600 12px var(--font-sans);
    cursor: pointer;
    opacity: 0.8;
}

.copy:hover {
    opacity: 1;
}

.browsers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.browsers span {
    padding: 3px 10px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 28px 0 40px;
    color: var(--color-text-muted);
    font-size: 14px;
}

.site-footer .wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
}

.site-footer nav {
    display: flex;
    gap: 20px;
}

.site-footer a {
    color: inherit;
}

.prose {
    max-width: 760px;
    padding: 56px 16px 72px;
}

.prose h1 {
    max-width: none;
    font-size: clamp(2rem, 3vw + 1rem, 2.75rem);
}

.prose .updated {
    margin: 12px 0 0;
    color: var(--color-text-muted);
}

.prose h2 {
    max-width: none;
    margin-top: 44px;
    font-size: 1.4rem;
}

.prose h3 {
    margin: 28px 0 0;
    font-size: 1.1rem;
}

.prose p,
.prose li {
    color: color-mix(in oklab, var(--color-fg) 88%, var(--color-bg));
}

.prose ul {
    padding-left: 22px;
}

.prose li + li {
    margin-top: 6px;
}

.prose .summary {
    margin-top: 28px;
    padding: 18px 22px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
}

.prose .summary ul {
    margin: 8px 0 0;
}

.table-scroll {
    overflow-x: auto;
    margin-top: 16px;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.prose th,
.prose td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.prose th {
    font-weight: 600;
}

.prose a {
    text-decoration: underline;
}

.prose code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 1px 5px;
    border-radius: 4px;
    background: color-mix(in oklab, var(--color-fg) 8%, transparent);
}

@media (max-width: 820px) {
    .hero {
        padding: 56px 0 48px;
    }

    section {
        padding: 56px 0;
    }

    .pillar {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .site-nav .hide-small {
        display: none;
    }
}

.nowrap {
    white-space: nowrap;
}
