/* =========================================================================
   xuyangliu.com — quiet, bookish minimal (after jquiambao.com / Blot)
   Newsreader literary serif · plain text nav · generous whitespace
   ========================================================================= */

:root {
  /* warm paper + ink */
  --paper:     oklch(0.987 0.006 90);
  --paper-2:   oklch(0.968 0.007 88);
  --ink:       oklch(0.255 0.010 55);
  --ink-soft:  oklch(0.435 0.010 55);
  --ink-faint: oklch(0.605 0.009 56);
  --line:      oklch(0.885 0.006 80);
  --line-soft: oklch(0.935 0.005 84);

  /* accent — used very sparingly (today dot, link hover). tweakable. */
  --accent:    oklch(0.52 0.15 28);

  --serif: "Newsreader", "Noto Serif SC", Georgia, "Times New Roman", serif;

  /* measure */
  --measure: 38rem;     /* ~640px reading column */
  --wide:    72rem;
  --pad: clamp(22px, 5vw, 56px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-ligatures: common-ligatures;
}

::selection { background: oklch(0.9 0.05 85); color: var(--ink); }

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

p { text-wrap: pretty; }

/* ---- shared type primitives ---------------------------------------- */
.serif { font-family: var(--serif); }

.dl {                      /* dateline / meta label */
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-feature-settings: "smcp";
}
.dl .dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.7em;
  vertical-align: middle;
}

.h-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 5.4vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.012em;
  margin: 0;
}
.h-sub {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(18px, 1.7vw, 22px);
  line-height: 1.4;
  color: var(--ink-soft);
  margin: 18px 0 0;
  max-width: 34ch;
}

.lede {
  font-size: clamp(19px, 1.6vw, 22px);
  line-height: 1.58;
  color: var(--ink);
}

.tlink {
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: text-decoration-color .18s, color .18s;
}
.tlink:hover { color: var(--accent); text-decoration-color: var(--accent); }

hr.rule { border: 0; height: 1px; background: var(--line); margin: 0; }

/* ============================ shell ================================== */
.app { min-height: 100vh; display: flex; flex-direction: column; }

/* masthead — plain text nav, like a quiet blog header */
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  max-width: var(--wide);
  width: 100%;
  margin: 0 auto;
  padding: clamp(22px, 3.5vw, 40px) var(--pad) clamp(18px, 2.5vw, 26px);
}
.brand {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.brand .dot { color: var(--accent); }
.mast-nav {
  display: flex;
  align-items: baseline;
  gap: clamp(16px, 2vw, 28px);
}
.mast-nav button {
  appearance: none; background: none; border: 0; cursor: pointer;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink-faint);
  padding: 0 0 2px;
  position: relative;
  transition: color .18s;
}
.mast-nav button:hover { color: var(--ink); }
.mast-nav button.active { color: var(--ink); }
.mast-nav button.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 1px; background: var(--ink);
}
.mast-nav .sep { color: var(--line); }
.lang {
  display: inline-flex; align-items: baseline; gap: 7px;
  font-family: var(--serif); font-size: 14px;
}
.lang button {
  appearance: none; background: none; border: 0; cursor: pointer;
  font-family: inherit; font-size: 14px; color: var(--ink-faint);
  padding: 0; transition: color .15s;
}
.lang button.on { color: var(--ink); }
.lang .bar { color: var(--line); }

/* page body */
main {
  flex: 1; width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: clamp(8px, 2vw, 24px) var(--pad) 0;
}
.col {                   /* narrow reading column */
  max-width: var(--measure);
}

/* footer */
.foot {
  max-width: var(--wide);
  width: 100%;
  margin: clamp(64px, 10vw, 140px) auto 0;
  padding: 22px var(--pad) 40px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 14px 28px;
  align-items: baseline; justify-content: space-between;
  font-family: var(--serif); font-size: 14px; color: var(--ink-faint);
}
.foot > * { white-space: nowrap; }

/* ===================== photographs ================================== */
/* display-only photo: real <img> when src given, else a quiet toned field.
   never an upload affordance. */
.photo {
  position: relative;
  display: block;
  width: 100%;
  background: var(--paper-2);
  overflow: hidden;
}
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo--ph {
  background:
    linear-gradient(155deg,
      oklch(0.86 0.035 var(--h, 70)) 0%,
      oklch(0.74 0.05 calc(var(--h, 70) + 24)) 100%);
  box-shadow: inset 0 0 0 1px oklch(0.5 0.04 var(--h,70) / 0.10),
              inset 0 -40px 60px -30px oklch(0.4 0.06 var(--h,70) / 0.25);
}
.photo--ph::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 30% 28%, oklch(0.95 0.03 var(--h,70) / 0.55), transparent 45%);
  mix-blend-mode: soft-light;
}
.photo .ph-no {
  position: absolute; left: 12px; bottom: 11px; z-index: 2;
  font-family: var(--serif); font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: oklch(0.32 0.03 var(--h,70) / 0.62);
}
.photo--click { cursor: zoom-in; }
.photo--click:hover img { filter: brightness(0.97); }

/* caption under a photo */
.cap {
  display: flex; justify-content: space-between; gap: 16px;
  align-items: baseline; margin-top: 11px;
}
.cap .txt {
  font-family: var(--serif); font-style: italic;
  font-size: 16px; line-height: 1.4; color: var(--ink-soft);
  max-width: 46ch;
}
.cap .meta {
  font-family: var(--serif); font-size: 12px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-faint); white-space: nowrap;
}

/* ===================== masonry (the daily journal) ================== */
.masonry {
  column-count: 3;
  column-gap: clamp(16px, 2.2vw, 34px);
}
.masonry .m-item {
  break-inside: avoid;
  margin-bottom: clamp(22px, 3vw, 40px);
}
@media (max-width: 900px) { .masonry { column-count: 2; } }
@media (max-width: 560px) { .masonry { column-count: 1; } }

/* ===================== work entries ================================= */
.work-list { display: flex; flex-direction: column; }
.work-row {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: clamp(18px, 3vw, 40px);
  align-items: center;
  padding: clamp(20px, 2.6vw, 30px) 0;
  border-top: 1px solid var(--line);
  text-align: left;
}
.work-row:last-child { border-bottom: 1px solid var(--line); }
.work-thumb {
  width: 96px; height: 96px; flex: 0 0 auto;
}
.work-row .nm {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(23px, 2.4vw, 32px); line-height: 1.05;
  letter-spacing: -0.01em; color: var(--ink);
}
.work-row .one {
  font-family: var(--serif); font-style: italic;
  font-size: 17px; line-height: 1.4; color: var(--ink-soft);
  margin-top: 6px; max-width: 52ch;
}
.work-row .visit {
  font-family: var(--serif); font-size: 14px;
  letter-spacing: 0.06em; color: var(--ink-faint);
  white-space: nowrap; transition: color .18s;
}
.work-row:hover .nm { color: var(--accent); }
.work-row:hover .visit { color: var(--accent); }

@media (max-width: 600px) {
  .work-row { grid-template-columns: 64px 1fr; }
  .work-thumb { width: 64px; height: 64px; }
  .work-row .visit { grid-column: 2; justify-self: start; }
}

/* a fuller work section (Work page detail rooms) */
.work-detail { border-top: 1px solid var(--line); padding-top: clamp(28px,4vw,52px); }
.work-detail .body {
  font-size: 18px; line-height: 1.62; color: var(--ink-soft);
  max-width: 54ch; margin-top: 16px;
}

/* ===================== lightbox ===================================== */
.lb {
  position: fixed; inset: 0; z-index: 90;
  background: oklch(0.22 0.01 55 / 0.86);
  backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(20px, 5vw, 64px);
}
.lb-fig { margin: 0; max-width: 760px; width: 100%; }
.lb-photo { width: 100%; max-height: 76vh; }
.lb-photo.photo--ph { aspect-ratio: 4 / 3; }
.lb-cap { display: flex; justify-content: space-between; gap: 18px; margin-top: 15px; align-items: baseline; }
.lb-cap .txt { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--paper); max-width: 50ch; }
.lb-cap .meta { font-family: var(--serif); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: oklch(0.85 0.01 80 / 0.7); white-space: nowrap; }
.lb-x, .lb-nav {
  position: fixed; background: none; border: 0; cursor: pointer;
  color: var(--paper); font-family: var(--serif);
}
.lb-x { top: 22px; right: 26px; font-size: 14px; letter-spacing: 0.08em; }
.lb-nav { top: 50%; transform: translateY(-50%); font-size: 26px; padding: 10px; }
.lb-prev { left: 22px; } .lb-next { right: 22px; }

/* ===================== entrance (translate-only; never hides) ======= */
@keyframes rise { from { transform: translateY(10px); } to { transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .rise.is-in { animation: rise .6s cubic-bezier(.2,.7,.2,1) backwards; }
  .rise.is-in.d1 { animation-delay: .05s; }
  .rise.is-in.d2 { animation-delay: .12s; }
  .rise.is-in.d3 { animation-delay: .19s; }
}

/* utilities */
.sp-s { height: clamp(20px, 3vw, 36px); }
.sp-m { height: clamp(36px, 6vw, 72px); }
.sp-l { height: clamp(56px, 9vw, 120px); }
