/* ============================================================
   Tokens, reset and the reading pages.

   The room (index.html) uses the tokens from here and adds room.css.
   Everything else is a paper page: a rail on the left, one column of
   text, a faint pencil drawing of something from the room in the corner.
   ============================================================ */

:root {
  --serif: 'Newsreader', 'Noto Serif SC', 'Songti SC', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Warm paper, graphite ink, moss from the sofa, cedar from the doors. */
  --paper: #efebe2;
  --paper-2: #f6f3ec;
  --ink: #1f1d19;
  --ink-2: #57534a;
  --ink-3: #8d877a;
  --rule: #d5cdbd;
  --rule-2: #e3ddd1;
  --accent: #4b6b50;
  --cedar: #a8612f;

  --drawing-filter: none;
  --drawing-opacity: 0.3;
  --face-dark: inline;
  --face-light: none;
  --theme: light;

  --rail: 11rem;
  --measure: 40rem;

  /* Grain: a tiny tile of turbulence, so the paper is not flat colour. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-opacity: 0.09;
}

/* Dark paper. Declared twice because the system preference is a media query
   and the reader's own choice is an attribute; one selector cannot say both. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #1b1a17;
    --paper-2: #22211d;
    --ink: #ebe6da;
    --ink-2: #b3ac9d;
    --ink-3: #7f796d;
    --rule: #37342e;
    --rule-2: #2a2824;
    --accent: #93b596;
    --cedar: #d08a57;
    --drawing-filter: invert(1);
    --drawing-opacity: 0.22;
    --face-dark: none;
    --face-light: inline;
    --theme: dark;
    --grain-opacity: 0.05;
  }
}
:root[data-theme='dark'] {
  --paper: #1b1a17;
  --paper-2: #22211d;
  --ink: #ebe6da;
  --ink-2: #b3ac9d;
  --ink-3: #7f796d;
  --rule: #37342e;
  --rule-2: #2a2824;
  --accent: #93b596;
  --cedar: #d08a57;
  --drawing-filter: invert(1);
  --drawing-opacity: 0.22;
  --face-dark: none;
  --face-light: inline;
  --theme: dark;
  --grain-opacity: 0.05;
}


/* --- reset -------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; display: block; }
/* width/height attributes reserve the space; the column sets the size. */
.main img { height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}


/* --- the paper page ----------------------------------------- */

html.paper { background: var(--paper); }

html.paper body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Grain over everything, never in the way. */
html.paper body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background-image: var(--grain);
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
}

.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100vh;
}


/* --- rail --------------------------------------------------- */

.rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2rem;
  padding: 4.25rem 1.5rem 2rem 1rem;
  border-right: 1px solid var(--rule-2);
  text-align: right;
  font-family: var(--mono);
}

.rail__name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 1.5;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}

.rail__nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  font-size: 13px;
}
.rail__nav a {
  position: relative;
  text-decoration: none;
  color: var(--ink-3);
  transition: color 140ms ease;
}
.rail__nav a:hover { color: var(--ink); }
.rail__nav a[aria-current] { color: var(--ink); }
/* The current page is marked the way a pencil would: one small square. */
.rail__nav a[aria-current]::after {
  content: '';
  position: absolute;
  right: -0.9rem;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -2px;
  background: var(--accent);
}

.theme-toggle {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
}
.theme-toggle:hover { color: var(--ink); }
.theme-toggle .face-dark { display: var(--face-dark); }
.theme-toggle .face-light { display: var(--face-light); }

.rail__room {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
  text-decoration: none;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.rail__room:hover { color: var(--ink); }
.rail__room picture {
  width: 7.5rem;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 2px;
}
.rail__room img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.rail__room:hover img { transform: scale(1.04); }
/* The thumbnail follows the page: daylight on paper, the lamps on at night. */
.rail__room .thumb-night { display: var(--face-light); }
.rail__room .thumb-day { display: var(--face-dark); }


/* --- main column -------------------------------------------- */

.main {
  position: relative;
  padding: 4rem clamp(1.5rem, 8vw, 8.5rem) 3rem;
  animation: arrive 520ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.main > * { max-width: var(--measure); }

@keyframes arrive {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
html.is-leaving .main { opacity: 0; transition: opacity 200ms ease; }

.page-title {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.page-lede {
  margin: 0.6rem 0 3rem;
  color: var(--ink-2);
  font-size: 1.05rem;
}


/* --- index list --------------------------------------------- */

.year {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2.2rem 0 0.2rem;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
}
.year::after { content: ''; flex: 1; height: 1px; background: var(--rule); }

.entries { list-style: none; margin: 0; padding: 0 0 0 1.25rem; }
.entry { border-bottom: 1px solid var(--rule-2); }
.entry a {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.95rem 0;
  text-decoration: none;
}
.entry__date {
  padding-top: 0.3rem;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.entry__title {
  display: block;
  font-size: 1.08rem;
  line-height: 1.4;
  transition: color 140ms ease;
}
.entry a:hover .entry__title { color: var(--accent); }
.entry__summary {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty {
  margin-top: 1rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule-2);
  border-bottom: 1px solid var(--rule-2);
  color: var(--ink-3);
  font-style: italic;
}


/* --- a post ------------------------------------------------- */

.back {
  display: inline-block;
  margin-bottom: 2.2rem;
  font-family: var(--mono);
  font-size: 12px;
  text-decoration: none;
  color: var(--ink-3);
}
.back:hover { color: var(--ink); }

.post__title {
  margin: 0;
  font-size: 2rem;
  font-weight: 450;
  line-height: 1.25;
  letter-spacing: -0.005em;
}
.post__meta {
  margin: 0.8rem 0 2.6rem;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.prose { font-size: 1.1rem; line-height: 1.75; }
.prose:lang(zh) { font-size: 1.04rem; line-height: 1.95; letter-spacing: 0.01em; }
.prose > * { margin: 0 0 1.15em; }
.prose h2, .prose h3 {
  margin: 2.2em 0 0.7em;
  font-weight: 500;
  line-height: 1.35;
}
.prose h2 { font-size: 1.35rem; }
.prose h3 { font-size: 1.15rem; }
.prose a {
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  transition: text-decoration-color 140ms ease;
}
.prose a:hover { text-decoration-color: var(--accent); }
.prose blockquote {
  margin-left: 0;
  padding-left: 1.2rem;
  border-left: 2px solid var(--rule);
  color: var(--ink-2);
  font-style: italic;
}
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0.3em 0; }
.prose li::marker { color: var(--ink-3); }
.prose hr {
  border: 0;
  height: 1px;
  margin: 2.5em auto;
  width: 40%;
  background: var(--rule);
}
.prose code {
  font-family: var(--mono);
  font-size: 0.82em;
  padding: 0.1em 0.35em;
  background: var(--paper-2);
  border: 1px solid var(--rule-2);
  border-radius: 3px;
}
.prose pre {
  overflow-x: auto;
  padding: 1rem 1.1rem;
  background: var(--paper-2);
  border: 1px solid var(--rule-2);
  border-radius: 3px;
  font-size: 0.85rem;
  line-height: 1.55;
}
.prose pre code { padding: 0; border: 0; background: none; }
.prose img { margin: 1.8em 0; border-radius: 2px; }
.prose strong { font-weight: 600; }
.prose table { border-collapse: collapse; font-size: 0.92rem; width: 100%; }
.prose th, .prose td { padding: 0.45em 0.6em; border-bottom: 1px solid var(--rule-2); text-align: left; }

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 3.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}
.post-nav a { text-decoration: none; color: var(--ink-2); max-width: 48%; }
.post-nav a:hover { color: var(--ink); }
.post-nav small {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.post-nav .next { margin-left: auto; text-align: right; }


/* --- travels ------------------------------------------------
   Photographs first. The column of text stays at reading width, but the
   pictures, the cover and the trip cards open out to a wider measure.
   ------------------------------------------------------------ */

.main--wide > * { max-width: 56rem; }
.main--wide .page-title,
.main--wide .page-lede,
.main--wide .back,
.main--wide .post__title,
.main--wide .post__meta { max-width: var(--measure); }

.trips { list-style: none; margin: 0; padding: 0; display: grid; gap: 3.2rem; }
.trip a { display: grid; gap: 0.35rem; text-decoration: none; }
.trip__cover {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin-bottom: 0.9rem;
  border-radius: 3px;
  background: var(--paper-2);
}
.trip__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms cubic-bezier(0.2, 0.7, 0.2, 1); }
.trip a:hover .trip__cover img { transform: scale(1.025); }
.trip__meta {
  display: flex;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.trip__title { font-size: 1.6rem; line-height: 1.3; transition: color 140ms ease; }
.trip a:hover .trip__title { color: var(--accent); }
.trip__summary { max-width: var(--measure); color: var(--ink-2); font-size: 1rem; line-height: 1.65; }

.hero { margin: 0 0 2.4rem; }
.hero img { width: 100%; max-height: 78vh; object-fit: cover; border-radius: 3px; }

/* In a trip the text keeps to the reading column and the photographs open
   out past it. A line of text belongs to the pictures right under it: it
   sits close above them, and the next line keeps its distance. */
.prose--travel > * { max-width: var(--measure); }
.prose--travel > p + .media { margin-top: 1rem; }
.prose--travel h2 { margin-top: 4.2rem; font-size: 1.5rem; }
.prose--travel h3 { margin-top: 2.6rem; font-size: 1.06rem; color: var(--ink-2); }

/* Groups of pictures (see MEDIA_BLOCK in build.py). --r is each picture's
   aspect ratio, --sum the group's; widths are capped by height, so a
   portrait never grows taller than the screen. */
.prose--travel > .media { position: relative; max-width: 100%; margin: 2.4rem 0 3.2rem; }
.media--single,
.media--wide,
.media--small  { width: min(56rem, var(--sum) * 76vh); }
.media--row    { width: min(56rem, var(--sum) * 70vh); }
.media--grid   { width: 56rem; }

/* A strip keeps to the picture column like everything else and scrolls
   sideways inside it. The edge that has more to show fades out, and a thin
   line underneath says where you are. */
.prose--travel > .media--strip { position: relative; width: 56rem; --strip-h: min(27rem, 62vh); }
.media--strip .media__items {
  --fade-l: 0rem;
  --fade-r: 0rem;
  position: relative;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent);
}
.media--strip.has-more-left .media__items { --fade-l: 3.5rem; }
.media--strip.has-more-right .media__items { --fade-r: 3.5rem; }
.media--strip .media__items::-webkit-scrollbar { display: none; }
.media--strip .media__items > figure {
  flex: 0 0 auto;
  width: calc(var(--r) * var(--strip-h));
  scroll-snap-align: start;
}
.media--strip.is-dragging .media__items { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.media--strip.is-dragging img { pointer-events: none; }
.strip__bar { margin-top: 0.9rem; }
.strip__bar[hidden] { display: none; }
.strip__track {
  position: relative;
  display: block;
  height: 1px;
  background: var(--rule);
}
.strip__thumb {
  position: absolute;
  top: -0.5px;
  height: 2px;
  background: var(--ink-3);
  transition: left 120ms linear;
}
/* The arrows sit on the pictures, halfway down their edge: glass circles,
   there while there is more to see, gone at the end. */
.strip__nav {
  position: absolute;
  top: calc(var(--strip-h) / 2);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  margin-top: -1.2rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(22, 20, 18, 0.48);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  transition: opacity 220ms ease, transform 220ms ease, background-color 220ms ease;
}
.strip__nav svg { width: 1rem; height: 1rem; }
.strip__nav:hover { background: rgba(22, 20, 18, 0.7); transform: scale(1.06); }
.strip__nav.is-off { opacity: 0; pointer-events: none; }
.strip__prev { left: 0.75rem; }
.strip__next { right: 0.75rem; }
@media (hover: none) { .strip__nav { display: none; } }
.media figure { margin: 0; }
.media img,
.media video {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border-radius: 3px;
  background: var(--paper-2);
}
.media img { cursor: zoom-in; }

/* A video is its poster, a play button and its length; it plays in the viewer. */
.media figure.is-video { position: relative; cursor: pointer; }
.media figure.is-video img { cursor: pointer; }
.play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  margin: -1.7rem 0 0 -1.7rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(22, 20, 18, 0.42);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  pointer-events: none;
  transition: transform 220ms ease, background-color 220ms ease;
}
.play svg { width: 1.15rem; height: 1.15rem; margin-left: 0.15rem; }
.media figure.is-video:hover .play { transform: scale(1.07); background: rgba(22, 20, 18, 0.62); }
.play-time {
  position: absolute;
  right: 0.55rem;
  bottom: 0.5rem;
  padding: 0.15rem 0.4rem;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.45);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #fff;
  pointer-events: none;
}
.media__items { display: flex; gap: 0.6rem; }
/* Widths in proportion to the aspect ratios, so a row comes out one height.
   (x100: flex hands out only part of the space when the factors sum below 1.) */
.media__items > figure { flex: calc(var(--r) * 100) 1 0; min-width: 0; }
.media--grid .media__items { flex-wrap: wrap; gap: 0.5rem; }
.media--grid .media__items > figure { flex: var(--r) 1 calc(var(--r) * 10.5rem); }
.media--grid .media__items::after { content: ''; flex: 1000 1 0; }
.media figcaption {
  margin-top: 0.7rem;
  max-width: var(--measure);
  line-height: 1.75;
  color: var(--ink-2);
}

/* Click a photograph to see it large. */
.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.lightbox::backdrop { background: rgba(14, 13, 12, 0.97); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.lightbox img,
.lightbox video {
  width: 100%;
  height: 100%;
  padding: 3vh 4.5rem 3.4rem;
  object-fit: contain;
  cursor: zoom-out;
}
/* The player hugs the picture, so its controls are as wide as the video. */
.lightbox[open] { display: grid; place-items: center; }
.lightbox video {
  width: auto;
  height: auto;
  max-width: calc(100% - 9rem);
  max-height: calc(100% - 6.5rem);
  padding: 0;
  border-radius: 3px;
  background: transparent;
  cursor: default;
}
.lightbox.is-video img,
.lightbox:not(.is-video) video { display: none; }
.lightbox__nav {
  position: absolute;
  top: 50%;
  width: 3.2rem;
  height: 6rem;
  margin-top: -3rem;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 2.6rem;
  line-height: 1;
  cursor: pointer;
  transition: color 140ms ease;
}
.lightbox__nav:hover { color: #fff; }
.lightbox__nav:focus:not(:focus-visible) { outline: none; }
.lightbox__prev { left: 0.5rem; }
.lightbox__next { right: 0.5rem; }
.lightbox.is-single .lightbox__nav { display: none; }
.lightbox__foot {
  z-index: 1;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1.1rem;
  display: flex;
  justify-content: center;
  gap: 1.4rem;
  margin: 0;
  padding: 0 1rem;
  pointer-events: none;
  color: rgba(255, 255, 255, 0.62);
}
.lightbox__note { font-size: 0.86rem; }
.lightbox__count { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; line-height: 1.9; }
html.has-lightbox { overflow: hidden; }
@media (max-width: 48rem) {
  .lightbox img { padding: 2vh 2vw 3.2rem; }
  .lightbox video { max-width: 96%; max-height: calc(100% - 4.5rem); }
  .lightbox__nav { display: none; }
}

@media (max-width: 48rem) {
  .trips { gap: 2.4rem; }
  .trip__title { font-size: 1.35rem; }
  .media__items { gap: 0.35rem; }
  /* On a phone strips run edge to edge, and a row too wide to stay legible
     (media--swipe-narrow, see build.py) turns into a strip as well. */
  .prose--travel > .media--strip,
  .prose--travel > .media--swipe-narrow {
    --strip-h: 20rem;
    width: auto;
    max-width: none;
    margin-left: -1.25rem;
    margin-right: -1.25rem;
  }
  .media--swipe-narrow .media__items {
    overflow-x: auto;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .media--swipe-narrow .media__items::-webkit-scrollbar { display: none; }
  .media--strip .media__items,
  .media--swipe-narrow .media__items { padding: 0 1.25rem; scroll-padding: 0 1.25rem; -webkit-mask-image: none; mask-image: none; }
  .media--swipe-narrow .media__items > figure { flex: 0 0 auto; width: calc(var(--r) * var(--strip-h)); scroll-snap-align: start; }
  .strip__bar { padding: 0 1.25rem; }
  .media--grid .media__items > figure { flex-basis: calc(var(--r) * 6.5rem); }
}


/* --- photography --------------------------------------------
   A series is a cover, a few lines, then groups of pictures in justified
   rows. build.py cuts each group into rows and gives every picture a flex
   share equal to its aspect ratio, so the pictures in a row come out the
   same height; a short row narrows to --share instead of towering. On a
   phone each picture takes the full width. Travel styles apply underneath
   (the article is also .post--travel).
   ------------------------------------------------------------ */

.trips--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3rem 2rem; }
.trips--grid .trip__title { font-size: 1.35rem; }

.post__dek { max-width: var(--measure); margin: 0.55rem 0 0; font-size: 1.12rem; line-height: 1.6; color: var(--ink-2); }
.post--series .hero img { height: auto; cursor: zoom-in; }   /* it carries width/height attributes */

.prose--travel > .photo-group { max-width: none; margin: 2.2rem 0; }
.photo-group { display: grid; gap: 0.6rem; }
.photo-row { display: flex; gap: 0.6rem; width: var(--share, 100%); margin: 0 auto; }
.photo-row figure { margin: 0; min-width: 0; }
.photo-row img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border-radius: 3px;
  background: var(--paper-2);
  cursor: zoom-in;
}

@media (max-width: 48rem) {
  .trips--grid { grid-template-columns: 1fr; gap: 2.4rem; }
}
@media (max-width: 40rem) {
  .photo-group { gap: 0.5rem; }
  .photo-row { display: grid; gap: 0.5rem; width: auto; }
}


/* --- footer ------------------------------------------------- */

.foot {
  display: flex;
  justify-content: space-between;
  margin-top: 4.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}
.foot nav { display: flex; gap: 1.2rem; }
.foot a { text-decoration: none; text-transform: uppercase; }
.foot a:hover { color: var(--ink); }


/* --- the drawing in the corner ------------------------------ */

.corner {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 0;
  width: min(28vw, 320px);
  margin: 0 1.5rem 1.25rem 0;
  pointer-events: none;
  opacity: var(--drawing-opacity);
  filter: var(--drawing-filter);
  -webkit-mask-image: radial-gradient(farthest-side at 62% 62%, #000 55%, transparent);
  mask-image: radial-gradient(farthest-side at 62% 62%, #000 55%, transparent);
}
.main { z-index: 1; }


/* --- small screens ------------------------------------------ */

@media (max-width: 48rem) {
  .shell { display: block; }
  .rail {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.8rem 1.2rem;
    padding: 1.4rem 1.25rem 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--rule-2);
    text-align: left;
  }
  .rail__name br { display: none; }
  .rail__nav { flex-direction: row; flex-wrap: wrap; gap: 0.9rem; order: 3; width: 100%; }
  .rail__nav a[aria-current]::after { right: auto; left: 50%; top: auto; bottom: -6px; margin: 0 0 0 -2px; }
  .rail__room { display: none; }
  .main { padding: 2.2rem 1.25rem 2.5rem; }
  .page-title { font-size: 1.9rem; }
  .post__title { font-size: 1.6rem; }
  .entries { padding-left: 0; }
  .entry a { grid-template-columns: 4.6rem minmax(0, 1fr); gap: 0.7rem; }
  .corner { width: 46vw; opacity: calc(var(--drawing-opacity) * 0.7); }
}

@media (prefers-reduced-motion: reduce) {
  .main { animation: none; }
}
