/* Reading mode: the article is the quietest room of the same day/night field. Variables are
   resolved once below from the base tokens, so light/dark follow the site theme. */
.is-post .site-header {
  border-color: var(--read-line);
  background: color-mix(in srgb, var(--read-bg) 93%, transparent);
  color: var(--read-ink);
}
.is-post .site-nav > a {
  color: var(--read-muted);
}
.is-post .site-nav > a:hover {
  color: var(--read-ink);
}
.is-post .inner-shell:before {
  display: none;
}
.reading-theme-toggle {
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--read-line);
  background: transparent;
  color: inherit;
  font-size: 0.7rem;
  cursor: pointer;
}
.reading-theme-toggle:hover {
  border-color: var(--read-link);
  color: var(--read-link);
}
.article-shell {
  width: min(980px, calc(100% - 2.5rem));
  padding-top: clamp(3.5rem, 7vw, 7rem);
}
.article-head {
  padding: 0 0 2.8rem;
  border-bottom: 1px solid var(--read-line);
}
.article-tools {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}
.back-link {
  font-size: 0.75rem;
  color: var(--read-link);
}
.back-link:before {
  content: "← ";
}
.article-head h1 {
  max-width: 14ch;
  margin: 1.6rem 0 0;
  font: 900 clamp(2.9rem, 4.6vw, 5rem)/1.04 var(--display);
  letter-spacing: 0;
  text-wrap: balance;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem 1.4rem;
  color: var(--read-muted);
  font-size: 0.78rem;
}
.article-meta time {
  color: var(--read-link);
}
.article-content {
  max-width: 75ch;
  margin: clamp(3.5rem, 7vw, 6rem) auto;
  font-size: clamp(1rem, 1.18vw, 1.09rem);
  line-height: 1.9;
}
.article-content h2,
.article-content h3,
.article-content h4 {
  margin: 2.7em 0 0.8em;
  line-height: 1.3;
  letter-spacing: -0.035em;
}
.article-content h2 {
  font-size: 1.7rem;
}
.article-content h3 {
  font-size: 1.28rem;
}
.article-content p {
  margin: 1.25em 0;
}
.article-content a {
  color: var(--read-link);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.article-content blockquote {
  margin: 2.2rem 0;
  padding: 1.1rem 1.5rem;
  border-top: 1px solid var(--read-line);
  border-bottom: 1px solid var(--read-line);
  color: var(--read-muted);
}
.article-content img {
  margin: 2.5rem auto;
  border: 1px solid var(--read-line);
}
.article-content code {
  padding: 0.12em 0.32em;
  background: color-mix(in srgb, var(--read-link) 11%, transparent);
  color: var(--read-link);
  font-family: var(--mono);
}
.article-content pre {
  overflow: auto;
  margin: 2.2rem 0;
  padding: 1.35rem 1.5rem;
  background: var(--code-bg);
  color: var(--code-ink);
  border: 1px solid color-mix(in srgb, var(--read-link) 45%, transparent);
  box-shadow: 10px 14px 28px rgba(0, 0, 0, 0.15);
}
.article-content pre:before {
  content: "CODE";
  display: block;
  margin-bottom: 0.9rem;
  color: var(--cyan);
  font: 0.64rem var(--mono);
  letter-spacing: 0.16em;
}
.article-content pre code {
  padding: 0;
  background: none;
  color: inherit;
}
.article-content table {
  width: 100%;
  margin: 2rem 0;
  border-collapse: collapse;
}
.article-content th,
.article-content td {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--read-line);
}
.article-content th {
  color: var(--read-link);
  text-align: left;
}
.article-foot {
  padding-top: 2.4rem;
  border-top: 1px solid var(--read-line);
}
.tags {
  font-size: 0.8rem;
  color: var(--read-muted);
}
.post-near {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}
.post-near span {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--read-muted);
  font: 0.72rem var(--mono);
  letter-spacing: 0.06em;
}
.post-near > div:last-child {
  text-align: right;
}
.post-near a {
  color: var(--read-link);
}
.reading-progress {
  position: fixed;
  z-index: 80;
  left: 0;
  top: 0;
  width: 100%;
  height: 2px;
  pointer-events: none;
}
.reading-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--read-link);
}
.back-to-top {
  position: fixed;
  z-index: 70;
  right: 1.25rem;
  bottom: 1.25rem;
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  place-items: center;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  background: var(--ocean-deep);
  color: var(--cyan);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 0.28s var(--ease),
    transform 0.28s var(--ease),
    background 0.28s var(--ease),
    color 0.28s var(--ease);
  cursor: pointer;
}
.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover,
.back-to-top:focus-visible {
  background: var(--cyan);
  color: var(--ocean-deep);
  outline: 0;
}
.back-to-top svg {
  width: 1.1rem;
  height: 1.1rem;
}
.comments-panel {
  max-width: 75ch;
  margin: 6rem auto 0;
  padding-top: 3rem;
  border-top: 1px solid var(--read-line);
}
.comment-list,
.comment-list ol {
  padding: 0;
  list-style: none;
}
.comment-body {
  margin: 1.4rem 0;
}
.comment-body > article {
  padding: 1.1rem;
  border: 1px solid var(--read-line);
}
.comment-body header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.75rem;
}
.comment-body header img {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
}
.comment-body header time {
  color: var(--read-muted);
}
.comment-body header a {
  margin-left: auto;
  color: var(--cyan);
}
.comment-body header a:hover,
.comment-body header a:focus-visible {
  color: var(--read-ink);
}
.comment-children {
  margin-left: 2rem;
}
.comment-content {
  margin-left: 3.1rem;
}
.respond {
  margin-top: 4rem;
}
.respond label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.76rem;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}
.respond input,
.respond textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--read-line);
  background: transparent;
  color: inherit;
  outline: 0;
}
.respond input:focus,
.respond textarea:focus {
  border-color: var(--read-link);
}
.respond button {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--read-ink);
  background: var(--read-ink);
  color: var(--read-bg);
  cursor: pointer;
}
.is-post .site-footer {
  border-color: var(--read-line);
  color: var(--read-muted);
}

/* Article detail: an index rail gives the reading surface the same spatial grammar as its archive. */
@media (min-width: 901px) {
  .article-shell {
    width: min(2048px, calc(100% - 5rem));
    padding-top: clamp(3rem, 6vw, 6rem);
  }
  .article-sheet {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(15rem, 0.82fr);
    column-gap: clamp(3rem, 7vw, 9rem);
  }
  .article-head {
    grid-column: 1/-1;
    display: block;
    padding: 1.25rem 0 2.75rem;
    border-top: 1px solid var(--read-line);
    border-bottom: 1px solid var(--read-line);
  }
  .article-head h1 {
    max-width: none;
    margin: clamp(2.25rem, 4.5vw, 4rem) 0 0;
    font-size: clamp(2.9rem, 4.6vw, 5rem);
    text-wrap: balance;
  }
  .article-meta {
    margin: 0;
    font-size: 0.72rem;
  }
  .article-content {
    grid-column: 1;
    width: min(75ch, 100%);
    margin: clamp(3.5rem, 7vw, 6rem) 0;
  }
  .article-outline:not([hidden]) {
    display: block;
    grid-column: 2;
    grid-row: 2;
    position: sticky;
    top: calc(4.5rem + 2.5rem);
    align-self: start;
    margin-top: clamp(3.5rem, 7vw, 6rem);
    padding: 1rem 0;
    border-top: 1px solid var(--read-line);
    border-bottom: 1px solid var(--read-line);
  }
  .article-foot {
    grid-column: 1;
    width: min(75ch, 100%);
  }
  .article-shell > .comments-panel {
    width: min(75ch, 100%);
    margin: 6rem auto 0 0;
  }
}

.article-outline[hidden] {
  display: none;
}
.article-outline ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.article-outline li + li {
  margin-top: 0.15rem;
}
.article-outline a {
  display: block;
  padding: 0.35rem 0;
  color: var(--read-muted);
  font-size: 0.78rem;
  line-height: 1.45;
  transition: color 0.2s var(--ease);
}
.article-outline a:hover,
.article-outline a:focus-visible,
.article-outline a.is-active {
  color: var(--read-link);
}
.article-outline .outline-level-1 a {
  font-weight: 700;
}
.article-outline .outline-level-2 a {
  padding-left: 0.5rem;
}
.article-outline .outline-level-3 a {
  padding-left: 1rem;
  font-size: 0.72rem;
}
@media (max-width: 900px) {
  .article-outline {
    display: none !important;
  }
}

/* The article is the quietest room of that same field, not a separate visual system. */
.is-post .article-head {
  border-top-color: var(--read-line);
}
.is-post .article-head h1 {
  letter-spacing: 0;
}
.is-post .article-outline:before {
  content: "CONTENTS";
  display: block;
  margin-bottom: 0.8rem;
  color: var(--read-muted);
  font: 0.62rem var(--mono);
  letter-spacing: 0.14em;
}
@keyframes theme-orbit {
  0% {
    opacity: 0.7;
    transform: scale(0.58);
  }
  42% {
    opacity: 0.95;
    transform: scale(1.5);
  }
  100% {
    opacity: 0;
    transform: scale(1.7);
  }
}
@keyframes theme-icon-turn {
  0% {
    filter: blur(0);
  }
  45% {
    filter: blur(0.5px);
  }
  100% {
    filter: blur(0);
  }
}
body.is-inner,
.is-inner .site-header,
.is-inner .site-footer,
.is-inner .section-feel .moment,
.is-inner .friend-network > a,
.is-inner .nav-search {
  transition:
    background-color 0.56s var(--ease),
    color 0.56s var(--ease),
    border-color 0.56s var(--ease),
    box-shadow 0.56s var(--ease);
}

/* Article and discussion return to the same day/night plane as every other route. */
body.is-post,
html[data-reading-theme="light"] body.is-post,
html[data-reading-theme="dark"] body.is-post {
  --read-bg: var(--ocean);
  --read-ink: var(--ink);
  --read-muted: color-mix(in srgb, var(--ink) 69%, var(--ocean));
  --read-line: color-mix(in srgb, var(--ink) 26%, transparent);
  --read-link: var(--ink);
  --code-bg: var(--ocean-deep);
  --code-ink: var(--mist);
  background: var(--ocean);
  color: var(--ink);
  color-scheme: dark;
}
.is-post .site-theme-toggle {
  color: var(--read-ink);
}
.is-post .site-theme-toggle:hover,
.is-post .site-theme-toggle:focus-visible {
  color: var(--read-ink);
}
.is-post .site-nav > a[aria-current="page"] {
  color: var(--read-ink);
}
.is-post .article-shell,
.is-post .article-sheet,
.is-post .comments-panel,
.is-post .site-footer {
  transition:
    background-color 0.56s var(--ease),
    color 0.56s var(--ease),
    border-color 0.56s var(--ease);
}
.is-post .comments-panel {
  width: min(75ch, 100%);
  margin: clamp(4.5rem, 10vw, 9rem) auto 0 0;
  padding-top: clamp(2.25rem, 5vw, 4rem);
  border-top-color: var(--read-line);
}
.is-post .comments-panel > h2 {
  margin: 0 0 2rem;
  font: 900 clamp(2rem, 4vw, 3.5rem)/0.94 var(--display);
  letter-spacing: 0;
}
.is-post .respond {
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
}
.is-post .respond h2 {
  margin: 0 0 1.5rem;
  font: 900 clamp(1.6rem, 2.6vw, 2.2rem)/1 var(--display);
  letter-spacing: 0;
}
.is-post #comment-form {
  display: grid;
  gap: 1.2rem;
  padding: clamp(1.2rem, 3vw, 2rem) 0 0;
  border-top: 1px solid var(--read-line);
}
.comment-identity {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.2rem;
  align-items: center;
  padding: 0;
  margin: 0;
  border: 0;
}
.comment-identity legend {
  width: 100%;
  margin: 0 0 0.15rem;
  color: var(--read-ink);
  font: 700 0.82rem/1 var(--display);
  letter-spacing: 0.03em;
}
.comment-identity label {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  color: var(--read-muted);
  font-size: 0.84rem;
  cursor: pointer;
}
.comment-identity input {
  width: 1rem !important;
  height: 1rem;
  padding: 0 !important;
  accent-color: var(--read-ink);
}
.comment-identity-note {
  min-height: 1.5em;
  margin: 0;
  color: var(--read-muted);
  font-size: 0.82rem;
}
.is-post .respond .form-grid {
  gap: 1rem;
  margin: 0;
}
.is-post .respond label {
  color: var(--read-muted);
  font-size: 0.78rem;
}
.is-post .respond input,
.is-post .respond textarea {
  border-color: var(--read-line);
  background: color-mix(in srgb, var(--mist) 14%, transparent);
  color: var(--read-ink);
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease);
}
.is-post .respond input:focus,
.is-post .respond textarea:focus {
  border-color: var(--read-ink);
  background: color-mix(in srgb, var(--mist) 28%, transparent);
}
.field-label {
  display: inline-flex;
  align-items: baseline;
  gap: 0.18em;
}
.required-mark {
  color: var(--read-ink);
  font-style: normal;
  font-weight: 900;
}
.is-post .respond button {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  margin: 0;
  padding: 0.7rem 1.05rem;
  border: 1px solid var(--cyan);
  background: var(--cyan);
  color: var(--read-bg);
  font: 700 0.82rem/1 var(--display);
  letter-spacing: 0.025em;
  transition:
    transform 0.2s var(--ease),
    background 0.2s var(--ease),
    color 0.2s var(--ease);
  cursor: pointer;
}
.is-post .respond button:hover,
.is-post .respond button:focus-visible {
  transform: translateY(-2px);
  background: transparent;
  color: var(--read-ink);
  outline: 0;
}
.is-post .respond button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}
.is-post .comment-list {
  margin: 0;
}
.is-post .comment-body > article {
  background: color-mix(in srgb, var(--mist) 10%, transparent);
}
