/* --------------------------------------------------------------------------
   wylie-chang.com
   Left sidebar, left-aligned throughout, a nearly flat typographic scale.
   Hierarchy comes from case, colour and space — not size.
   -------------------------------------------------------------------------- */

:root {
  --paper:  #fcfbf8;   /* warm white */
  --ink:    #1c1b19;   /* near-black */
  --quiet:  #726d64;   /* labels, metadata */
  --accent: #2e4a6b;   /* faded ink blue, links only */
  --rule:   #e0dbd1;
  --rule-strong: #b3aa9a;   /* visible underline for linked titles */

  /* CJK fallbacks so 張振曦 sets gracefully alongside the Latin face */
  --serif: "EB Garamond", "Iowan Old Style", Georgia,
           "Songti SC", "Noto Serif CJK SC", "Hiragino Mincho ProN", serif;
  --sans:  "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { 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: 1.1875rem;
  line-height: 1.68;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- shell --------------------------------------------------------------- */

.shell {
  max-width: 57rem;
  margin: 0 auto;
  padding: 5.5rem 2.5rem 12rem;
  display: grid;
  grid-template-columns: 10.5rem 1fr;
  gap: 4.5rem;
  align-items: start;
}

/* ---- sidebar ------------------------------------------------------------- */

.name {
  display: block;
  font-family: var(--serif);
  font-size: 1.3125rem;
  line-height: 1.35;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 1.75rem;
}
.name:hover { color: var(--accent); }

.nav a {
  display: block;
  font-family: var(--sans);
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  color: var(--quiet);
  text-decoration: none;
  padding: 0.3rem 0;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); }

/* ---- content ------------------------------------------------------------- */

main { min-width: 0; }

.column { max-width: 33rem; }

.column p { margin: 0 0 1.5rem; }
.column p:last-child { margin-bottom: 0; }

/* section heading: all caps, near body size, tracked lightly */
.label {
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  color: var(--ink);
  margin: 0.4rem 0 2.75rem;
}

/* subordinate heading inside a section: same treatment, quieter */
.group {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  color: var(--quiet);
  margin: 3.5rem 0 1.75rem;
}
.group:first-of-type { margin-top: 0; }

a.link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
a.link:hover { color: var(--accent); border-bottom-color: var(--accent); }

em, i, cite { font-style: italic; }

.profiles { color: var(--quiet); }
.profiles a.link { color: var(--quiet); }

/* ---- bibliography -------------------------------------------------------- */

.bibliography { margin-top: 6rem; }
.bibliography .label { margin-bottom: 2.5rem; }

.entry { margin: 0 0 2.1rem; }
.entry:last-child { margin-bottom: 0; }

/* title leads; everything else recedes */
.entry .title {
  display: block;
  font-size: 1.0625rem;
  line-height: 1.5;
}

.entry .authors,
.entry .source {
  display: block;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--quiet);
}
.entry .authors { margin-top: 0.25rem; }

/* own name in full ink so it is findable without being shouted */
.entry .self { color: var(--ink); }

a.title-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a.title-link:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ---- writing entries ----------------------------------------------------- */

.piece { margin: 0 0 2.5rem; }
.piece:last-child { margin-bottom: 0; }

.piece .title { display: block; }

.piece .where {
  display: block;
  font-size: 0.9375rem;
  color: var(--quiet);
  line-height: 1.6;
  margin-top: 0.1rem;
}

/* ---- homepage photograph -------------------------------------------------- */

.photo {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 5.5rem;
}

/* ---- long-form prose ----------------------------------------------------- */

.piece-title {
  font-family: var(--serif);
  font-size: 1.3125rem;
  font-weight: 400;
  line-height: 1.35;
  margin: 0 0 0.4rem;
}

.piece-meta {
  font-size: 0.9375rem;
  color: var(--quiet);
  margin: 0 0 3.5rem;
}

.longform p { margin: 0 0 1.5rem; }

/* quoted letters: indent and italic rather than a rule — no borders anywhere */
.longform blockquote {
  margin: 2.5rem 0;
  padding: 0 0 0 2rem;
  font-style: italic;
}
.longform blockquote p:last-child { margin-bottom: 0; }

/* a single line standing alone: give it room rather than emphasis */
.longform p.beat { margin: 2.5rem 0; }

/* scriptural reading: Chinese, romanisation, gloss */
.reading { margin: 2.75rem 0; padding-left: 2rem; }
.reading .zh {
  display: block;
  font-size: 1.5rem;
  line-height: 1.6;
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
}
.reading .pinyin {
  display: block;
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--quiet);
}
.reading .gloss { display: block; font-style: italic; margin-top: 1.15rem; }

.colophon {
  margin-top: 4.5rem;
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--quiet);
}

/* ---- contact ------------------------------------------------------------- */

.address { line-height: 2; }

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

@media (max-width: 44rem) {
  body { font-size: 1.125rem; }

  .shell {
    grid-template-columns: 1fr;
    gap: 3.5rem;
    padding: 3.25rem 1.5rem 7rem;
  }

  .name { margin-bottom: 1.25rem; }

  /* nav goes horizontal only once the sidebar has collapsed */
  .nav { display: flex; flex-wrap: wrap; gap: 0 1.35rem; }
  .nav a { padding: 0.15rem 0; }

  .label { margin-top: 0; }
  .bibliography { margin-top: 4.5rem; }
}
