/*
 * GitHub Presence — Shared Design System
 * Dark-theme CSS kit for developer tool landing pages.
 * Source: github.com/janrummel/github-presence
 *
 * Usage: Link this CSS, then use the component classes in your HTML.
 * Customize: Override --accent and --accent-dim for your project's color.
 */

/* ── Variables ── */
:root {
    --bg: #0d1117;
    --bg-card: #161b22;
    --bg-elevated: #1c2128;
    --border: #30363d;
    --border-subtle: #21262d;
    --text: #c9d1d9;
    --text-dim: #848d97;
    --text-heading: #e6edf3;
    --accent: #58a6ff;
    --accent-dim: rgba(88, 166, 255, 0.12);
    --accent-glow: rgba(88, 166, 255, 0.25);
    --danger: #f85149;
    --danger-dim: rgba(248, 81, 73, 0.1);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.7;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 840px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Accessibility ── */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; top: -40px; left: 0;
    background: var(--accent); color: var(--bg);
    padding: 8px 16px; z-index: 100; font-size: 14px;
    text-decoration: none; border-radius: 0 0 8px 0;
}
.skip-link:focus { top: 0; }

/* ── Hero ── */
.hero {
    text-align: center;
    padding: 80px 0 64px;
}

.tagline {
    font-size: 18px;
    color: var(--text-dim);
    margin-top: 16px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* ── Badges ── */
.badges {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.badge {
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-dim);
    font-weight: 500;
}

.badge-accent {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

/* ── Buttons / CTA ── */
.cta {
    margin-top: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-primary {
    padding: 12px 32px;
    background: var(--accent);
    color: var(--bg);
    text-decoration: none;
    font-weight: 600;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-secondary {
    padding: 12px 24px;
    background: transparent;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    font-size: 15px;
    border: 1px solid var(--border);
    transition: border-color 0.2s;
}

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

/* ── Animations ── */
.animate-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.15s; }
.delay-2 { transition-delay: 0.3s; }

/* ── Sections ── */
.section {
    padding: 64px 0;
}

.section-dark {
    background: var(--bg-card);
    margin: 0 -24px;
    padding: 64px 24px;
    border-radius: 0;
}

@media (min-width: 888px) {
    .section-dark {
        margin: 0 -48px;
        padding: 64px 48px;
        border-radius: 16px;
    }
}

.section-heading {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.section-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    font-weight: 500;
    margin-bottom: 12px;
}

.section-intro {
    color: var(--text);
    font-size: 15px;
    margin-bottom: 28px;
    max-width: 620px;
    line-height: 1.7;
}

.section-intro code {
    font-family: var(--font-mono);
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--accent);
}

.aside {
    margin-top: 20px;
    color: var(--text-dim);
    font-size: 14px;
    text-align: center;
}

.dim { color: var(--text-dim); }

/* ── Terminal Mockup ── */
.terminal {
    background: #0a0a0f;
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    max-width: 700px;
    margin: 0 auto;
}

.terminal-bar {
    background: #1c1c24;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.terminal-dot {
    width: 10px; height: 10px; border-radius: 50%;
}
.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-title {
    font-size: 12px; color: var(--text-dim);
    margin-left: auto; margin-right: auto;
}

.terminal-body {
    padding: 20px 24px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.8;
}

.term-prompt { color: var(--accent); font-weight: 600; margin-right: 8px; }
.term-string { color: #e9d5ff; }
.term-output { color: var(--text); }
.term-masked { color: var(--text-dim); }
.term-placeholder { color: var(--accent); font-weight: 500; }
.term-success { color: #34d399; }
.term-dim { color: var(--text-dim); font-size: 12px; }
.term-cursor { color: var(--accent); animation: blink 1s infinite; }

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.term-line {
    opacity: 0;
    animation: termAppear 0.3s ease forwards;
}
.term-line-1 { animation-delay: 0.3s; }
.term-line-2 { animation-delay: 0.8s; }
.term-line-3 { animation-delay: 1.2s; }
.term-line-4 { animation-delay: 1.5s; }
.term-line-5 { animation-delay: 1.8s; }
.term-line-6 { animation-delay: 2.4s; }
.term-line-7 { animation-delay: 2.8s; }
.term-line-8 { animation-delay: 3.3s; }
.term-line-9 { animation-delay: 3.6s; }
.term-line-10 { animation-delay: 4.0s; }

@keyframes termAppear {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Feature Cards ── */
.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 600px) {
    .feature-grid { grid-template-columns: 1fr; }
}

.feature-card {
    background: var(--bg);
    border-radius: 12px;
    padding: 24px;
    transition: border-color 0.2s;
    border: 1px solid var(--border-subtle);
}

.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    transition: all 0.2s;
}

.feature-icon {
    margin-bottom: 14px;
    opacity: 0.8;
}

.feature-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 6px;
}

.feature-card p {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
}

/* ── Quick Start (numbered steps — reusable for any install flow) ── */
.quickstart {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.qs-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.qs-number {
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent);
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 2px;
}

.qs-content {
    flex: 1;
    min-width: 0;
}

.qs-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.qs-desc {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 10px;
    line-height: 1.5;
}

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

.qs-desc a:hover { text-decoration: underline; }

.qs-desc code {
    font-family: var(--font-mono);
    background: var(--bg-elevated);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
}

.qs-content .code-block {
    font-size: 13px;
    padding: 14px 18px;
    line-height: 1.6;
    border-radius: 8px;
    background: var(--bg-card);
    font-family: var(--font-mono);
    white-space: pre;
    overflow-x: auto;
}

/* ── Code Blocks ── */
.code-block {
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--bg-card);
    border-radius: 8px;
    padding: 14px 18px;
    line-height: 1.6;
    white-space: pre;
    overflow-x: auto;
}

code {
    font-family: var(--font-mono);
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

/* ── FAQ ── */
.faq {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.faq-item {
    border-bottom: 1px solid var(--border);
    padding: 0;
}

.faq-item:first-child {
    border-top: 1px solid var(--border);
}

.faq-item summary {
    padding: 18px 0;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-heading);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item summary::after {
    content: '+';
    font-size: 20px;
    color: var(--text-dim);
    transition: transform 0.2s;
    flex-shrink: 0;
    margin-left: 16px;
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item p {
    padding: 0 0 18px;
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.6;
    max-width: 600px;
}

.faq-item code {
    font-family: var(--font-mono);
    background: var(--bg-card);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
}

/* ── Footer ── */
.footer {
    padding: 40px 0 60px;
    text-align: center;
    font-size: 14px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.footer-sep {
    color: var(--text-dim);
}

.footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

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

.footer .dim {
    margin-top: 4px;
    font-size: 12px;
}

.footer .dim a {
    font-weight: 400;
}

/* ── Mobile breakpoints ── */
@media (max-width: 639px) {
    .hero { padding: 60px 0 48px; }
    .tagline { font-size: 16px; }
    .section-heading { font-size: 22px; }
    .btn-primary, .btn-secondary { width: 100%; text-align: center; }
}

@media (min-width: 640px) {
    .section-heading { font-size: 28px; }
}
