/* ============================================================
   yizhang.io — dark ink-blue, signal amber, memory-trace spine
   type: Archivo (display) · IBM Plex Sans (body) · IBM Plex Mono (utility)
   ============================================================ */

:root {
  --bg: #0f2b2a;
  --bg-raised: #173d3b;
  --line: rgba(150, 215, 200, 0.2);
  --line-strong: rgba(150, 215, 200, 0.38);
  --text: #eaf5f1;
  --muted: #a3c4ba;
  --faint: #6d938a;
  --accent: #f2a93b;
  --accent-soft: rgba(242, 169, 59, 0.16);
  --display: "Archivo", "Helvetica Neue", sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --content: 1000px;
  --stamp-w: 168px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  /* depth glows */
  background-image:
    radial-gradient(1100px 700px at 72% -12%, rgba(58, 175, 155, 0.22), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(40, 125, 110, 0.16), transparent 55%);
}

::selection { background: var(--accent); color: var(--bg); }

a { color: var(--text); text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

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

.accent { color: var(--accent); }
.kw { color: var(--text); font-weight: 600; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--accent);
}

/* ---------------- top bar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  padding: 0.9rem clamp(1.25rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-mark {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
}

.topbar-nav { display: flex; gap: 1.4rem; margin-left: auto; }

.topbar-nav a {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
}
.topbar-nav a:hover { color: var(--accent); }

.topbar-cv {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent);
  padding: 0.35rem 0.85rem;
  border-radius: 3px;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.topbar-cv:hover { background: var(--accent); color: var(--bg); }

/* ---------------- hero ---------------- */

.hero {
  max-width: var(--content);
  margin: 0 auto;
  padding: clamp(4rem, 11vh, 8rem) clamp(1.25rem, 4vw, 3rem) clamp(4rem, 9vh, 7rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3rem;
  align-items: start;
}

.hero-name {
  font-family: var(--display);
  font-variation-settings: "wdth" 118;
  font-weight: 860;
  font-size: clamp(3.4rem, 10.5vw, 6.8rem);
  line-height: 0.95;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  margin: 0.9rem 0 1.4rem;
}

.hero-thesis {
  font-family: var(--display);
  font-variation-settings: "wdth" 96;
  font-weight: 500;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  line-height: 1.3;
  max-width: 24ch;
  margin-bottom: 1.4rem;
}

.hero-thesis em {
  font-style: normal;
  color: var(--accent);
  /* hand-drawn underline feel via border, not text-decoration */
  border-bottom: 3px solid var(--accent-soft);
}

.hero-sub { color: var(--muted); max-width: 56ch; }
.hero-sub a { color: var(--text); }

.hero-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 2.2rem;
}

.hero-links a {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 0.4rem 0.9rem;
  border-radius: 3px;
  display: inline-block;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.hero-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.hero-photo img {
  width: clamp(150px, 18vw, 220px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  display: block;
  filter: saturate(0.9);
}

/* hero load sequence */
@media (prefers-reduced-motion: no-preference) {
  .hero-load {
    opacity: 0;
    transform: translateY(14px);
    animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  }
  .hl-1 { animation-delay: 0.05s; }
  .hl-2 { animation-delay: 0.15s; }
  .hl-3 { animation-delay: 0.3s; }
  .hl-4 { animation-delay: 0.45s; }
  .hl-5 { animation-delay: 0.6s; }
}

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- the trace ---------------- */

.trace {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem) 5rem;
  position: relative;
}

/* the spine itself */
.trace::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(clamp(1.25rem, 4vw, 3rem) + 5px);
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--line-strong) 4%,
    var(--line-strong) 96%,
    transparent
  );
}

.entry {
  display: grid;
  grid-template-columns: var(--stamp-w) minmax(0, 1fr);
  gap: 2.5rem;
  padding: clamp(3rem, 7vh, 5rem) 0;
  border-bottom: 1px solid var(--line);
}
.entry:last-child { border-bottom: none; }

.entry-stamp {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--faint);
  position: relative;
  padding-left: 26px;
  padding-top: 0.45em;
  white-space: nowrap;
}

.stamp-node {
  position: absolute;
  left: 1px;
  top: 0.75em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 12px var(--accent-soft);
}

.entry-body h2 {
  font-family: var(--display);
  font-variation-settings: "wdth" 104;
  font-weight: 750;
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 1.2rem;
  max-width: 26ch;
}

.entry-body > p, .entry-body .section-lede { color: var(--muted); max-width: 62ch; }
.entry-body > p + p { margin-top: 0.9rem; }

.entry-note {
  font-family: var(--mono);
  font-size: 0.88rem;
  margin-top: 1.2rem;
}

/* scroll reveal */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .reveal.is-visible { opacity: 1; transform: none; }
}

/* ---------------- research pillars ---------------- */

.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.pillar {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.5rem 1.4rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.pillar:hover { border-color: var(--accent); transform: translateY(-3px); }

.pillar h3 {
  font-family: var(--display);
  font-variation-settings: "wdth" 100;
  font-weight: 650;
  font-size: 1.1rem;
  line-height: 1.3;
  margin-bottom: 0.7rem;
}

.pillar-key {
  display: block;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.55rem;
}

.pillar p { font-size: 0.94rem; color: var(--muted); }

.pillar-refs {
  font-family: var(--mono);
  font-size: 0.75rem !important;
  color: var(--faint) !important;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--line);
}

/* ---------------- timeline ---------------- */

.timeline { list-style: none; margin-top: 0.5rem; }

.tl-item {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.15rem 0;
}
.tl-item + .tl-item { border-top: 1px solid var(--line); }

.tl-when {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--faint);
  padding-top: 0.3em;
  white-space: nowrap;
}

.tl-what h3 { font-family: var(--body); font-weight: 600; font-size: 1.02rem; }

.tl-role {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-left: 0.5rem;
}

.tl-what p { color: var(--muted); font-size: 0.94rem; margin-top: 0.25rem; }

.tl-points { list-style: none; margin-top: 0.5rem; }
.tl-points li {
  color: var(--muted);
  font-size: 0.94rem;
  padding-left: 1.1rem;
  position: relative;
  margin-top: 0.4rem;
}
.tl-points li::before { content: "\2014"; position: absolute; left: 0; color: var(--faint); }

/* ---------------- publications ---------------- */

.pub-list { list-style: none; margin-top: 0.5rem; }

.pub {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.05rem 0.6rem;
  margin: 0 -0.6rem;
  border-radius: 5px;
  transition: background 0.15s ease;
}
.pub:hover { background: var(--bg-raised); }
.pub + .pub { border-top: 1px solid var(--line); }

.pub-venue {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  padding-top: 0.35em;
}

.pub-title { font-weight: 600; font-size: 0.98rem; line-height: 1.45; }

.pub-authors { color: var(--faint); font-size: 0.86rem; margin-top: 0.25rem; }
.pub-authors strong { color: var(--muted); font-weight: 500; }

.pub-award {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--accent);
  margin-top: 0.4rem;
}

.pub-year-group { margin-top: 1.6rem; }
.pub-year-group:first-child { margin-top: 0; }

.pub-year {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  color: var(--faint);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.4rem;
}

.pubs-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

#pubs-toggle {
  font-family: var(--mono);
  font-size: 0.84rem;
  color: var(--accent);
  background: none;
  border: 1px solid var(--accent);
  padding: 0.55rem 1.1rem;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
#pubs-toggle:hover { background: var(--accent); color: var(--bg); }

.pubs-scholar {
  font-family: var(--mono);
  font-size: 0.84rem;
  color: var(--muted);
  text-decoration: none;
}
.pubs-scholar:hover { color: var(--accent); }

/* ---------------- footer ---------------- */

.footer {
  border-top: 1px solid var(--line);
  background: var(--bg-raised);
}

.footer-inner {
  max-width: var(--content);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vh, 6rem) clamp(1.25rem, 4vw, 3rem);
}

.footer-line {
  font-family: var(--display);
  font-variation-settings: "wdth" 102;
  font-weight: 650;
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
  line-height: 1.25;
  margin-top: 0.8rem;
  max-width: 24ch;
}

.footer-email {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 3px solid var(--accent-soft);
  transition: border-color 0.15s ease;
}
.footer-email:hover { border-color: var(--accent); }

.footer-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  margin-top: 2.2rem;
}
.footer-links a {
  font-family: var(--mono);
  font-size: 0.84rem;
  color: var(--muted);
  text-decoration: none;
}
.footer-links a:hover { color: var(--accent); }

.footer-meta {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--faint);
  margin-top: 3rem;
}

/* ---------------- 404 ---------------- */

.notfound {
  min-height: 70vh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 2rem;
}
.notfound h1 {
  font-family: var(--display);
  font-variation-settings: "wdth" 118;
  font-weight: 860;
  font-size: clamp(4rem, 16vw, 9rem);
  line-height: 1;
}
.notfound p { font-family: var(--mono); color: var(--muted); margin-top: 1rem; }
.notfound a { color: var(--accent); }

/* ---------------- responsive ---------------- */

@media (max-width: 900px) {
  .pillars { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; gap: 2rem; }
  .hero-photo { order: -1; }
}

@media (max-width: 720px) {
  .topbar { gap: 1rem; }
  .topbar-nav { gap: 0.9rem; overflow-x: auto; }

  .trace::before { left: calc(clamp(1.25rem, 4vw, 3rem) - 12px); }
  .entry { grid-template-columns: 1fr; gap: 1.2rem; }
  .entry-stamp { padding-left: 0; padding-top: 0; }
  .stamp-node { left: -17px; top: 0.45em; }

  .tl-item, .pub { grid-template-columns: 1fr; gap: 0.3rem; }
  .tl-when, .pub-venue { padding-top: 0; }
}
