:root {
    --bg: #ffffff;
    --text: #333333;
    --text-heading: #111111;
    --text-muted: #767676;
    --border: #e5e5e5;
    --sage: #4f6b45;
    --sage-dark: #3a4f33;
    --pen: #5c8f3c;
    --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
}

.page {
    max-width: 880px;
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 4rem) clamp(1.25rem, 4vw, 2rem) 3rem;
}

a {
    color: var(--text-heading);
    text-decoration: none;
    border-bottom: 1px solid #ccc;
}

a:hover,
a:focus-visible {
    border-bottom-color: transparent;
}

a:focus-visible {
    outline: 2px solid var(--sage);
    outline-offset: 2px;
}

a.highlight {
    color: var(--sage);
    border-bottom: 1px solid var(--sage);
}

a.highlight:hover,
a.highlight:focus-visible {
    border-bottom-color: transparent;
}

/* Hand-drawn pen squiggle under the text (stroke colour matches --pen) */
.mark,
a.item-title.highlight {
    --squiggle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 8' preserveAspectRatio='none'%3E%3Cpath d='M1.5 5.2c9.6-2.4 19.4-2.9 29.1-1.6 9.1 1.2 17.9 2.6 27.1 1.3 10.3-1.5 20.6-3.2 31-2.2 9.7.9 19.4 2.3 29.8.6' fill='none' stroke='%235c8f3c' stroke-width='1.8' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
    padding-bottom: 0.3em;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.mark {
    background: var(--squiggle) no-repeat left bottom / 100% 0.45em;
}

a.mark {
    border-bottom: none;
}

/* Header */
.site-header {
    text-align: center;
    margin-bottom: clamp(2.5rem, 6vw, 3.5rem);
}

/* Alexandria-style masthead: name centred, links right, hairline under */
.topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding-bottom: 1.1rem;
    margin-bottom: 1.4rem;
    border-bottom: 1px solid var(--border);
}

.topbar h1 {
    grid-column: 2;
}

.social-links {
    grid-column: 3;
    display: flex;
    justify-content: flex-end;
    gap: 1.25rem;
    font-size: 0.85rem;
}

.social-links a {
    color: var(--text-muted);
    border-bottom-color: #ddd;
}

.social-links a:hover {
    color: var(--text-heading);
}

.topbar h1 {
    font-family: var(--serif);
    font-size: 2.1rem;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--text-heading);
}

.intro .bio {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 38ch;
    margin: 0 auto;
}

.intro .bio .company {
    color: var(--text-heading);
    font-weight: 600;
}

/* Thinking about */
.thinking {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: clamp(2rem, 5vw, 3.5rem);
    align-items: center;
    margin-bottom: clamp(2.5rem, 6vw, 3.5rem);
}

.thinking h2 {
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.thinking-list {
    list-style: none;
}

.thinking-list li {
    padding: 0.7rem 0;
}

.thinking-list .topic {
    font-family: var(--serif);
    color: var(--text-heading);
    font-weight: 600;
    font-size: 1.08rem;
}

.thinking-list p {
    margin-top: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.thinking-always {
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
    font-size: 0.92rem;
    color: var(--text-heading);
}

.thinking-art img {
    display: block;
    width: 100%;
    height: auto;
}

/* Panels */
.panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

#reads-panel {
    padding-right: clamp(1rem, 3vw, 1.6rem);
}

#writing-panel {
    padding-left: clamp(1rem, 3vw, 1.6rem);
    border-left: 1px solid var(--border);
}

.panel h2 {
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.panel-scroll {
    height: min(56vh, 480px);
    overflow-y: auto;
}

.panel-list {
    list-style: none;
}

.panel-list li {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border);
}

.panel-list li:first-child {
    padding-top: 0;
}

.panel-list li:last-child {
    border-bottom: none;
}

.item-title {
    display: inline;
    font-family: var(--serif);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.35;
}

a.item-title.highlight {
    border-bottom: none;
    background: var(--squiggle) no-repeat left bottom / 0 0.45em;
    transition: background-size 0.3s ease;
}

a.item-title.highlight:hover,
a.item-title.highlight:focus-visible {
    background-size: 100% 0.45em;
}

.item-title + .item-meta,
.item-title + .item-note {
    margin-top: 0.3rem;
}

.item-meta {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.item-note {
    font-size: 0.87rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.panel-empty {
    padding: 0.5rem 0;
    font-size: 0.88rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Experience */
.experience {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 3.5rem);
    align-items: center;
    margin-top: clamp(3rem, 7vw, 4.5rem);
}

.experience-art img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 2px;
}

.experience h2 {
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.experience-list {
    list-style: none;
}

.experience-list li {
    display: grid;
    grid-template-columns: 11rem 1fr auto;
    gap: 1.5rem;
    align-items: baseline;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}

.experience-list li:last-child {
    border-bottom: none;
}

.experience-list .org {
    color: var(--text-heading);
    font-weight: 500;
}

.experience-list .role {
    color: var(--text-muted);
}

.experience-list .dates {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Footer */
footer {
    margin-top: clamp(2.5rem, 6vw, 3.5rem);
    text-align: center;
}

.copyright {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 700px) {
    .panels {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .panel-scroll {
        height: min(46vh, 400px);
    }

    .topbar {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .topbar h1,
    .social-links {
        grid-column: 1;
    }

    .social-links {
        grid-row: 1;
        justify-content: center;
    }

    #reads-panel,
    #writing-panel {
        padding: 0;
        border-left: none;
    }

    .thinking {
        grid-template-columns: 1fr;
    }

    .thinking-art {
        max-width: 170px;
        margin: 0 auto;
    }

    .experience {
        grid-template-columns: 1fr;
    }

    .experience-art {
        order: 1;
        max-width: 170px;
        margin: 0 auto;
    }

    .experience-list li {
        grid-template-columns: 1fr auto;
        gap: 0.2rem 1rem;
    }

    .experience-list .role {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}
