/* Pixel-perfect minimal design for A2A Guides */

:root {
    --bg: #f6f6f6;
    --ink: #222;
    --muted: #666;
    --border: #111;
    --card: #fff;
    --accent: #0b66ff;
    --accent-bg: #e9eefc;
    --hover-bg: #f0f0f0;
}

/* Reset and base styles */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 14px;
    line-height: 1.6;
    letter-spacing: 0.01em;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 20px 0;
    letter-spacing: -0.01em;
}

h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 30px 0 15px 0;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

p {
    margin: 0 0 12px 0;
    color: var(--muted);
}

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

a:hover {
    color: var(--ink);
    text-decoration: underline;
}

/* Site header */
.site-header {
    position: sticky;
    top: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation tabs */
.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 4px 0;
}

.tab {
    padding: 6px 10px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--ink);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 2px 2px 0 0 var(--border);
    transition: all 0.1s ease;
    cursor: pointer;
    border-radius: 0;
}

.tab:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 0 var(--border);
    background: var(--hover-bg);
    text-decoration: none;
    color: var(--ink);
}

.tab.active {
    background: var(--accent);
    color: white;
    box-shadow: 2px 2px 0 0 var(--border);
}

.tab.active:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 0 var(--border);
    background: var(--accent);
}

/* Main content */
main {
    padding: 40px 0;
}

.tag-section {
    margin-bottom: 60px;
}

.tag-section:first-of-type {
    margin-top: 0;
}

/* Responsive grid layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* Card styles */
.card {
    border: 1px solid var(--border);
    background: var(--card);
    padding: 16px;
    box-shadow: 4px 4px 0 0 var(--border);
    transition: all 0.1s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 0 var(--border);
}

.card h3 {
    margin-bottom: 8px;
}

.card h3 a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 500;
}

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

.card p {
    flex-grow: 1;
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 12px;
}

/* Badge styles */
.badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: auto;
}

.badge {
    border: 1px solid var(--border);
    background: var(--accent-bg);
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 500;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

/* Focus styles for keyboard navigation */
.tab:focus,
.card a:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .site-header {
        padding: 16px 0;
    }

    h1 {
        font-size: 20px;
        margin-bottom: 16px;
    }

    h2 {
        font-size: 16px;
        margin-top: 24px;
        margin-bottom: 12px;
    }

    .tabs {
        gap: 6px;
    }

    .tab {
        padding: 4px 8px;
        font-size: 11px;
    }

    main {
        padding: 24px 0;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .card {
        padding: 12px;
    }

    .card p {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    html, body {
        font-size: 13px;
    }

    h1 {
        font-size: 18px;
    }

    .tab {
        font-size: 10px;
        padding: 3px 6px;
    }

    .card {
        padding: 10px;
    }
}

/* Print styles */
@media print {
    .site-header {
        position: static;
        box-shadow: none;
        border-bottom: 1px solid #ccc;
    }

    .tabs {
        display: none;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    .card:hover {
        transform: none;
        box-shadow: none;
    }
}