:root {
  --paper: #f5f4ef;
  --ink: #171715;
  --muted: #6e6d67;
  --line: #cfcec6;
  --accent: #e84d1d;
  --selection: #deddd4;
  color: var(--ink);
  background: var(--paper);
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  scroll-behavior: smooth;
}

body,
body.quarto-light {
  min-width: 320px;
  width: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(to right, transparent calc(50% - 0.5px), rgba(23, 23, 21, 0.025) calc(50% - 0.5px), rgba(23, 23, 21, 0.025) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    var(--paper);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.65;
}

::selection {
  background: var(--selection);
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

/* Quarto's layout remains useful as document structure, but the visual layout is custom. */
#quarto-header {
  display: none;
}

body.home #title-block-header,
body.writing #title-block-header,
body.blog #title-block-header,
body.photography #title-block-header {
  display: none;
}

#quarto-content,
#quarto-content .page-columns,
#quarto-content .content {
  display: block;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 0;
}

#quarto-content {
  width: min(100% - 48px, 1160px);
  margin: 0 auto;
}

#quarto-document-content {
  width: 100%;
  max-width: none;
  margin: 0;
}

.site-shell {
  width: min(100% - 48px, 1160px);
  margin: 0 auto;
}

.home-page,
.writing-page {
  width: min(100% - 48px, 1160px);
  margin: 0 auto;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header {
  min-height: 112px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  color: var(--ink);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.12em;
  line-height: 1;
  text-decoration: none;
}

.site-header nav,
.site-footer div {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.site-header nav a,
.site-footer a {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
}

.site-header nav a:hover,
.site-footer a:hover {
  color: var(--accent);
}

.hero {
  padding: clamp(84px, 13vw, 176px) 0 clamp(92px, 14vw, 188px);
}

.eyebrow,
.post-date,
#title-block-header .quarto-title-meta {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.45;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(230px, 0.62fr);
  gap: clamp(36px, 8vw, 132px);
  align-items: start;
  margin-top: 34px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero h1,
.page-intro h1,
#title-block-header .quarto-title .title,
#title-block-header .title {
  margin-bottom: 0;
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 1.05;
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(42px, 6.7vw, 92px);
}

.hero-bio {
  max-width: 660px;
  margin-top: clamp(32px, 4vw, 52px);
  font-size: 15px;
  line-height: 1.8;
}

.hero-bio p {
  margin-bottom: 1.5em;
}

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

.hero-note {
  max-width: 340px;
  padding-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.hero-note p {
  margin-bottom: 18px;
}

.sph-fluid-block {
  width: 100%;
}

.sph-fluid-shell {
  position: relative;
  width: 100%;
  height: 240px;
  margin-top: 0;
  overflow: hidden;
}

#sph-fluid-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  touch-action: pan-y;
}

#sph-fluid-canvas[hidden] {
  display: none;
}

.sph-fluid-restart {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 0;
  padding: 4px 0 4px 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  line-height: 1.4;
}

.sph-fluid-restart:hover,
.sph-fluid-restart:focus-visible {
  color: var(--accent);
}

.sph-fluid-restart:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: -2px;
}

.sph-fluid-restart:disabled {
  cursor: default;
  opacity: 0.45;
}

.sph-fluid-restart[hidden] {
  display: none;
}

.sph-fluid-fallback {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.sph-fluid-fallback[hidden] {
  display: none;
}

.sph-fluid-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 4vw, 54px);
  padding: 14px 0 16px;
  border-top: 1px solid var(--line);
}

.sph-fluid-controls[hidden] {
  display: none;
}

.sph-fluid-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 10px;
  align-items: center;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  line-height: 1.4;
}

.sph-fluid-control output {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.sph-fluid-control input {
  grid-column: 1 / -1;
  width: 100%;
  height: 14px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.sph-fluid-control input:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

.sph-fluid-control input:disabled {
  cursor: default;
  opacity: 0.45;
}

.sph-fluid-control input::-webkit-slider-runnable-track {
  height: 1px;
  background: var(--line);
}

.sph-fluid-control input::-webkit-slider-thumb {
  width: 10px;
  height: 10px;
  margin-top: -4px;
  appearance: none;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}

.sph-fluid-control input::-moz-range-track {
  height: 1px;
  background: var(--line);
}

.sph-fluid-control input::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}

.sph-fluid-control:hover input:not(:disabled)::-webkit-slider-thumb,
.sph-fluid-control input:focus-visible::-webkit-slider-thumb {
  background: var(--accent);
}

.sph-fluid-control:hover input:not(:disabled)::-moz-range-thumb,
.sph-fluid-control input:focus-visible::-moz-range-thumb {
  background: var(--accent);
}

.sph-fluid-mode {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.sph-fluid-mode legend {
  padding: 0;
}

.sph-fluid-mode-options {
  display: flex;
  gap: 6px;
  align-items: center;
}

.sph-fluid-mode label {
  cursor: pointer;
}

.sph-fluid-mode input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.sph-fluid-mode input + span {
  color: var(--muted);
}

.sph-fluid-mode input:checked + span {
  color: var(--ink);
}

.sph-fluid-mode input:focus-visible + span {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

.sph-fluid-mode input:disabled + span {
  cursor: default;
  opacity: 0.45;
}

.text-link {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.text-link span {
  display: inline-block;
  margin-left: 4px;
  transition: transform 160ms ease;
}

.text-link:hover span {
  transform: translate(2px, -2px);
}

.section {
  padding: 30px 0 118px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 19px;
  border-bottom: 1px solid var(--ink);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.writing-preview {
  padding-bottom: 140px;
}

/* Quarto listing template */
.quarto-listing,
.quarto-listing-container-default,
.quarto-listing-default {
  margin: 0;
}

.listing-no-matching.d-none {
  display: none;
}

.post-list {
  border-bottom: 1px solid var(--line);
}

.post-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 22px;
  gap: 22px;
  align-items: start;
  padding: 26px 0 28px;
  border-bottom: 1px solid var(--line);
}

.post-row:first-child {
  border-top: 1px solid var(--line);
}

.post-row:last-child {
  border-bottom: 0;
}

.post-copy {
  color: var(--ink);
  text-decoration: none;
}

.post-copy:hover {
  color: var(--ink);
}

.post-copy strong,
.post-summary {
  display: block;
}

.post-copy strong {
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.35;
}

.post-summary {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.post-arrow {
  justify-self: end;
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
  transition: transform 160ms ease;
}

.post-row:hover .post-arrow {
  transform: translate(3px, -3px);
}

.closing {
  max-width: 710px;
  padding: 28px 0 clamp(116px, 15vw, 180px);
  border-top: 1px solid var(--ink);
}

.closing .eyebrow {
  margin-bottom: 26px;
}

.closing > p:last-child {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 37px);
  letter-spacing: -0.06em;
  line-height: 1.3;
}

.closing a {
  text-decoration-color: var(--accent);
}

.site-footer {
  min-height: 94px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer p {
  margin: 0;
  font-size: 11px;
}

/* Writing index */
.page-intro {
  max-width: 820px;
  padding: clamp(82px, 11vw, 142px) 0 clamp(62px, 9vw, 108px);
}

.page-intro .eyebrow {
  margin-bottom: 28px;
}

.page-intro h1 {
  margin-bottom: 27px;
  font-size: clamp(38px, 5.8vw, 72px);
}

.page-intro > p:last-child {
  max-width: 580px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.writing-page .post-list {
  margin-bottom: clamp(112px, 15vw, 166px);
}

.blog-empty {
  margin: 0;
  padding: 28px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

/* Article title generated from QMD front matter */
#title-block-header {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: clamp(82px, 11vw, 142px) 0 clamp(58px, 9vw, 100px);
  border: 0;
}

#title-block-header .quarto-title-block,
#title-block-header .quarto-title {
  margin: 0;
  padding: 0;
}

#title-block-header .quarto-title .title,
#title-block-header .title {
  max-width: 730px;
  margin-bottom: 25px;
  color: var(--ink);
  font-size: clamp(42px, 6vw, 76px);
}

#title-block-header .description {
  max-width: 635px;
  margin: 0 0 26px;
  color: var(--muted);
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.65;
}

#title-block-header .quarto-title-meta,
#title-block-header .quarto-title-meta-heading,
#title-block-header .quarto-title-meta-contents,
#title-block-header .quarto-title-meta-contents p,
#title-block-header .author,
#title-block-header .date {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

#title-block-header .quarto-title-meta-heading {
  display: none;
}

#title-block-header .quarto-title-meta-contents {
  display: inline;
}

#title-block-header .author,
#title-block-header .date {
  display: inline;
  margin: 0;
}

#title-block-header .author:not(:last-child)::after {
  content: " · ";
}

#title-block-header .quarto-title-meta-contents:not(:last-child)::after {
  content: " · ";
}

#title-block-header .quarto-categories {
  display: none;
}

/* Article body is wrapped in .article-content in every post. */
.article-content {
  padding-bottom: 0;
  font-size: 15px;
  line-height: 1.9;
}

.article-content > * {
  max-width: 660px;
  margin-right: auto;
  margin-left: auto;
}

.article-content p {
  margin-bottom: 1.65em;
}

.article-content h2 {
  margin-top: 3.5em;
  margin-bottom: 1em;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1.35;
}

.article-content h3 {
  margin-top: 2.8em;
  margin-bottom: 0.9em;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.4;
}

.article-content ul,
.article-content ol {
  padding-left: 1.45em;
  margin-bottom: 1.7em;
}

.article-content li + li {
  margin-top: 0.5em;
}

.article-content blockquote {
  max-width: 610px;
  margin-top: 2.6em;
  margin-bottom: 2.6em;
  padding: 8px 0 8px 26px;
  border-left: 2px solid var(--accent);
  color: #46453f;
  font-size: 18px;
  line-height: 1.75;
}

.article-content blockquote p:last-child {
  margin-bottom: 0;
}

.article-content pre,
.article-content div.sourceCode {
  overflow-x: auto;
  margin-top: 2.5em;
  margin-bottom: 2.5em;
  padding: 20px 22px;
  background: #e9e7df;
  border: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.75;
}

.article-content pre {
  white-space: pre;
}

.article-content pre code,
.article-content div.sourceCode code {
  padding: 0;
  background: transparent;
  color: var(--ink);
}

code {
  padding: 0.08em 0.3em;
  background: rgba(23, 23, 21, 0.06);
  font-size: 0.9em;
}

.article-content figure,
.article-content .quarto-figure {
  margin-top: clamp(48px, 8vw, 88px);
  margin-bottom: clamp(48px, 8vw, 88px);
}

.article-content figure img,
.article-content .quarto-figure img,
.article-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.article-content figcaption,
.article-content .figure-caption,
.article-content .quarto-figure figcaption {
  max-width: 640px;
  margin: 13px auto 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  text-align: left;
}

.article-content > .quarto-layout-panel,
.article-content > .quarto-layout-row,
.article-content > .panel-layout {
  width: min(100%, 1120px);
  max-width: 1120px;
}

.article-content > .quarto-layout-panel img,
.article-content > .quarto-layout-row img {
  width: 100%;
}

.article-content .citation {
  font-size: 12px;
}

.references-heading {
  color: var(--muted);
  font-size: 11px !important;
  font-weight: 500 !important;
  letter-spacing: 0.04em;
  line-height: 1.45;
  margin-top: 5em !important;
  margin-bottom: 1.05em !important;
}

#refs {
  max-width: 660px;
  margin: 0 auto;
  padding-top: 1.25em;
  border-top: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.75;
}

#refs .csl-entry {
  margin-bottom: 1em;
  padding-left: 1.6em;
  overflow-wrap: anywhere;
  text-indent: -1.6em;
}

#refs a {
  text-decoration-color: var(--accent);
}

.article-content .MathJax_Display,
.article-content mjx-container[display="true"] {
  overflow-x: auto;
  margin-top: 2.45em;
  margin-bottom: 2.45em;
  padding: 21px 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

/* Photography sequence */
.photography-page {
  width: min(100% - 48px, 1160px);
  margin: 0 auto;
}

.photography-intro {
  max-width: 900px;
  padding: clamp(82px, 11vw, 142px) 0 clamp(88px, 12vw, 150px);
}

.photography-intro .eyebrow {
  margin-bottom: 28px;
}

.photography-intro h1 {
  margin: 0;
  font-size: clamp(40px, 6vw, 78px);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 1.05;
}

.photo-sequence {
  padding-bottom: clamp(110px, 16vw, 190px);
}

.photo-entry {
  width: min(92%, 1040px);
  margin: 0 0 clamp(92px, 15vw, 180px);
}

.photo-entry:last-child {
  margin-bottom: 0;
}

.photo-entry--medium {
  width: min(68%, 760px);
}

.photo-entry--right {
  margin-left: auto;
}

.photo-entry img {
  display: block;
  width: 100%;
  height: auto;
}

.photo-entry figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
  line-height: 1.45;
}

body.photography.motion-ready .photo-entry {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms ease, transform 850ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.photography.motion-ready .photo-entry.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 720px) {
  .sph-fluid-shell {
    height: 168px;
  }

  .sph-fluid-controls {
    grid-template-columns: 1fr;
    gap: 11px;
    padding: 13px 0 15px;
  }

  .sph-fluid-control {
    grid-template-columns: 96px minmax(0, 1fr) 44px;
    gap: 10px;
  }

  .sph-fluid-control input {
    grid-column: 2;
    grid-row: 1;
  }

  .sph-fluid-control output {
    grid-column: 3;
    grid-row: 1;
    text-align: right;
  }

  .sph-fluid-mode {
    grid-template-columns: 96px minmax(0, 1fr) 44px;
    gap: 10px;
  }

  .sph-fluid-mode legend {
    grid-column: 1;
    grid-row: 1;
  }

  .sph-fluid-mode-options {
    grid-column: 2 / -1;
    grid-row: 1;
  }
}

@media (max-width: 700px) {
  body,
  body.quarto-light {
    background: var(--paper);
  }

  #quarto-content,
  .site-shell,
  .home-page,
  .writing-page,
  .photography-page {
    width: min(100% - 34px, 1160px);
  }

  .photography-intro {
    padding: 72px 0 88px;
  }

  .photo-entry {
    width: 100%;
    margin-bottom: 88px;
  }

  .photo-entry--medium {
    width: 88%;
  }

  .site-header {
    min-height: 82px;
  }

  .site-header nav,
  .site-footer div {
    gap: 13px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .hero-note {
    max-width: 430px;
  }

  .section {
    padding-bottom: 90px;
  }

  .post-row {
    grid-template-columns: 1fr 18px;
    gap: 8px 14px;
  }

  .post-date {
    grid-column: 1 / -1;
  }

  .post-arrow {
    grid-column: 2;
    grid-row: 2;
  }

  .closing > p:last-child {
    letter-spacing: -0.07em;
  }

  #title-block-header {
    width: 100%;
  }

  .article-content {
    font-size: 14px;
    line-height: 1.85;
  }

  .article-content blockquote {
    padding-left: 18px;
    font-size: 16px;
  }

}

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