/* Reset and base styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #f6f7f8;
    --surface: #ffffff;
    --surface-2: #eef1f2;
    --ink: #14171a;
    --ink-2: #4f5860;
    --ink-3: #7a838b;
    --line: #dde2e5;
    --accent: #0e6b5c;
    --accent-hover: #0a5648;
    --accent-soft: #e3f1ed;
    --code-bg: #14171a;
    --code-ink: #e6e9eb;
    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
    --max: 1040px;
    --s1: 0.5rem;
    --s2: 1rem;
    --s3: 1.5rem;
    --s4: 2.5rem;
    --s5: 4rem;
    --s6: 6rem;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-padding-top: 4rem;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--ink);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--s3);
}

h1,
h2,
h3 {
    text-wrap: balance;
    line-height: 1.15;
}

/* Header */
.header {
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--line);
    background-color: rgba(246, 247, 248, 0.92);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--s3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s2);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--s3);
    font-size: 0.9375rem;
}

.nav a {
    color: var(--ink-2);
    text-decoration: none;
}

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

.nav a:not(.github-link):nth-child(-n+2) {
    display: none;
}

@media (min-width: 600px) {
    .nav a:not(.github-link):nth-child(-n+2) {
        display: inline;
    }
}

.github-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.github-stars {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.1rem 0.45rem;
    color: var(--ink-2);
}

.github-stars svg {
    color: #d9a520;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.github-stars:has(#stars-count:empty) {
    display: none;
}

/* Hero */
.hero {
    padding: var(--s6) 0 var(--s5);
}

.hero-grid {
    display: grid;
    gap: var(--s4);
    align-items: center;
}

@media (min-width: 860px) {
    .hero-grid {
        grid-template-columns: 1.05fr 1fr;
        gap: var(--s5);
    }
}

.hero h1 {
    font-size: clamp(2rem, 4.2vw, 2.875rem);
    font-weight: 600;
    letter-spacing: -0.015em;
    margin-bottom: var(--s3);
}

.subheadline {
    font-size: 1.125rem;
    color: var(--ink-2);
    max-width: 34rem;
    margin-bottom: var(--s4);
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2);
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.4rem;
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

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

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

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

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

.btn-block {
    display: block;
    width: 100%;
}

/* Code panel */
.code-panel {
    background-color: var(--code-bg);
    color: var(--code-ink);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(20, 23, 26, 0.12);
    min-width: 0;
}

.code-panel figcaption {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: #9aa4ab;
    border-bottom: 1px solid #262b30;
}

.code-file {
    color: var(--code-ink);
}

.code-panel pre {
    margin: 0;
    padding: 1rem 1rem 1.1rem;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1.55;
}

@media (max-width: 480px) {
    .code-panel pre {
        font-size: 0.7rem;
        padding: 0.8rem 0.8rem 0.9rem;
    }
}

.code-panel code {
    font-family: inherit;
}

.code-panel .k { color: #7fd1c0; }
.code-panel .t { color: #f2d479; }
.code-panel .f { color: #9ec7ff; }
.code-panel .b { color: #d9a5f5; }
.code-panel .n { color: #f5b98a; }
.code-panel .s { color: #b5e08c; }
.code-panel .c { color: #7a838b; }

/* Facts */
.facts {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background-color: var(--surface);
}

.facts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s3) var(--s4);
    padding-top: var(--s3);
    padding-bottom: var(--s3);
}

@media (min-width: 860px) {
    .facts-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.fact {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.fact-value {
    font-family: var(--mono);
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.fact-label {
    font-size: 0.875rem;
    color: var(--ink-2);
    line-height: 1.45;
}

@media (max-width: 859px) {
    .facts-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .fact {
        flex-direction: row;
        align-items: baseline;
        gap: 0.75rem;
    }

    .fact-value {
        min-width: 8.5rem;
        font-size: 1rem;
    }
}

/* Sections */
.services,
.how,
.contact {
    padding: var(--s6) 0;
}

.section-head {
    max-width: 40rem;
    margin-bottom: var(--s4);
}

.section-head h2 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: var(--s2);
}

.section-head p {
    color: var(--ink-2);
}

/* Services */
.service-list {
    list-style: none;
    border-top: 1px solid var(--line);
}

.service-row {
    display: grid;
    grid-template-columns: 2.25rem 1fr;
    gap: 0.5rem;
    padding: var(--s3) 0;
    border-bottom: 1px solid var(--line);
}

@media (min-width: 860px) {
    .service-row {
        grid-template-columns: 3rem 16rem 1fr;
        gap: var(--s3);
    }

    .service-row .service-body {
        display: contents;
    }
}

.service-num {
    font-family: var(--mono);
    font-size: 0.875rem;
    color: var(--accent);
    padding-top: 0.2rem;
}

.service-body h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--s1);
}

@media (min-width: 860px) {
    .service-body h3 {
        margin-bottom: 0;
    }
}

.service-body p {
    color: var(--ink-2);
}

.service-footnote {
    margin-top: var(--s3);
    font-size: 0.9375rem;
    color: var(--ink-2);
}

/* How it fits */
.how {
    background-color: var(--surface);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.flow {
    display: grid;
    gap: 0.5rem;
    align-items: stretch;
}

@media (min-width: 860px) {
    .flow {
        grid-template-columns: 1fr 1.25rem 1fr 1.25rem 1.15fr 1.25rem 1fr 1.25rem 1fr;
        gap: 0.25rem;
    }
}

.flow-step {
    background-color: var(--bg);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.flow-step-accent {
    background-color: var(--accent-soft);
    border-color: var(--accent);
}

.flow-title {
    font-weight: 600;
    font-size: 0.9375rem;
}

.flow-sub {
    font-size: 0.8125rem;
    color: var(--ink-2);
    line-height: 1.4;
}

.flow-arrow {
    position: relative;
    min-height: 1rem;
}

.flow-arrow::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    border-left: 1px solid var(--ink-3);
}

.flow-arrow::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 1px solid var(--ink-3);
    border-bottom: 1px solid var(--ink-3);
    transform: translate(-50%, 0) rotate(45deg);
}

@media (min-width: 860px) {
    .flow-arrow::before {
        left: 0;
        right: 0;
        top: 50%;
        bottom: auto;
        border-left: none;
        border-top: 1px solid var(--ink-3);
    }

    .flow-arrow::after {
        left: auto;
        right: 0.1rem;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%) rotate(-45deg);
    }
}

.lanes {
    display: grid;
    gap: 0.5rem;
    margin-top: var(--s3);
}

@media (min-width: 860px) {
    .lanes {
        grid-template-columns: repeat(3, 1fr);
    }
}

.lane {
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
    padding: 0.75rem 1rem;
    border-left: 2px solid var(--accent);
    background-color: var(--bg);
}

.lane-name {
    font-family: var(--mono);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--accent);
    min-width: 4.5rem;
}

.lane-desc {
    font-size: 0.875rem;
    color: var(--ink-2);
    line-height: 1.45;
}

.how-notes {
    margin-top: var(--s4);
    display: grid;
    gap: var(--s2);
    max-width: 44rem;
    font-size: 0.9375rem;
    color: var(--ink-2);
}

.how-notes strong {
    color: var(--ink);
    font-weight: 600;
}

.get {
    margin-top: var(--s4);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: var(--s2) var(--s3);
    border: 1px solid var(--line);
    border-radius: 8px;
    background-color: var(--bg);
}

.get-label {
    font-family: var(--mono);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-3);
    margin-right: 0.5rem;
}

.get code {
    font-family: var(--mono);
    font-size: 0.875rem;
    background-color: var(--surface);
    border: 1px solid var(--line);
    padding: 0.35rem 0.7rem;
    border-radius: 5px;
}

.get-links {
    display: flex;
    gap: 1rem;
}

.get a {
    font-size: 0.9375rem;
    text-decoration: none;
}

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

@media (max-width: 859px) {
    .get {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }

    .get-label {
        margin-right: 0;
    }

    .get code {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .get-links {
        display: flex;
        gap: 1.25rem;
    }
}

/* Contact */
.contact-grid {
    display: grid;
    gap: var(--s4);
}

@media (min-width: 860px) {
    .contact-grid {
        grid-template-columns: 1fr 1.1fr;
        gap: var(--s6);
    }
}

.contact-copy h2 {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: var(--s2);
}

.contact-copy p {
    color: var(--ink-2);
    margin-bottom: var(--s2);
}

.contact-direct a {
    font-family: var(--mono);
    font-size: 1rem;
    text-decoration: none;
}

.contact-direct a:hover {
    text-decoration: underline;
}

.contact-form {
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: var(--s3);
}

.form-group {
    margin-bottom: var(--s2);
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    font-family: var(--sans);
    font-size: 1rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background-color: var(--bg);
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 107, 92, 0.15);
    background-color: var(--surface);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.gotcha {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.form-note {
    margin-top: var(--s2);
    font-size: 0.8125rem;
    color: var(--ink-3);
}

/* Footer */
.footer {
    padding: var(--s3) 0;
    border-top: 1px solid var(--line);
    font-size: 0.875rem;
    color: var(--ink-2);
}

.footer-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--s2);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s3);
}

.footer-links a {
    color: var(--ink-2);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--ink);
}

/* Small screens */
@media (max-width: 480px) {
    html {
        font-size: 15px;
    }

    .hero {
        padding: var(--s4) 0 var(--s4);
    }

    .services,
    .how,
    .contact {
        padding: var(--s5) 0;
    }

    .container,
    .header-content {
        padding: 0 var(--s2);
    }
}


/* Home: README-style intro */
.intro {
    padding: var(--s5) 0 var(--s4);
}

.intro-grid {
    display: grid;
    gap: var(--s4);
    align-items: start;
}

@media (min-width: 900px) {
    .intro-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
        gap: var(--s5);
    }
}

.intro h1 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.intro .tagline {
    font-size: 1.25rem;
    color: var(--ink-2);
    margin-top: var(--s1);
}

.intro .install {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s1) var(--s2);
    margin-top: var(--s3);
}

.intro .install code {
    font-family: var(--mono);
    font-size: 0.95rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.45rem 0.7rem;
}

.links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2);
    margin-top: var(--s2);
}

.intro h2,
.services-short h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: var(--s4);
    margin-bottom: var(--s2);
}

.facts-list {
    list-style: disc;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.5rem;
    color: var(--ink);
}

.facts-list code {
    font-family: var(--mono);
    font-size: 0.95em;
}

.services-short {
    padding: var(--s4) 0 var(--s5);
}

.services-short h2 {
    margin-top: 0;
}

.services-short p {
    max-width: 60ch;
    color: var(--ink-2);
}

/* Services page */
.page {
    padding: var(--s5) 0;
}

.page h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: var(--s2);
}

.page .lede {
    color: var(--ink-2);
    max-width: 60ch;
    margin-bottom: var(--s4);
}
