/* =========================================
   TechToolKit — Developer-Grade Design
   ========================================= */

:root {
    --bg: #0d1117;
    --bg2: #161b22;
    --bg3: #1c2128;
    --bg4: #21262d;
    --border: #30363d;
    --text: #e6edf3;
    --text2: #8b949e;
    --text3: #484f58;
    --accent: #58a6ff;
    --accent-dim: rgba(88, 166, 255, 0.1);
    --green: #3fb950;
    --green-dim: rgba(63, 185, 80, 0.1);
    --yellow: #d29922;
    --yellow-dim: rgba(210, 153, 34, 0.1);
    --orange: #f0883e;
    --red: #f85149;
    --red-dim: rgba(248, 81, 73, 0.1);
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */
header {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text);
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text2);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.15s;
}

.nav-links a:hover {
    color: var(--accent);
}

/* ── Main ── */
main {
    flex: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

/* ── Homepage ── */
.hero-home {
    text-align: center;
    padding: 3rem 1rem 2.5rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--text), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-home p {
    color: var(--text2);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.search-hint {
    display: inline-block;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    color: var(--text2);
}

/* ── Category Section ── */
.category-section {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.category-section h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.count {
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2px 8px;
    color: var(--text2);
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.5rem;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.15s ease;
}

.tool-card:hover {
    border-color: var(--accent);
    background: var(--bg3);
    transform: translateX(2px);
}

.tool-badge {
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg4);
    border: 1px solid var(--border);
    color: var(--text2);
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-green {
    background: var(--green-dim);
    color: var(--green);
    border-color: var(--green);
}

.badge-yellow {
    background: var(--yellow-dim);
    color: var(--yellow);
    border-color: var(--yellow);
}

.badge-orange {
    background: rgba(240, 136, 62, 0.1);
    color: var(--orange);
    border-color: var(--orange);
}

.badge-red {
    background: var(--red-dim);
    color: var(--red);
    border-color: var(--red);
}

.tool-title {
    font-size: 0.875rem;
    color: var(--text);
    line-height: 1.3;
}

/* ── Tool Page ── */
.tool-hero {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.breadcrumb {
    font-size: 0.8rem;
    color: var(--text3);
    margin-bottom: 0.75rem;
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.tool-hero h1 {
    font-size: 1.9rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
}

.intro {
    color: var(--text2);
    font-size: 1rem;
    max-width: 680px;
}

.meta {
    font-size: 0.78rem;
    color: var(--text3);
    margin-top: 0.5rem;
}

/* ── Reference Section ── */
.reference-section {
    margin-bottom: 2rem;
}

.reference-section h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 1.75rem 0 0.75rem;
    color: var(--text);
}

.quick-facts {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.fact-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1.25rem;
    min-width: 130px;
}

.fact-card.highlight {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.fact-card.highlight.error {
    border-color: var(--red);
    background: var(--red-dim);
}

.fact-card.highlight.warn {
    border-color: var(--yellow);
    background: var(--yellow-dim);
}

.fact-card.highlight.ok {
    border-color: var(--green);
    background: var(--green-dim);
}

.fact-card .label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text2);
    margin-bottom: 0.25rem;
}

.fact-card .value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
}

.fact-card .value.mono {
    font-family: var(--mono);
}

/* ── Lists ── */
.use-cases,
.steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.use-cases li::before {
    content: "→ ";
    color: var(--accent);
}

.steps {
    counter-reset: step;
}

.steps li {
    counter-increment: step;
    padding-left: 0.25rem;
}

.steps li::before {
    content: counter(step) ". ";
    color: var(--accent);
    font-weight: 600;
}

/* ── Code Blocks ── */
pre {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    overflow-x: auto;
    margin: 0.5rem 0;
}

code {
    font-family: var(--mono);
    font-size: 0.875rem;
    color: var(--green);
}

pre code {
    color: var(--text);
}

kbd {
    font-family: var(--mono);
    font-size: 0.8rem;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    color: var(--text);
}

/* ── Tables ── */
.cli-table-wrap,
.conversion-table-wrap {
    overflow-x: auto;
}

.cli-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.cli-table th {
    background: var(--bg3);
    border: 1px solid var(--border);
    padding: 0.6rem 0.85rem;
    text-align: left;
    color: var(--text2);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cli-table td {
    border: 1px solid var(--border);
    padding: 0.55rem 0.85rem;
    vertical-align: top;
    color: var(--text);
}

.cli-table tr:hover td {
    background: var(--bg3);
}

/* ── Tip Box ── */
.tip-box {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--yellow);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    color: var(--text2);
    font-size: 0.9rem;
    margin: 1rem 0;
}

.tip-box.dev {
    border-left-color: var(--accent);
}

/* ── Tag List ── */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag {
    font-size: 0.8rem;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 3px 8px;
    color: var(--accent);
    text-decoration: none;
    transition: all 0.15s;
}

.tag:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
}

/* ── Pros / Cons ── */
.pros-cons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.pros-box,
.cons-box {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

.pros-box h3 {
    color: var(--green);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.cons-box h3 {
    color: var(--red);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.pros-box li,
.cons-box li {
    font-size: 0.875rem;
    list-style: none;
    padding: 0.2rem 0;
    color: var(--text2);
}

/* ── FAQ ── */
.faq-section {
    margin-top: 2.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.faq-section h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.faq-item {
    margin-bottom: 1.25rem;
}

.faq-item h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--accent);
}

.faq-item p {
    font-size: 0.9rem;
    color: var(--text2);
}

/* ── Ad Slots ── */
.ad-slot {
    background: var(--bg2);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    margin: 1.5rem 0;
    text-align: center;
    min-height: 90px;
}

/* ── Footer ── */
footer {
    background: var(--bg2);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8rem;
    color: var(--text3);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem;
    }

    .tool-hero h1 {
        font-size: 1.5rem;
    }

    .pros-cons-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
    }

    main {
        padding: 1rem;
    }
}