/* ===================================================================
   infocard — styles
   GitHub-flavored dark/light, sidebar layout, dev-friendly aesthetics

   Organization:
     1. Reset & Base (variables, typography, global elements)
     2. Logo & Topbar (shared header across all pages)
     3. Shared Layout (page-content container, page-footer)
     4. Hire Page (recruiter landing — hero, featured, how-it-works)
     5. Landing Page (developer onboarding — messaging, steps, try-it)
     6. Search Page (form, filter chips, result cards)
     7. Syntax Reference Page (side-by-side markdown examples)
     8. Profile Page (sidebar, content area)
     9. Responsive (tablet/mobile breakpoints)

   All colors are defined as CSS variables on html[data-theme].
   Never hardcode colors in component styles — always use variables.
   The theme is set via a data-theme attribute on <html>, toggled by
   JavaScript and persisted in localStorage.

   Every page shares: topbar() + .page-content (960px) + .page-footer.
   The topbar-inner and page-content have matching max-width + padding
   so logo and content are always visually aligned.
   =================================================================== */

/* --- Reset & Base -------------------------------------------------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Typography — Inter for body, JetBrains Mono for code/accents */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    /* Spacing scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Layout dimensions */
    --sidebar-width: 260px;
    --topbar-height: 48px;
}

/* Dark theme (default) — matches GitHub's dark default (#0d1117) */
html[data-theme="dark"] {
    --bg-primary: #0d1117;      /* page background */
    --bg-secondary: #161b22;    /* cards, topbar, sidebar */
    --bg-tertiary: #21262d;     /* hover states, code blocks */
    --border: #30363d;          /* all borders */
    --text-primary: #e6edf3;    /* headings, body text */
    --text-secondary: #7d8590;  /* secondary text, descriptions */
    --text-muted: #484f58;      /* hints, labels, placeholders */
    --accent: #58a6ff;          /* links, interactive elements */
    --accent-subtle: #1f6feb;   /* focus rings, input borders */
    --badge-open-bg: rgba(31, 111, 235, 0.15);   /* "open to" badge fill */
    --badge-open-border: rgba(31, 111, 235, 0.3); /* "open to" badge border */
    --badge-ai-bg: rgba(163, 113, 247, 0.12);    /* AI-inferred tag fill */
    --badge-ai-border: rgba(163, 113, 247, 0.3);  /* AI-inferred tag border */
    --badge-ai-text: #a371f7;                      /* AI-inferred tag text */
}

/* Light theme — mirrors GitHub's light default */
html[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-tertiary: #eaeef2;
    --border: #d0d7de;
    --text-primary: #1f2328;
    --text-secondary: #656d76;
    --text-muted: #8b949e;
    --accent: #0969da;
    --accent-subtle: #218bff;
    --badge-open-bg: rgba(9, 105, 218, 0.1);
    --badge-open-border: rgba(9, 105, 218, 0.25);
    --badge-ai-bg: rgba(130, 80, 223, 0.08);
    --badge-ai-border: rgba(130, 80, 223, 0.25);
    --badge-ai-text: #8250df;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    letter-spacing: -0.01em;
    min-height: 100vh;
}

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

a:hover {
    text-decoration: underline;
}

/* Global inline code style (not inside .markdown-body, which is handled
   by github-markdown-css from the CDN) */
code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--bg-tertiary);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

/* --- Logo ----------------------------------------------------------
   The "infocard" wordmark is split into two <span>s so we can color
   each part independently: "info" (primary), "card" (accent).
   Used in the topbar on every page — always links to home.
   ------------------------------------------------------------------ */
.logo {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.125rem;
    text-decoration: none !important;
    letter-spacing: -0.02em;
}

.logo-info {
    color: var(--text-primary);
}

.logo-dot {
    color: var(--accent);
}


/* === PAGE SHELL ====================================================
   Universal page container used by all pages (except profile which
   has its own sidebar layout). Centered at 960px with 24px gutters.
   Paired with the sticky .topbar above it.
   ================================================================== */
.page-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    min-height: calc(100vh - var(--topbar-height));
    display: flex;
    flex-direction: column;
}

/* Unified page footer — centered, subtle, consistent */
.page-footer {
    padding: var(--space-lg) 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: auto;
}

.page-footer a {
    color: var(--text-secondary);
}

.landing-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 40px 0;
}

.landing-title {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.landing-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: var(--space-2xl);
}

/* --- Steps ---
   Numbered steps 1-5. Each step has a .num-badge and
   .step-content with a heading + detail text. This pattern is
   reused on the 404 page for setup instructions.
   ------------------------------------------------------------------ */
.steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: var(--space-2xl);
}

.step {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

/* Monospace number badge — accent colored, rounded square.
   Base size 28×28; use .num-badge-lg for 32×32 (hire page). */
.num-badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
    margin-top: 2px;
}

.num-badge-lg {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    margin-top: 0;
}

.step-content h3 {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.step-detail {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.step-detail code {
    font-size: 0.8125rem;
}

/* <em> inside step details is styled as accent (not italic) —
   used for highlighting the "you" placeholder in URLs */
.step-detail em {
    color: var(--accent);
    font-style: normal;
}

/* --- Try-it input ---
   Step 4's inline form: "info.md/~" prefix + text input + go button.
   Looks like a URL bar with the prefix grayed out.
   ------------------------------------------------------------------ */
.try-input-group {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.15s;
}

/* Highlight border when the input is focused */
.try-input-group:focus-within {
    border-color: var(--accent-subtle);
}

/* "info.md/~" prefix — non-selectable, muted text */
.try-prefix {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-muted);
    padding-left: 12px;
    user-select: none;
}

.try-input-group input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-primary);
    padding: 10px 4px;
    min-width: 0;             /* allow flex item to shrink below content size */
}

.try-input-group input::placeholder {
    color: var(--text-muted);
}

/* Blinking cursor effect on focused empty try-it input */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.try-input-group input:focus::placeholder {
    animation: blink 1.2s step-end infinite;
}

/* Arrow (→) go button */
.try-input-group button {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 1.125rem;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.try-input-group button:hover {
    background: var(--bg-tertiary);
}

/* Column headings — monospace, same weight as landing-title */
.landing-col-title {
    font-family: var(--font-mono);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

/* Small hint text */
.landing-col-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 16px;
}

.landing-col-hint a {
    color: var(--text-secondary);
}


/* --- Join page content (developer onboarding) ---
   Single-column layout with message + setup steps.
   No search form, no two-column grid. Dev-focused. */
.join-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xl);
}

.join-message {
    max-width: 640px;
}

.join-message p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 16px;
}

.join-message em {
    color: var(--text-primary);
    font-style: italic;
}

.join-setup {
    max-width: 540px;
}


/* === HIRE PAGE (recruiter landing) ==================================
   /hire — professional copy, search-forward, featured profiles.
   Uses .page-content container + .topbar (shared with all pages).
   =================================================================== */
.hire-main {
    flex: 1;
    padding: 40px 0;
}

.hire-hero {
    margin-bottom: 56px;
}

.hire-title {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.hire-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 32px;
    max-width: 640px;
    line-height: 1.6;
}

/* Section headings within hire page */
.hire-section-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* --- Featured profiles grid --- */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.featured-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.featured-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-subtle);
    text-decoration: none;
    box-shadow: inset 3px 0 0 var(--accent);
}

.featured-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-tertiary);
}

.featured-name {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.featured-title {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.featured-location {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.featured-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin-top: 4px;
}

/* --- How it works steps --- */
.hire-how-it-works {
    margin-top: 48px;
}

.hire-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

/* .hire-step-num consolidated into .num-badge + .num-badge-lg above */

.hire-step strong {
    display: block;
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.hire-step p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.hire-featured {
    margin-bottom: 48px;
}

/* --- FAQ (on /join) --- */
.join-faq {
    margin-top: 48px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.faq-item {
    background: var(--bg-secondary);
}

.faq-question {
    padding: 16px 20px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-primary);
    list-style: none;
}

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

.faq-question::before {
    content: ">";
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    color: var(--text-muted);
    margin-right: 12px;
    display: inline-block;
    transition: transform 0.15s ease;
}

details[open] > .faq-question::before {
    transform: rotate(90deg);
}

.faq-answer {
    padding: 0 20px 16px 36px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.faq-answer a {
    color: var(--accent);
}

/* === SYNTAX REFERENCE PAGE =========================================
   /syntax — side-by-side markdown source + rendered output.
   Each syntax section has a .syntax-pair grid (source | rendered).
   Ends with a full starter template users can copy.
   =================================================================== */
/* syntax-page wrapper no longer needed — page-content handles shell */

.syntax-main {
    flex: 1;
    max-width: 820px;
    padding: 40px 0;
    width: 100%;
}

.syntax-title {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.syntax-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 40px;
}

.syntax-section {
    margin-bottom: 36px;
}

/* Section headings styled as small uppercase labels (like GitHub settings) */
.syntax-section h2 {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* Side-by-side grid: markdown source on left, rendered output on right.
   The 1px gap + border-colored background creates a visual divider
   between the two panes without a separate border element. */
.syntax-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);  /* visible through the 1px gap as a divider */
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

/* Left pane: raw markdown source */
.syntax-source {
    background: var(--bg-secondary);
    padding: 16px;
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-secondary);
    overflow-x: auto;
    border: none;              /* override <pre> defaults */
    border-radius: 0;
}

/* Reset the global <code> styles inside source panes */
.syntax-source code {
    font-family: inherit;
    font-size: inherit;
    background: none;
    padding: 0;
    color: inherit;
}

/* Right pane: rendered HTML output */
.syntax-rendered {
    background: var(--bg-primary);
    padding: 16px;
}

/* Scale down heading sizes inside the small rendered pane */
.syntax-rendered.markdown-body {
    font-size: 14px;
}

.syntax-rendered.markdown-body h1 {
    font-size: 1.5em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3em;
}

.syntax-rendered.markdown-body h2 {
    font-size: 1.25em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3em;
}

.syntax-rendered.markdown-body h3 {
    font-size: 1.1em;
}

/* "Copy this into your info.md" hint above the starter template */
.syntax-hint {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* Starter template block — full-width, not split into a pair */
.syntax-template {
    border: 1px solid var(--border);
    border-radius: 0 0 8px 8px;
    padding: 20px;
}

/* Header row above the starter template: hint text + copy button */
.syntax-template-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 10px 16px;
}

.syntax-template-header .syntax-hint {
    margin-bottom: 0;
}

/* Copy-to-clipboard button */
.copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 12px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.copy-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-subtle);
    background: var(--bg-tertiary);
}


/* === SEARCH PAGE =====================================================
   /search — find profiles by tag and location.
   Layout: topbar + centered form + result cards list.
   =================================================================== */
/* search-page wrapper no longer needed — page-content handles shell */

.search-main {
    flex: 1;
    max-width: 720px;
    padding: 40px 0;
    width: 100%;
}

.search-title {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.search-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 32px;
}

/* --- Search form (v2) ---
   Redesigned form with text inputs + availability filter chips.
   Stacks vertically on mobile (see responsive section). */
.search-form-v2 {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.search-form-v2 .search-row {
    display: flex;
    gap: 12px;
}

.search-form-v2 .search-btn {
    align-self: flex-start;
}

/* --- Search form (original — used on landing page) --- */
.search-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 24px;
}

/* --- Filter chips (availability toggles) --- */
.search-filters {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-chip {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.filter-chip-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.filter-chip-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    transition: all 0.15s;
}

.filter-chip:hover .filter-chip-label {
    border-color: var(--accent-subtle);
    color: var(--text-primary);
}

.filter-chip-active .filter-chip-label,
.filter-chip-input:checked + .filter-chip-label {
    background: var(--badge-open-bg);
    border-color: var(--badge-open-border);
    color: var(--accent);
}

.search-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.search-label {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Keyboard shortcut hint badge next to search label */
.search-kbd {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.625rem;
    line-height: 1;
    padding: 1px 5px;
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    text-transform: none;
    letter-spacing: 0;
    vertical-align: middle;
    margin-left: 4px;
}

.search-field::after {
    content: '>';
    position: absolute;
    left: 10px;
    bottom: 9px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-field input {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px 8px 24px;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
}

.search-field input:focus {
    border-color: var(--accent-subtle);
}

.search-field input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    background: var(--accent-subtle);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 8px 20px;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

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

/* --- Empty state (no search performed) --- */
.search-empty {
    margin-bottom: 24px;
}

.search-browse {
    margin-top: 24px;
}

.search-browse-label {
    font-size: 13px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.search-browse-tags {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge-link {
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}

.badge-link:hover {
    background: var(--bg-tertiary);
}

/* --- Results status --- */
.search-status {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* --- Result cards ---
   Stacked list with 1px gap dividers (same technique as .syntax-pair).
   Each card is a clickable <a> linking to /~username.
   Redesigned for professional/recruiter-friendly appearance. */
.search-results {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.search-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: var(--bg-secondary);
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s;
}

.search-card:hover {
    background: var(--bg-tertiary);
    text-decoration: none;
    box-shadow: inset 3px 0 0 var(--accent);
}

.search-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.search-card-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

/* Header row: name on left, availability badges on right */
.search-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.search-card-name {
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.search-card-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.search-card-location {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* User-written summary shown below location in search result cards */
.search-card-summary {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 2px;
}

.search-card-tags,
.search-card-open-to {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}


/* === PROFILE PAGE ==================================================
   /~username — the core viewer page. Uses the shared topbar +
   page-content (960px) container, with sidebar + content inside.
   ================================================================== */

/* --- Top bar ---
   Unified sticky header used on every page. Full-bleed background
   with a centered inner container (960px) that matches page-content.
   Contains: logo (left) + optional nav link + theme toggle + extras (right). */
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-top: 2px solid var(--accent);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    display: flex;
    align-items: center;
    height: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    gap: var(--space-xs);
}

.topbar .logo {
    font-size: 0.9375rem;
}

/* Center nav links (Search, Join) — always visible */
.topbar-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Right-aligned controls (theme toggle + GitHub link) */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
}

/* Nav link inside topbar — bordered pill style */
.topbar-nav-link {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.15s;
    white-space: nowrap;
}

.topbar-nav-link:hover {
    color: var(--text-primary);
    border-color: var(--accent-subtle);
    text-decoration: none;
}

/* Active/current page nav link — muted "you are here" */
.topbar-nav-active {
    color: var(--text-muted);
    border-color: transparent;
    cursor: default;
}

.topbar-nav-active:hover {
    color: var(--text-muted);
    border-color: transparent;
    text-decoration: none;
}

/* --- Theme toggle button ---
   Shows sun icon in dark mode (click → switch to light)
   and moon icon in light mode (click → switch to dark).
   Visibility is controlled by data-theme on <html>. */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* Both icons hidden by default — the active one is shown via data-theme */
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    display: none;
}

/* Dark mode → show sun (click to go light) */
html[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

/* Light mode → show moon (click to go dark) */
html[data-theme="light"] .theme-toggle .icon-moon {
    display: block;
}

/* GitHub link icon in the topbar */
.topbar-link {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    padding: 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.topbar-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    text-decoration: none;
}

/* --- Profile body: sidebar + content side by side --- */
.profile-body {
    display: flex;
    flex: 1;
}

/* --- Sidebar ---
   Fixed-width left column with: avatar, @username, job title,
   location, "open to" badges (blue), skill tag badges (gray),
   and a link to the source repo. All fields are optional —
   the template conditionally renders each based on frontmatter. */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    padding: 24px 0;
    padding-right: 24px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Circular GitHub avatar (fetched from github.com/<username>.png) */
.sidebar-avatar {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-tertiary); /* placeholder while loading */
}

.sidebar-username {
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.sidebar-username:hover {
    color: var(--accent);
}

/* Job title from frontmatter (e.g. "Senior Engineer") */
.sidebar-title {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.4;
}

/* Location with pin icon (e.g. "📍 New York, NY") */
.sidebar-location {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* AI-generated summary — italic, smaller, centered in sidebar */
.sidebar-summary {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.5;
    font-style: italic;
    padding: 8px 0 4px;
    border-top: 1px solid var(--border);
    width: 100%;
}

/* Small uppercase labels for "Open to" and "Tags" sections */
.sidebar-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

/* Purple tint for the AI-detected label */
.sidebar-label svg {
    color: var(--badge-ai-text);
}

.sidebar-open-to,
.sidebar-tags {
    width: 100%;
    padding-top: 4px;
}

/* Flex container for badge pills */
.sidebar-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* Base badge style — monospace pill shape */
.badge {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

/* Blue accent badges for "open to" availability (full-time, contract, etc.) */
.badge-open {
    background: var(--badge-open-bg);
    color: var(--accent);
    border: 1px solid var(--badge-open-border);
}

/* Gray badges for skill tags (python, react, aws, etc.) */
.badge-tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* Purple dashed badges for AI-inferred tags (detected from resume text) */
.badge-ai {
    background: var(--badge-ai-bg);
    color: var(--badge-ai-text);
    border: 1px dashed var(--badge-ai-border);
}

/* Tag visual hierarchy — first 4 tags are prominent, rest fade back */
.sidebar-badges .badge-tag:nth-child(n+5) {
    opacity: 0.55;
}

.search-card-tags .badge-tag:nth-child(n+5) {
    opacity: 0.55;
}

/* Link to the user's info.md repo on GitHub */
.sidebar-repo-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.sidebar-repo-link:hover {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    text-decoration: none;
}

/* --- Content area ---
   Main column where the rendered markdown resume is displayed.
   Uses github-markdown-css (from CDN) inside .markdown-body.
   Inside the 960px page-content, so no max-width needed — it
   just fills the space next to the sidebar. */
.profile-content {
    flex: 1;
    min-width: 0;             /* prevent flex overflow with long content */
    padding: 32px 40px;
}

/* Override github-markdown-css's own background color so it inherits
   our theme's --bg-primary instead of its hardcoded value */
.markdown-body {
    background: transparent !important;
    font-size: 15px;
}


/* === STATS PAGE ====================================================
   Community stats — aggregate data cards, bar charts, badge rows
   =================================================================== */

.stats-main {
    flex: 1;
    padding: 40px 0;
}

.stats-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.stats-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 32px;
}

/* Top-level number cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-card-highlight {
    border-color: var(--accent);
}

.stat-number {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card-highlight .stat-number {
    color: var(--accent);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Sections (Top Skills, Top Locations) */
.stats-section {
    margin-bottom: 32px;
}

.stats-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* Horizontal bar chart rows */
.stats-bar-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stats-bar-row {
    display: grid;
    grid-template-columns: 140px 1fr 40px;
    align-items: center;
    gap: 12px;
}

.stats-bar-label {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-bar-track {
    height: 20px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.stats-bar-fill {
    height: 100%;
    background: var(--border);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.stats-bar-top {
    background: var(--accent);
}

.stats-bar-count {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: right;
}

/* Open-to badges row */
.stats-badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stats-badge-count {
    font-weight: 700;
    margin-left: 4px;
    opacity: 0.7;
}

/* Stack section — open source tools grid */
.stats-stack-intro {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.stats-stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-sm);
}

.stats-stack-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    transition: border-color 0.15s;
}

.stats-stack-item:hover {
    border-color: var(--text-muted);
    text-decoration: none;
}

.stats-stack-item strong {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent);
}

.stats-stack-item span {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* === COMMAND PALETTE (⌘K) ==========================================
   Full-screen overlay with centered modal. Keyboard-navigable list
   of all pages. Triggered by Cmd+K / Ctrl+K.
   =================================================================== */
.cmd-palette-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20vh;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.cmd-palette-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.cmd-palette-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.cmd-palette-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cmd-palette-kbd {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
}

.cmd-palette-list {
    padding: 8px;
}

.cmd-palette-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.1s;
}

.cmd-palette-item:hover {
    background: var(--bg-tertiary);
}

.cmd-palette-item-active {
    background: var(--bg-tertiary);
}

.cmd-palette-item-active .cmd-palette-item-name {
    color: var(--accent);
}

.cmd-palette-item-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.cmd-palette-item-route {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* === RESPONSIVE ====================================================
   Breakpoints:
   - 768px: landing columns stack, sidebar collapses, syntax pairs stack
   - 480px: tighter padding
   =================================================================== */
@media (max-width: 768px) {
    /* Stats grid: 2x2 on tablet */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Bar chart labels shrink */
    .stats-bar-row {
        grid-template-columns: 100px 1fr 36px;
        gap: 8px;
    }

    /* Syntax pairs stack vertically (source above, rendered below) */
    .syntax-pair {
        grid-template-columns: 1fr;
    }

    /* Profile layout stacks: sidebar on top, content below */
    .profile-body {
        flex-direction: column;
    }

    /* Sidebar stacks vertically on mobile — compact centered card */
    .sidebar {
        width: 100%;
        min-width: 0;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 20px 0;
    }

    /* Shrink avatar for stacked layout */
    .sidebar-avatar {
        width: 80px;
        height: 80px;
    }

    .profile-content {
        padding: 24px 0;
    }

    .landing-title {
        font-size: 1.375rem;
    }

    /* Search forms stack vertically on tablet/mobile */
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form-v2 .search-row {
        flex-direction: column;
    }

    .search-btn {
        align-self: flex-start;
    }

    /* Stack card header vertically on mobile */
    .search-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    /* Featured grid: 2 columns on tablet, 1 on mobile */
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hire-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding: 0 var(--space-md);
    }

    .topbar-inner {
        padding: 0 var(--space-md);
    }

    .landing-title {
        font-size: 1.25rem;
    }

    .profile-content {
        padding: 20px 0;
    }

    .featured-grid {
        grid-template-columns: 1fr;
    }

    /* Stats: single column on small mobile */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stats-bar-row {
        grid-template-columns: 80px 1fr 32px;
        gap: 6px;
    }

    .stats-bar-label {
        font-size: 0.75rem;
    }

    /* Command palette: tighter padding on small screens */
    .cmd-palette-overlay {
        padding-top: 10vh;
        padding-left: 12px;
        padding-right: 12px;
    }

    .cmd-palette-modal {
        border-radius: 10px;
    }

    .cmd-palette-item {
        padding: 8px 10px;
    }

    /* Topbar nav: tighter gap */
    .topbar-nav {
        gap: 12px;
    }

    .topbar-nav-link {
        font-size: 0.8125rem;
    }
}

/* === 404 PAGE =====================================================
   Not-found page — hint box for users who just set up their repo.
   =================================================================== */
.not-found-hint {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.5;
}

.not-found-retry {
    display: inline-block;
    margin-left: 8px;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--accent);
    padding: 2px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.15s;
    text-decoration: none;
}

.not-found-retry:hover {
    border-color: var(--accent-subtle);
    background: var(--bg-tertiary);
    text-decoration: none;
}

.not-found-setup-heading {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.not-found-explore {
    margin-top: 32px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.not-found-explore a {
    color: var(--accent);
}

/* === LEGAL PAGES (privacy, terms) ==================================
   /privacy, /terms — plain-language legal text with readable widths.
   Uses the shared page-content container.
   =================================================================== */
.legal-main {
    flex: 1;
    max-width: 680px;
    padding: 40px 0;
}

.legal-main h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.legal-updated {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.legal-main h2 {
    font-size: 1.125rem;
    margin-top: 32px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.legal-main h3 {
    font-size: 0.9375rem;
    margin-top: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.legal-main p,
.legal-main ul,
.legal-main ol {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.legal-main ul,
.legal-main ol {
    padding-left: 24px;
}

.legal-main li {
    margin-bottom: 6px;
}

.legal-main a {
    color: var(--accent);
}

.legal-main code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
}

.footer-legal {
    font-size: 0.75rem;
    margin-top: 8px;
}

.footer-legal a {
    color: var(--text-muted);
}

/* Footer badge links — tag-style pills for CTAs */
.footer-badges {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.badge-footer {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    text-decoration: none;
}

button.badge-footer {
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

.badge-footer kbd {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    opacity: 0.7;
}

.badge-footer:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}
