@property --notes-hole {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

:root {
  --paper: #f4f1eb;
  --paper-deep: #ebe6dc;
  --ink: #11110f;
  --muted: #696761;
  --line: rgba(17, 17, 15, 0.13);
  --clay: #bf4e3b;
  --powder: #dce8ed;
  --rail-height: 72px;
  --page-gutter: clamp(22px, 5vw, 78px);
  color-scheme: light;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--ink) var(--paper-deep);
  scrollbar-width: thin;
}

html,
body {
  min-width: 0;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

body {
  min-height: 100vh;
  overflow-x: clip;
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  width: min(280px, 24vw);
  height: min(620px, 70vh);
  background-image:
    linear-gradient(to right, rgba(17, 17, 15, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(17, 17, 15, 0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  content: "";
  mask-image: linear-gradient(135deg, #000 0 42%, transparent 88%);
  pointer-events: none;
}

body::-webkit-scrollbar {
  width: 9px;
}

body::-webkit-scrollbar-track {
  background: var(--paper-deep);
}

body::-webkit-scrollbar-thumb {
  border: 3px solid var(--paper-deep);
  background: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.site-rail {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  min-height: var(--rail-height);
  padding: 0 var(--page-gutter);
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: rgba(244, 241, 235, 0.96);
  border-bottom: 1px solid rgba(17, 17, 15, 0.045);
}

.site-rail p,
.site-rail time,
.site-rail a {
  margin: 0;
  font-family: "Bricolage Grotesque", "Noto Sans SC", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.site-rail__section {
  justify-self: center;
}

.site-rail__nav {
  display: flex;
  justify-self: end;
  gap: clamp(24px, 4vw, 58px);
  align-items: center;
}

.world-link {
  position: relative;
  padding-block: 10px;
}

.world-link::after,
.journal-jump::after {
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  height: 1px;
  background: currentColor;
  content: "";
  transform: scaleX(0.28);
  transform-origin: left;
  transition: transform 280ms ease;
}

.world-link:hover::after,
.world-link:focus-visible::after,
.journal-jump:hover::after,
.journal-jump:focus-visible::after {
  transform: scaleX(1);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 6px;
}

.scroll-meter {
  position: fixed;
  z-index: 35;
  top: 50%;
  right: 16px;
  display: grid;
  gap: 12px;
  justify-items: center;
  transform: translateY(-50%);
  pointer-events: none;
}

.scroll-meter__track {
  position: relative;
  display: block;
  width: 1px;
  height: 170px;
  overflow: hidden;
  background: rgba(17, 17, 15, 0.18);
}

.scroll-meter__fill {
  position: absolute;
  inset: 0;
  display: block;
  background: var(--ink);
  transform: scaleY(0);
  transform-origin: top;
  will-change: transform;
}

.scroll-meter__count {
  width: 58px;
  color: var(--muted);
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-align: center;
}

main,
.notes-footer {
  position: relative;
  z-index: 1;
}

.notes-hero {
  display: grid;
  min-height: max(950px, calc(100vh - var(--rail-height)));
  padding: clamp(28px, 4vw, 64px) var(--page-gutter) clamp(110px, 12vw, 190px);
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: 90px 150px 150px 170px 220px;
  column-gap: clamp(14px, 1.7vw, 28px);
  row-gap: clamp(16px, 2vw, 30px);
}

.notes-hero__copy {
  z-index: 2;
  grid-column: 1 / 5;
  grid-row: 1 / 6;
  align-self: center;
  padding: 3.2rem 0 0 clamp(0px, 1vw, 16px);
}

.eyebrow {
  margin: 0 0 2.2rem;
  color: var(--muted);
  font-family: "Bricolage Grotesque", "Noto Sans SC", sans-serif;
  font-size: clamp(0.64rem, 0.72vw, 0.76rem);
  font-weight: 700;
  letter-spacing: 0.2em;
}

.notes-hero h1 {
  max-width: 4em;
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  font-size: clamp(5.2rem, 9.2vw, 9rem);
  font-weight: 600;
  letter-spacing: -0.1em;
  line-height: 0.96;
}

.notes-hero__lead {
  margin: clamp(22px, 3vw, 42px) 0 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(1.1rem, 1.7vw, 1.55rem);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.journal-jump {
  position: relative;
  display: inline-block;
  margin-top: clamp(54px, 8vw, 112px);
  padding: 0 0 13px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.notes-hero__date {
  margin: clamp(118px, 15vw, 220px) 0 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
}

.photo-entry {
  min-width: 0;
  margin: 0;
}

.photo-entry > img,
.photo-entry__media,
.photo-entry__media img {
  width: 100%;
  height: 100%;
}

.photo-entry > img,
.photo-entry__media img {
  object-fit: cover;
}

.photo-entry__media {
  overflow: hidden;
}

.photo-entry figcaption {
  display: flex;
  margin-top: 9px;
  gap: 8px;
  color: #373631;
  font-size: 0.68rem;
  line-height: 1.4;
}

.photo-entry figcaption span + span::before {
  margin-right: 8px;
  color: #98958d;
  content: "/";
}

.photo-entry--street {
  grid-column: 5 / 8;
  grid-row: 2 / 5;
}

.photo-entry--street > img {
  object-position: 50% 64%;
}

.photo-entry--lead {
  z-index: 2;
  grid-column: 8 / 13;
  grid-row: 1 / 3;
}

.photo-entry--lead .photo-entry__media {
  height: calc(100% - 26px);
}

.photo-entry--lead img {
  object-position: 50% 42%;
}

.photo-entry--cat {
  height: 260px;
  grid-column: 8 / 12;
  grid-row: 3 / 5;
  align-self: start;
}

.photo-entry--cat > img {
  object-position: 52% 36%;
}

.photo-entry--landscape-teaser {
  height: 270px;
  margin-top: 84px;
  grid-column: 8 / 11;
  grid-row: 4 / 6;
  align-self: start;
}

.photo-entry--landscape-teaser > img {
  object-position: 50% 52%;
}

.hero-color-note {
  display: flex;
  min-height: 230px;
  padding: clamp(24px, 3vw, 42px);
  grid-column: 4 / 7;
  grid-row: 5 / 6;
  flex-direction: column;
  justify-content: space-between;
  align-self: start;
  color: #fff9f1;
  background: var(--clay);
}

.hero-color-note span {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.hero-color-note p {
  max-width: 13em;
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1rem, 1.45vw, 1.35rem);
  line-height: 1.65;
}

.journal {
  display: grid;
  max-width: 1540px;
  margin: 0 auto;
  padding: clamp(90px, 12vw, 190px) var(--page-gutter) clamp(150px, 18vw, 270px);
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(14, auto);
  column-gap: clamp(16px, 2vw, 34px);
  row-gap: clamp(90px, 11vw, 180px);
}

.chapter-intro {
  grid-column: 1 / 7;
  grid-row: 1;
}

.chapter-intro h2 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(2.8rem, 5.2vw, 5.7rem);
  font-weight: 600;
  letter-spacing: -0.06em;
  line-height: 1.18;
}

.chapter-intro > p:last-child {
  max-width: 34rem;
  margin: clamp(28px, 4vw, 56px) 0 0;
  color: var(--muted);
  font-family: "Noto Serif SC", serif;
  font-size: clamp(0.95rem, 1.2vw, 1.12rem);
  line-height: 2;
}

.photo-entry--daily-a {
  height: clamp(520px, 54vw, 760px);
  grid-column: 2 / 6;
  grid-row: 2;
}

.photo-entry--daily-b {
  height: clamp(390px, 38vw, 570px);
  margin-top: clamp(80px, 10vw, 150px);
  grid-column: 7 / 12;
  grid-row: 2;
}

.photo-entry--daily-b > img {
  object-fit: contain;
  background: #fff;
}

.photo-entry--daily-c {
  height: clamp(570px, 58vw, 820px);
  grid-column: 1 / 5;
  grid-row: 3;
}

.journal-quote {
  margin: clamp(90px, 12vw, 180px) 0 0;
  grid-column: 6 / 12;
  grid-row: 3;
  align-self: start;
}

.journal-quote p {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(2rem, 3.8vw, 4.1rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.55;
}

.journal-quote cite {
  display: block;
  margin-top: 2rem;
  color: var(--muted);
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 0.68rem;
  font-style: normal;
  letter-spacing: 0.16em;
}

.photo-entry--daily-d {
  height: clamp(540px, 52vw, 760px);
  grid-column: 7 / 12;
  grid-row: 4;
}

.photo-entry--daily-e {
  height: clamp(430px, 43vw, 620px);
  margin-top: clamp(140px, 16vw, 230px);
  grid-column: 2 / 6;
  grid-row: 4;
}

.photo-entry--daily-f {
  height: clamp(540px, 48vw, 720px);
  grid-column: 5 / 9;
  grid-row: 5;
}

.photo-entry--daily-g {
  height: clamp(410px, 38vw, 560px);
  margin-top: clamp(170px, 18vw, 260px);
  grid-column: 10 / 13;
  grid-row: 5;
}

.photo-entry--daily-h {
  height: clamp(560px, 55vw, 790px);
  grid-column: 2 / 7;
  grid-row: 6;
}

.photo-entry--daily-i {
  height: clamp(500px, 48vw, 690px);
  margin-top: clamp(130px, 15vw, 220px);
  grid-column: 8 / 12;
  grid-row: 6;
}

.photo-entry--daily-j {
  height: clamp(570px, 56vw, 800px);
  grid-column: 1 / 5;
  grid-row: 7;
}

.photo-entry--daily-k {
  height: clamp(540px, 53vw, 760px);
  margin-top: clamp(90px, 10vw, 160px);
  grid-column: 6 / 11;
  grid-row: 7;
}

.photo-entry--daily-l {
  height: clamp(590px, 58vw, 820px);
  grid-column: 4 / 9;
  grid-row: 8;
}

.chapter-intro--selected {
  grid-column: 1 / 8;
  grid-row: 9;
}

.photo-entry--selected-a {
  height: clamp(620px, 63vw, 900px);
  grid-column: 2 / 5;
  grid-row: 10;
}

.photo-entry--selected-b {
  height: clamp(460px, 43vw, 620px);
  margin-top: clamp(190px, 20vw, 290px);
  grid-column: 6 / 10;
  grid-row: 10;
}

.photo-entry--selected-c {
  height: clamp(420px, 44vw, 630px);
  grid-column: 5 / 13;
  grid-row: 11;
}

.selected-color-field {
  height: clamp(260px, 30vw, 430px);
  margin-top: clamp(80px, 9vw, 140px);
  grid-column: 1 / 4;
  grid-row: 11;
  background: var(--powder);
}

.photo-entry--selected-d {
  height: clamp(540px, 56vw, 800px);
  grid-column: 2 / 7;
  grid-row: 12;
}

.photo-entry--selected-e {
  height: clamp(650px, 64vw, 920px);
  margin-top: clamp(120px, 13vw, 190px);
  grid-column: 8 / 12;
  grid-row: 12;
}

.photo-entry--selected-f {
  height: clamp(360px, 38vw, 510px);
  grid-column: 2 / 6;
  grid-row: 13;
}

.photo-entry--selected-g {
  height: clamp(390px, 41vw, 560px);
  margin-top: clamp(110px, 12vw, 180px);
  grid-column: 7 / 12;
  grid-row: 13;
}

.photo-entry--selected-h {
  height: clamp(390px, 40vw, 550px);
  grid-column: 1 / 5;
  grid-row: 14;
}

.photo-entry--selected-i {
  height: clamp(390px, 42vw, 590px);
  margin-top: clamp(80px, 9vw, 140px);
  grid-column: 6 / 13;
  grid-row: 14;
}

.has-js .journal .photo-entry,
.has-js .journal .chapter-intro,
.has-js .journal .journal-quote,
.has-js .journal .selected-color-field {
  opacity: 0;
  transform: translateY(34px);
  transition:
    opacity 720ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 840ms cubic-bezier(0.22, 1, 0.36, 1);
}

.has-js .journal .is-visible {
  opacity: 1;
  transform: translateY(0);
}

.notes-footer {
  display: grid;
  min-height: 170px;
  padding: 42px var(--page-gutter);
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  background: var(--ink);
  color: var(--paper);
}

.notes-footer p,
.notes-footer a {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.13em;
}

.notes-footer p:nth-child(2) {
  justify-self: center;
  color: #a8a59e;
}

.notes-footer a {
  justify-self: end;
  padding: 10px 0;
}

.notes-arrival-fallback {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: none;
  overflow: hidden;
  background: transparent;
  isolation: isolate;
  pointer-events: none;
}

html.notes-arrival-pending .notes-arrival-fallback,
html.notes-transition-active .notes-arrival-fallback {
  display: block;
}

.notes-transition-target {
  position: fixed;
  z-index: 0;
  top: var(--notes-target-top, 0);
  left: var(--notes-target-left, 0);
  display: none;
  width: var(--notes-target-width, 0);
  height: var(--notes-target-height, 0);
  overflow: hidden;
  background: #111416;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.notes-transition-target img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
}

html.notes-use-target-proxy .notes-transition-target {
  display: block;
}

html.notes-return-target-visible .notes-transition-target {
  opacity: 1;
}

.notes-flight-canvas {
  position: fixed;
  z-index: 8;
  inset: 0;
  width: 100vw;
  height: 100vh;
  mix-blend-mode: screen;
  pointer-events: none;
}

.notes-aperture {
  position: absolute;
  inset: 0;
  --notes-hole: 0px;
  background: var(--aperture-color);
  -webkit-mask-image: radial-gradient(
    circle at var(--notes-aperture-x, 50%) var(--notes-aperture-y, 50%),
    transparent 0 var(--notes-hole),
    #000 calc(var(--notes-hole) + 1px)
  );
  mask-image: radial-gradient(
    circle at var(--notes-aperture-x, 50%) var(--notes-aperture-y, 50%),
    transparent 0 var(--notes-hole),
    #000 calc(var(--notes-hole) + 1px)
  );
  will-change: -webkit-mask-image, mask-image;
}

.notes-aperture--paper {
  z-index: 1;
  --aperture-color: #d8c9ae;
  --aperture-delay: 240ms;
  --aperture-return-delay: 0ms;
}

.notes-aperture--clay {
  z-index: 2;
  --aperture-color: #bf4e3b;
  --aperture-delay: 160ms;
  --aperture-return-delay: 80ms;
}

.notes-aperture--slate {
  z-index: 3;
  --aperture-color: #566b70;
  --aperture-delay: 80ms;
  --aperture-return-delay: 160ms;
}

.notes-aperture--ink {
  z-index: 4;
  --aperture-color: #111416;
  --aperture-delay: 0ms;
  --aperture-return-delay: 240ms;
}

html.notes-aperture-primed .notes-aperture,
html.notes-aperture-closed .notes-aperture {
  --notes-hole: var(--notes-aperture-start, 0px);
}

html.notes-aperture-opening .notes-aperture {
  animation: notes-aperture-open 920ms cubic-bezier(0.2, 0.78, 0.18, 1) var(--aperture-delay) both;
}

html.notes-aperture-closing .notes-aperture {
  animation: notes-aperture-close 920ms cubic-bezier(0.2, 0.78, 0.18, 1)
    var(--aperture-return-delay) both;
}

html.notes-aperture-sealing .notes-aperture {
  animation: notes-aperture-seal 280ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes notes-aperture-open {
  from {
    --notes-hole: var(--notes-aperture-start, 0px);
  }
  to {
    --notes-hole: var(--notes-aperture-radius, 180vmax);
  }
}

@keyframes notes-aperture-close {
  from {
    --notes-hole: var(--notes-aperture-radius, 180vmax);
  }
  to {
    --notes-hole: var(--notes-aperture-start, 0px);
  }
}

@keyframes notes-aperture-seal {
  from {
    --notes-hole: var(--notes-aperture-start, 0px);
  }
  to {
    --notes-hole: 0px;
  }
}

@media (max-width: 980px) {
  :root {
    --page-gutter: clamp(20px, 4.4vw, 42px);
  }

  .notes-hero {
    grid-template-rows: 82px 136px 140px 158px 210px;
  }

  .notes-hero__copy {
    grid-column: 1 / 6;
  }

  .photo-entry--street {
    grid-column: 6 / 9;
  }

  .photo-entry--lead {
    grid-column: 9 / 13;
  }

  .photo-entry--cat {
    grid-column: 8 / 13;
  }

  .hero-color-note {
    grid-column: 4 / 8;
  }
}

@media (max-width: 720px) {
  :root {
    --rail-height: 60px;
    --page-gutter: 18px;
  }

  body::before {
    width: 48vw;
    height: 420px;
    background-size: 48px 48px;
  }

  .site-rail {
    min-height: var(--rail-height);
    grid-template-columns: 1fr auto;
  }

  .site-rail__section {
    display: none;
  }

  .site-rail__nav {
    gap: 22px;
  }

  .site-rail time {
    color: var(--muted);
  }

  .scroll-meter {
    right: 4px;
  }

  .scroll-meter__track {
    height: 118px;
  }

  .scroll-meter__count {
    display: none;
  }

  .notes-hero {
    display: flex;
    min-height: 0;
    padding: 64px var(--page-gutter) 120px;
    gap: 76px;
    flex-direction: column;
  }

  .notes-hero__copy {
    order: 1;
    padding: 0;
  }

  .eyebrow {
    margin-bottom: 1.4rem;
  }

  .notes-hero h1 {
    font-size: clamp(4.7rem, 24vw, 7rem);
  }

  .notes-hero__lead {
    margin-top: 22px;
    font-size: 1.16rem;
  }

  .journal-jump {
    margin-top: 48px;
  }

  .notes-hero__date {
    margin-top: 76px;
  }

  .photo-entry--lead {
    order: 2;
    width: 100%;
    height: 270px;
  }

  .photo-entry--street {
    order: 3;
    width: 70%;
    height: 500px;
    margin-left: auto;
  }

  .photo-entry--cat {
    order: 4;
    width: 84%;
    height: 320px;
  }

  .photo-entry--landscape-teaser {
    width: 68%;
    height: auto;
    margin-top: 0;
    margin-left: auto;
    order: 5;
  }

  .hero-color-note {
    width: 68%;
    min-height: 220px;
    margin-left: 13%;
    order: 6;
  }

  .journal {
    display: block;
    padding-top: 90px;
    padding-bottom: 160px;
  }

  .chapter-intro,
  .journal-quote,
  .photo-entry,
  .selected-color-field {
    margin-top: 0;
    margin-bottom: 94px;
  }

  .chapter-intro h2 {
    font-size: clamp(2.9rem, 13vw, 4.6rem);
    line-height: 1.2;
  }

  .chapter-intro > p:last-child {
    font-size: 0.96rem;
  }

  .photo-entry--daily-a,
  .photo-entry--daily-d,
  .photo-entry--daily-h,
  .photo-entry--daily-j,
  .photo-entry--selected-d,
  .photo-entry--selected-f,
  .photo-entry--selected-g,
  .photo-entry--selected-i {
    width: 88%;
    height: auto;
  }

  .photo-entry--daily-b,
  .photo-entry--daily-e,
  .photo-entry--daily-i,
  .photo-entry--daily-k,
  .photo-entry--selected-b,
  .photo-entry--selected-e,
  .photo-entry--selected-h {
    width: 76%;
    height: auto;
    margin-left: auto;
  }

  .photo-entry--daily-c,
  .photo-entry--daily-f,
  .photo-entry--daily-l,
  .photo-entry--selected-a {
    width: 72%;
    height: auto;
  }

  .photo-entry--daily-g {
    width: 66%;
    height: auto;
    margin-left: auto;
  }

  .photo-entry--selected-c {
    width: 100%;
    height: auto;
  }

  .photo-entry > img,
  .photo-entry__media,
  .photo-entry__media img {
    height: auto;
  }

  .photo-entry__media {
    aspect-ratio: 4 / 3;
  }

  .photo-entry__media img {
    height: 100%;
  }

  .journal-quote {
    padding: 62px 0 42px;
  }

  .journal-quote p {
    font-size: clamp(1.7rem, 8vw, 2.6rem);
  }

  .chapter-intro--selected {
    padding-top: 78px;
  }

  .selected-color-field {
    width: 62%;
    height: 210px;
    margin-left: 12%;
  }

  .notes-footer {
    min-height: 190px;
    padding: 34px var(--page-gutter);
    grid-template-columns: 1fr auto;
    gap: 24px;
  }

  .notes-footer p:nth-child(2) {
    display: none;
  }
}

@media (max-width: 380px) {
  .site-rail p,
  .site-rail time,
  .site-rail a {
    font-size: 0.64rem;
  }

  .site-rail time {
    display: none;
  }

  .notes-hero {
    padding-top: 54px;
  }

  .notes-hero h1 {
    font-size: 4.8rem;
  }

  .photo-entry--street {
    width: 76%;
    height: 440px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

}
