/* ----- Web fonts ----- */
@font-face {
  font-family: "Bookman Old Style";
  src: url("/assets/fonts/BookmanOldStyle-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { line-height: 1.55; -webkit-font-smoothing: antialiased; }
img, picture, svg, video { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
a { color: inherit; }

/* ----- Tokens ----- */
:root {
  --font-serif: "Bookman Old Style", "Bookman", "URW Bookman L", "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Brand palette — Royal Coast Media / Olive Branch */
  --brand-red:     #891010;
  --brand-red-dk:  #6a0c0c;
  --brand-sage:    #7d9270;
  --brand-sage-dk: #5e7256;
  --brand-cream:   #faf6d6;
  --brand-gold:    #e9c63a;

  --measure: 64ch;
  --container: 46rem;
  --container-wide: 72rem;

  --step--1: clamp(0.875rem, 0.84rem + 0.15vw, 0.95rem);
  --step-0:  clamp(1.05rem, 1rem + 0.25vw, 1.2rem);
  --step-1:  clamp(1.3rem, 1.15rem + 0.5vw, 1.55rem);
  --step-2:  clamp(1.65rem, 1.4rem + 0.9vw, 2.15rem);
  --step-3:  clamp(2.2rem, 1.7rem + 1.7vw, 3.15rem);
  --step-4:  clamp(3rem, 2.2rem + 3vw, 4.75rem);
  --step-5:  clamp(3.75rem, 2.2rem + 6vw, 7rem);

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(20, 18, 12, 0.06);
  --shadow:    0 4px 18px -8px rgba(20, 18, 12, 0.18), 0 1px 3px rgba(20, 18, 12, 0.05);
  --shadow-lg: 0 12px 32px -12px rgba(20, 18, 12, 0.22), 0 2px 6px rgba(20, 18, 12, 0.06);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="light"], :root:not([data-theme]) {
  --bg:        #faf7f0;
  --bg-elev:   #fffdf6;
  --bg-card:   #fbf6e8;
  --fg:        #1a1817;
  --fg-muted:  #59544c;
  --fg-faint:  #8a857a;
  --rule:      #e6e1d2;
  --rule-soft: #efe9d8;
  --accent:        var(--brand-red);
  --accent-hover:  var(--brand-red-dk);
  --accent-2:      var(--brand-sage-dk);
  --accent-2-soft: var(--brand-sage);
  --highlight:     var(--brand-gold);
  --code-bg:       #f1ecdb;
}

:root[data-theme="dark"] {
  --bg:        #141210;
  --bg-elev:   #1e1b16;
  --bg-card:   #221d15;
  --fg:        #ecebe5;
  --fg-muted:  #b3ad9d;
  --fg-faint:  #807a6c;
  --rule:      #2e2a22;
  --rule-soft: #25211a;
  --accent:        #e26b6b;
  --accent-hover:  #ef8b8b;
  --accent-2:      #9bb094;
  --accent-2-soft: #7d9270;
  --highlight:     #f0d055;
  --code-bg:       #221f18;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg:        #141210;
    --bg-elev:   #1e1b16;
    --bg-card:   #221d15;
    --fg:        #ecebe5;
    --fg-muted:  #b3ad9d;
    --fg-faint:  #807a6c;
    --rule:      #2e2a22;
    --rule-soft: #25211a;
    --accent:        #e26b6b;
    --accent-hover:  #ef8b8b;
    --accent-2:      #9bb094;
    --accent-2-soft: #7d9270;
    --highlight:     #f0d055;
    --code-bg:       #221f18;
  }
}

/* ----- Document ----- */
html {
  background: var(--bg);
  color: var(--fg);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  font-size: var(--step-0);
  background: var(--bg);
  color: var(--fg);
  font-feature-settings: "kern" 1, "liga" 1, "onum" 1;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Paper-grain texture — adds warmth without weight */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.65 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
:root[data-theme="dark"] body::before { opacity: 0.08; mix-blend-mode: screen; }

body > * { position: relative; z-index: 1; }

/* ----- Container ----- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1.5rem; }
.container-wide { max-width: var(--container-wide); }
.main { flex: 1; padding-block: 3.5rem 6rem; }

/* ----- Header ----- */
.site-header {
  padding-block: 1.4rem;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: var(--container-wide);
}
.site-name {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.site-name::before {
  content: "";
  width: 0.55rem; height: 0.55rem;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-family: var(--font-sans);
  font-size: var(--step--1);
  letter-spacing: 0.01em;
}
.site-nav a {
  text-decoration: none;
  color: var(--fg-muted);
  position: relative;
  padding-block: 0.25rem;
  transition: color 0.2s var(--ease);
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.site-nav a:hover { color: var(--fg); }
.site-nav a:hover::after { transform: scaleX(1); }

.theme-toggle {
  border: 1px solid var(--rule);
  border-radius: 999px;
  width: 2rem; height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.theme-toggle:hover { color: var(--fg); border-color: var(--accent); background: var(--bg-elev); }
.theme-toggle-icon::before { content: "☾"; font-size: 0.95rem; }
:root[data-theme="dark"] .theme-toggle-icon::before { content: "☀"; }

/* ----- Footer ----- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 2.5rem;
  font-family: var(--font-sans);
  font-size: var(--step--1);
  color: var(--fg-muted);
}
.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: var(--container-wide);
}
.footer-name {
  color: var(--fg);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.footer-links {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 1.4rem;
}
.footer-links a { text-decoration: none; transition: color 0.2s var(--ease); }
.footer-links a:hover { color: var(--accent); }

/* ----- Typography ----- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--fg);
  text-wrap: balance;
}

.prose { max-width: var(--measure); font-size: var(--step-0); }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: var(--step-2); margin-top: 2.4em; letter-spacing: -0.02em; }
.prose h3 { font-size: var(--step-1); margin-top: 1.9em; }
.prose p, .prose ul, .prose ol, .prose blockquote { color: var(--fg); text-wrap: pretty; }
.prose strong { font-weight: 600; }

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: color-mix(in oklab, var(--accent) 45%, transparent);
  transition: text-decoration-color 0.2s var(--ease), color 0.2s var(--ease);
}
.prose a:hover { color: var(--accent-hover); text-decoration-color: var(--accent); }

.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: none; }
.prose ul li { position: relative; padding-left: 0.2em; }
.prose ul li::before {
  content: "";
  position: absolute;
  left: -1em;
  top: 0.7em;
  width: 0.45em;
  height: 1px;
  background: var(--accent-2);
}
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 0.4em; }

.prose blockquote {
  border-left: 3px solid var(--accent-2-soft);
  padding: 0.1rem 1.2rem;
  color: var(--fg-muted);
  font-style: italic;
  background: var(--rule-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}
.prose pre {
  background: var(--code-bg);
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.9em;
  border: 1px solid var(--rule);
}
.prose pre code { background: transparent; padding: 0; }
.prose hr {
  border: none;
  height: 1px;
  background: var(--rule);
  margin: 3em 0;
  position: relative;
}
.prose hr::after {
  content: "✦";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  padding-inline: 0.75rem;
  color: var(--accent-2);
  font-size: 0.8rem;
}

/* ----- Kickers + section labels ----- */
.kicker {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-2);
  margin-bottom: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}
.kicker::before {
  content: "";
  width: 1.4rem; height: 1px;
  background: var(--accent-2);
  display: inline-block;
}

.section-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.section-label::before {
  content: "";
  display: inline-block;
  width: 1.75rem; height: 1px;
  background: var(--highlight);
}

/* ----- Page headings ----- */
.page-title {
  font-size: var(--step-4);
  margin-bottom: 0.4em;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-weight: 400;
}
.page-subtitle {
  font-family: var(--font-sans);
  font-size: var(--step-1);
  color: var(--fg-muted);
  font-weight: 400;
  margin-bottom: 3rem;
  max-width: var(--measure);
  text-wrap: balance;
}

.post-header { margin-bottom: 3rem; }
.post-title {
  font-size: var(--step-4);
  margin-bottom: 0.75rem;
  letter-spacing: -0.025em;
  line-height: 1.04;
  font-weight: 400;
}
.post-lede {
  font-family: var(--font-sans);
  font-size: var(--step-1);
  color: var(--fg-muted);
  font-weight: 400;
  margin-bottom: 1.25rem;
  max-width: var(--measure);
  line-height: 1.45;
  text-wrap: balance;
}
.post-meta {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.post-meta time { color: var(--accent-2); }

/* Editorial prelude — small italic note before the body proper */
.prose > .prelude {
  font-family: var(--font-sans);
  font-size: 0.94rem;
  line-height: 1.55;
  font-style: italic;
  color: var(--fg-muted);
  border-left: 2px solid var(--accent-2-soft);
  padding: 0.3rem 0 0.3rem 1.1rem;
  margin: 0 0 1.75rem;
  max-width: var(--measure);
  display: block;
}
.prose > .prelude strong { font-style: normal; color: var(--fg); font-weight: 600; }

/* Byline / author bio at the end */
.prose > .byline {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--fg-muted);
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
  margin-top: 2.5rem;
  display: block;
  max-width: var(--measure);
}
.prose > .byline a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--accent) 35%, transparent);
  text-underline-offset: 3px;
}
.prose > .byline a:hover { text-decoration-color: var(--accent); }

/* Drop cap: first paragraph of the body proper. After the prelude+hr, the next p gets the cap. */
.post .prose > .prelude + hr + p::first-letter,
.post .prose > p:first-of-type::first-letter {
  font-size: 3.7em;
  font-weight: 400;
  float: left;
  line-height: 0.85;
  padding: 0.15rem 0.55rem 0 0;
  color: var(--accent);
  margin-top: 0.05em;
  font-feature-settings: "kern" 1;
}
/* Suppress drop cap on the prelude itself */
.post .prose > .prelude::first-letter { all: unset; }

/* ----- Home — editorial hero ----- */
.home {
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 18rem);
  gap: 3rem;
  align-items: end;
  padding-block: 2rem 5rem;
  border-bottom: 1px solid var(--rule);
}
.home-hero h1 {
  font-size: var(--step-5);
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-weight: 400;
  margin-bottom: 1.5rem;
  text-wrap: balance;
}
.home-hero h1 .accent { color: var(--accent); font-style: italic; }
.home-hero .lede {
  font-family: var(--font-sans);
  font-size: var(--step-1);
  color: var(--fg-muted);
  font-weight: 400;
  max-width: 38ch;
  line-height: 1.4;
}
.home-hero .lede strong { color: var(--fg); font-weight: 600; }
.home-hero .intro p { display: none; } /* replaced by structured lede */
.home-hero .cta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  margin-top: 2rem;
  font-family: var(--font-sans);
  font-size: var(--step-0);
}
.home-hero .cta a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
  padding-bottom: 0.15rem;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.home-hero .cta a:hover { color: var(--accent-hover); border-color: var(--accent); }

.home-masthead {
  align-self: stretch;
  padding-left: 1.75rem;
  border-left: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2.25rem;
}

/* ----- Monogram ----- */
.monogram {
  display: grid;
  justify-items: start;
  align-content: start;
  line-height: 0.82;
  padding-top: 0.25rem;
}

.monogram--mark { gap: 0; }
.monogram-image {
  width: clamp(8.5rem, 6rem + 8vw, 11rem);
  height: clamp(8.5rem, 6rem + 8vw, 11rem);
  max-width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(20, 18, 12, 0.08), 0 8px 22px -10px rgba(137, 16, 16, 0.35);
}
.monogram--mark .monogram-rule { margin-top: 1.25rem; }
.monogram-letter {
  font-family: var(--font-serif);
  font-size: clamp(5rem, 3.5rem + 6vw, 8.5rem);
  letter-spacing: -0.05em;
  font-weight: 400;
  display: block;
  line-height: 0.85;
}
.monogram-r {
  color: var(--accent);
  font-style: italic;
  transform: translateX(-0.05em);
}
.monogram-a {
  color: var(--accent-2);
  margin-top: -0.18em;
  transform: translateX(0.6em);
}
.monogram-rule {
  display: block;
  width: 3.5rem;
  height: 2px;
  background: var(--highlight);
  margin: 1rem 0 0.8rem;
}
.monogram-label {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-faint);
  font-weight: 600;
}

.home-meta {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--fg-muted);
  line-height: 1.55;
  display: grid;
  gap: 1.1rem;
}
.home-meta .meta-row { display: grid; gap: 0.15rem; }
.home-meta .meta-label {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-faint);
  font-weight: 600;
}
.home-meta .meta-value { color: var(--fg); }
.home-meta .meta-value a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
}
.home-meta .meta-value a:hover { border-color: var(--accent); }

.home-section {
  padding-block: 4rem 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}
.home-section + .home-section { padding-block-start: 4rem; }
.home-section header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.home-section .view-all {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
  padding-bottom: 0.1rem;
}
.home-section .view-all:hover { color: var(--accent-hover); border-color: var(--accent); }

@media (max-width: 800px) {
  .home-hero { grid-template-columns: minmax(0, 1fr); padding-block: 1rem 3rem; }
  .home-masthead {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--rule);
    padding-top: 2rem;
    flex-direction: column;
    gap: 1.75rem;
  }
  .monogram { justify-items: start; }
  .monogram-letter { font-size: clamp(4rem, 3rem + 8vw, 6rem); }
  .monogram-a { transform: translateX(0.5em); }
}

/* ----- Lists / cards ----- */
.post-list, .project-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0;
}

.post-list-item {
  border-top: 1px solid var(--rule);
}
.post-list-item:last-child { border-bottom: 1px solid var(--rule); }
.post-list-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem 2rem;
  padding-block: 1.5rem;
  text-decoration: none;
  color: var(--fg);
  align-items: baseline;
  transition: background 0.2s var(--ease), padding-inline 0.25s var(--ease);
}
.post-list-link:hover {
  background: var(--bg-elev);
  padding-inline: 0.75rem;
}
.post-list-link:hover .post-list-title { color: var(--accent); }
.post-list-title {
  font-size: var(--step-2);
  font-weight: 400;
  letter-spacing: -0.015em;
  grid-column: 1;
  transition: color 0.2s var(--ease);
}
.post-list-desc {
  font-family: var(--font-sans);
  color: var(--fg-muted);
  max-width: var(--measure);
  font-size: 0.95rem;
  grid-column: 1;
  line-height: 1.45;
}
.post-list-meta {
  font-family: var(--font-sans);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
  grid-column: 2;
  grid-row: 1;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .post-list-link { grid-template-columns: 1fr; }
  .post-list-meta { grid-column: 1; grid-row: auto; }
}

/* ----- Project cards ----- */
.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr));
  gap: 1.25rem;
}
.project-list-item {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}
.project-list-item::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--accent-2);
  opacity: 0.6;
  transition: opacity 0.25s var(--ease), background 0.25s var(--ease);
}
.project-list-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: color-mix(in oklab, var(--accent) 22%, var(--rule));
}
.project-list-item:hover::before { background: var(--accent); opacity: 1; }
.project-list-link {
  display: block;
  padding: 1.5rem 1.5rem 1.65rem;
  text-decoration: none;
  color: var(--fg);
  height: 100%;
}
.project-list-title {
  font-size: var(--step-1);
  font-weight: 400;
  letter-spacing: -0.015em;
  margin-bottom: 0.5rem;
  transition: color 0.2s var(--ease);
}
.project-list-link:hover .project-list-title { color: var(--accent); }
.project-list-desc {
  font-family: var(--font-sans);
  color: var(--fg-muted);
  font-size: 0.92rem;
  line-height: 1.45;
  margin-bottom: 0.85rem;
}
.project-list-meta {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 600;
}

/* ----- Archives ----- */
.archive { max-width: var(--container); margin-inline: auto; padding-inline: 1.5rem; }
.archive-header { margin-bottom: 3.5rem; }
.archive-header .kicker { display: inline-flex; }

/* Elsewhere — cross-published work */
.elsewhere-section {
  margin-top: 4.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
}
.elsewhere-header {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.elsewhere-note {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--fg-muted);
  max-width: var(--measure);
  line-height: 1.5;
}
.elsewhere-note a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
}
.elsewhere-note a:hover { border-color: var(--accent); }

.post-list-link.is-external .post-list-title {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.external-arrow {
  font-size: 0.65em;
  color: var(--accent-2);
  font-family: var(--font-sans);
  transition: transform 0.25s var(--ease), color 0.2s var(--ease);
  display: inline-block;
  font-weight: 400;
}
.post-list-link.is-external:hover .external-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}
.post-venue {
  color: var(--fg-muted);
  font-weight: 600;
}
.post-meta-sep {
  color: var(--fg-faint);
  margin-inline: 0.4rem;
}

/* ----- Page bodies ----- */
.page { max-width: var(--container); margin-inline: auto; padding-inline: 1.5rem; }
.post { max-width: var(--container); margin-inline: auto; padding-inline: 1.5rem; }
.project { max-width: var(--container); margin-inline: auto; padding-inline: 1.5rem; }

/* ----- Bio portrait ----- */
.bio-portrait {
  float: right;
  margin: 0.3rem 0 1.5rem 2rem;
  max-width: 38%;
  position: relative;
}
.bio-portrait img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  display: block;
  filter: saturate(0.9) contrast(1.02);
  box-shadow: var(--shadow);
}
.bio-portrait::before {
  content: "";
  position: absolute;
  inset: -8px -8px 8px 8px;
  border: 1px solid var(--accent-2-soft);
  border-radius: var(--radius);
  z-index: -1;
  opacity: 0.5;
}

@media (max-width: 640px) {
  .bio-portrait {
    float: none;
    margin: 0 auto 1.75rem;
    max-width: 240px;
  }
  .bio-portrait::before { inset: -6px -6px 6px 6px; }
}

/* ----- Contact list ----- */
.contact-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.6rem;
  font-family: var(--font-sans);
  font-size: var(--step-1);
}
.contact-list a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
  padding-bottom: 0.1rem;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.contact-list a:hover { color: var(--accent-hover); border-color: var(--accent); }

/* ----- Selection ----- */
::selection {
  background: var(--highlight);
  color: var(--fg);
}
:root[data-theme="dark"] ::selection {
  background: color-mix(in oklab, var(--highlight) 60%, transparent);
}

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

/* ----- Motion preference ----- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* ----- Responsive ----- */
@media (max-width: 540px) {
  .site-header .container { gap: 0.75rem; }
  .site-nav { gap: 1rem; }
  .site-footer .container { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .footer-links { gap: 1rem; flex-wrap: wrap; }
}
