/* Copyright (c) 2026. Jericho Crosby (Chalwk) */

/* Core styles for the whole site. Variables below control most of the color/spacing stuff. */
:root {
    --bg: #0b0e14;
    --bg-elevated: #141922;
    --surface: #1a2029;
    --surface-hover: #222a35;

    --border: #2a3341;
    --border-strong: #3d4756;

    --text: #e6edf3;
    --text-muted: #8b949e;
    --text-faint: #6e7681;

    --accent: #5b8731;
    --accent-hover: #7aad42;
    --accent-soft: rgba(91, 135, 49, 0.14);
    --success: #3fb950;
    --warning: #d29922;
    --danger: #f85149;
    --purple: #bc8cff;

    /* syntax highlighting (also see `./assets/css/syntax.css`) */
    --code-type: #f0883e;
    --code-func: #d2a8ff;
    --code-attr: #79c0ff;

    --container: 1100px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-sm: 6px;

    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono",
        Menlo, Consolas, "Liberation Mono", monospace;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --transition: 150ms ease;
}

/* Reset/page shell. */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
svg {
    max-width: 100%;
    height: auto;
}

/* Typography. */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 1.6em 0 0.6em;
    color: var(--text);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.015em;
}

h1 {
    font-size: 2.25rem;
}

h2 {
    font-size: 1.6rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.05rem;
}

p {
    margin: 0 0 1.1em;
}

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

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}

strong {
    color: var(--text);
    font-weight: 600;
}

em {
    font-style: italic;
}

hr {
    margin: 2.5em 0;
    border: 0;
    border-top: 1px solid var(--border);
}

blockquote {
    margin: 1.5em 0;
    padding: 0.8em 1.2em;
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-muted);
}

blockquote p:last-child {
    margin-bottom: 0;
}

/* Layout helpers. */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* Main content area. */
.site-main {
    flex: 1 0 auto;
    padding-bottom: 80px;
}

/* Accessibility skip link. */
.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    padding: 10px 16px;
    background: var(--accent);
    color: var(--bg);
    border-radius: var(--radius-sm);
    font-weight: 600;
    z-index: 1000;
}

.skip-link:focus {
    top: 16px;
}

/* Sticky header. */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 14, 20, 0.82);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 62px;
}

/* Brand block in the header. */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text);
    font-size: 1rem;
}

.brand:hover {
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 15px;
}

.brand-name {
    font-family: var(--font-mono);
    letter-spacing: -0.01em;
}

/* Primary navigation. */
.site-nav {
    display: flex;
    gap: 26px;
    align-items: center;
}

.site-nav a {
    color: var(--text-muted);
    font-size: 0.93rem;
    font-weight: 500;
}

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

.nav-external {
    color: var(--accent) !important;
}

/* Tools dropdown. It uses <details> so it works without JavaScript. Woo! */
.nav-dropdown {
    position: relative;
}

.nav-dropdown>summary.nav-dropdown-toggle {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    color: var(--text-muted);
    font-size: 0.93rem;
    font-weight: 500;
    user-select: none;
    transition: color var(--transition);
}

.nav-dropdown>summary.nav-dropdown-toggle::-webkit-details-marker {
    display: none;
}

.nav-dropdown>summary.nav-dropdown-toggle::marker {
    content: "";
}

.nav-dropdown-caret {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: 0.65;
    transition: transform var(--transition);
}

.nav-dropdown[open] .nav-dropdown-caret {
    transform: rotate(180deg);
}

.nav-dropdown>summary.nav-dropdown-toggle:hover,
.nav-dropdown[open]>summary.nav-dropdown-toggle {
    color: var(--text);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    min-width: 220px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 200;
}

.nav-dropdown-menu::before {
    content: "";
    position: absolute;
    top: -14px;
    left: 0;
    right: 0;
    height: 14px;
}

.nav-dropdown-menu a {
    display: block;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
}

.nav-dropdown-menu a:hover {
    color: var(--text);
    background: var(--surface-hover);
    text-decoration: none;
}

/* Home page hero. */
.hero {
    padding: 88px 0 56px;
    text-align: center;
}

.hero-eyebrow {
    display: inline-block;
    padding: 5px 12px;
    margin-bottom: 20px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.hero h1 {
    margin: 0 0 16px;
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.hero h1 .accent {
    background: linear-gradient(120deg, var(--accent) 0%, var(--purple) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-lede {
    max-width: 620px;
    margin: 0 auto 32px;
    color: var(--text-muted);
    font-size: 1.08rem;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons. */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.94rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.btn:hover {
    text-decoration: none;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

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

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

.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

/* Generic section wrapper. */
.section {
    margin-top: 24px;
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.section-head h2 {
    margin: 0;
    font-size: 1.35rem;
}

.section-head .section-meta {
    color: var(--text-faint);
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

/* Plugin card grid. */
.script-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 18px;
}

/* Plugin card. */
.script-card {
    display: flex;
    flex-direction: column;
    padding: 22px 22px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition), transform var(--transition),
        background var(--transition);
}

.script-card:hover {
    border-color: var(--border-strong);
    background: var(--surface-hover);
    transform: translateY(-2px);
}

.script-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.script-card-name {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.script-card-name a {
    color: inherit;
}

.script-card-name a:hover {
    color: var(--accent);
    text-decoration: none;
}

.script-card-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.category-badge {
    flex-shrink: 0;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.version-badge {
    flex-shrink: 0;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
}

.script-card-desc {
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 0.93rem;
    line-height: 1.55;
}

.script-card-features {
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.script-card-features li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 5px;
}

.script-card-features li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-family: var(--font-mono);
}

.script-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.script-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    padding: 2px 9px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

/* Long form text pages. */
.prose {
    max-width: 760px;
    margin: 48px auto 0;
}

/* Page title block. */
.page-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    margin: 0;
    font-size: 2rem;
}

.page-subtitle {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 1.02rem;
}

/* Breadcrumb trail on plugin pages. */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 32px 0 24px;
    font-size: 0.88rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

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

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

.breadcrumb-sep {
    color: var(--text-faint);
}

/* Plugin detail page. */
.script-detail {
    max-width: 1040px;
    margin: 0 auto;
}

.script-detail-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.script-detail-title {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.script-detail-title h1 {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 1.85rem;
    letter-spacing: -0.02em;
}

.script-detail-lede {
    margin: 0 0 20px;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.script-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.script-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.script-detail .prose {
    max-width: none;
    margin: 0;
}

/* Metadata list on plugin pages. */
.plugin-meta {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 16px;
    margin: 18px 0 0;
    font-size: 0.9rem;
}

.plugin-meta dt {
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-top: 2px;
}

.plugin-meta dd {
    margin: 0;
    color: var(--text);
}

.prose h2 {
    margin-top: 2.2em;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.prose ul,
.prose ol {
    padding-left: 1.4em;
    margin: 0 0 1.2em;
}

.prose li {
    margin-bottom: 0.4em;
}

.prose li::marker {
    color: var(--accent);
}

/* Code blocks. */
code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--accent-hover);
}

pre {
    margin: 1.4em 0;
    padding: 16px 18px;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) var(--bg);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.82rem;
    line-height: 1.55;
}

pre::-webkit-scrollbar {
    height: 10px;
}

pre::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 5px;
}

pre::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 5px;
}

pre::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

pre code {
    padding: 0;
    background: none;
    border: 0;
    color: var(--text);
    font-size: inherit;
}

.highlight {
    margin: 1.4em 0;
    border-radius: var(--radius);
    overflow: hidden;
}

.highlight pre {
    margin: 0;
    border: 0;
    border-radius: 0;
}

/* Tables. */
table {
    width: 100%;
    margin: 1.4em 0;
    border-collapse: collapse;
    font-size: 0.92rem;
}

th,
td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-elevated);
    color: var(--text);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

tr:hover td {
    background: var(--bg-elevated);
}

/* Footer. */
.site-footer {
    flex-shrink: 0;
    padding: 28px 0;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
    font-size: 0.88rem;
    color: var(--text-faint);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}

.footer-brand {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-weight: 500;
}

.footer-sep {
    margin: 0 8px;
    opacity: 0.5;
}

.footer-right a {
    margin-left: 20px;
    color: var(--text-muted);
}

.footer-right a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* Utility class stuff. */
.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

.mono {
    font-family: var(--font-mono);
}

/* Responsive stuff. */
@media (max-width: 720px) {
    .container {
        padding: 0 18px;
    }

    .site-nav {
        gap: 18px;
    }

    .site-nav a {
        font-size: 0.88rem;
    }

    .hero {
        padding: 60px 0 40px;
    }

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

    .script-card-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .script-detail-title h1 {
        font-size: 1.5rem;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .footer-right a {
        margin: 0 10px;
    }
}

@media (max-width: 480px) {
    .brand-name {
        display: none;
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}