:root {
  --bg: #fbfaf7;
  --text: #1d1d1b;
  --muted: #6b6a65;
  --faint: #e6e3dc;
  --link: #1f5f8b;
  --hover: #f2efe8;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --text: #e8e6e1;
    --muted: #9a978f;
    --faint: #2c2b28;
    --link: #8cbbe0;
    --hover: #1d1c1a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "kern", "liga";
}

main {
  max-width: 48rem;
  margin: 0 auto;
  padding: 4.5rem 1.25rem 3rem;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
.tagline { margin: 0.25rem 0 0.9rem; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; }

.about { margin-top: 2.25rem; }
.about p { margin: 0 0 1rem; }

section { margin-top: 3rem; }

h2 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--faint);
}
h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 2rem 0 0.5rem;
}

/* Expand-all control */
.toggle-all { margin: 2.5rem 0 -2rem; text-align: right; }
.toggle-all button {
  font: inherit;
  font-size: 0.85rem;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0.25rem 0;
  cursor: pointer;
}
.toggle-all button:hover { color: var(--text); }

/* Rows: date column + content column */
summary, .row {
  display: grid;
  grid-template-columns: 9.75rem 1fr;
  gap: 0 1rem;
  padding: 0.85rem 0;
}
.row { border-bottom: 1px solid var(--faint); }
.row:last-child { border-bottom: 0; }

details { border-bottom: 1px solid var(--faint); }

summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding-right: 1.75rem;
  margin: 0 -0.5rem;
  padding-left: 0.5rem;
  border-radius: 4px;
}
summary::-webkit-details-marker { display: none; }
summary:hover { background: var(--hover); }
summary:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* + / − marker */
summary::after {
  content: "";
  position: absolute;
  right: 0.5rem;
  top: 1.35rem;
  width: 9px;
  height: 9px;
  background:
    linear-gradient(var(--muted), var(--muted)) center / 9px 1.5px no-repeat,
    linear-gradient(var(--muted), var(--muted)) center / 1.5px 9px no-repeat;
  transition: transform 0.15s ease;
}
details[open] > summary::after {
  background: linear-gradient(var(--muted), var(--muted)) center / 9px 1.5px no-repeat;
}

.when {
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  padding-top: 0.1rem;
  white-space: nowrap;
}
.what { display: block; min-width: 0; }
.title { display: block; }
.title b { font-weight: 600; }
.aside { color: var(--muted); font-weight: 400; }
.line { display: block; color: var(--muted); font-size: 0.95rem; margin-top: 0.15rem; }

.body {
  margin-left: 10.75rem;
  padding: 0 0 1.25rem;
  font-size: 0.95rem;
}
.body p { margin: 0 0 0.75rem; }
.body ul { margin: 0 0 0.75rem; padding-left: 1.1rem; }
.body li { margin-bottom: 0.4rem; }
.body li::marker { color: var(--muted); }
.stack { color: var(--muted); font-size: 0.85rem; }

/* Screenshots */
.shots { display: flex; gap: 0.75rem; margin: 1rem 0; }
.shots figure { margin: 0; flex: 1; min-width: 0; }
.shots img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--faint);
}
.shots-phone figure { flex: 0 1 11rem; }
figcaption { color: var(--muted); font-size: 0.8rem; margin-top: 0.35rem; }

/* Publications */
.pubs { margin: 0; padding-left: 1.25rem; }
.pubs li { margin-bottom: 0.9rem; }
.pubs li::marker { color: var(--muted); }
.pub-title { display: block; }
.pub-meta { display: block; color: var(--muted); font-size: 0.9rem; }
.pub-meta u { text-decoration: none; color: var(--text); }
.note { color: var(--muted); font-size: 0.8rem; margin: 0; }

/* Skills */
.skills {
  display: grid;
  grid-template-columns: 9.75rem 1fr;
  gap: 0.5rem 1rem;
  margin: 0.85rem 0 0;
}
.skills dt { color: var(--muted); font-size: 0.9rem; padding-top: 0.05rem; }
.skills dd { margin: 0; }

#elsewhere p { margin: 0.85rem 0 0; }

footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--faint);
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 40rem) {
  main { padding-top: 3rem; }
  summary, .row, .skills { grid-template-columns: 1fr; }
  .when { padding: 0 0 0.1rem; font-size: 0.85rem; }
  summary::after { top: 1.15rem; }
  .body { margin-left: 0; }
  .skills dt { margin-top: 0.4rem; }
  .shots { flex-direction: column; }
  .shots-phone { flex-direction: row; }
  .toggle-all { margin-bottom: -2.25rem; }
}

@media print {
  :root { --bg: #fff; --text: #000; --muted: #444; --link: #000; }
  main { padding: 0; max-width: none; }
  .toggle-all, summary::after, .shots { display: none; }
  details > .body { display: block; }
  section { break-inside: avoid-page; }
}
