/* ============================================================
   Stefan Spanic — personal site
   Monochrome, serif, minimal. Black & white only.
   ============================================================ */

:root {
    /* Palette — only black & white. (#222 / #f2f2f2 per the reference.) */
    --paper:      #f2f2f2;   /* page background  */
    --ink:        #222222;   /* primary text     */
    --ink-soft:   #555555;   /* secondary text   */
    --ink-faint:  #888888;   /* meta / captions  */
    --rule:       rgba(34, 34, 34, 0.16);   /* hairline rules */
    --rule-strong:rgba(34, 34, 34, 0.32);

    /* Type stacks */
    --serif: "Source Serif 4", "Apple Garamond", "Baskerville", "Libre Baskerville", "Droid Serif", "Times New Roman", "Times", serif;
    --sans:  "Source Sans 3", "Lucida Sans Unicode", "Helvetica", "Trebuchet MS", sans-serif;
    --mono:  "IBM Plex Mono", "Liberation Mono", "Consolas", "Courier", monospace;

    /* Measure / rhythm */
    --measure: 42rem;   /* prose reading width */
    --wide:    52rem;   /* page container width */
    --gap:     1.5rem;
}

/* --- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }

/* Black highlight, white text on selection */
::selection { background: var(--ink); color: var(--paper); }

/* --- Base ------------------------------------------------- */
body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1.125rem;       /* ~18px */
    line-height: 1.6;
    font-feature-settings: "kern" 1, "liga" 1, "onum" 1;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.wrap {
    width: 100%;
    max-width: var(--wide);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.wrap > main { flex: 1 0 auto; }   /* grow to push footer to bottom */

/* --- Links ------------------------------------------------ */
a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    text-decoration-color: var(--rule-strong);
    transition: text-decoration-color 0.15s ease, background 0.15s ease;
}
a:hover { text-decoration-color: var(--ink); }

/* --- Headings --------------------------------------------- */
h1, h2, h3, h4 {
    font-family: var(--serif);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

/* Section header with hairline rule beneath */
.rule-head {
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-family: var(--sans);
    color: var(--ink-soft);
    padding-bottom: 0.5rem;
    margin-bottom: 1.4rem;
    border-bottom: 1px solid var(--rule);
}

p { margin: 0 0 1.1rem; }

/* ============================================================
   Masthead / navigation
   ============================================================ */
.masthead {
    border-bottom: 1px solid var(--rule);
    margin-bottom: 3rem;
}
.masthead-inner {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    padding: 1.5rem 0 1.1rem;
}
.brand {
    font-family: var(--serif);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
}
.brand:hover { text-decoration: none; }

.nav {
    display: flex;
    gap: 1.5rem;
    font-family: var(--sans);
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.nav a { text-decoration: none; color: var(--ink-soft); }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    text-decoration-color: var(--ink);
}

/* ============================================================
   Hero (About / landing)
   ============================================================ */
.hero {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 2rem;
    align-items: center;
    margin-bottom: 3.5rem;
}
.hero-photo {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
}
.hero h1 { margin-bottom: 0.4rem; }
.hero .tagline {
    font-family: var(--sans);
    font-size: 0.95rem;
    color: var(--ink-soft);
    line-height: 1.5;
    margin: 0;
}

/* Contact line */
.contact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.4rem;
    font-family: var(--sans);
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    margin-top: 0.9rem;
}
.contact a {
    text-decoration: none;
    color: var(--ink-soft);
    border-bottom: 1px solid var(--rule);
    padding-bottom: 1px;
}
.contact a:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ============================================================
   Generic prose / sections
   ============================================================ */
section { margin-bottom: 3.5rem; }
.prose { max-width: var(--measure); }
.prose p { color: var(--ink); }

/* ============================================================
   Recent-writing list (landing) + blog index
   ============================================================ */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
/* pull the list up under a section hairline so the first post isn't floating */
.rule-head + .post-list { margin-top: -1.4rem; }

.post-item-title {
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.3;
}
.post-item-title:hover { text-decoration: underline; text-decoration-color: var(--ink); }

.post-meta {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--ink-faint);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}
.post-summary {
    margin: 0.35rem 0 0;
    color: var(--ink-soft);
    font-size: 1rem;
}

.see-all {
    display: inline-block;
    margin-top: 1.4rem;
    font-family: var(--sans);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink-soft);
}
.see-all:hover { color: var(--ink); }
.see-all::after { content: " \2192"; }

/* ============================================================
   Article (single blog post)
   ============================================================ */
.article { max-width: var(--measure); }
.article-header { margin-bottom: 2rem; }
.article-header h1 { font-size: 2.4rem; margin-bottom: 0.6rem; }
.article-date {
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.article-body { font-size: 1.15rem; }
.article-body h2 {
    margin: 2.4rem 0 0.9rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--rule);
}
.article-body h3 { margin: 1.8rem 0 0.7rem; }
.article-body p { margin: 0 0 1.2rem; }
.article-body ul, .article-body ol { margin: 0 0 1.2rem; padding-left: 1.4rem; }
.article-body li { margin-bottom: 0.4rem; }
.article-body blockquote {
    margin: 1.4rem 0;
    padding: 0.2rem 0 0.2rem 1.2rem;
    border-left: 2px solid var(--rule-strong);
    color: var(--ink-soft);
    font-style: italic;
}
.article-body code {
    font-family: var(--mono);
    font-size: 0.86em;
    background: rgba(34, 34, 34, 0.06);
    padding: 0.1em 0.35em;
    border-radius: 2px;
}
.article-body pre {
    font-family: var(--mono);
    font-size: 0.82rem;
    line-height: 1.5;
    background: rgba(34, 34, 34, 0.05);
    border: 1px solid var(--rule);
    padding: 1rem 1.1rem;
    overflow-x: auto;
    margin: 0 0 1.2rem;
}
.article-body pre code { background: none; padding: 0; font-size: inherit; }
.article-body hr { border: none; border-top: 1px solid var(--rule); margin: 2rem 0; }
.article-body a { text-decoration-color: var(--ink); }

.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    font-family: var(--sans);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink-soft);
}
.back-link:hover { color: var(--ink); }
.back-link::before { content: "\2190 \00a0"; }

/* ============================================================
   CV
   ============================================================ */
.cv-section { margin-bottom: 1.8rem; max-width: var(--measure); }
.cv-section .rule-head { margin-bottom: 1rem; }
.cv-entry { margin-bottom: 0.95rem; }
.cv-entry:last-child { margin-bottom: 0; }
.cv-entry-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
}
.cv-entry-head h3 { font-size: 1rem; font-weight: 600; }
.cv-entry-head h3 .cv-where { font-weight: 400; }
.cv-when {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    color: var(--ink-faint);
    text-transform: uppercase;
    white-space: nowrap;
}
.cv-where {
    font-family: var(--sans);
    font-size: 0.82rem;
    color: var(--ink-soft);
    white-space: nowrap;
}
.cv-entry p { font-size: 0.92rem; margin-bottom: 0.25rem; line-height: 1.5; }
.cv-entry ul { margin: 0.2rem 0 0; padding-left: 1.3rem; font-size: 0.92rem; }
.cv-entry li { margin-bottom: 0.25rem; }

.cv-download {
    font-family: var(--sans);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
}

/* ============================================================
   List bullets — custom marker (applies to CV + article lists)
   ============================================================ */
.cv-entry ul,
.article-body ul { list-style-type: "\2726  "; }   /* ✦ */
.cv-entry ul li::marker,
.article-body ul li::marker {
    color: var(--ink);
    font-size: 0.78em;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    border-top: 1px solid var(--rule);
    margin-top: 4rem;
    padding: 1.6rem 0 2.5rem;
    font-family: var(--sans);
    font-size: 0.78rem;
    color: var(--ink-faint);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem 1.2rem;
}
.site-footer a { color: var(--ink-faint); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 600px) {
    body { font-size: 1.06rem; }
    .hero {
        grid-template-columns: 1fr;
        justify-items: start;
        gap: 1.2rem;
        text-align: left;
    }
    .hero-photo { width: 120px; height: 120px; }
    h1 { font-size: 1.8rem; }
    .article-header h1 { font-size: 1.9rem; }
    .masthead { margin-bottom: 2rem; }
    .nav { gap: 1.1rem; }
}
