:root {
  --bg: #161616;
  --fg: #ededeb;
  --muted: #a3a3a0;
  --dim: #5c5c5a;
  --line: #2b2b2a;
  --font: "Nunito", ui-rounded, system-ui, sans-serif;
  --gutter: 16px;
  --width: 720px;
  --node: 237, 237, 235;   /* network color (field.js) */
  --outlier: 235, 87, 87;
  --field: 1;              /* line strength multiplier */
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #efefec;
  --fg: #1c1c1b;
  --muted: #5d5d5a;
  --dim: #a9a9a5;
  --line: #d4d4d0;
  --node: 28, 28, 27;
  --outlier: 214, 48, 54;
  --field: 2.2;
  color-scheme: light;
}

/* Theme switch: the new theme grows out of the toggle (theme.js) instead of cross-fading. */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--dim);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.15s;
}
a:hover { text-decoration-color: var(--fg); }
a:focus-visible, button:focus-visible, .panel:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Top bar: name + tabs */
.top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px 24px;
  flex-wrap: wrap;
  width: 100%;
  max-width: var(--width);
  margin: 0 auto;
  padding: 20px var(--gutter);
  background: var(--bg);
}
.name {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.name { margin-right: auto; }
.name a { text-decoration: none; }

/* Sun in light mode; in dark mode the core grows and a cutout slides in to make a moon. */
.theme {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: -16px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.theme:hover { color: var(--fg); background: var(--line); }
.theme svg { width: 20px; height: 20px; overflow: visible; }
.theme .core, .theme .cut, .theme .rays {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.6s cubic-bezier(.5, 0, .2, 1), opacity 0.35s;
}
:root:not([data-theme="light"]) .theme .core { transform: scale(1.7); }
:root:not([data-theme="light"]) .theme .cut { transform: translate(-7px, 3px); }
:root:not([data-theme="light"]) .theme .rays { opacity: 0; transform: rotate(-90deg) scale(0.5); }

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.tabs button:hover { color: var(--fg); }
.tabs button[aria-selected="true"] {
  color: var(--bg);
  background: var(--fg);
}

main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: var(--width);
  margin: 0 auto;
  padding: 0 var(--gutter) 64px;
  /* Keeps text legible where node lines pass behind it. */
  text-shadow: 0 0 4px var(--bg), 0 0 12px var(--bg);
}

/* Intro */
.panel.intro { padding-top: clamp(48px, 14vh, 140px); }
.tagline {
  margin: 0;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
  max-width: 18em;
}
.lede {
  margin: 20px 0 0;
  max-width: 36em;
  color: var(--muted);
}
.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 24px;
  font-weight: 600;
}

/* Panels */
.panel { padding-top: 40px; }

ul { list-style: none; margin: 0; padding: 0; }

.entries > li + li { margin-top: 32px; }
.entries p { margin: 0; max-width: 36em; }
.entries p:not(.role) { color: var(--muted); }
.entries .role { font-weight: 600; margin-bottom: 6px; }

.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.row h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.when {
  color: var(--muted);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.plain li { padding: 4px 0; max-width: 36em; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .top { padding: 16px var(--gutter) 12px; }
  .theme { order: 2; margin-left: 0; }
  .tabs { order: 3; width: calc(100% + 2 * var(--gutter)); margin: 0 calc(-1 * var(--gutter)); padding: 0 calc(var(--gutter) - 12px); }
}

/* Recognition list nested under a project */
.recog {
  margin-top: 14px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
  max-width: 36em;
  font-size: 15px;
}
.recog li { padding: 2px 0; }
.recog li:first-child { font-weight: 600; }

/* Note shown when hovering the red outlier dot (field.js). */
.outlier-note {
  position: fixed;
  z-index: 4;
  max-width: 260px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--fg);
  color: var(--bg);
  font-size: 14px;
  line-height: 1.45;
  pointer-events: none;
  animation: note-in 0.2s ease-out;
}
@keyframes note-in { from { opacity: 0; transform: translateY(4px); } }

/* One-line hint for the hidden interactions. */
.hint {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--width);
  margin: 0 auto;
  padding: 0 var(--gutter) 28px;
  color: var(--muted);
  font-size: 14px;
  text-shadow: 0 0 4px var(--bg), 0 0 12px var(--bg);
}
.hint p { margin: 0; }
.hint-touch { display: none; }
@media (hover: none) {
  .hint-mouse { display: none; }
  .hint-touch { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  .hint-mouse, .hint-touch { display: none; }
  .theme .core, .theme .cut, .theme .rays { transition: none; }
  .outlier-note { animation: none; }
}
