:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #5f6670;
  --border: #e4e2dd;
  --accent: #0b6e4f;
  --accent-soft: #e3f1ec;
  --cut: #d9822b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --surface: #1c2024;
    --text: #e6e8ea;
    --muted: #9aa3ad;
    --border: #2c3238;
    --accent: #5cc8a0;
    --accent-soft: #1d3a31;
    --cut: #f0a050;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout {
  max-width: 1040px;
  margin: 0 auto;
  padding: 56px 24px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 64px;
}

.sidebar {
  position: sticky;
  top: 56px;
  align-self: start;
}

.photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}

h1, h2 {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 600;
  line-height: 1.25;
}

h1 { font-size: 1.75rem; margin: 20px 0 6px; }

.role { color: var(--muted); margin: 0 0 20px; font-size: 0.95rem; }

.links { list-style: none; padding: 0; margin: 0; }
.links li { padding: 6px 0; border-top: 1px solid var(--border); font-size: 0.95rem; }
.links li:last-child { border-bottom: 1px solid var(--border); }

main section { margin-bottom: 48px; }

h2 {
  font-size: 1.4rem;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

h3 { font-size: 1rem; font-weight: 600; margin: 0 0 6px; }

p { margin: 0 0 12px; }

.meta { color: var(--muted); font-size: 0.875rem; margin: 0; }

.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
}
.card p:not(.meta) { font-size: 0.925rem; flex: 1; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  position: relative;
  padding: 0 0 20px 22px;
  border-left: 2px solid var(--border);
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline .meta { margin-bottom: 6px; }
.timeline p:not(.meta) { font-size: 0.925rem; }

footer { color: var(--muted); font-size: 0.85rem; padding-top: 8px; }

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; gap: 32px; padding: 32px 16px; }
  .sidebar { position: static; text-align: center; }
  .photo { width: 128px; height: 128px; }
  .links { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
  .links li, .links li:last-child { border: 0; padding: 0; }
}

.note { color: var(--muted); font-size: 0.925rem; margin-top: 14px; }

.viz {
  margin: 0 0 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.viz canvas {
  display: block;
  width: 100%;
  height: 260px;
}
.viz-wide canvas { height: 340px; }
#cut-canvas, #dist-canvas, #seefed-canvas, #bnb-canvas { cursor: grab; touch-action: pan-y; }
#cut-canvas:active, #dist-canvas:active, #seefed-canvas:active, #bnb-canvas:active { cursor: grabbing; }
.viz #seefed-canvas { height: 420px; }
.viz figcaption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
}
.viz-title { font-weight: 600; }
.viz-status { color: var(--muted); font-variant-numeric: tabular-nums; }
.hint { color: var(--muted); font-weight: 400; }

@media (max-width: 760px) {
  .viz canvas { height: 230px; }
  .viz-wide canvas { height: 270px; }
  .viz #seefed-canvas { height: 320px; }
  .hint { display: none; }
}
