/* V5 Compact Table Style - IBM Plex Mono aesthetic */

:root {
    --text: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --bg: #fff;
    --code-bg: #f5f5f5;
    --border: #eee;
    --max-width: 720px;

    /* Muted Breakout palette */
    --color-startups: #5a9ea6;
    --color-agi: #3d5a8b;
    --color-emotions: #6b4a7a;
    --color-community: #6b8e5a;
    --color-stanford: #8C1515;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
    color: #333;
    background: var(--bg);
    margin: 0;
    padding: 2rem 1rem;
}

main {
    max-width: var(--max-width);
    margin: 0 auto;
}

/* Navigation */
nav {
    margin-bottom: 1.5rem;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
}

nav a:hover {
    color: var(--text);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    line-height: 1.3;
    margin: 1.5em 0 0.5em;
    font-weight: 600;
    color: #000;
    letter-spacing: -0.3px;
}

h1 {
    font-size: 28px;
    margin-top: 0;
    margin-bottom: 2rem;
    letter-spacing: -0.5px;
}

h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4, h5, h6 { font-size: 16px; }

p {
    margin: 1em 0;
}

/* Links */
a {
    color: hsl(258, 88%, 66%);
    text-decoration: underline;
}

a:visited {
    color: hsl(258, 88%, 66%);
}

a:hover {
    color: hsl(258, 88%, 76%);
}

.broken-link {
    color: var(--text-secondary);
    border-bottom: 1px dashed var(--border);
    text-decoration: none;
}

/* Lists */
ul, ol {
    padding-left: 1.5em;
    margin: 1em 0;
}

li {
    margin: 0.5em 0;
}

/* Code */
code {
    font-family: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;
    font-size: 0.95em;
    background: var(--code-bg);
    padding: 0.15em 0.4em;
    border-radius: 3px;
}

pre {
    background: var(--code-bg);
    padding: 1em;
    overflow-x: auto;
    border-radius: 4px;
    margin: 1em 0;
    font-size: 12px;
}

pre code {
    padding: 0;
    background: none;
}

/* Code block with copy button */
.code-block {
    position: relative;
    margin: 1em 0;
}

.code-block pre {
    margin: 0;
}

.copy-btn {
    position: absolute;
    top: 0.5em;
    right: 0.5em;
    padding: 0.25em 0.5em;
    font-size: 11px;
    font-family: 'IBM Plex Mono', monospace;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    cursor: pointer;
    opacity: 0.7;
}

.copy-btn:hover {
    opacity: 1;
    background: var(--code-bg);
}

/* Blockquotes */
blockquote {
    margin: 1em 0;
    padding: 0.75em 1em;
    border-left: 3px solid var(--color-emotions);
    background: #fafafa;
    color: var(--text-secondary);
}

blockquote p {
    margin: 0.5em 0;
}

blockquote p:first-child {
    margin-top: 0;
}

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

/* Images */
img {
    max-width: 100%;
    height: auto;
}

/* Large images get block display with margin */
img:not([width]), img[width="400"], img[width="300"], img[width="200"] {
    display: block;
    margin: 1em 0;
}

/* Small images (avatars) stay inline */
img[width="40"], img[width="80"], img[width="60"], img[width="50"] {
    display: inline;
    vertical-align: middle;
    margin-right: 0.5em;
    border-radius: 50%;
}

/* Horizontal rule */
hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2em 0;
}

/* iframes and videos */
iframe {
    border: none;
    max-width: 100%;
}

/* Strong and emphasis */
strong {
    font-weight: 600;
}

em {
    font-style: italic;
}

/* Category tags - for use in start-here and similar */
.tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tag-startups { background: var(--color-startups); }
.tag-agi { background: var(--color-agi); }
.tag-emotions { background: var(--color-emotions); }
.tag-community { background: var(--color-community); }
.tag-stanford { background: var(--color-stanford); }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

th, td {
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

/* First column (tags) */
td:first-child {
    padding: 10px 16px 10px 0;
    width: 90px;
}

/* Content column */
td:last-child {
    padding: 10px 0;
}

th {
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 10px 16px 10px 0;
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 1rem;
        font-size: 15px;
    }

    h1 {
        font-size: 22px;
        margin-bottom: 1.5rem;
    }

    nav a {
        font-size: 14px;
    }

    /* Stack table rows on mobile */
    table, tbody, tr, td {
        display: block;
        width: 100%;
    }

    tr {
        padding: 12px 0;
        border-bottom: 1px solid var(--border);
    }

    td {
        border-bottom: none;
        padding: 0;
    }

    td:first-child {
        width: auto;
        padding: 0 0 8px 0;
    }

    td:last-child {
        padding: 0;
    }

    /* Hide empty tag cells on mobile */
    td:first-child:empty {
        display: none;
    }

    /* Adjust blockquotes on mobile */
    blockquote {
        padding: 0.5em 0.75em;
        margin: 0.75em 0;
    }

    /* Smaller avatars on mobile if needed */
    img[width="60"] {
        width: 50px;
        height: auto;
    }
}
