/* fjeastman.com
   A black mass on the left, the lit side on the right. Payne's gray is the
   only colour apart from one red tile. Archivo for structure, Literata for prose. */

@font-face {
  font-family: Archivo;
  src: url(/static/fonts/archivo-normal.woff2) format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: Literata;
  src: url(/static/fonts/literata-normal.woff2) format("woff2");
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: Literata;
  src: url(/static/fonts/literata-italic.woff2) format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --red: #c2331f;
  --edge: 41.6667%;      /* home: where the mass ends */
  --edge-c: 41.6667cqw;
  --edge-in: 31%;        /* inner pages */
  --gutter: clamp(16px, 4.5vw, 64px);
  --inset: clamp(24px, 4vw, 56px);
  --sans: Archivo, "Helvetica Neue", Arial, sans-serif;
  --serif: Literata, Georgia, serif;

  /* light: ink on paper */
  --mass: #0c0e11;
  --on-mass: #e8e7e1;
  --on-mass-2: #8d99a3;
  --mass-rule: #2c333b;
  --panel: #e8e7e1;
  --text: #0c0e11;
  --text-2: #44525f;
  --rule: #a9b1b8;
  --slab: #0c0e11;
  --dot: #44525f;
  --name-lit: #f3f1ee;
  --name-shade: #0c0e11;
}
/* dark: black, and Payne's gray where the light falls */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --mass: #08090b;
    --on-mass: #dcdcd6;
    --on-mass-2: #7f8c97;
    --mass-rule: #252b32;
    --panel: #2c3843;
    --text: #e4e4de;
    --text-2: #a3b0bb;
    --rule: #55636f;
    --slab: #08090b;
    --dot: #08090b;
    --name-lit: #e4e4de;
    --name-shade: #08090b;
  }
}
:root[data-theme="dark"] {
  --mass: #08090b;
  --on-mass: #dcdcd6;
  --on-mass-2: #7f8c97;
  --mass-rule: #252b32;
  --panel: #2c3843;
  --text: #e4e4de;
  --text-2: #a3b0bb;
  --rule: #55636f;
  --slab: #08090b;
  --dot: #08090b;
  --name-lit: #e4e4de;
  --name-shade: #08090b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--panel);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.label {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--panel); color: var(--text); padding: 8px 12px; z-index: 9; }
.tile { width: 22px; height: 22px; background: var(--red); }

/* ---------- top bar ---------- */
.bar {
  background: var(--mass);
  color: var(--on-mass);
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 22px var(--gutter);
}
.bar a { text-decoration: none; }
.bar a:hover, .bar a[aria-current] { text-decoration: underline; text-underline-offset: 6px; }
.bar .home {
  margin-right: auto;
  font-stretch: 125%;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.bar .spacer { margin-right: auto; }
.bar button { background: none; border: 0; cursor: pointer; padding: 4px; margin: -4px; color: var(--on-mass-2); }
.bar button:hover { color: var(--on-mass); }
.bar button span {
  display: block;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: linear-gradient(to right, currentColor 50%, transparent 50%);
}

/* ---------- home ---------- */
.hero {
  container-type: inline-size;
  min-height: calc(100vh - 63px);
  display: grid;
  grid-template-columns: var(--edge) 1fr;
  grid-template-rows: auto 1fr;
  background: linear-gradient(to right, var(--mass) 0 var(--edge), var(--panel) var(--edge));
}
.name {
  grid-column: 1 / -1;
  padding: clamp(28px, 5vh, 64px) var(--gutter) 0;
}
.name h1 {
  font-family: var(--sans);
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(56px, 10vw, 160px);
  line-height: 0.86;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  /* The letters change where they cross the edge of the mass. */
  background: linear-gradient(to right,
    var(--name-lit) 0 calc(var(--edge-c) - var(--gutter)),
    var(--name-shade) calc(var(--edge-c) - var(--gutter)));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.name h1 span { display: block; }

.aside {
  color: var(--on-mass);
  padding: 40px var(--gutter);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
}
.aside ul { list-style: none; }
.aside li {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.35;
  padding: 12px 0;
  border-top: 1px solid var(--mass-rule);
  max-width: 30ch;
}
.aside li:last-child { border-bottom: 1px solid var(--mass-rule); }

.light { padding: 40px var(--gutter) 56px 0; }
.statement { padding-left: var(--inset); max-width: 34em; }
.statement p {
  font-size: clamp(20px, 1.9vw, 26px);
  line-height: 1.36;
  letter-spacing: -0.005em;
}
/* second paragraph is the beat: one line, set apart, heavier */
.statement p:nth-child(2) { margin-top: 1.1em; font-weight: 700; }
.statement p:nth-child(n+3) { margin-top: 1.1em; color: var(--text-2); }

.slab { height: 18px; background: var(--slab); width: 78%; margin-top: 36px; }
.cast {
  width: 62%;
  height: 44px;
  background-image: radial-gradient(circle, var(--dot) 1.5px, transparent 1.9px);
  background-size: 8px 8px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
          mask-image: linear-gradient(to bottom, #000, transparent);
}
.doors {
  padding-left: var(--inset);
  margin-top: 6px;
  display: flex;
  gap: clamp(28px, 5vw, 72px);
}
.doors a {
  font-family: var(--sans);
  font-stretch: 112%;
  font-weight: 800;
  font-size: clamp(26px, 3vw, 40px);
  letter-spacing: -0.01em;
  text-decoration: none;
  border-bottom: 4px solid currentColor;
  padding-bottom: 2px;
}
.doors a:hover { color: var(--text-2); }

/* ---------- list of writing (home and /writing/) ---------- */
.band {
  display: grid;
  grid-template-columns: var(--edge) 1fr;
  border-top: 18px solid var(--slab);
  padding: 72px 0 96px;
}
.band h2 { padding: 6px var(--gutter) 0; color: var(--text-2); }
.posts { list-style: none; padding-right: var(--gutter); padding-left: var(--inset); max-width: 46em; }
.posts li {
  display: grid;
  grid-template-columns: 3.2em 1fr;
  align-items: baseline;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
}
.posts li:last-child { border-bottom: 1px solid var(--rule); }
.posts .n {
  font-family: var(--sans);
  font-stretch: 125%;
  font-weight: 900;
  font-size: 22px;
  color: var(--text-2);
}
.posts h3 { font-size: 26px; font-weight: 500; line-height: 1.2; }
.posts h3 a { text-decoration: none; }
.posts h3 a:hover { text-decoration: underline; }
.posts p { color: var(--text-2); font-size: 17px; margin-top: 6px; }
.posts .when { font-family: var(--sans); font-size: 13px; font-weight: 500; letter-spacing: 0.04em; margin-top: 8px; }

/* ---------- inner pages ---------- */
.page {
  min-height: calc(100vh - 63px);
  display: grid;
  grid-template-columns: var(--edge-in) 1fr;
  background: linear-gradient(to right, var(--mass) 0 var(--edge-in), var(--panel) var(--edge-in));
}
.page-mass { color: var(--on-mass); padding: 56px 32px 48px var(--gutter); }
.page-mass .stick { position: sticky; top: 40px; display: flex; flex-direction: column; gap: 28px; }
.page-mass h1 {
  font-family: var(--sans);
  font-weight: 900;
  font-size: clamp(26px, 2.8vw, 40px);
  line-height: 1;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  overflow-wrap: break-word;
}
.page-mass .meta { font-family: var(--sans); font-size: 15px; font-weight: 500; line-height: 1.5; color: var(--on-mass-2); }
.page-mass .meta a { color: var(--on-mass); display: block; width: fit-content; }
.page-mass .lede { font-size: 17px; line-height: 1.45; color: var(--on-mass); }
.page-body { padding: 56px var(--gutter) 96px var(--inset); min-width: 0; }
.page-body > * { max-width: 40rem; }

/* prose */
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre { margin-top: 1.15em; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose li { font-size: 19px; line-height: 1.62; }
.prose > p:first-child { font-size: 23px; line-height: 1.45; }
.prose h2 {
  font-family: var(--sans);
  font-stretch: 112%;
  font-weight: 800;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-top: 2.2em;
  padding-top: 16px;
  border-top: 6px solid var(--slab);
}
.prose h3 { font-family: var(--sans); font-weight: 700; font-size: 19px; margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: 0.4em; }
.prose blockquote { border-left: 6px solid var(--slab); padding-left: 20px; color: var(--text-2); font-style: italic; }
.prose code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.86em; }
.prose pre { overflow-x: auto; padding: 16px; background: var(--mass); color: var(--on-mass); line-height: 1.5; }
.prose img { max-width: 100%; height: auto; display: block; }
.prose hr { border: 0; height: 18px; width: 40%; background: var(--slab); margin-top: 2.2em; }

/* resume */
.resume .summary p { font-size: clamp(19px, 1.6vw, 22px); line-height: 1.45; }
.resume h2 {
  color: var(--text-2);
  margin-top: 56px;
  padding-top: 14px;
  border-top: 6px solid var(--slab);
}
.resume section:first-child h2 { margin-top: 0; }
.resume section > p, .resume dl { margin-top: 16px; }
.resume dt { font-family: var(--sans); font-weight: 700; font-size: 16px; margin-top: 14px; }
.resume dd { font-size: 17px; line-height: 1.5; }
.role { padding: 22px 0 6px; border-top: 1px solid var(--rule); margin-top: 18px; }
.role-head, .phase-head { break-after: avoid; }
.role li { break-inside: avoid; }
.resume h2 + .role { border-top: 0; margin-top: 0; }
.role-head, .phase-head { display: grid; grid-template-columns: 1fr auto; gap: 2px 24px; align-items: baseline; }
.role-head h3 { font-family: var(--sans); font-weight: 700; font-size: 20px; line-height: 1.25; }
.when {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  color: var(--text-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.where { grid-column: 1 / -1; font-style: italic; color: var(--text-2); font-size: 17px; }
.phase-head { margin-top: 20px; }
.phase-head h4 { font-family: var(--sans); font-weight: 600; font-size: 16px; line-height: 1.3; }
.role ul { margin: 10px 0 0; padding-left: 1.1em; }
.role li { font-size: 17px; line-height: 1.5; margin-top: 7px; }
.role li::marker { color: var(--text-2); }

/* ---------- foot ---------- */
footer {
  background: var(--mass);
  color: var(--on-mass);
  display: grid;
  grid-template-columns: var(--edge) 1fr;
  padding: 56px 0 64px;
}
body.inner footer { grid-template-columns: var(--edge-in) 1fr; }
footer .l { padding: 4px var(--gutter) 0; color: var(--on-mass-2); }
footer .r { padding-right: var(--gutter); padding-left: var(--inset); max-width: 42em; }
footer .r p { font-size: 22px; line-height: 1.4; }
footer .r p + p {
  margin-top: 20px;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  display: flex; gap: 28px; flex-wrap: wrap;
}

/* ---------- narrow ---------- */
@media (max-width: 760px) {
  .bar { gap: 14px; flex-wrap: wrap; row-gap: 10px; }
  .bar.label { letter-spacing: 0.08em; font-size: 11px; }
  .bar .home { font-stretch: 100%; letter-spacing: 0.06em; }
  .hero { display: block; min-height: 0; background: var(--panel); }
  .name { background: var(--mass); padding-top: 32px; }
  .name h1 { font-size: 13vw; background: none; color: var(--name-lit); }
  .aside { background: var(--mass); padding-top: 32px; gap: 32px; }
  .light { padding: 40px var(--gutter) 48px; }
  .statement, .doors { padding-left: 0; }
  .slab { width: 100%; margin-left: calc(-1 * var(--gutter)); }
  .cast { width: 70%; margin-left: calc(-1 * var(--gutter)); }
  .band, footer, body.inner footer, .page { display: block; }
  .band { padding: 48px 0 64px; }
  .band h2 { padding-bottom: 20px; }
  .posts, footer .r { padding-left: var(--gutter); }
  .posts h3 { font-size: 22px; }
  footer .l { padding-bottom: 16px; }
  footer .r p { font-size: 19px; }
  .page { min-height: 0; background: var(--panel); }
  .page-mass { background: var(--mass); padding: 36px var(--gutter) 32px; }
  .page-mass .stick { position: static; gap: 20px; }
  .page-mass h1 { font-size: 30px; }
  .page-body { padding: 36px var(--gutter) 64px; }
  .prose p, .prose li { font-size: 18px; }
  .prose > p:first-child { font-size: 20px; }
  .role-head, .phase-head { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------- print (the resume) ---------- */
@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --panel: #fff; --text: #000; --text-2: #333; --rule: #999; --slab: #000;
    --mass: #fff; --on-mass: #000; --on-mass-2: #333;
  }
  body { font-size: 10.5pt; background: #fff; }
  .bar, footer, .tile, .skip, .no-print { display: none !important; }
  .page { display: block; background: none; min-height: 0; }
  .page-mass { padding: 0 0 10pt; }
  .page-mass .stick { position: static; gap: 4pt; }
  .page-mass h1 { font-size: 20pt; }
  .page-mass .meta a { display: inline; margin-left: 12pt; text-decoration: none; }
  .page-body { padding: 0; }
  .page-body > * { max-width: none; }
  .resume .summary p, .resume dd, .role li, .where { font-size: 10.5pt; }
  .resume h2 { margin-top: 16pt; padding-top: 6pt; border-top-width: 2pt; }
  .role { padding-top: 8pt; margin-top: 8pt; }
  .role-head h3 { font-size: 12pt; }
}
