:root {
  --bg: #fff;
  --ink: #37352f;
  --muted: #73726f;
  --line: #e9e9e7;
  --rail: 132px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
::selection { background: #d9e8ff; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  width: var(--rail);
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
}
.sidebar nav {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transform: translateY(-50%);
}
.sidebar nav a {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 20px 1fr;
  column-gap: 8px;
  align-items: center;
  height: 20px;
  padding: 0 10px 0 14px;
}
.sidebar nav i {
  justify-self: center;
  width: 7px;
  height: 7px;
  border: 1px solid #b8b8b4;
  border-radius: 50%;
  background: #fff;
  transition: width .18s, height .18s, background .18s;
}
.sidebar nav span {
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
  color: #666;
  transform-origin: left center;
  transition: color .18s, transform .18s;
}
.sidebar nav a:hover span { color: var(--ink); }
.sidebar nav a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
  border-radius: 4px;
}
.sidebar nav a.active i {
  width: 10px;
  height: 10px;
  border-color: var(--ink);
  background: var(--ink);
}
.sidebar nav a.active span {
  color: var(--ink);
  font-weight: 600;
  transform: scale(1.06);
}
.sidebar nav b {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 24px;
  z-index: 1;
  width: 1px;
  background: #dededb;
}
.sidebar nav em {
  display: block;
  width: 1px;
  height: 0;
  background: var(--ink);
}

main {
  width: min(calc(100% - var(--rail)), 960px);
  margin-left: max(var(--rail), calc((100vw - 960px + var(--rail)) / 2));
  padding: 0 56px;
}
.profile,
.timeline { border-bottom: 1px solid var(--line); }

.profile {
  display: grid;
  grid-template-columns: 156px minmax(360px, 1fr) 220px;
  gap: 42px 36px;
  align-items: start;
  padding: 112px 0 82px;
}
.profile-photo {
  align-self: center;
  width: 156px;
  height: 156px;
  overflow: hidden;
  border-radius: 3px;
  background: #f1f1ef;
}
.profile-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.profile-copy { min-width: 0; }
.label {
  margin: 3px 0 12px;
  color: var(--muted);
  font-size: 12px;
}
.profile-copy h1 {
  margin: 0;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0;
  white-space: nowrap;
}
.profile-copy h1 span { color: var(--muted); font-weight: 600; }
.focus-tags { display: flex; gap: 6px; margin-top: 15px; }
.focus-tags span,
.activity-tag {
  border-radius: 3px;
  background: #f1f1ef;
  color: #65645f;
}
.focus-tags span { padding: 3px 8px; font-size: 11px; }
.intro {
  max-width: 460px;
  margin: 20px 0 0;
  font-size: 15px;
  line-height: 1.7;
}
.now {
  align-self: center;
  margin: 0;
  padding-left: 14px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.now p { margin: 0 0 20px; }
.now p:last-child { margin-bottom: 0; }
.now strong { color: var(--ink); font-weight: 500; }

.contact-box {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid #e2e2df;
  border-radius: 4px;
}
.contact-box > a,
.contact-box > .contact-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.contact-box > :nth-child(odd) { border-right: 1px solid var(--line); }
.contact-box > :nth-last-child(-n + 2) { border-bottom: 0; }
.contact-box small { color: #666; }
.contact-box strong { overflow-wrap: anywhere; font-weight: 500; }

.timeline {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  padding: 72px 0;
}
.timeline header > p {
  margin: 2px 0 10px;
  color: var(--muted);
  font-size: 11px;
}
.timeline h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 650;
  line-height: 1.25;
}
.entries { border-top: 1px solid var(--line); }
.entries article,
.entry {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr) 16px;
  gap: 14px;
  align-items: start;
  padding: 17px 2px;
  border-bottom: 1px solid var(--line);
}
.entries article { grid-template-columns: 94px minmax(0, 1fr); }
.entries time {
  padding-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.entries h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}
.entries .is-current h3::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 7px 2px 0;
  border-radius: 50%;
  background: #35a765;
}
.entries p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
#ctf .entries p { overflow-wrap: anywhere; }
#ctf .result-badge {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid #c8cdd2;
  border-radius: 4px;
  background: #f1f2f3;
  color: #4f5962;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.entry > span { color: #aaa; font-size: 11px; transition: transform .18s; }
.entry:hover { background: #fafafa; }
.entry:hover h3 { text-decoration: underline; }
.entry:hover > span { transform: translate(2px, -2px); }
.activity-entry p { line-height: 1.65; }
.activity-tag {
  display: inline-block;
  margin-right: 7px;
  padding: 2px 6px;
  font-size: 9px;
  letter-spacing: .4px;
  text-transform: uppercase;
}
.affiliation-list p + p { margin-top: 5px; }
.affiliation-list p b { color: #555; font-weight: 500; }
.affiliation-list h3 span { color: var(--muted); font-weight: 400; }

@media (max-width: 1099px) {
  :root { --rail: 34px; }
  .sidebar nav { gap: 8px; }
  .sidebar nav a {
    display: block;
    height: 34px;
    padding: 0;
  }
  .sidebar nav i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  .sidebar nav span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .sidebar nav b { top: 17px; bottom: 17px; left: 50%; transform: translateX(-50%); }
  main {
    width: calc(100% - var(--rail));
    margin-left: var(--rail);
    padding: 0 22px;
  }
  .profile {
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 24px 20px;
    padding: 62px 0 52px;
  }
  .profile-photo { width: 82px; height: 82px; }
  .profile-copy h1 { font-size: 31px; }
  .intro { margin-top: 16px; font-size: 14px; }
  .now { grid-column: 1 / -1; margin-top: 4px; }
  .timeline {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 50px 0;
  }
  .timeline h2 { font-size: 25px; }
  .entries article,
  .entry { grid-template-columns: 76px minmax(0, 1fr) 14px; }
  .entries article { grid-template-columns: 76px minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .profile { grid-template-columns: 1fr; }
  .profile-photo { width: 96px; height: 96px; }
  .profile-copy h1 { font-size: 30px; }
  .now { grid-column: auto; }
  .contact-box { grid-template-columns: 1fr; }
  .contact-box > :nth-child(odd) { border-right: 0; }
  .contact-box > :nth-last-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .contact-box > :last-child { border-bottom: 0; }
}

@media (max-width: 400px) {
  .profile-copy h1 { font-size: 24px; white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
