:root { --text: #111; --muted: #777; --line: #e4e4e4; --nav-h: 60px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #fff; color: var(--text);
  font: 17px/1.6 "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--muted); }

/* header: the name on the left and a three-line menu button on the right, both on the same left/right edges as the text column below,
   so "Haotian" in the bar always sits right above "Haotian" on the home page. The section links open in a panel under the bar. */
:root { --gutter: 24px; --frame: 600px; }   /* --frame: width of the text column; the bar follows it, so a wider page (Plates) widens both */
body[data-tab="plates"] { --frame: 880px; }
body[data-tab="steps"] { --frame: 100vw; }   /* the map is full width, so the bar spans it too */
#top { position: fixed; inset: 0 0 auto 0; height: var(--nav-h); z-index: 10; display: flex; align-items: center; justify-content: space-between;
       padding: 0 max(var(--gutter), calc((100% - var(--frame)) / 2 + var(--gutter)));
       background: rgba(255,255,255,.82); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
       border-bottom: 1px solid rgba(0,0,0,.07); transition: padding .25s ease; }
.brand { font-weight: 600; font-size: 18px; letter-spacing: -.2px; text-decoration: none; }

.menu-btn { position: relative; width: 40px; height: 40px; margin: 0 -9px 0 0; padding: 0; border: 0; background: none; cursor: pointer; color: var(--text); }
.menu-btn span { position: absolute; left: 9px; width: 22px; height: 1.5px; background: currentColor; border-radius: 1px; transition: transform .25s ease, opacity .2s ease; }
.menu-btn span:nth-child(1) { top: 14px; } .menu-btn span:nth-child(2) { top: 19px; } .menu-btn span:nth-child(3) { top: 24px; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
.menu-btn:focus-visible { outline: 1px solid var(--muted); outline-offset: 2px; border-radius: 4px; }

#tabs { position: absolute; top: 100%; left: 0; right: 0; display: flex; flex-direction: column;
        padding: 6px max(var(--gutter), calc((100% - var(--frame)) / 2 + var(--gutter))) 14px;
        background: #fff;
        border-bottom: 1px solid rgba(0,0,0,.07);
        opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .2s ease, transform .2s ease, visibility 0s .2s; }
#top.open #tabs { opacity: 1; visibility: visible; transform: none; transition: opacity .2s ease, transform .2s ease; }
#tabs a { padding: 13px 0; font-size: 20px; letter-spacing: -.2px; text-decoration: none; color: var(--muted); border-bottom: 1px solid var(--line); }
#tabs a:last-child { border-bottom: 0; }
#tabs a:hover, #tabs a.active { color: var(--text); }

main { padding-top: var(--nav-h); }
.tab[hidden] { display: none; }
.col { max-width: var(--frame); margin: 0 auto; padding: 32px 24px 120px; }

h1 { font-size: 40px; font-weight: 600; letter-spacing: -.5px; line-height: 1.1; margin: 0 0 20px; }
h2 { font-size: 40px; font-weight: 600; letter-spacing: -.5px; line-height: 1.1; margin: 0 0 40px; }
h3 { font-size: 13px; font-weight: 400; color: var(--muted); margin: 48px 0 8px; }
.intro { margin: 0 0 12px; }
.portrait { margin: 32px 0 0; }
.portrait img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.portrait figcaption { color: var(--muted); font-size: 13px; margin-top: 8px; }
.facts { color: var(--muted); margin: 0 0 56px; }

.links { list-style: none; margin: 40px 0 0; padding: 0; border-top: 1px solid var(--line); }
.links li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.links span { color: var(--muted); }

/* Steps: the map page fills everything under the header */
.tab-full { position: fixed; inset: var(--nav-h) 0 0 0; }
.tab-full iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Gigs */
.gig { display: flex; gap: 24px; padding: 14px 0; border-top: 1px solid var(--line); }
.gig .when { width: 110px; flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.gig p { margin: 0; }
.gig .where { color: var(--muted); }
.empty { color: var(--muted); margin: 0; }

/* Notes */

@media (max-width: 640px) {
  :root { --gutter: 20px; } .brand { font-size: 17px; }
  .col { padding: 16px 20px 80px; } h1, h2 { font-size: 34px; }
  .gig, .note { flex-direction: column; gap: 0; }
}

.copy { margin: 64px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.stars { color: var(--muted); font-size: 14px; letter-spacing: 1px; }
.total { margin: -24px 0 24px; color: var(--muted); }

/* Notes list */
.note { display: flex; gap: 24px; padding: 14px 0; border-top: 1px solid var(--line); text-decoration: none; }
.note:hover .t { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.note .d { width: 110px; flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.note .cat { margin-left: auto; color: var(--muted); font-size: 14px; }

/* Reading view: a small book-like page that floats over the Notes list */
#reader { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 4vh 16px;
  background: rgba(17,17,17,.4); animation: read-fade .25s ease; }
#reader[hidden] { display: none; }
@keyframes read-fade { from { opacity: 0; } }
@keyframes read-rise { from { opacity: 0; transform: translateY(14px); } }
body.reading { overflow: hidden; }
#reader .sheet { width: min(700px, 100%); max-height: 90vh; overflow-y: auto; background: #fbf9f4; border-radius: 3px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35); animation: read-rise .3s ease;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif; }
#reader .bar { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 26px 34px 0; background: linear-gradient(#fbf9f4 70%, rgba(251,249,244,0)); }
#reader .close { font: 16px/1 "Helvetica Neue", Helvetica, Arial, sans-serif; color: var(--muted); text-decoration: none; }
#reader .save { font: 18px/1 "Helvetica Neue", Helvetica, Arial, sans-serif; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; }
#reader .save:hover { color: var(--text); }
#reader .save:disabled { cursor: default; text-decoration: none; }
#reader .close:hover { color: var(--text); }
#reader article { padding: 0 84px 96px; }
#reader .kind { text-align: center; margin: 22px 0 20px; font: 12px/1 "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: 2.5px; text-transform: uppercase; color: var(--muted); }
#reader h1 { text-align: center; font-weight: 400; font-size: 34px; line-height: 1.2; letter-spacing: 0; margin: 0 0 14px; }
#reader .by { text-align: center; font-style: italic; margin: 0; }
#reader .when { text-align: center; color: var(--muted); font-size: 15px; margin: 4px 0 0; }
#reader hr { width: 36px; border: 0; border-top: 1px solid #bdb8ac; margin: 36px auto 44px; }
#reader .text { font-size: 18px; line-height: 1.7; }
#reader .text p { margin: 0 0 20px; }
#reader .pair { margin: 0 0 24px; }
#reader .prose { margin: 0 0 40px; }
#reader .stanza { margin: 0 0 36px; line-height: 1.95; }
#reader .pstanza { margin: 0 0 40px; }
#reader .text .pstanza .pair { margin: 0 0 14px; }
#reader .place { text-align: right; font-style: italic; color: #6f6b62; font-size: 16px; margin: 44px 0 0; }
#reader .prose .en { color: #6f6b62; font-size: 16px; line-height: 1.65; }
#reader .pair em { display: block; color: #6f6b62; font-size: 16px; }
#reader .end { text-align: center; margin: 72px 0 0; font: 13px "Helvetica Neue", Helvetica, Arial, sans-serif; color: var(--muted); }
@media (max-width: 640px) { #reader { padding: 0; } #reader .sheet { max-height: 100vh; height: 100%; border-radius: 0; } #reader article { padding: 0 32px 64px; } #reader .bar { padding: 20px 24px 0; } #reader h1 { font-size: 28px; } }

/* Plates: collector's grid */
.plates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 700px) { .plates { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px) { .plates { grid-template-columns: 1fr; } }
.plate { display: flex; flex-direction: column; gap: 2px; padding: 24px 22px 18px; border: 1px solid var(--line); color: var(--text); text-decoration: none; min-height: 250px; }
a.plate:hover { border-color: #aaa; }
.plate .cov { display: block; width: calc(100% + 44px); aspect-ratio: 1; object-fit: cover; margin: -24px -22px 16px; }
.plate .st { min-height: 26px; font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: 24px; letter-spacing: 3px; line-height: 1; margin-bottom: 14px; }
.plate .nm { font-weight: 600; line-height: 1.3; }
.plate .ct { color: var(--muted); font-size: 14px; }
.plate .yr { color: var(--muted); font-size: 13px; margin-top: auto; padding-top: 14px; font-variant-numeric: tabular-nums; }
.mstar { height: 16px; width: auto; margin-right: 5px; vertical-align: -2px; }
.mbib { height: 18px; width: auto; vertical-align: -3px; }
.total .mstar { height: 14px; margin-right: 2px; vertical-align: -2px; }
.total .mbib { height: 16px; vertical-align: -3px; }

/* entries that open a pop-up */
a.gig { color: inherit; text-decoration: none; }
a.gig:hover p:first-child { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
#reader .soon { color: #8a867c; font-style: italic; text-align: center; margin: 12px 0 0; }
#reader .pimg { display: block; width: 100%; height: auto; margin: 0 0 22px; }
#reader .kind .mstar { height: 18px; margin: 0 3px; vertical-align: -3px; }
#reader .kind .mbib { height: 20px; vertical-align: -4px; }
#reader .place a { color: inherit; }
.mrec { height: 20px; width: auto; vertical-align: -4px; }
.total .mrec { height: 16px; vertical-align: -3px; }
#reader .kind .mrec { height: 22px; vertical-align: -5px; }

/* long bilingual pieces: epigraph, numbered sections, references */
#reader .epi { margin: 0 0 44px; padding-left: 20px; border-left: 2px solid #cfc9bb; font-style: italic; }
#reader .epi p { margin: 0 0 8px; }
#reader .epi .en { font-size: 16px; color: #6f6b62; }
#reader h2.sec { font-weight: 400; font-size: 23px; line-height: 1.3; margin: 58px 0 24px; }
#reader h2.sec .n { display: block; font: 12px/1 "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: 2.5px; color: var(--muted); margin-bottom: 10px; }
#reader h2.sec .en { display: block; font-size: 17px; font-style: italic; color: #6f6b62; margin-top: 3px; }
#reader h3.subhead { font-weight: 400; font-size: 17px; font-style: italic; margin: 36px 0 16px; color: #4d4a43; }
#reader h3.subhead .en { font-style: italic; }
#reader .refs { margin-top: 70px; padding-top: 24px; border-top: 1px solid #cfc9bb; }
#reader .refs-h { font: 12px/1 "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: 2.5px; text-transform: uppercase; color: var(--muted); font-weight: 400; margin: 0 0 20px; }
#reader .ref { margin: 0 0 12px; padding-left: 1.7em; text-indent: -1.7em; font-size: 14.5px; line-height: 1.55; color: #4d4a43; }
#reader .ref a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; word-break: break-all; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: -20px 0 28px; }
.tag { font: inherit; font-size: 14px; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; cursor: pointer; }
#notes-tags:not(:empty) { margin-bottom: 12px; }
#notes-langs { margin-top: 0; }
#notes-langs:empty { display: none; }
.tags.filters { margin: 0 0 12px; }
.tags.filters:empty { display: none; }
.tag:hover { color: inherit; }
.tag.on { color: inherit; border-color: currentColor; }

/* Plates filter buttons: icons sized like the tally */
.tag .mstar { height: 14px; margin-right: 1px; vertical-align: -2px; }
.tag .mbib { height: 16px; vertical-align: -3px; }
.tag .mrec { height: 16px; vertical-align: -3px; }
#reader .book { display: flex; gap: 26px; align-items: flex-start; margin: 36px auto 0; max-width: 460px; }
#reader .bcover { flex: none; width: 130px; height: auto; border-radius: 2px; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
#reader .binfo { font-size: 15px; line-height: 1.55; color: #4d4a43; }
#reader .binfo p { margin: 0 0 8px; }
#reader .binfo .bt { font-size: 18px; line-height: 1.3; color: var(--text); }
#reader .binfo .ba { font-style: italic; }
@media (max-width: 640px) { #reader .bcover { width: 100px; } #reader .book { gap: 18px; } }
