/* ---------------------------------------------------------------
   zacharyhale.net — shared stylesheet
   Typeface: Computer Modern (CMU Serif), served locally from /fonts
   --------------------------------------------------------------- */

@font-face {
  font-family: "CMU Serif";
  src: url("fonts/cmu-serif-500-roman.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "CMU Serif";
  src: url("fonts/cmu-serif-500-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "CMU Serif";
  src: url("fonts/cmu-serif-700-roman.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "CMU Serif";
  src: url("fonts/cmu-serif-700-italic.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "CMU Sans";
  src: url("fonts/cmu-sans-serif-500-roman.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --- tokens ---------------------------------------------------- */

:root {
  --paper:      #fbfaf7;
  --ink:        #1b1917;
  --ink-soft:   #6d6862;
  --ink-faint:  #97918a;
  --rule:       #e2ddd4;
  --rule-soft:  #eeeae3;
  --accent:     #8a3324;
  --accent-soft:#b5806c;
  --tint:       #f4f1ea;
  --link-rule:  #cec5b6;

  --serif: "CMU Serif", "Latin Modern Roman", "Computer Modern", Georgia, "Times New Roman", serif;
  --sans:  "CMU Sans", "CMU Serif", Georgia, serif;

  --measure: 34rem;
  --wide:    46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #14130f;
    --ink:        #eae5dc;
    --ink-soft:   #a29b90;
    --ink-faint:  #746e65;
    --rule:       #2f2c26;
    --rule-soft:  #24211c;
    --accent:     #d08b6e;
    --accent-soft:#96634c;
    --tint:       #1c1a15;
    --link-rule:  #4a453d;
  }
}

/* --- base ------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.62;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1.6rem;
}

.measure { max-width: var(--measure); }

img { max-width: 100%; height: auto; display: block; }

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--link-rule);
  transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}
a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Links sitting in running prose carry the accent so they read as
   links mid-sentence; chrome links (nav, pager, feed) opt out below. */
.measure a,
.standfirst a,
figcaption a {
  color: var(--accent);
  border-bottom-color: var(--accent-soft);
}
.measure a:hover,
.standfirst a:hover,
figcaption a:hover {
  border-bottom-color: var(--accent);
  background-color: var(--tint);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* --- masthead -------------------------------------------------- */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 2.4rem 0 1.1rem;
  border-bottom: 1px solid var(--rule);
}

.masthead .mark {
  font-variant: small-caps;
  letter-spacing: .09em;
  font-size: .96rem;
  border-bottom: none;
}
.masthead .mark:hover { color: var(--accent); }

.masthead nav {
  display: flex;
  gap: 1.5rem;
  font-size: .88rem;
  font-variant: small-caps;
  letter-spacing: .07em;
}
.masthead nav a { border-bottom: none; color: var(--ink-soft); }
.masthead nav a:hover,
.masthead nav a[aria-current="page"] { color: var(--ink); }
.masthead nav a[aria-current="page"] { border-bottom: 1px solid var(--ink); }

/* --- hero ------------------------------------------------------ */

.hero { padding: 4rem 0 0; }

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 3.6rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -.012em;
  margin: 0 0 .5rem;
}

.standfirst {
  color: var(--ink-soft);
  font-style: italic;
  font-size: 1.02rem;
  margin: 0 0 2.2rem;
  max-width: 30rem;
}

.portrait {
  float: right;
  width: 12.5rem;
  margin: .4rem 0 1.6rem 2.4rem;
  border: 1px solid var(--rule);
  padding: 6px;
  background: var(--paper);
}
.portrait img { filter: saturate(.94); }

.bio p { margin: 0 0 1.15rem; }
.bio p:last-child { margin-bottom: 0; }

/* --- link row -------------------------------------------------- */

.linkrow {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  gap: .55rem 1.4rem;
  align-items: baseline;
  margin: 2.6rem 0 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  font-size: .95rem;
}
.linkrow a { border-bottom-color: var(--ink-faint); }
.linkrow .tag {
  font-size: .74rem;
  font-variant: small-caps;
  letter-spacing: .08em;
  color: var(--ink-faint);
  margin-left: .35rem;
}

/* --- section heading ------------------------------------------- */

.rubric {
  font-variant: small-caps;
  letter-spacing: .11em;
  font-size: .82rem;
  font-weight: 400;
  color: var(--ink-faint);
  margin: 4.5rem 0 1.6rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--rule);
}

/* --- project feed ---------------------------------------------- */

.feed { margin: 2.6rem 0 0; }

.entry {
  display: grid;
  grid-template-columns: 13rem 1fr;
  gap: 2rem;
  align-items: start;
  padding: 2.4rem 0;
  border-top: 1px solid var(--rule-soft);
  border-bottom: none;
}
.entry:first-child { border-top: none; padding-top: .6rem; }

a.entry { color: inherit; }
a.entry:hover { color: inherit; }

.entry .shot {
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--tint);
}
.entry .shot img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2,.6,.2,1), filter .3s ease;
  filter: saturate(.9);
}
a.entry:hover .shot img { transform: scale(1.035); filter: saturate(1); }

.entry .no {
  font-size: .74rem;
  font-variant: small-caps;
  letter-spacing: .1em;
  color: var(--ink-faint);
  display: block;
  margin-bottom: .45rem;
}

.entry h2 {
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 .55rem;
  letter-spacing: -.008em;
}
a.entry:hover h2 { color: var(--accent); }

.entry .dek {
  color: var(--ink-soft);
  margin: 0 0 .9rem;
  font-size: .96rem;
}

.entry .more {
  font-size: .8rem;
  font-variant: small-caps;
  letter-spacing: .09em;
  color: var(--ink-faint);
}
a.entry:hover .more { color: var(--accent); }

/* --- article --------------------------------------------------- */

.article { padding: 3.6rem 0 0; }

.kicker {
  font-variant: small-caps;
  letter-spacing: .11em;
  font-size: .8rem;
  color: var(--ink-faint);
  margin: 0 0 .9rem;
}
.kicker a { border-bottom: none; color: inherit; }

.article h1 {
  font-size: clamp(2.1rem, 5.5vw, 2.9rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.012em;
  margin: 0 0 .7rem;
}

.article .standfirst { margin-bottom: 2.4rem; }

figure { margin: 0 0 2.6rem; }
figure img { border: 1px solid var(--rule); }
figcaption {
  font-size: .82rem;
  color: var(--ink-faint);
  font-style: italic;
  margin-top: .6rem;
  padding-left: .1rem;
}

.article h2 {
  font-size: 1.28rem;
  font-weight: 700;
  margin: 2.6rem 0 .8rem;
  letter-spacing: -.004em;
}

.article p { margin: 0 0 1.2rem; }

.pullquote {
  margin: 2.4rem 0;
  padding-left: 1.4rem;
  border-left: 2px solid var(--rule);
  font-style: italic;
  color: var(--ink-soft);
}

.article dl { margin: 0 0 2rem; }
.article dl div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: .93rem;
}
.article dt {
  font-variant: small-caps;
  letter-spacing: .07em;
  color: var(--ink-faint);
  font-size: .82rem;
  padding-top: .12rem;
}
.article dd { margin: 0; }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 4rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
  font-size: .88rem;
  font-variant: small-caps;
  letter-spacing: .07em;
}
.pager a { border-bottom: none; color: var(--ink-soft); }
.pager a:hover { color: var(--accent); }

/* --- footer ---------------------------------------------------- */

.foot {
  margin-top: 6rem;
  padding: 1.6rem 0 3.5rem;
  border-top: 1px solid var(--rule);
  font-size: .82rem;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.foot a { border-bottom-color: var(--link-rule); }

/* --- responsive ------------------------------------------------ */

@media (max-width: 640px) {
  body { font-size: 17.5px; }
  .hero { padding-top: 2.6rem; }
  .portrait {
    float: none;
    width: 10rem;
    margin: 0 0 1.8rem;
  }
  .entry {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }
  .entry .shot img { aspect-ratio: 16 / 10; }
  .article dl div { grid-template-columns: 1fr; gap: .1rem; }
  .masthead { padding-top: 1.8rem; }
}

@media print {
  body { background: #fff; color: #000; }
  .masthead nav, .pager, .foot { display: none; }
}
