/* =================================================================
   Owen Reid - main.css
   Quiet editorial. Warm white, near-black ink, one restrained
   accent. Newsreader for words that matter, Inter for labels.
   One system for every page: landing, sections, articles.
   ================================================================= */

:root {
    --paper:  #FAF8F3;
    --paper-2:#F3F0E8;   /* hover fill */
    --ink:    #1B1A17;
    --muted:  #6F6A60;
    --line:   #E5E1D6;
    --accent: #7A3B2E;

    --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
    --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    --maxw: 1020px;
    --gut:  clamp(20px, 5vw, 56px);
}

/* soft cross-page fade (progressive enhancement) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation-duration: .16s; }
::view-transition-new(root) { animation-duration: .16s; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 15.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection { background: rgba(122, 59, 46, .16); }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 {
    font-family: var(--serif);
    font-weight: 500;
    line-height: 1.15;
    margin: 0;
    letter-spacing: -0.005em;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

/* ---------- shell: header / main / footer ---------- */
.top {
    max-width: var(--maxw);
    width: 100%;
    margin: 0 auto;
    padding: clamp(22px, 4vh, 34px) var(--gut);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px 28px;
    flex-wrap: wrap;
}
.brand {
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 500;
}
.brand:hover { color: var(--accent); }
.top nav { display: flex; gap: clamp(16px, 3vw, 30px); }
.top nav a {
    font-size: 13px;
    color: var(--muted);
    padding-bottom: 3px;
}
.top nav a:hover { color: var(--ink); }
.top nav a[aria-current="page"] {
    color: var(--ink);
    border-bottom: 1.5px solid var(--accent);
}

main {
    flex: 1;
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: clamp(20px, 4vh, 44px) var(--gut) clamp(48px, 7vh, 80px);
}

.bottom {
    max-width: var(--maxw);
    width: 100%;
    margin: 0 auto;
    padding: 22px var(--gut) clamp(24px, 4vh, 36px);
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 24px;
    font-size: 13px;
    color: var(--muted);
}
.bottom a { color: var(--muted); }
.bottom a:hover { color: var(--accent); }
.bottom .links { display: flex; gap: 18px; }

/* ---------- page head ---------- */
.page-head { margin-bottom: clamp(30px, 5vh, 48px); }
.page-head h1 { font-size: clamp(32px, 4.5vw, 44px); }
.page-head .sub {
    font-family: var(--serif);
    font-size: 18px;
    color: var(--muted);
    margin-top: 10px;
    max-width: 54ch;
}

/* =================================================================
   LANDING - four doors, one viewport, uniform breathing room
   ================================================================= */
body.home {
    padding: clamp(24px, 4.5vh, 52px) var(--gut);
    gap: clamp(18px, 3vh, 30px);
}
.home-head { max-width: var(--maxw); width: 100%; margin: 0 auto; }
.home-head h1 { font-size: clamp(24px, 3vh + 8px, 32px); }
.home-head p {
    font-family: var(--serif);
    font-size: clamp(15px, 1.8vh + 4px, 18px);
    color: var(--muted);
    margin: 6px 0 0;
    max-width: 52ch;
}

.doors {
    flex: 1;
    max-width: var(--maxw);
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2vh, 22px);
    min-height: 0;
}
.door {
    flex: 1;
    min-height: 62px;
    border: 1px solid var(--line);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 clamp(20px, 4vw, 48px);
    transition: background .25s ease, border-color .25s ease;
}
.door:hover, .door:focus-visible {
    background: var(--paper-2);
    border-color: var(--ink);
    outline: none;
}
.door .t {
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(24px, 4.5vh, 42px);
    letter-spacing: -0.008em;
}
.door .m {
    display: flex;
    align-items: baseline;
    gap: 14px;
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}
.door .arw { transition: transform .25s ease; }
.door:hover .arw { transform: translateX(5px); color: var(--accent); }

.home-foot {
    max-width: var(--maxw);
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 24px;
    font-size: 13px;
    color: var(--muted);
}
.home-foot a { color: var(--muted); }
.home-foot a:hover { color: var(--accent); }
.home-foot .links { display: flex; gap: 18px; }

/* =================================================================
   PROJECTS - image tiles, inline expanding detail
   ================================================================= */
.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(20px, 3vw, 32px) clamp(18px, 2.5vw, 28px);
}
@media (max-width: 880px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .grid { grid-template-columns: 1fr; } }

.tile {
    appearance: none;
    background: none;
    border: 0;
    padding: 0;
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: pointer;
    display: block;
    width: 100%;
}
.tile .frame {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--paper-2);
    transition: border-color .25s ease;
}
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile:hover .frame, .tile:focus-visible .frame { border-color: var(--ink); }
.tile:focus-visible { outline: none; }
.tile h2 { font-size: 19px; margin-top: 12px; transition: color .2s ease; }
.tile:hover h2 { color: var(--accent); }
.tile[aria-expanded="true"] h2 { color: var(--accent); }
.tile .cat { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* the expanding panel: sits full-width in the grid, slides open */
.panel {
    grid-column: 1 / -1;
    display: none;
    grid-template-rows: 0fr;
    transition: grid-template-rows .35s ease;
}
.panel.show { display: grid; }
.panel.open { grid-template-rows: 1fr; }
.panel-clip { min-height: 0; overflow: hidden; }
.panel-box {
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: clamp(22px, 3.5vw, 36px);
    margin: 2px 0 6px;
}
.panel-box .head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.panel-box h3 { font-size: clamp(22px, 2.6vw, 28px); }
.panel-close {
    appearance: none;
    background: none;
    border: 0;
    padding: 4px 8px;
    font: 500 13px var(--sans);
    color: var(--muted);
    cursor: pointer;
}
.panel-close:hover { color: var(--accent); }
.panel-box p {
    font-family: var(--serif);
    font-size: 17.5px;
    line-height: 1.7;
    max-width: 62ch;
}
.panel-box .stack {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 16px;
}
.panel-box .visit {
    display: inline-block;
    margin-top: 14px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--accent);
    border-bottom: 1px solid var(--line);
    padding-bottom: 1px;
}
.panel-box .visit:hover { border-color: var(--accent); }

/* =================================================================
   LISTS - academia, experience, writing index
   ================================================================= */
.rows { border-top: 1px solid var(--line); }
.row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 32px;
    align-items: baseline;
    padding: clamp(20px, 3vh, 28px) 0;
    border-bottom: 1px solid var(--line);
}
.row h2 { font-size: clamp(19px, 2.2vw, 23px); }
.row .note {
    font-family: var(--serif);
    font-size: 16px;
    color: var(--muted);
    margin: 6px 0 0;
    max-width: 62ch;
    line-height: 1.6;
    grid-column: 1;
}
.row .side {
    font-size: 12.5px;
    color: var(--muted);
    text-align: right;
    white-space: nowrap;
}
.row .side a { color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: 1px; }
.row .side a:hover { border-color: var(--accent); }
.row .side .grade { display: block; margin-bottom: 6px; }
@media (max-width: 600px) {
    .row { grid-template-columns: 1fr; }
    .row .side { text-align: left; margin-top: 8px; }
}

.group-label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin: clamp(36px, 5vh, 52px) 0 12px;
}

/* a row that links somewhere whole (writing index: title + date only).
   Serif descender space makes equal padding look bottom-heavy, so the
   bottom is trimmed to sit the text optically centred between rules. */
a.row {
    transition: background .2s ease;
    padding-top: clamp(21px, 3vh, 29px);
    padding-bottom: clamp(15px, 2.4vh, 23px);
}
a.row:hover { background: var(--paper-2); }
a.row:hover h2 { color: var(--accent); }

.empty {
    font-family: var(--serif);
    font-size: 17px;
    color: var(--muted);
    padding: clamp(24px, 4vh, 36px) 0;
}

/* =================================================================
   ARTICLES - the reading page
   ================================================================= */
.article {
    max-width: 680px;
    margin: 0 auto;
    padding-top: clamp(12px, 3vh, 32px);
}
.article header { text-align: left; margin-bottom: clamp(28px, 5vh, 44px); }
.article h1 {
    font-size: clamp(30px, 4.5vw, 42px);
    line-height: 1.12;
    letter-spacing: -0.01em;
}
.article .meta {
    font-size: 13px;
    color: var(--muted);
    margin-top: 12px;
}
.article-body {
    font-family: var(--serif);
    font-size: 19px;
    line-height: 1.78;
    color: #26241F;
}
.article-body p { margin: 0 0 1.35em; }
.article-body h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 2em 0 0.7em;
    line-height: 1.25;
}
.article-body h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 1.8em 0 0.6em;
}
.article-body a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--line);
    text-underline-offset: 3px;
    transition: text-decoration-color .2s ease, color .2s ease;
}
.article-body a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.article-body blockquote {
    margin: 1.6em 0;
    padding-left: 22px;
    border-left: 2px solid var(--accent);
    font-style: italic;
    color: var(--muted);
}
.article-body img { border-radius: 2px; margin: 1.8em 0 0.5em; }
.article-body figcaption, .article-body .caption {
    font-family: var(--sans);
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    margin-bottom: 1.8em;
}
.article-body hr {
    border: 0;
    margin: 2.4em 0;
    text-align: center;
}
.article-body hr::after {
    content: "\00b7 \00a0 \00b7 \00a0 \00b7";
    color: var(--muted);
    font-size: 18px;
    letter-spacing: 0.2em;
}
.article-body code {
    font-family: ui-monospace, 'Cascadia Code', Menlo, monospace;
    font-size: 0.82em;
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 1px 5px;
}
.article-body pre {
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 16px 20px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 1.6em;
}
.article-body pre code { background: none; border: 0; padding: 0; font-size: inherit; }

/* ---------- the council: machine peer review, published as-is ---------- */
.council {
    max-width: 680px;
    margin: clamp(44px, 7vh, 72px) auto 0;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}
.c-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
}
.c-label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
}
.c-tally {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.c-note {
    font-size: 13px;
    color: var(--muted);
    margin: 10px 0 6px;
    max-width: 58ch;
    line-height: 1.6;
}
.c-bots {
    display: flex;
    gap: 12px;
    margin: 20px 0 14px;
}
.c-bot {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 10px 12px;
    border: 1px solid var(--line);
    border-radius: 2px;
    color: var(--muted);            /* split: blank, no colour */
}
.c-bot svg { width: 36px; height: auto; display: block; }
.c-bot-name {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.c-bot.agrees {
    color: #3E7C4F;
    border-color: rgba(62, 124, 79, .45);
    background: rgba(62, 124, 79, .07);
}
.c-bot.dissents {
    color: #B23A2E;
    border-color: rgba(178, 58, 46, .45);
    background: rgba(178, 58, 46, .06);
}
/* tiny per-seat verdict dots for the writing index rows */
.c-dots {
    display: inline-flex;
    gap: 5px;
    margin-left: 12px;
    vertical-align: middle;
}
.c-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid var(--muted);
    background: transparent;        /* split: hollow */
}
.c-dot.agrees { background: #3E7C4F; border-color: #3E7C4F; }
.c-dot.dissents { background: #B23A2E; border-color: #B23A2E; }

.c-box {
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 18px 22px 20px;
}
.c-name {
    display: block;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 8px;
}
.c-box p {
    font-family: var(--serif);
    font-size: 16.5px;
    line-height: 1.7;
    color: #3A372F;
    margin: 0;
}

.sub-note {
    font-size: 13px;
    color: var(--muted);
    margin: 10px 0 0;
    max-width: 58ch;
}

.article-foot {
    max-width: 680px;
    margin: clamp(40px, 6vh, 64px) auto 0;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 24px;
    font-size: 13.5px;
}
.article-foot a { color: var(--accent); }
.article-foot a:hover { border-bottom: 1px solid var(--accent); }

/* ---------- motion restraint ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; animation: none !important; }
    .panel { transition: none; }
}
