/* Wayne Lau — personal site
   World: research notebook / journal paper. Warm paper, blue-black ink, captioned figures. */

:root {
  --paper: #f7f4ee;
  --card: #fdfbf7;
  --raised: #efe9df;
  --line: rgba(31, 27, 22, 0.1);
  --text: #1f1b16;
  --text-2: #5e554a;
  --muted: #7b7266;
  --ink: #2a4b9b;          /* accent: fountain-pen blue */
  --todo: #fff1a8;         /* draft markers, remove before submitting */

  --serif: "Newsreader", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --max: 1120px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color 150ms var(--ease); }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

.todo { background: var(--todo); color: var(--text); padding: 0 4px; border-radius: 4px; font-style: normal; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
}
.nav-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; }
.nav-links a {
  display: block;
  padding: 20px 0;
  font-size: 15px;
  color: var(--text-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 150ms var(--ease), border-color 150ms var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--text); border-bottom-color: var(--ink); }
.menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  place-items: center;
}

/* ---------- Layout ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 64px 32px 96px; }
h1, h2, h3 { margin: 0; font-weight: 500; }
h1 { font-family: var(--serif); font-size: 64px; line-height: 1.04; letter-spacing: -0.02em; font-weight: 400; }
h2 { font-family: var(--serif); font-size: 32px; line-height: 1.15; font-weight: 400; }
h3 { font-size: 18px; line-height: 1.4; }
.lede { font-size: 20px; line-height: 1.5; color: var(--text-2); max-width: 36rem; margin: 16px 0 0; }
.meta { font-family: var(--mono); font-size: 13px; line-height: 20px; color: var(--muted); }
section + section { margin-top: 80px; }
.page-head { margin-bottom: 64px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--text); margin-bottom: 8px; }

/* ---------- Figures (signature: journal captions) ---------- */
figure { margin: 0; }
.fig-frame { border-radius: 12px; overflow: hidden; background: var(--raised); }
.fig-frame.empty { aspect-ratio: 3 / 2; }
figcaption { margin-top: 12px; font-family: var(--mono); font-size: 13px; line-height: 20px; color: var(--text-2); }
figcaption b { color: var(--ink); font-weight: 500; margin-right: 8px; }

/* ---------- Home ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
}
.hero .facts { margin-top: 24px; }
.bio p { margin: 16px 0 0; max-width: 36rem; color: var(--text); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.btn {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease), transform 120ms var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--text); color: var(--paper); }
.btn-primary:hover { background: var(--ink); color: #fff; }
.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--raised); color: var(--text); }

/* Notebook-style rows */
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row p { margin: 4px 0 0; color: var(--text-2); }
.row ul { margin: 8px 0 0; padding-left: 20px; color: var(--text-2); }
.row li + li { margin-top: 4px; }
.row .org { font-size: 15px; color: var(--text-2); margin-top: 2px; }

/* Experience: figure beside entries */
.with-fig { display: grid; grid-template-columns: 1fr 320px; gap: 48px; align-items: start; }
.with-fig figure { position: sticky; top: 24px; margin-top: 24px; }

/* ---------- Skills ---------- */
.skill-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 48px; }
.skill-groups .row { grid-template-columns: 1fr; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  font-size: 14px;
  line-height: 20px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
}
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }

/* ---------- Contact ---------- */
.contact-rows .row { grid-template-columns: 160px 1fr; align-items: baseline; }
.contact-rows .value { font-family: var(--serif); font-size: 24px; line-height: 1.3; color: var(--text); }
.contact-rows a.value { text-decoration: none; }
.contact-rows a.value:hover { color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer {
  max-width: calc(var(--max) - 64px);
  margin: 0 auto;
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Entrance: one fade and rise ---------- */
@media (prefers-reduced-motion: no-preference) {
  main > * { animation: rise 400ms var(--ease) both; }
  main > *:nth-child(2) { animation-delay: 60ms; }
  main > *:nth-child(3) { animation-delay: 120ms; }
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero, .with-fig, .split { grid-template-columns: 1fr; gap: 40px; }
  .with-fig figure { position: static; margin-top: 0; max-width: 480px; }
  .hero figure { max-width: 440px; }
}
@media (max-width: 760px) {
  .nav { padding: 0 20px; height: 56px; position: relative; }
  .menu-btn { display: grid; }
  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    z-index: 10;
    flex-direction: column;
    gap: 0;
    padding: 8px 20px 16px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }
  .nav.open .nav-links { display: flex; }
  .nav-links a { padding: 12px 0; border-bottom: 0; }
  .nav-links a[aria-current="page"] { color: var(--ink); }
  main { padding: 40px 20px 64px; }
  h1 { font-size: 40px; }
  h2 { font-size: 28px; }
  .lede { font-size: 18px; }
  section + section { margin-top: 64px; }
  .page-head { margin-bottom: 48px; }
  .row, .contact-rows .row { grid-template-columns: 1fr; gap: 8px; padding: 20px 0; }
  .skill-groups { grid-template-columns: 1fr; }
  .contact-rows .value { font-size: 20px; }
  .site-footer { margin: 0 20px; padding: 24px 0 32px; }
}

/* Fixes after review render */
.chip.todo { background: var(--todo); }
.split .row { grid-template-columns: 140px 1fr; gap: 24px; }
@media (max-width: 760px) { .split .row { grid-template-columns: 1fr; gap: 8px; } }
