/* ============================================================
   cjarhodes.com — public site stylesheet
   Used by the public pages (home, résumé, writing, posts,
   photography, 404). The private goals area keeps rhodes.css.

   A plain, single-column page: EB Garamond throughout (loaded
   per page with <link>), warm paper, ink-coloured links with a
   soft underline. No cards, shadows, pills or entrance motion.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --font-serif: 'EB Garamond', Garamond, Georgia, serif;
  --font-sans: var(--font-serif);   /* older page styles still ask for "sans" */
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --bg: #fbfaf6;
  --bg-alt: #f2f0ea;
  --surface: #fbfaf6;
  --ink: #232220;
  --ink-2: #4a4843;
  --ink-3: #6e6a63;
  --rule: #dcd8cf;
  --rule-strong: #c5bfb3;
  --underline: #c5bfb3;
  --accent: #8a2a1f;
  --accent-hover: #6e2118;
  --accent-ink: #fbfaf6;
  --accent-tint: #f3e6e2;

  --radius-sm: 2px;
  --radius: 2px;
  --radius-lg: 2px;

  --wrap: 640px;
  --gutter: 24px;
  --ease: ease;
  --dur: 120ms;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #191917;
  --bg-alt: #22221f;
  --surface: #191917;
  --ink: #e8e4dc;
  --ink-2: #c3bfb6;
  --ink-3: #a39e95;
  --rule: #36342f;
  --rule-strong: #4c4a44;
  --underline: #5e5a52;
  --accent: #e59a85;
  --accent-hover: #f0b5a4;
  --accent-ink: #191917;
  --accent-tint: rgba(229, 154, 133, 0.12);

  color-scheme: dark;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.6;
  font-variant-numeric: oldstyle-nums;
  color: var(--ink);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent-tint); color: var(--ink); }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease);
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }

:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 50;
  padding: 6px 12px;
  background: var(--ink);
  color: var(--bg);
  font-size: 16px;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.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;
}

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.wrap--narrow, .wrap--reading { max-width: calc(var(--wrap) + 2 * var(--gutter)); }

/* Small-caps label with a short rule under it */
.eyebrow,
.label {
  display: block;
  margin-bottom: 12px;
  font-size: 17px;
  font-weight: 500;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.label::after {
  content: "";
  display: block;
  width: 28px;
  margin-top: 6px;
  border-top: 1px solid var(--rule);
}

.arrow-link svg { display: none; }

/* ---------- Header: one quiet line ---------- */
.site-header { padding-top: 48px; }
.site-header__inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--accent); }
.site-nav { display: flex; align-items: baseline; }
.site-nav__links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-nav__link {
  font-size: 18px;
  color: var(--ink-3);
  text-decoration: none;
}
.site-nav__link:hover { color: var(--accent); }
.site-nav__link[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--underline);
}
.site-nav__link--ext { display: none; }
/* The theme follows the device setting; the toggle stays in the markup for the goals area's script. */
.site-nav__actions { display: none; }

/* ---------- Buttons (rare: 404, résumé PDF) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  cursor: pointer;
  transition: color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease);
}
.btn:hover { color: var(--accent); text-decoration-color: currentColor; }
.btn svg { width: 16px; height: 16px; }

/* A button that reads as a link inside a sentence */
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.link-btn[hidden] { display: none; }
.link-btn u {
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
.link-btn:hover { color: var(--accent); }
.link-btn:hover u { text-decoration-color: currentColor; }

.tag {
  font-size: 0.85em;
  font-style: italic;
  color: var(--ink-3);
  white-space: nowrap;
}
.tag--accent { color: var(--accent); }

/* ---------- Page head (inner pages) ---------- */
.page-head { padding: 56px 0 8px; }
.page-head__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 38px;
  font-weight: 400;
  line-height: 1.1;
}
.page-lead {
  margin-top: 8px;
  font-style: italic;
  color: var(--ink-2);
}

/* ---------- Post list (writing index) ---------- */
.post-list { margin-top: 8px; }
.post-row {
  display: block;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}
.post-row:hover { color: inherit; }
.post-row__date {
  display: block;
  font-size: 16px;
  font-style: italic;
  color: var(--ink-3);
}
.post-row__title {
  font-size: 23px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--dur) var(--ease);
}
.post-row:hover .post-row__title { color: var(--accent); text-decoration-color: currentColor; }
.post-row__excerpt { margin-top: 4px; color: var(--ink-2); }
.post-row__meta {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-size: 16px;
  font-style: italic;
  color: var(--ink-3);
}
.post-row__meta .tag { font-size: inherit; }

/* ---------- Article (blog posts) ---------- */
.article-head { padding: 48px 0 12px; }
.back-link {
  display: inline-block;
  margin-bottom: 32px;
  font-size: 17px;
  color: var(--ink-3);
  text-decoration: none;
}
.back-link svg { display: none; }
.back-link::before { content: "← "; }
.back-link:hover { color: var(--accent); }
.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 10px;
  font-size: 17px;
  font-style: italic;
  color: var(--ink-3);
}
.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }
.article-title {
  font-size: 38px;
  font-weight: 400;
  line-height: 1.12;
}
.article-lede {
  margin-top: 14px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
  font-size: 22px;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink-2);
}

.prose { padding: 28px 0 16px; }
.prose > * + * { margin-top: 0.9em; }
.prose p { text-wrap: pretty; }
.prose h2 {
  margin-top: 1.8em;
  font-size: 26px;
  font-weight: 400;
  line-height: 1.25;
}
.prose h3 {
  margin-top: 1.8em;
  font-size: 18px;
  font-weight: 500;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.prose h2 + *, .prose h3 + * { margin-top: 0.5em; }
.prose strong { font-weight: 500; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose ul { list-style: none; padding-left: 20px; }
.prose ul > li { position: relative; }
.prose ul > li::before { content: "–"; position: absolute; left: -20px; color: var(--ink-3); }
.prose li + li { margin-top: 0.35em; }
.prose li::marker { color: var(--ink-3); }
.prose blockquote {
  margin: 1.6em 0;
  padding-left: 20px;
  border-left: 1px solid var(--rule-strong);
  font-size: 22px;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink-2);
}
.prose hr {
  margin: 2em auto;
  width: 40px;
  border: 0;
  border-top: 1px solid var(--rule-strong);
}
.prose code {
  padding: 0.05em 0.3em;
  background: var(--bg-alt);
  font-family: var(--font-mono);
  font-size: 0.78em;
}
.prose figure { margin: 1.8em 0; }
.prose figure img { width: 100%; }
.prose figure.figure--portrait img { max-width: 400px; margin: 0 auto; }
.prose figure.figure--portrait figcaption { text-align: center; }
.prose figcaption {
  margin-top: 8px;
  font-size: 16px;
  font-style: italic;
  line-height: 1.45;
  color: var(--ink-3);
}

.author-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.author-card img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(1);
}
.author-card__name { font-weight: 500; }
.author-card__bio { font-size: 17px; line-height: 1.5; color: var(--ink-2); }
.author-card__links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; font-size: 17px; }

.article-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 28px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 17px;
}

/* ---------- Footer ---------- */
.site-footer { padding: 56px 0 64px; }
.site-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 24px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-size: 16px;
  color: var(--ink-3);
}
.site-footer__links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-footer__links a { text-decoration: none; }
.site-footer__links a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 520px) {
  :root { --gutter: 20px; }
  body { font-size: 18px; }
  .site-header { padding-top: 28px; }
  .brand, .site-nav__link { font-size: 17px; }
  .site-nav__links { gap: 4px 12px; }
  .page-head { padding-top: 40px; }
  .page-title, .article-title { font-size: 32px; }
  .article-lede, .prose blockquote { font-size: 20px; }
  .prose h2 { font-size: 24px; }
}

/* ---------- Home page chat (assets/agentforce-chat.js) ---------- */
/* Shown when the Agentforce conversation is slow to start */
.agent-notice {
  position: fixed;
  right: 16px;
  bottom: 96px;
  z-index: 2147483000;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: min(340px, calc(100vw - 32px));
  padding: 12px 12px 12px 16px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  font-size: 17px;
  line-height: 1.45;
}
.agent-notice[hidden] { display: none; }
.agent-notice__text { margin: 0; }
.agent-notice__close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.agent-notice__close:hover { color: var(--ink); }
/* Ask link clicked before the chat is ready: a small spinner after the label */
.is-busy { cursor: progress; }
.is-busy::after {
  content: "";
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-left: 8px;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.8s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .is-busy::after { animation-duration: 2.4s; } }
