:root {
  --bg: #000000;
  --text: #ffffff;
  --muted: #9a9a9a;
  --border: #262626;
  --accent: #ffffff;
  --surface: #0d0d0d;
  --max-width: 900px;
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 96px;
}

/* Header / nav */
header {
  margin-bottom: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-name {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

nav {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.15s ease;
}

nav a:hover {
  color: var(--text);
}

nav a.active {
  color: var(--text);
}

/* Sections */
section {
  margin-bottom: 76px;
}

section:last-child {
  margin-bottom: 0;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 20px;
}

h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 20px;
}

h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}

p {
  margin-bottom: 16px;
  color: #e6e6e6;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--border);
  transition: text-decoration-color 0.15s ease;
}

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

/* Item lists (research, talks, projects) */
.item {
  padding: 20px 0;
  border-top: 1px solid var(--border);
}

.item:first-of-type {
  border-top: none;
  padding-top: 0;
}

.item .meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 0;
}

.item p {
  color: var(--muted);
  font-size: 15px;
  margin-top: 6px;
  margin-bottom: 0;
}

/* Social icon links */
.social {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.social a {
  color: var(--muted);
  display: inline-flex;
  text-decoration: none;
  transition: color 0.15s ease;
}

.social a:hover {
  color: var(--text);
}

.social svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
  display: block;
}

footer .social {
  margin-bottom: 18px;
}

/* Home hero */
.tagline {
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.lede {
  color: #cfcfcf;
}

/* Selected work / card grid */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 560px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

.card {
  display: block;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.card:hover {
  border-color: #3d3d3d;
  background: #0a0a0a;
}

.card h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.card p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

/* About — role subtitle */
.role {
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
  margin-bottom: 10px;
}

.entry {
  margin-bottom: 28px;
}

.entry:last-child {
  margin-bottom: 0;
}

/* Research themes */
.theme {
  padding: 20px 0;
  border-top: 1px solid var(--border);
}

.theme:first-of-type {
  border-top: none;
  padding-top: 0;
}

.theme h3 {
  font-size: 17px;
  margin-bottom: 6px;
}

.theme .num {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-right: 8px;
}

.theme p {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
}

/* Narrative callout (e.g. event-camera story) */
.note {
  border-left: 2px solid var(--border);
  padding-left: 18px;
  margin-top: 8px;
}

.note p {
  color: #bdbdbd;
  font-size: 15px;
}

/* Timeline (Work) */
.timeline {
  margin-top: 4px;
}

.tl-item {
  position: relative;
  padding-left: 26px;
  padding-bottom: 26px;
  border-left: 1px solid var(--border);
}

.tl-item:last-child {
  padding-bottom: 0;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text);
}

.tl-item .tl-year {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: #777;
  margin-bottom: 2px;
}

.tl-item h3 {
  font-size: 18px;
  margin-bottom: 2px;
}

.tl-role {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  letter-spacing: 0.02em;
  color: #777;
  font-size: 13px;
  margin-bottom: 10px;
}

.tl-item p {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
}

/* Floating cards (Research / Projects) */
.float-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 560px) {
  .float-cards {
    grid-template-columns: 1fr;
  }
}

.fcard {
  display: block;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.fcard:hover {
  transform: translateY(-3px);
  border-color: #3d3d3d;
}

.fcard h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.fcard p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.card-year {
  display: block;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.02em;
  color: #777;
  margin: 0 0 8px;
}

/* Openable cards (buttons) */
button.fcard {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  text-align: left;
  width: 100%;
  cursor: pointer;
}

.fcard-more {
  display: inline-block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

button.fcard:hover .fcard-more {
  color: var(--text);
}

button.mcard {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: var(--text);
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

button.mcard:hover {
  transform: translateY(-2px);
  border-color: #3d3d3d;
}

/* Modal dialog */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  width: min(680px, 92vw);
  max-height: 86vh;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  overflow: auto;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.modal-inner {
  position: relative;
  padding: 26px;
}

.modal h3 {
  font-size: 20px;
  margin-bottom: 12px;
  padding-right: 28px;
}

.modal p {
  color: #cfcfcf;
  font-size: 15px;
  margin-bottom: 18px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  padding: 0;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
}

/* Masonry gallery — every image shown whole at its natural aspect ratio */
.gallery {
  column-count: 2;
  column-gap: 10px;
}

@media (max-width: 560px) {
  .gallery {
    column-count: 1;
  }
}

.gallery img,
.gallery video {
  width: 100%;
  height: auto;
  margin: 0 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
  background: #000;
  break-inside: avoid;
}

.gallery .ph {
  width: 100%;
  aspect-ratio: 4 / 3;
  margin: 0 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  break-inside: avoid;
  background: repeating-linear-gradient(
    45deg,
    #141414 0 12px,
    #0e0e0e 12px 24px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5a5a5a;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gallery .ph::after {
  content: "photo";
}

/* Diagram gallery — show figures whole, single full-width column */
.gallery.diagrams {
  column-count: 1;
}

.gallery.diagrams img {
  background: #fff;
}

/* Clean list with type tags (Selected outputs / Talks) */
.list {
  border-top: 1px solid var(--border);
}

.list-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.list-row .l-title {
  color: var(--text);
}

.list-row .l-title a {
  text-decoration: none;
}

.list-row .l-title a:hover {
  text-decoration: underline;
  text-decoration-color: var(--text);
}

.list-row .l-sub {
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
}

.tag {
  flex-shrink: 0;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

/* Small cards (Outside) */
.mini-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 560px) {
  .mini-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

.mcard {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.mcard .emoji {
  font-size: 22px;
  display: block;
  margin-bottom: 8px;
  line-height: 1;
}

.mcard h3 {
  font-size: 15px;
  margin-bottom: 2px;
}

.mcard p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

/* Footer contact links */
.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 14px;
}

.contact a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.contact a:hover {
  color: var(--text);
}

.copyright {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* Interests (bio) */
.interests-block {
  margin-top: 24px;
  margin-bottom: 44px;
}

.section-kicker {
  color: #cfcfcf;
  margin-bottom: 12px;
}

.interest-list {
  list-style: disc;
  padding-left: 22px;
  color: #cfcfcf;
}

.interest-list li {
  margin-bottom: 8px;
}

.interest-list li:last-child {
  margin-bottom: 0;
}

.interest-list strong {
  font-weight: 600;
}

.interest-list strong::after {
  content: " — ";
  font-weight: 400;
}

/* Footer */
footer {
  margin-top: 72px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

footer a {
  color: var(--muted);
  text-decoration-color: var(--border);
}

footer a:hover {
  color: var(--text);
}
