@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;1,400&family=DM+Mono:wght@400;500&display=swap');

:root {
  color-scheme: dark;
  --bg: #111110;
  --paper: #eee2c9;
  --muted: #a69e8f;
  --gold: #b69a6b;
  --line: #d7c39c29;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --mono: 'DM Mono', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body { margin: 0; background: var(--bg); color: var(--paper); font: 14px/1.8 var(--mono); }
a { color: inherit; text-decoration: none; }
a, button { -webkit-tap-highlight-color: transparent; }
a:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }
::selection { background: var(--gold); color: var(--bg); }
[hidden] { display: none !important; }
.skip { position: fixed; top: -70px; left: 20px; padding: 12px 20px; background: var(--paper); color: var(--bg); z-index: 20; }
.skip:focus { top: 10px; }
.diary-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 104px; padding: 0 5vw; border-bottom: 1px solid var(--line); }
.wordmark { font: 30px/1 var(--serif); letter-spacing: .04em; }
.wordmark span { color: var(--gold); }
.header-note, .back-link { font-size: 14px; letter-spacing: .12em; }
.header-note { color: var(--muted); }
.back-link:hover { color: var(--gold); }
.eyebrow { font-size: 14px; letter-spacing: .19em; color: var(--gold); }
.diary-intro {
  position: relative;
  isolation: isolate;
  padding-top: 74px;
  padding-inline: calc(8vw + max(0px, (100% - 1700px) / 2));
}
.diary-intro .diary-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}
.diary-intro > .eyebrow { display: flex; justify-content: space-between; margin: 0; }
.diary-intro > .eyebrow span { color: var(--muted); }
.intro-layout { display: grid; grid-template-columns: 1.6fr 1fr; align-items: end; gap: 10%; padding: 35px 0 60px; }
h1 { font: 400 clamp(70px, 8.5vw, 140px)/.88 var(--serif); letter-spacing: -.045em; margin: 0; }
h1 em { color: #cdb892; font-weight: 400; }
#page-title {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 44px);
}
.title-chinese {
  flex: none;
  padding-left: clamp(10px, 1.7vw, 26px);
  border-left: 1px solid var(--line);
  color: var(--gold);
  font: 400 clamp(34px, 5.4vw, 84px)/1 "Songti SC", "Noto Serif CJK SC", SimSun, serif;
  letter-spacing: .12em;
  writing-mode: vertical-rl;
  text-orientation: upright;
  /* Match the visual midpoint of the English lettering and its descenders. */
  translate: 0 .15em;
}
.title-period { display: none; }
.intro-note { padding-bottom: 5px; }
.intro-note p { color: #ddd2bf; font-size: 14px; line-height: 1.9; }
.intro-note .small-note { font-size: 14px; color: var(--muted); margin: 20px 0 0; }
.diary-layout { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 6vw; max-width: 1700px; padding: 70px 8vw 110px; margin: auto; align-items: start; }
.archive-nav { position: sticky; top: 35px; }
.archive-nav .eyebrow { margin-top: 0; margin-bottom: 24px; }
.archive-nav nav { display: flex; flex-direction: column; gap: 5px; }
.archive-nav nav a { color: #8c8577; font: 27px/1.5 var(--serif); padding-left: 18px; border-left: 1px solid var(--line); transition: color .2s, border-color .2s; }
.archive-nav nav a:hover, .archive-nav nav a[aria-current="true"] { color: var(--paper); border-left-color: var(--gold); }
.archive-main { min-width: 0; }
.year-heading { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 15px; }
.year-heading h2 { margin: 0; font: 400 47px/1 var(--serif); color: var(--gold); letter-spacing: -.035em; }
.year-heading > span { font-size: 14px; letter-spacing: .14em; color: var(--muted); }
.diary-year + .diary-year { margin-top: 80px; }
.diary-entry { display: grid; grid-template-columns: 80px minmax(0,1fr); gap: 25px; padding: 48px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 30px; }
.entry-date { font-size: 14px; color: var(--gold); padding-top: 11px; white-space: nowrap; }
.entry-date span { display: block; color: #827a6b; font-size: 14px; }
.entry-date .entry-note { white-space: normal; line-height: 1.6; margin-top: 12px; }
.entry-main { min-width: 0; }
.entry-main h3 { font: 400 clamp(32px, 3.2vw, 48px)/1.05 var(--serif); margin: 0 0 27px; letter-spacing: -.02em; }
.entry-content { color: #c6bdad; font-size: 14px; line-height: 1.95; overflow-wrap: anywhere; }
.entry-content p { margin: 0 0 20px; }
.entry-content p:last-child { margin-bottom: 0; }
.entry-content ul { padding-left: 20px; margin: 12px 0 25px; }
.entry-content li { padding-left: 4px; margin-bottom: 7px; }
.entry-content strong { color: var(--paper); font-weight: 500; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; color: var(--gold); }
.entry-content img { display: block; max-width: 100%; width: 100%; height: auto; max-height: 650px; object-fit: contain; margin: 0 auto 18px; background: #1d1b17; }
.entry-content .gallery { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin: 0 0 20px; }
.entry-content .gallery-item { margin: 0; min-width: 0; }
.entry-content video { display: block; width: 100%; height: auto; max-height: 650px; background: #080808; margin-bottom: 20px; }
.entry-content p:has(> img ~ img) { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; align-items: start; }
.entry-content p:has(> img ~ img) > img { width: 100%; min-width: 0; object-fit: contain; margin-bottom: 0; }
.entry-content p:has(> img ~ img) > br { display: none; }
.diary-outro { padding: 80px 8vw; background: #181610; border-top: 1px solid var(--line); text-align: center; }
.diary-outro h2 { font: 400 clamp(58px, 7vw, 100px)/.95 var(--serif); letter-spacing: -.035em; margin: 35px 0; }
.diary-outro h2 em { color: #cdb892; font-weight: 400; }
.diary-outro > a { display: inline-block; color: var(--gold); border-bottom: 1px solid #b69a6b70; padding: 12px 0; font-size: 14px; letter-spacing: .12em; }
footer { padding: 25px 5vw; display: flex; justify-content: space-between; gap: 20px; font-size: 14px; letter-spacing: .1em; color: var(--muted); }

@media (max-width: 1000px) {
  .header-note { display: none; }
  .diary-intro { padding: 55px 6vw 0; }
  .diary-layout { padding: 45px 6vw 80px; grid-template-columns: 90px minmax(0,1fr); gap: 35px; }
  .diary-entry { grid-template-columns: 60px minmax(0,1fr); gap: 18px; }
  .intro-layout { gap: 6%; }
}

@media (max-width: 700px) {
  html { scroll-padding-top: 95px; }
  .diary-header { min-height: 80px; padding: 0 6vw; }
  .wordmark { font-size: 25px; }
  .back-link { font-size: 14px; letter-spacing: .05em; }
  .diary-intro { padding-top: 43px; }
  .diary-intro > .eyebrow { font-size: 14px; }
  .intro-layout { grid-template-columns: 1fr; gap: 28px; padding: 12px 0 50px; }
  h1 { font-size: clamp(65px, 14vw, 95px); }
  .intro-note { display: block; }
  .intro-note p { font-size: 14px; margin: 0; }
  .intro-note .small-note { margin-top: 12px; font-size: 14px; }
  .diary-layout { display: block; padding-top: 0; }
  .archive-nav { top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); padding: 14px 0; margin-bottom: 30px; }
  .archive-nav .eyebrow { display: none; }
  .archive-nav nav { flex-direction: row; gap: 22px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
  .archive-nav nav a { display: inline-flex; align-items: center; min-height: 44px; border-left: 0; border-bottom: 1px solid transparent; font: 14px/1.8 var(--mono); padding: 3px 0; }
  .archive-nav nav a[aria-current="true"] { border-bottom-color: var(--gold); }
  .year-heading h2 { font-size: 38px; }
  .diary-entry { grid-template-columns: 1fr; gap: 12px; padding: 30px 0; }
  .entry-date { padding: 0; font-size: 14px; }
  .entry-date span { display: inline; margin-left: 12px; }
  .entry-main h3 { font-size: 34px; margin-bottom: 22px; }
  .entry-content { font-size: 14px; line-height: 1.9; }
  .entry-content img, .entry-content video { max-height: none; }
  .diary-year + .diary-year { margin-top: 50px; }
  .diary-outro { padding: 65px 6vw; }
  footer { flex-wrap: wrap; padding: 25px 6vw; font-size: 14px; }
}

@media (max-width: 400px) {
  #page-title { font-size: clamp(50px, 16vw, 65px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Same ink-and-paper daylight palette as the exhibition landing page. */
:root[data-theme="day"] {
  --bg: #f4f4f0;
  --paper: #252b28;
  --muted: #59635b;
  --gold: #a87512;
  --line: #52625530;
  color-scheme: light;
}
[data-theme="day"] h1,
[data-theme="day"] h1 em,
[data-theme="day"] .entry-main h3 { color: #252b28; }
[data-theme="day"] .entry-date { color: #333b37; }
[data-theme="day"] #page-title { color: #252b28; }
[data-theme="day"] .intro-note p,
[data-theme="day"] .entry-content { color: #414b43; }
[data-theme="day"] .intro-note .small-note,
[data-theme="day"] .entry-date span { color: var(--muted); }
[data-theme="day"] .archive-nav nav a { color: #687369; }
[data-theme="day"] .archive-nav nav a[aria-current="true"],
[data-theme="day"] .archive-nav nav a:hover { color: var(--gold); }
[data-theme="day"] .entry-content img { background: #e4e7e1; }
.diary-header .wordmark,
footer a { transition: color .2s ease; }
.diary-header .wordmark:hover,
footer a:hover { color: #ffda91; }
[data-theme="day"] .diary-header .wordmark:hover,
[data-theme="day"] footer a:hover,
[data-theme="day"] .entry-content a:hover { color: var(--gold); }
