/* ============================================================
   had-nu.github.io — shared stylesheet
   Standardized on the Wardex article template:
   720px container, #fafafa background, blue links, editorial.
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: #fafafa;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ---- Header ---- */

header {
    margin-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 1rem;
}

header a {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 500;
}

header a:hover { text-decoration: underline; }

.breadcrumb {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.breadcrumb a {
    color: #666;
    font-weight: 400;
}

/* ---- Typography ---- */

h1 {
    font-size: 1.8rem;
    margin: 1.5rem 0 1rem;
    line-height: 1.3;
}

h2 {
    font-size: 1.3rem;
    margin: 2.5rem 0 1rem;
}

h3 {
    font-size: 1.1rem;
    margin: 1.5rem 0 0.75rem;
}

p {
    margin-bottom: 1rem;
}

.date { color: #666; font-size: 0.9rem; margin-bottom: 1rem; }
.meta { font-size: 0.85rem; color: #999; }

hr {
    margin: 1.5rem 0;
    border: none;
    border-top: 1px solid #e0e0e0;
}

ul, ol {
    margin: 0 0 1rem 1.5rem;
}

li {
    margin-bottom: 0.4rem;
}

a {
    color: #0066cc;
    text-decoration: none;
}

a:hover { text-decoration: underline; }

/* ---- Code / pre ---- */

code {
    background: #f0f0f0;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: "Monaco", "Menlo", "Ubuntu Mono", "Courier New", monospace;
    font-size: 0.9rem;
}

pre {
    background: #f5f5f5;
    border-left: 3px solid #ddd;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
    border-radius: 4px;
    font-family: "Monaco", "Menlo", "Ubuntu Mono", "Courier New", monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

pre code {
    background: none;
    padding: 0;
    font-size: 0.85rem;
}

/* ---- Tables ---- */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

table th, table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background: #f9f9f9;
    font-weight: 600;
}

/* ---- Blockquote ---- */

blockquote {
    border-left: 3px solid #ccc;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #555;
}

/* ---- Homepage components ---- */

.intro {
    padding: 2.5rem 0 0.5rem;
}

.intro p {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.text-muted {
    color: #666;
    font-size: 0.9rem;
}

.about {
    padding: 1.5rem 0;
}

.about p {
    margin-bottom: 1rem;
}

.entries {
    padding: 1rem 0;
}

.section-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #666;
    border-top: 1px solid #e0e0e0;
    padding-top: 1.75rem;
    margin: 3rem 0 1.25rem;
}

.section-label:first-of-type {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

.entry {
    margin-bottom: 1.75rem;
}

/* Cards (problems I solve / projects) */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 1.25rem;
}

.card h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.card h3 a {
    text-decoration: none;
}

.card h3 a:hover {
    text-decoration: underline;
}

.card p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.55;
    margin-bottom: 0.75rem;
}

.card .entry-meta {
    margin-top: auto;
}

.entry h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.15rem;
}

.entry h3 a {
    text-decoration: none;
}

.entry h3 a:hover {
    text-decoration: underline;
}

.entry p {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.35rem;
    line-height: 1.55;
}

.entry-meta {
    font-size: 0.8rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tag {
    font-family: "Monaco", "Menlo", "Ubuntu Mono", "Courier New", monospace;
    font-size: 0.75rem;
    color: #666;
    border: 1px solid #ddd;
    padding: 0.1rem 0.45rem;
    border-radius: 3px;
}

.status {
    font-size: 0.75rem;
    font-weight: 500;
}

.status.active  { color: #2e7d32; }
.status.stable  { color: #1565c0; }
.status.research { color: #6a1b9a; }

.links {
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.links a {
    color: #0066cc;
}

/* ---- Latest writing reveal ---- */

@keyframes entryReveal {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

#latest-writing .entry {
    opacity: 0;
    animation: entryReveal 500ms ease forwards;
}

@media (prefers-reduced-motion: reduce) {
    #latest-writing .entry {
        opacity: 1;
        animation: none;
    }
}

/* ---- Footer ---- */

footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
    font-size: 0.9rem;
    color: #666;
}

footer a {
    margin-right: 1rem;
    color: #0066cc;
}

/* ---- Responsive ---- */

@media (max-width: 600px) {
    .container {
        padding: 1.5rem 1.25rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }
}
