/* Tinta — ink rail + page */

@font-face {
  font-family: Literata;
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/fonts/literata-latin-ext-300-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Literata;
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/fonts/literata-latin-300-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Literata;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/literata-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Literata;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/literata-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Literata;
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/literata-latin-ext-400-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Literata;
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/literata-latin-400-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Literata;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/literata-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Literata;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/literata-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Literata;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/literata-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Literata;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/literata-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Sans Condensed";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-condensed-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans Condensed";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-condensed-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans Condensed";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-condensed-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans Condensed";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-condensed-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* === palette — edit only these === */
  /* calm stone / observational — soft slate + quiet sage mark */
  --rail: #2a3038;
  --rail-raised: #363d47;
  --rail-text: #e6e8eb;
  --rail-muted: #9aa1ab;
  --rail-tick: #4a5160;
  --mark: #a8b59a;
  --page: #f2f1ee;
  --ink: #1c1e22;
  --muted: #5e636c;
  --accent: #4a5560;
  /* === layout === */
  --measure: 640px;
  --meta: 96px;
  --rail-w: clamp(380px, 30vw, 460px);
  --ease-grow: 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  --ease-panel: 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  color-scheme: light;
  scroll-behavior: auto;
  overflow-anchor: auto;
  background-color: var(--page);
  overscroll-behavior-y: none;
}

body {
  font-family: Literata, Georgia, serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 28px;
  background-color: var(--page);
  background-image: none;
  color: var(--ink);
  overscroll-behavior-y: none;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

button,
.share-btn,
.tl-item,
.about-open,
.about-close,
.search-hit {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* —— Desk —— */
.desk {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100dvh;
  background-color: var(--page);
}

.rail {
  background: var(--rail);
  color: var(--rail-text);
  display: flex;
  flex-direction: column;
  padding: 24px 20px 20px;
  gap: 16px;
}

.rail-chrome {
  flex: 0 0 auto;
}

.rail-head {
  flex: 0 0 auto;
}

.about-open--head {
  display: none;
}

.about-open--foot {
  display: inline;
}

.masthead {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--rail-text);
  line-height: 1;
}

.masthead-name {
  font-family: Literata, Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-size: 36px;
  letter-spacing: -0.01em;
}

.masthead-dots {
  margin-top: 6px;
  font-family: "IBM Plex Sans Condensed", system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: 0.6em;
  color: var(--mark);
}

.search-form {
  position: relative;
  margin-top: 24px;
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  background: var(--rail-raised);
  border-radius: 4px;
}

.search-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--rail-text);
  font-family: "IBM Plex Sans Condensed", system-ui, sans-serif;
  font-size: 14px;
  line-height: 20px;
  padding: 0;
}

.search-form input::placeholder {
  color: var(--rail-muted);
}

.search-form input:focus {
  outline: none;
}

.search-form input::-webkit-search-decoration,
.search-form input::-webkit-search-cancel-button {
  appearance: none;
}

.jump-latest {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  padding: 0 0 10px;
  border: 0;
  background: none;
  font-family: "IBM Plex Sans Condensed", system-ui, sans-serif;
  font-size: 13px;
  line-height: 18px;
  color: var(--rail-muted);
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.jump-latest:hover {
  color: var(--rail-text);
}

.rail-mid {
  position: relative;
  flex: 1 1 auto;
  min-height: 220px;
  overflow: hidden;
}

/* Soft blur/fade so timeline titles dissolve into the foot */
.rail-mid::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32px;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 0%,
    color-mix(in srgb, var(--rail) 55%, transparent) 55%,
    var(--rail) 100%
  );
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  mask-image: linear-gradient(180deg, transparent 0%, #000 42%, #000 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 42%, #000 100%);
}

.timeline {
  position: relative;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--rail-tick) transparent;
  transition: opacity var(--ease-panel), visibility var(--ease-panel);
}

.timeline-list {
  position: relative;
  padding: 8px 0 24px;
}

.timeline-list::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 52px;
  width: 1px;
  background: var(--rail-tick);
  pointer-events: none;
}

.tl-year {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 40px 16px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin: 10px 0 2px;
  padding: 6px 8px 6px 0;
  background: var(--rail);
  font-family: "IBM Plex Sans Condensed", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}

.tl-year .tl-num {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--mark);
}

.tl-tick--year {
  width: 10px;
  opacity: 0.5;
}

.tl-item {
  display: grid;
  grid-template-columns: 40px 16px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 32px;
  padding: 4px 8px 4px 0;
  text-align: left;
  border-radius: 4px;
  font-family: "IBM Plex Sans Condensed", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  transition: background 0.12s ease;
}

@media (hover: hover) {
  .tl-item:hover {
    background: var(--rail-raised);
  }
}

.tl-item:focus-visible {
  outline: 1px solid var(--mark);
  outline-offset: 1px;
}

.tl-num {
  font-size: 12px;
  line-height: 16px;
  text-align: right;
  color: var(--rail-muted);
}

.tl-tick {
  display: block;
  height: 1px;
  width: var(--tick, 12px);
  justify-self: start;
  background: var(--rail-tick);
  transition: width 0.2s ease, background 0.2s ease;
}

.tl-item.is-active .tl-tick {
  width: 100%;
  background: var(--mark);
}

.tl-item.is-active .tl-title {
  color: #fff;
  font-weight: 500;
}

.tl-item.is-active .tl-num {
  color: var(--mark);
}

.tl-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

  .tl-title {
  font-size: 15px;
  line-height: 20px;
  color: var(--rail-text);
}

.tl-date {
  display: block;
  font-size: 12px;
  line-height: 16px;
  color: var(--rail-muted);
}

.search-panel,
.about-panel {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--rail);
  padding: 4px 0 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  pointer-events: none;
  transition:
    opacity var(--ease-panel),
    transform var(--ease-panel),
    visibility var(--ease-panel);
}

.rail.is-about .about-panel,
.rail.is-search .search-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

.rail.is-about .timeline,
.rail.is-search .timeline {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.search-panel-status {
  margin: 0 0 12px;
  padding: 0 4px;
  font-family: "IBM Plex Sans Condensed", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rail-muted);
}

.search-hit {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 8px 10px 0;
  border-radius: 4px;
  font-family: "IBM Plex Sans Condensed", system-ui, sans-serif;
}

.search-hit:hover,
.search-hit:focus-visible {
  background: var(--rail-raised);
  outline: none;
}

.search-hit-num {
  font-size: 12px;
  text-align: right;
  color: var(--rail-muted);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

.search-hit-title {
  display: block;
  font-size: 15px;
  line-height: 20px;
  color: #fff;
  font-weight: 500;
}

.search-hit-excerpt {
  display: block;
  margin-top: 4px;
  font-family: Literata, Georgia, serif;
  font-style: italic;
  font-size: 13px;
  line-height: 18px;
  color: var(--rail-muted);
}

.search-hit mark {
  background: transparent;
  color: inherit;
  box-shadow: inset 0 -2px var(--mark);
}

.about-panel {
  padding: 8px 4px 24px;
}

.about-block {
  margin: 0 0 28px;
}

.about-block:last-child {
  margin-bottom: 8px;
}

.about-title {
  margin: 0 0 10px;
  font-family: Literata, Georgia, serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 26px;
}

.about-text {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--rail-muted);
}

.rail-foot {
  position: relative;
  flex: 0 0 auto;
  padding-top: 8px;
  z-index: 4;
}

.profile {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0;
}

.profile img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
  transition: width var(--ease-grow), height var(--ease-grow);
}

.profile figcaption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-family: "IBM Plex Sans Condensed", system-ui, sans-serif;
  font-size: 14px;
  line-height: 18px;
  transition: gap var(--ease-grow);
}

.profile figcaption b {
  font-weight: 500;
  transition: font-size var(--ease-grow);
}

.socials {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px 12px;
  min-width: 0;
  font-size: 13px;
  color: var(--rail-muted);
  transition: gap var(--ease-grow), font-size var(--ease-grow);
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  max-width: 100%;
  padding: 2px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: padding var(--ease-grow), gap var(--ease-grow), color 0.15s ease;
}

.social-btn[data-copy-email] {
  flex-shrink: 1;
  min-width: 0;
}

.social-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-btn:hover {
  color: var(--rail-text);
}

.social-icon {
  flex-shrink: 0;
  display: block;
  opacity: 0.85;
  transition: width var(--ease-grow), height var(--ease-grow);
}

.rail.is-about .profile,
.rail.is-timeline .profile {
  gap: 16px;
}

.rail.is-about .profile img,
.rail.is-timeline .profile img {
  width: 72px;
  height: 72px;
}

.rail.is-about .profile figcaption,
.rail.is-timeline .profile figcaption {
  gap: 6px;
}

.rail.is-about .profile figcaption b,
.rail.is-timeline .profile figcaption b {
  font-size: 16px;
}

.rail.is-about .socials,
.rail.is-timeline .socials {
  gap: 6px 14px;
  font-size: 14px;
}

.rail.is-about .social-btn,
.rail.is-timeline .social-btn {
  gap: 8px;
  padding: 2px 0;
}

.rail.is-about .social-icon,
.rail.is-timeline .social-icon {
  width: 16px;
  height: 16px;
}

.rail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 0.75em;
  margin: 12px 0 0;
  font-family: "IBM Plex Sans Condensed", system-ui, sans-serif;
  font-size: 12px;
  line-height: 18px;
  color: var(--rail-muted);
}

.toc-fab {
  display: none;
}

.about-open {
  color: var(--rail-text);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.about-open:hover,
.about-open[aria-expanded="true"] {
  color: #fff;
}

.sheet-close {
  display: none;
}

.site-credit {
  margin: 0;
  color: inherit;
}

.site-credit--rail {
  margin-left: auto;
  text-align: right;
}

.site-credit--about {
  display: none;
}

.site-credit a {
  color: inherit;
}

.about-years {
  margin: 14px 0 0;
  font-family: "IBM Plex Sans Condensed", system-ui, sans-serif;
  font-size: 13px;
  line-height: 18px;
  color: var(--rail-muted);
}

/* —— Stage / feed —— */
.stage {
  background: var(--page);
  min-width: 0;
}

.page-inner {
  width: min(var(--measure), calc(100% - 48px));
  margin-inline: auto;
  padding: 96px 0 160px;
}

.feed-edge {
  height: 1px;
}

.post {
  margin: 0 0 160px;
  position: relative;
}

.post:not(:last-child)::after {
  content: "· · · ·";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -88px;
  text-align: center;
  font-family: "IBM Plex Sans Condensed", system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: 0.6em;
  color: color-mix(in srgb, var(--accent) 60%, transparent);
  pointer-events: none;
}

.post-title {
  margin: 0 0 10px;
  font-family: Literata, Georgia, serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 40px;
  text-wrap: balance;
  color: inherit;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35em 0.45em;
  margin: 0 0 24px;
  font-family: "IBM Plex Sans Condensed", system-ui, sans-serif;
  font-size: 13px;
  line-height: 18px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.post-body {
  text-wrap: pretty;
}

.post-body p {
  margin: 0;
}

.post-body p + p {
  text-indent: 1.5em;
}

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.post-body a:hover {
  text-decoration-color: var(--accent);
}

.post-end {
  display: flex;
  justify-content: flex-end;
  margin: 20px 0 0;
}

.share-btn {
  display: inline-flex;
  opacity: 0.55;
}

.share-btn:hover {
  opacity: 1;
}

.share-btn img {
  filter: none;
}

.empty {
  margin: 48px 0;
  font-family: "IBM Plex Sans Condensed", system-ui, sans-serif;
  color: var(--muted);
}

#snackbar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  margin: 0;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--page);
  font-family: "IBM Plex Sans Condensed", system-ui, sans-serif;
  font-size: 14px;
  z-index: 50;
  border-radius: 4px;
}

.cookie-consent {
  position: fixed;
  z-index: 40;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  max-width: 36rem;
  margin-inline: auto;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  border-radius: 4px;
  font-family: "IBM Plex Sans Condensed", system-ui, sans-serif;
}

.cookie-consent p {
  margin: 0;
  flex: 1 1 12rem;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted);
}

.cookie-consent__actions {
  display: flex;
  gap: 8px;
}

.cookie-consent button {
  appearance: none;
  font: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--ink);
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
}

.cookie-consent button[data-cookie-accept] {
  background: var(--ink);
  color: var(--page);
}

/* —— Desktop —— */
@media (min-width: 900px) {
  .desk {
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
    align-items: start;
  }

  .rail {
    position: sticky;
    top: 0;
    height: 100dvh;
    padding: 40px 32px 24px 40px;
    gap: 0;
  }

  .rail-head {
    margin-bottom: 24px;
  }

  .masthead-name {
    font-size: 40px;
  }

  .rail-mid {
    min-height: 0;
  }

  .page-inner {
    width: min(var(--measure), calc(100% - 4rem));
    margin-inline: auto;
    padding: 96px 0 96px;
  }
}

@keyframes phone-mark-breathe {
  0%,
  100% {
    opacity: 0.72;
    letter-spacing: 0.42em;
  }
  50% {
    opacity: 1;
    letter-spacing: 0.5em;
  }
}

@keyframes phone-fab-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 899px) {
  html {
    background-color: color-mix(in srgb, var(--mark) 18%, var(--page));
  }

  body {
    background-color: color-mix(in srgb, var(--mark) 18%, var(--page));
    background-image:
      radial-gradient(
        110% 48% at 8% -12%,
        color-mix(in srgb, var(--mark) 52%, transparent),
        transparent 60%
      ),
      radial-gradient(
        80% 40% at 100% 6%,
        color-mix(in srgb, var(--mark) 28%, transparent),
        transparent 55%
      ),
      linear-gradient(
        180deg,
        color-mix(in srgb, var(--mark) 18%, var(--page)) 0%,
        var(--page) 36%,
        var(--page) 100%
      );
  }

  .desk {
    background-color: transparent;
  }

  body.is-sheet-open {
    overflow: hidden;
  }

  .stage {
    background: transparent;
  }

  .rail {
    position: static;
    display: block;
    max-height: none;
    height: 0;
    padding: 0;
    gap: 0;
    overflow: visible;
    background: transparent;
    color: var(--ink);
    box-shadow: none;
  }

  .rail-chrome {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    padding: 12px 16px 10px;
    background:
      linear-gradient(
        180deg,
        color-mix(in srgb, var(--mark) 26%, var(--page)) 0%,
        color-mix(in srgb, var(--mark) 8%, var(--page)) 100%
      );
    border-bottom: 1px solid color-mix(in srgb, var(--mark) 48%, transparent);
    transform: translateY(0);
    transition: transform 0.28s ease, border-color 0.2s ease, background 0.2s ease;
  }

  .rail.is-chrome-hidden .rail-chrome:not(:focus-within) {
    transform: translateY(-100%);
  }

  .rail-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand about"
      "search search";
    gap: 8px 12px;
    align-items: end;
  }

  .masthead {
    grid-area: brand;
    color: var(--ink);
  }

  .about-open--head {
    display: inline;
    grid-area: about;
    justify-self: end;
    align-self: end;
    margin-bottom: 4px;
  }

  .about-open--foot {
    display: none;
  }

  .masthead-name {
    font-size: 26px;
  }

  .masthead-dots {
    margin-top: 5px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.42em;
    color: var(--mark);
    -webkit-text-stroke: 0.55px var(--mark);
    animation: phone-mark-breathe 4.2s ease-in-out infinite;
  }

  .search-form {
    grid-area: search;
    margin-top: 0;
    height: 36px;
    background: color-mix(in srgb, var(--mark) 34%, var(--page));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mark) 42%, transparent);
  }

  .search-form:focus-within {
    background: color-mix(in srgb, var(--mark) 44%, var(--page));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mark) 70%, transparent);
  }

  .search-form input {
    color: var(--ink);
  }

  .search-form input::placeholder {
    color: color-mix(in srgb, var(--muted) 70%, var(--mark));
  }

  .rail-foot {
    display: none;
  }

  .rail-meta {
    display: none;
  }

  .about-open {
    color: color-mix(in srgb, var(--mark) 55%, var(--ink));
    font-family: "IBM Plex Sans Condensed", system-ui, sans-serif;
    font-size: 14px;
    line-height: 19px;
    text-decoration-color: color-mix(in srgb, var(--mark) 55%, transparent);
  }

  .about-open:hover,
  .about-open[aria-expanded="true"] {
    color: var(--ink);
    text-decoration-color: var(--mark);
  }

  .site-credit--rail {
    display: none;
  }

  .site-credit--about {
    display: none;
    margin: 12px 0 0;
    font-family: "IBM Plex Sans Condensed", system-ui, sans-serif;
    font-size: 13px;
    line-height: 18px;
    color: var(--rail-muted);
    text-align: right;
  }

  .site-credit--about a {
    text-decoration: underline;
    text-underline-offset: 0.18em;
  }

  .toc-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    z-index: 45;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--mark) 78%, var(--rail));
    color: var(--rail);
    box-shadow:
      0 0 0 3px color-mix(in srgb, var(--mark) 55%, var(--page)),
      0 12px 30px color-mix(in srgb, var(--mark) 35%, transparent);
    cursor: pointer;
    transform: translateY(0);
    opacity: 1;
    animation: phone-fab-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
    transition:
      transform 0.28s ease,
      opacity 0.28s ease,
      background 0.15s ease,
      box-shadow 0.2s ease,
      color 0.15s ease;
  }

  .toc-fab.is-chrome-hidden {
    transform: translateY(calc(100% + 28px));
    opacity: 0;
    pointer-events: none;
  }

  body.is-sheet-open .toc-fab {
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 28px));
  }

  .toc-fab[aria-expanded="true"],
  .toc-fab:active {
    background: var(--rail);
    color: var(--mark);
    box-shadow:
      0 0 0 3px var(--mark),
      0 12px 30px color-mix(in srgb, var(--rail) 30%, transparent);
  }

  .toc-fab-icon {
    display: block;
  }

  .rail-mid {
    position: fixed;
    inset: 0;
    z-index: 50;
    max-height: none;
    min-height: 0;
    padding: 56px 16px 120px;
    overflow: auto;
    overscroll-behavior: contain;
    background: var(--rail);
    color: var(--rail-text);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px);
    transition:
      opacity var(--ease-panel),
      visibility var(--ease-panel),
      transform var(--ease-panel);
  }

  .jump-latest {
    position: sticky;
    top: 0;
    z-index: 4;
    margin: 0 0 10px;
    padding: 4px 0 12px;
    background: var(--rail);
    color: var(--rail-muted);
  }

  .jump-latest:hover {
    color: var(--rail-text);
  }

  .rail.is-timeline .rail-foot,
  .rail.is-about .rail-foot,
  .rail.is-search .rail-foot {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 51;
    padding: 16px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(
      180deg,
      transparent 0%,
      color-mix(in srgb, var(--rail) 55%, transparent) 18%,
      color-mix(in srgb, var(--rail) 92%, transparent) 38%,
      var(--rail) 55%
    );
    color: var(--rail-text);
  }

  .rail.is-timeline .rail-foot::before,
  .rail.is-about .rail-foot::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -16px;
    height: 40px;
    pointer-events: none;
    backdrop-filter: blur(10px) saturate(1.05);
    -webkit-backdrop-filter: blur(10px) saturate(1.05);
    mask-image: linear-gradient(180deg, transparent 0%, #000 45%, #000 100%);
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 45%, #000 100%);
  }

  /* Phone sheet: mid is full-screen; foot owns the dissolve instead */
  .rail.is-timeline .rail-mid::after,
  .rail.is-about .rail-mid::after,
  .rail.is-search .rail-mid::after {
    display: none;
  }

  .rail.is-about .site-credit--about,
  .rail.is-timeline .site-credit--about {
    display: block;
  }

  .rail.is-timeline .rail-mid,
  .rail.is-about .rail-mid,
  .rail.is-search .rail-mid {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .rail.is-timeline .rail-mid {
    padding-bottom: 168px;
  }

  .rail.is-about .rail-mid {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 52px;
    padding-bottom: 168px;
    overflow: auto;
  }

  .rail.is-about .about-panel {
    position: static;
    inset: auto;
    flex: 0 1 auto;
    width: 100%;
    max-height: 100%;
    margin-block: auto;
    overflow: auto;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    padding: 0;
  }

  .rail.is-about .about-title {
    font-size: 26px;
    line-height: 32px;
  }

  .rail.is-about .about-text {
    font-size: 17px;
    line-height: 26px;
  }

  .rail.is-about .about-years {
    font-size: 15px;
    line-height: 20px;
  }

  .rail.is-about .about-block:last-child {
    margin-bottom: 0;
  }

  .rail.is-about .timeline,
  .rail.is-about .search-panel {
    display: none;
  }

  /* Keep the search field usable above results */
  .rail.is-search .rail-chrome,
  .rail.is-search.is-chrome-hidden .rail-chrome {
    z-index: 55;
    transform: none;
  }

  .rail.is-search .rail-mid {
    padding-top: 118px;
    padding-bottom: 120px;
  }

  .rail.is-search .search-panel {
    position: static;
    inset: auto;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    padding: 8px 0 16px;
  }

  .rail.is-search .timeline,
  .rail.is-search .about-panel {
    display: none;
  }

  .rail.is-search .sheet-close {
    top: 122px;
  }

  .rail.is-search .rail-foot {
    display: none;
  }

  .sheet-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 10px;
    right: 12px;
    z-index: 60;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--rail-raised);
    color: var(--rail-text);
    font-size: 0;
    line-height: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--ease-panel), visibility var(--ease-panel);
  }

  .sheet-close svg {
    display: block;
    width: 16px;
    height: 16px;
  }

  .rail.is-timeline .sheet-close,
  .rail.is-about .sheet-close,
  .rail.is-search .sheet-close {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .about-panel,
  .search-panel {
    padding-top: 8px;
    color: var(--rail-text);
  }

  .about-title {
    color: var(--rail-text);
  }

  .page-inner {
    width: min(var(--measure), calc(100% - 32px));
    padding: 118px 0 88px;
  }

  .post {
    margin-bottom: 88px;
  }

  .post:not(:last-child)::after {
    bottom: -48px;
    color: var(--mark);
    letter-spacing: 0.72em;
    opacity: 0.9;
  }

  .post-title {
    font-size: 26px;
    line-height: 32px;
  }

  .post-meta {
    margin-bottom: 18px;
  }

  .post-meta time {
    color: color-mix(in srgb, var(--mark) 35%, var(--muted));
  }

  .post-end {
    margin-top: 16px;
  }

  .share-btn {
    opacity: 0.85;
    padding: 8px;
    margin: -8px;
    color: var(--mark);
  }

  .share-btn img {
    filter: invert(74%) sepia(12%) saturate(520%) hue-rotate(42deg) brightness(95%);
  }

  .share-btn:hover,
  .share-btn:active {
    opacity: 1;
  }

  .cookie-consent {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }

  @media (prefers-reduced-motion: reduce) {
    .masthead-dots,
    .toc-fab {
      animation: none;
    }
  }
}
