/* Shared styles for the main site pages: /, /projects/, /writing/, /contact/. */
:root {
    --background: #e8e6e1;
    --ink: #2a2a2a;
    --strong: #111111;
    --secondary: #77736f;
    --line: #cec9c1;
    --link-background: #c4cdd1;
    --link-hover: #b3bfc4;
    --sans: -apple-system, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* One face for the whole main site, so the nav and the content read as one page */
    --label: "Lato", -apple-system, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; letter-spacing: 0; }
[hidden] { display: none !important; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--background);
    color: var(--ink);
    font-family: var(--label);
    font-size: 15px;
    line-height: 24px;
    -webkit-font-smoothing: antialiased;
}
::selection { background: #cdd5d8; color: #222222; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; }
button { color: inherit; font: inherit; cursor: pointer; }
p { margin: 0 0 20px; }
h1, h2, h3 { font-weight: 500; line-height: 1.4; }
h2, h1.page-heading { font-size: 17px; line-height: 24px; margin: 0 0 20px; }
h3 { font-size: 14px; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 20px; top: -80px; padding: 8px 12px; background: var(--background); z-index: 10; }
.skip-link:focus { top: 12px; }
.site-layout {
    position: relative;
    display: grid;
    grid-template-columns: 176px clamp(64px, 8vw, 112px) minmax(480px, 560px) 80px minmax(400px, 1fr);
    align-items: start;
    width: min(100%, 1600px);
    min-height: 100vh;
    margin: 0;
    padding: 80px 24px 120px 36px;
}
.sidebar { grid-column: 1; grid-row: 1; min-width: 0; position: sticky; top: 80px; }
.portrait { float: right; width: 136px; height: 136px; border-radius: 50%; overflow: hidden; margin: 0 0 20px 40px; }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 10%; transform: scale(1.5); transform-origin: center 20%; }
.navigation { display: flex; flex-direction: column; gap: 10px; }
.navigation a { width: fit-content; padding: 0 0 0 12px; font-family: var(--label); font-size: 12px; line-height: 24px; letter-spacing: 1px; text-transform: uppercase; text-decoration: none; color: #222222; opacity: 0.6; white-space: nowrap; transition: opacity 0.2s ease; }
.navigation a[aria-current="page"] { font-weight: 700; color: #1a1b1f; opacity: 1; }
.navigation a:hover { opacity: 1; }
.content { grid-column: 3 / 6; grid-row: 1; min-width: 0; }
.page { min-width: 0; }
#about, #contact { width: min(100%, 560px); }
#writing, #projects { width: min(100%, 1100px); }
/* Headings speak the nav's label style; 10px below keeps list rows on the nav's 34px rhythm */
h1.page-heading, .work-section-title { color: var(--strong); font-family: var(--label); font-size: 12px; line-height: 24px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin: 0 0 10px; }
#about .page-heading { margin-bottom: 44px; }
.page-heading:focus, .detail-panel:focus { outline: none; }
.about-copy p { margin-bottom: 20px; }
.about-copy p:last-child { margin-bottom: 0; }
.text-link {
    background: var(--link-background);
    padding: 2px 3px;
    border-radius: 0;
    text-decoration: none;
    white-space: nowrap;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}
.text-link:hover, .text-link[aria-expanded="true"] { background: var(--link-hover); text-decoration: underline; text-decoration-thickness: 1px; }
.subscribe { margin-top: 40px; }
.subscribe .subscribe-intro { margin: 0 0 14px; font-style: italic; color: var(--secondary); }
.subscribe-fields { display: flex; flex-wrap: wrap; gap: 8px; }
.subscribe input { height: 36px; min-width: 0; padding: 0 12px; border: 1px solid #d9d4cc; border-radius: 6px; background: #f4f2ee; color: var(--ink); font: inherit; font-size: 14px; }
.subscribe input::placeholder { color: #a39d97; }
.subscribe input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.subscribe-name { flex: 0 1 140px; }
.subscribe-email { flex: 0 1 210px; }
.subscribe button { height: 36px; padding: 0 18px; border: 0; border-radius: 6px; background: var(--link-background); color: var(--strong); font-size: 14px; font-weight: 500; }
.subscribe button:hover { background: var(--link-hover); }
.subscribe button:disabled { cursor: default; opacity: 0.7; }
.subscribe .subscribe-note { margin: 10px 0 0; font-size: 13px; line-height: 20px; color: #928c87; }
.subscribe .subscribe-status { margin: 0; }
.subscribe-status:empty { display: none; }
.subscribe.is-done form, .subscribe.is-done .subscribe-note { display: none; }
.subscribe-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.social-links { position: absolute; left: 48px; bottom: 34px; display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; font-family: var(--label); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; z-index: 2; }
.social-links a { white-space: nowrap; color: #222222; opacity: 0.6; text-decoration: none; transition: opacity 0.2s ease; }
.social-links a:hover { opacity: 1; }
.detail-panel { grid-column: 5; grid-row: 1; min-width: 0; padding-top: 16px; }
.book-group { margin-bottom: 24px; }
.book-group:last-child { margin-bottom: 0; }
.book-group h3 { font-size: 15px; line-height: 22px; color: #99938e; margin-bottom: 8px; }
.book-list { list-style: none; padding: 0; margin: 0; }
.book-list li { margin: 0; font-size: 15px; line-height: 24px; }
.book-list cite { font-style: normal; }
.work-section + .work-section { margin-top: 40px; }
.article-list { list-style: none; padding: 0; margin: 0; }
.article-row { margin: 0 0 10px; line-height: 24px; }
.article-row a { display: inline; text-decoration: none; font-size: 15px; line-height: 24px; }
.article-row a:hover .article-title { text-decoration: underline; text-underline-offset: 4px; }
.article-date { color: #928c87; font-size: 13px; line-height: 1; margin-left: 6px; white-space: nowrap; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 40px; max-width: 840px; }
.project { display: flex; align-items: flex-start; gap: 16px; text-decoration: none; }
.project-icon { display: block; width: 56px; height: 56px; flex: none; border-radius: 13px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 6px 14px rgba(40, 32, 24, 0.14); }
.project-name { display: block; font-size: 15px; line-height: 22px; font-weight: 700; color: var(--strong); }
.project-desc { display: block; margin-top: 4px; font-size: 14px; line-height: 20px; color: var(--secondary); }
.project:hover .project-name { text-decoration: underline; text-underline-offset: 4px; }
.empty-writing { color: var(--secondary); margin: 0; }
.work-item { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 18px; align-items: center; text-decoration: none; padding: 9px 0; }
.work-item img { display: block; width: 96px; height: 58px; object-fit: contain; border-radius: 3px; }
.work-copy { display: flex; align-items: baseline; gap: 8px; min-width: 0; white-space: nowrap; }
.work-title { font-size: 15px; line-height: 22px; font-weight: 400; }
.work-meta { color: #928c87; font-size: 13px; line-height: 1.5; flex: 0 0 auto; }
.video-item { grid-template-columns: 104px minmax(0, 1fr); }
.video-item img { width: 104px; height: 64px; }
.video-item .work-copy { display: block; white-space: normal; }
.video-item .work-meta { display: block; margin-top: 3px; }
.work-item:hover .work-title { text-decoration: underline; text-underline-offset: 4px; }
.contact a { overflow-wrap: anywhere; }
@media (max-width: 1279px) {
    .site-layout { grid-template-columns: 176px clamp(64px, 8vw, 112px) minmax(0, 1fr); width: min(100%, 1000px); }
    .content, .detail-panel { grid-column: 3; }
    .site-layout.has-detail .content { display: none; }
    .detail-panel { padding-top: 0; }
    .work-copy { white-space: normal; }
}
@media (max-width: 700px) {
    .site-layout { display: block; padding: 40px 22px 48px; }
    .sidebar { position: static; margin-bottom: 40px; }
    #about .page-heading { margin-bottom: 32px; }
    .portrait { width: 96px; height: 96px; margin: 0 0 12px 24px; }
    .navigation { flex-direction: row; flex-wrap: wrap; gap: 4px 16px; margin-left: -12px; }
    .navigation a { padding-left: 11px; }
    .social-links { position: static; gap: 8px 24px; margin-top: 40px; }
    .book-list li { font-size: 15px; margin-bottom: 12px; }
    .book-group h3 { font-size: 15px; }
    .article-row { margin-bottom: 10px; }
    .subscribe-name, .subscribe-email, .subscribe button { flex: 1 1 100%; }
    .project-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .work-item { grid-template-columns: 76px minmax(0, 1fr); gap: 16px; }
    .work-item img { width: 76px; height: 52px; }
    .work-copy { display: block; }
    .work-title { font-size: 15px; }
    .work-meta { display: block; margin-top: 2px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .navigation a, .social-links a { transition: none; } }
@media print {
    .site-layout { display: block; padding: 0; }
    .sidebar { position: static; }
    .navigation { display: none; }
}
