/* Kuang Zhang — personal site. Plain CSS, no build step.
   Design system: minimalist zen.
   - Split-hero structure on Home (two worlds, center medallion).
   - Earthy muted palette: creamy off-white, warm beige, muted sage,
     taupe hairlines; one sparing accent — vermillion, seal only.
   - Generous negative space, soft shadows, thin rules, calm type.
   - Calligraphy motif: 禅 set in a system Kaiti stack (text, never an
     image) and an ensō drawn as inline SVG. No external assets. */

:root {
  --bg: #f7f2e8;          /* creamy warm off-white */
  --bg-deep: #f1ead9;     /* warm beige */
  --paper: #fffdf7;       /* card paper */
  --ink: #35322b;         /* soft warm black */
  --ink-soft: #57534a;
  --muted: #837b6c;       /* warm taupe-gray */
  --taupe: #b3a58f;
  --line: #e3dac6;        /* warm hairline */
  --sage: #7d8c6f;        /* muted sage — structural accent */
  --sage-deep: #5c6d4f;
  --sage-soft: #e9ece0;   /* pale sage wash */
  --sand-soft: #f3ecdc;   /* pale sand wash */
  --vermillion: #bc3a1c;  /* seal red — seal + nothing else */
  --shadow: 0 18px 44px rgba(96, 84, 58, 0.07);
  --shadow-lift: 0 24px 54px rgba(96, 84, 58, 0.11);
  --serif: "Songti SC", "STSong", "Noto Serif", Georgia, "Times New Roman", serif;
  --kai: "Kaiti SC", "STKaiti", KaiTi, "Songti SC", serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.005em;
}

::selection { background: var(--sage-soft); }

a {
  color: var(--sage-deep);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

a:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Vermillion seal (印章) — the one accent. White 匡衡, his given
   name stacked in one column, on a small rounded red square, set in
   the calligraphic stack. */

.seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 33px;
  height: 33px;
  border-radius: 7px;
  background: var(--vermillion);
  color: #fff;
  font-family: var(--kai);
  font-size: 13px;
  line-height: 1.1;
  letter-spacing: 0.5px;
  writing-mode: vertical-rl;
  box-shadow: 0 2px 6px rgba(188, 58, 28, 0.25);
  user-select: none;
}

/* His Chinese name as running text (footer) — same Kaiti stack,
   same size and color as its surroundings. */

.name-kai { font-family: var(--kai); }

/* Header / nav */

.site-header {
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 2;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 28px;
  padding-top: 26px;
  padding-bottom: 26px;
}

.brand-block {
  display: inline-flex;
  align-items: center;
  gap: 13px;
}

.brand {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.03em;
}
.brand:hover { color: var(--ink); text-decoration: none; }

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
}

.main-nav a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 4px 0 6px;
  border-bottom: 2px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}
.main-nav a:hover { color: var(--ink); text-decoration: none; }
.main-nav a.active {
  color: var(--ink);
  border-bottom-color: var(--sage);
}

/* Page body */

main {
  padding: 76px 0 92px;
  position: relative;
  z-index: 1;
}

/* Faint oversized 禅 watermark on inner pages. Text in the Kaiti
   stack — never an image. Fixed, behind content, barely there. */

body.inner::after {
  content: "禅";
  font-family: var(--kai);
  position: fixed;
  top: 3.5rem;
  right: -3.5rem;
  font-size: 24rem;
  line-height: 1;
  color: var(--sage);
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

h1 {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.02em;
  margin: 0 0 18px;
}

/* Name beside the About H1 — smaller, quiet, Chinese in Kaiti. */

.h1-name {
  font-size: 19px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
}
.h1-name .kai { font-family: var(--kai); }

h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 58px 0 16px;
}
h2::before {
  content: "";
  display: block;
  width: 30px;
  height: 2px;
  background: var(--sage);
  border-radius: 1px;
  margin-bottom: 14px;
}

h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 4px;
}

p { margin: 0 0 16px; }

.lede {
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 8px;
}

.sub { color: var(--muted); }

.small { font-size: 14px; color: var(--muted); }

/* ---------- Home: split hero (two worlds, center medallion) ---------- */

.split-hero {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 360px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.half {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 46px;
  transition: flex-grow 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.half:hover { flex-grow: 1.4; }

.half-left {
  background: linear-gradient(155deg, var(--sage-soft), var(--bg) 78%);
  text-align: right;
  align-items: flex-end;
  padding-right: 138px;
}

.half-right {
  background: linear-gradient(205deg, var(--sand-soft), var(--bg) 78%);
  text-align: left;
  align-items: flex-start;
  padding-left: 138px;
}

.half-word {
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.15;
  color: var(--ink);
}

.half-sub {
  font-size: 18px;
  color: var(--ink-soft);
  margin: 10px 0 8px;
}

.half p { color: var(--muted); font-size: 16px; margin-bottom: 0; max-width: 300px; }

/* Center medallion: ensō ring (inline SVG), 禅 inside, KZ below. */

.hero-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

.enso-wrap {
  position: relative;
  width: 196px;
  height: 196px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.enso {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--ink-soft);
}

.zen-char {
  font-family: var(--kai);
  font-size: 94px;
  line-height: 1;
  color: var(--ink);
  padding-bottom: 10px;
  user-select: none;
}

/* About-page banner: raked-sand Zen rock garden (photo supplied by
   Kuang 2026-10-23), full content width under the H1. */
.about-banner {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
  object-position: 50% 55%;
  margin: 10px 0 30px;
  border: 1px solid var(--line);
}

/* Brush-calligraphy 禅 (photo supplied by Kuang 2026-10-23), clipped
   to a disc inside the ensō ring. */
.zen-brush {
  height: 152px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  user-select: none;
}

.headshot-placeholder {
  position: relative;
  margin-top: -24px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px dashed var(--sage);
  color: var(--sage-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 29px;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 20px rgba(96, 84, 58, 0.08);
}

/* Scroll inscription — 张匡衡 written vertically in ink beside the
   medallion, the way a name is inscribed on a hanging scroll. It
   sits high in the hero's right corner, clear of both halves' text. */

.hero-inscription {
  position: absolute;
  top: 30px;
  right: 38px;
  writing-mode: vertical-rl;
  font-family: var(--kai);
  font-size: 27px;
  letter-spacing: 0.16em;
  line-height: 1;
  color: var(--ink);
  z-index: 2;
  user-select: none;
}

.hero-name {
  text-align: center;
  margin: 52px 0 14px;
}

.hero-before {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
  color: var(--ink-soft);
}

/* Cards (home "latest work" row, ventures) */

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin: 30px 0 10px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px 32px;
  box-shadow: 0 10px 26px rgba(96, 84, 58, 0.045);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

.card h3 { margin-bottom: 8px; }
.card p { margin-bottom: 12px; color: var(--muted); font-size: 16px; }
.card p:last-child { margin-bottom: 0; }

.card .tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin-bottom: 12px;
}

/* Experience entries — hairline-separated, lots of air */

.role {
  padding: 30px 2px 26px;
  border-bottom: 1px solid var(--line);
  margin: 0;
}
.role:last-of-type { border-bottom: none; }

.role-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px 28px;
  flex-wrap: wrap;
}

.role-head h3 { margin: 0; }

.dates {
  color: var(--taupe);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.org { color: var(--sage-deep); margin: 4px 0 10px; font-size: 16px; }

.role ul { margin: 0; padding-left: 20px; }
.role li { margin-bottom: 7px; }
.role li::marker { color: var(--sage); }

.facts {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 32px;
  margin-top: 10px;
  box-shadow: 0 10px 26px rgba(96, 84, 58, 0.045);
}
.facts p { margin-bottom: 10px; }
.facts p:last-child { margin-bottom: 0; }

/* Contact */

.contact-list { list-style: none; margin: 14px 0 0; padding: 0; }
.contact-list li {
  padding: 20px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
}
.contact-list li:first-child { padding-top: 6px; }
.contact-list .label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin-bottom: 3px;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 42px;
  color: var(--muted);
  font-size: 14px;
  position: relative;
  z-index: 1;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 28px;
}

.footer-id {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.enso-sm {
  position: static;
  width: 27px;
  height: 27px;
  color: var(--taupe);
  flex: 0 0 auto;
}

.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--sage-deep); }

/* Small screens */

@media (max-width: 860px) {
  .half { padding: 48px 34px; }
  .half-left { padding-right: 118px; }
  .half-right { padding-left: 118px; }
  .enso-wrap { width: 168px; height: 168px; }
  .zen-char { font-size: 80px; }
  .hero-center { width: 200px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  main { padding: 52px 0 68px; }
  h1 { font-size: 32px; }
  h2 { margin-top: 44px; }
  body.inner::after { font-size: 15rem; right: -2rem; }

  .split-hero { flex-direction: column; min-height: 0; }
  .half { padding: 40px 30px; text-align: center; align-items: center; }
  .half p { max-width: 340px; }
  .half-word { font-size: 34px; }
  .hero-center {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: auto;
    padding: 14px 0 6px;
    order: -1;
  }
  .headshot-placeholder { width: 76px; height: 76px; font-size: 25px; }
  .hero-inscription {
    position: static;
    writing-mode: horizontal-tb;
    order: -1;
    align-self: center;
    margin: 22px 0 2px;
    font-size: 22px;
    letter-spacing: 0.3em;
  }
  .hero-name { margin-top: 40px; }

  .cards { grid-template-columns: 1fr; }
  .card { padding: 26px 24px; }
  .facts { padding: 22px 24px; }
  .dates { white-space: normal; }
  .site-footer .wrap { justify-content: center; text-align: center; }
}

/* Restrained motion only — and none when the user asks for none. */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  .half:hover { flex-grow: 1; }
  .card:hover { transform: none; }
}

/* ---------- Blog ---------- */

.post-list { list-style: none; padding: 0; margin: 26px 0 0; }
.post-item { border-top: 1px solid var(--line); padding: 24px 0; }
.post-item:last-child { border-bottom: 1px solid var(--line); }
.post-item h2 { margin: 0 0 6px; font-size: 26px; }
.post-item h2 a { color: var(--ink); text-decoration: none; }
.post-item h2 a:hover { color: var(--sage-deep); }
.post-item p { color: var(--muted); margin: 0; }
.post-meta {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
article.post .post-meta { margin-top: -6px; }
.post-back { margin-top: 40px; }
